Dear Comsolfriends,
I want to do a parameter study for the size of my geometry, but I get the following error when trying to set the position of a POINT using a parameter defined before in MATLAB (directly in comsol this problem does not occur) -- for circles etc everything works fine in matlab, but for points the trouble starts:
model.param.set('cx','1'); model.param.set('px','1');
model.geom.create('geom1', 2);
model.geom('geom1').feature.create('c1', 'Circle');
model.geom('geom1').feature.create('pt1', 'Point');
model.geom('geom1').feature('c1').set('pos', {'1' '1'});
model.geom('geom1').feature('pt1').set('p', {'1'; '1'});
this works fine, as well as
model.geom('geom1').feature('c1').set('pos', {'cx' '1'});
but if I try
model.geom('geom1').feature('pt1').set('p', {'px'; '1'});
I get the error message:
Error using com.comsol.model.impl.GeomFeatureImpl/set
Java exception occurred:
Exception:
com.comsol.util.exceptions.FlException: Unknown variable name
Messages:
Unknown variable name
- Name: px
- Property name: p
Stack trace:
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.util.classes.o.b(Unknown Source)
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.e(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.properties.ak.set(Unknown Source)
at com.comsol.model.impl.PropValueImpl.set(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl.c(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl$p.a(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl$p.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)
has anyone an idea why this happens? where is the big difference between a point and a circle? did you try something similar, and, above all, HOW TO SOLVE THIS? I want a geometry with a point at the middle of one boundary, and when I sweep the size of my geometry, the point must move as well of course.
Thanks a lot for any answer!!! :)
Sabine
I want to do a parameter study for the size of my geometry, but I get the following error when trying to set the position of a POINT using a parameter defined before in MATLAB (directly in comsol this problem does not occur) -- for circles etc everything works fine in matlab, but for points the trouble starts:
model.param.set('cx','1'); model.param.set('px','1');
model.geom.create('geom1', 2);
model.geom('geom1').feature.create('c1', 'Circle');
model.geom('geom1').feature.create('pt1', 'Point');
model.geom('geom1').feature('c1').set('pos', {'1' '1'});
model.geom('geom1').feature('pt1').set('p', {'1'; '1'});
this works fine, as well as
model.geom('geom1').feature('c1').set('pos', {'cx' '1'});
but if I try
model.geom('geom1').feature('pt1').set('p', {'px'; '1'});
I get the error message:
Error using com.comsol.model.impl.GeomFeatureImpl/set
Java exception occurred:
Exception:
com.comsol.util.exceptions.FlException: Unknown variable name
Messages:
Unknown variable name
- Name: px
- Property name: p
Stack trace:
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.util.classes.o.b(Unknown Source)
at com.comsol.util.classes.o.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.e(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.parser.ParseUtil.a(Unknown Source)
at com.comsol.nativeutil.properties.ak.set(Unknown Source)
at com.comsol.model.impl.PropValueImpl.set(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl.c(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl$p.a(Unknown Source)
at com.comsol.model.impl.PropFeatureImpl$p.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)
has anyone an idea why this happens? where is the big difference between a point and a circle? did you try something similar, and, above all, HOW TO SOLVE THIS? I want a geometry with a point at the middle of one boundary, and when I sweep the size of my geometry, the point must move as well of course.
Thanks a lot for any answer!!! :)
Sabine