Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

parametrize the position of a point in the geometry gives an error message

Please login with a confirmed email address before reporting spam

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

0 Replies Last Post Jan 22, 2013, 9:52 a.m. EST
COMSOL Moderator

Hello Sabine

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.