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.
creating new geometry for a geometry object
Posted 7 juin 2012, 18:12 UTC−4 Interfacing, Geometry Version 4.2 1 Reply
Please login with a confirmed email address before reporting spam
I am trying to pick out one piece of my original geometry and do some analysis on it. I think this would be easiest if I simply do an intersection operation and set this to a new geometry geom2 to do the analysis. I have been trying to do this in livelink for matlab but the only command I can think of using is:
% initialise geometry
geom1=model.geom.create('geom1',2);
geom2=model.geom.create('geom2',2);
%create geom1
...
%create intersection
model.geom('geom1').feature(geomtag).set('size','width,height');
co1=model.geom('geom1').feature.create('co1', 'Compose');
co1.selection('input').object('geom1');
co1.selection('input').set({'i1' 'testr'});
co1.set('formula','i1*testr');
geom2=co1;
%build all
model.geom('geom1').runAll;
model.geom('geom2').runAll;
I can't seem to get this to work. It runs with no errors and co1 is created but geom2 is empty. I have also
tried this variant which I thought might import the object from geom1 to geom2.
co1=model.geom('geom2').feature.create('co1', 'Compose');
co1.selection('input').object('geom1');
co1.selection('input').set({'i1' 'testr'});
co1.set('formula','i1*testr');
but this outputs an error I don't understand. any help or a sugestion of another approach would be greatly appreciated.
Best,
Jonathan
Hello Jonathan Lake
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.