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.
Passing Parameters into geometry features via MATLAB LiveLink
Posted 2011年1月21日 GMT-5 14:43 Interfacing, Geometry Version 4.1 0 Replies
Please login with a confirmed email address before reporting spam
I've attached the .m file, and here are the lines in question...
model.param.set('ridge.r', 1);
...
%creating a square and other geometry works fine
model.geom('geom1').feature('wp1').geom.feature.create('s1', 'Square');
model.geom('geom1').feature('wp1').geom.feature('s1').set('base', 'center');
model.geom('geom1').feature('wp1').geom.feature('s1').set('size', 'ridge.r');
%'ridge.r' is passed into the model.
model.geom('geom1').feature('wp1').geom.feature('s1').set('pos', {'ridge.t/2-ridge.r/2' 'ridge.w/2-ridge.r/2'});
%creating an extrusion does not work the same way
model.geom('geom1').feature.create('ext1', 'Extrude');
model.geom('geom1').feature('ext1').selection('input').set({'wp1.r1'});
model.geom('geom1').feature('ext1').set('crossfaces', 'off');
model.geom('geom1').feature('ext1').set('distance', 'ridge.r');
%'ridge.r' is not passed into the model. The value 1 is passed into the model.
Any thoughts?
Attachments:
Hello David Hodgson
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.