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

Please login with a confirmed email address before reporting spam

Hi all,
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


1 Reply Last Post 2012年8月29日 GMT-4 09:50
COMSOL Moderator

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.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年8月29日 GMT-4 09:50
Why not copy the geometry feature within your new 'geom2'? So just do a command like:

model.geom('geom2').feature.copy('tag1','geom1/tag1');

Then you can extrude and do all the operations. Also, remember when you copy over a feature from one geometry to another that uses another feature for an input it loses that input.
Why not copy the geometry feature within your new 'geom2'? So just do a command like: model.geom('geom2').feature.copy('tag1','geom1/tag1'); Then you can extrude and do all the operations. Also, remember when you copy over a feature from one geometry to another that uses another feature for an input it loses that input.

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.