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 geometry features with LiveLink for Matlab

Please login with a confirmed email address before reporting spam

What is the most efficient way of cutting a large number (>1000) circles out of a rectangle using LiveLink for Matlab?
I do it in a simple "for"-loop, but the program slows down with an increasing number of circles.
Is there a more efficient way?
Thanks!

4 Replies Last Post Jun 5, 2012, 11:24 a.m. EDT
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 21, 2012, 3:38 p.m. EST
Hi

Isnt there a copy array feature in the matla calls, as in the GUI ?

probably it's quicker inside the COMSOL geometrical soler than via a matlb COMSOL link per cercle.

Anyhow, are ther no other way to avoid so many features/entities by some clever symmetry use?
As, your model will become really slow and heavy to handle.

We have some models with 800-900 entities in 3D, but made within the GUI, you need a minute or two to move up and down, and one should turn OFF the default replotting option in the preferences

--
Good luck
Ivar
Hi Isnt there a copy array feature in the matla calls, as in the GUI ? probably it's quicker inside the COMSOL geometrical soler than via a matlb COMSOL link per cercle. Anyhow, are ther no other way to avoid so many features/entities by some clever symmetry use? As, your model will become really slow and heavy to handle. We have some models with 800-900 entities in 3D, but made within the GUI, you need a minute or two to move up and down, and one should turn OFF the default replotting option in the preferences -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 15, 2012, 7:17 p.m. EDT
Hello,
I am trying to do the same thing but with rectangles. how did you do It in 4.2? I was able to make a geometry array of rectangles in 3.5a but I am trying to do it in 4.2 and I am having trouble since it keeps telling me that a variable with that name already exists.

Error in TEDgeom (line 43)
G{i} = geom2.feature.create('r1{i}','Rectangle');

An object with the given name already exists
- Name: r1{i}
did you find a way to create the geometry objects without giving them each a unique name?
Thanks for any advice.
Hello, I am trying to do the same thing but with rectangles. how did you do It in 4.2? I was able to make a geometry array of rectangles in 3.5a but I am trying to do it in 4.2 and I am having trouble since it keeps telling me that a variable with that name already exists. Error in TEDgeom (line 43) G{i} = geom2.feature.create('r1{i}','Rectangle'); An object with the given name already exists - Name: r1{i} did you find a way to create the geometry objects without giving them each a unique name? Thanks for any advice.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 16, 2012, 9:27 a.m. EDT
Hi

your variable name is probably "i" that is by default sqrt(-1) the complex "i" try using another name and try to avoid to short (1 lettre names)

--
Good luck
Ivar
Hi your variable name is probably "i" that is by default sqrt(-1) the complex "i" try using another name and try to avoid to short (1 lettre names) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 5, 2012, 11:24 a.m. EDT
Hi

I have the same question:
I need to create an array of geometry features, like blocks.
I use a simple for loop but it shows an error:
That's the syntax I am using:

for a=1:1:100
b1{a} = geom1.feature.create ('b1{a}', 'Block');
end

Would you mind telling me the correct syntax to create and array of geometry features?

Many Thanks



Hi I have the same question: I need to create an array of geometry features, like blocks. I use a simple for loop but it shows an error: That's the syntax I am using: for a=1:1:100 b1{a} = geom1.feature.create ('b1{a}', 'Block'); end Would you mind telling me the correct syntax to create and array of geometry features? Many Thanks

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.