Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 25916

LiveLink "selection.set"

$
0
0
Hello All,
I'm having what I believe to be a pretty straightforward problem getting the selection.set function to work properly. I am learning LiveLink by building up a model step by step, exporting to an m file at every step and keeping the parts of the script I need. For some reason, playing back any commands which require me to set a selection do not work (even if I did not modify them at all after export). For example:

model.physics('es').selection.set([1]);

Here is the error I get in matlab (where the illegal input vector is, I believe, the key part):

??? Java exception occurred:
Exception:
java.lang.IllegalArgumentException: Illegal input vector
(rethrown as com.comsol.util.exceptions.FlException)
Messages:
Illegal input vector

Stack trace:
at com.comsol.model.impl.SelectionImpl.a(Unknown Source)
at com.comsol.model.impl.SelectionImpl$b.a(Unknown Source)
at com.comsol.model.impl.SelectionImpl$b.execute(Unknown Source)
at com.comsol.model.clientserver.ClientManagerImpl$d.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Error in ==> scratch_10142010 at 111
model.physics('es').selection.set([1 2 3]);

As a side note, how does Comsol number the domains that are created from the various geometry operations? If I were writing this code 'blind' how would I know how to select domains, boundaries, etc..

Thanks, Mike

Viewing all articles
Browse latest Browse all 25916

Trending Articles