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.

Matlab assign geometry to materials

Please login with a confirmed email address before reporting spam

I desperatly try to run matlab script to simulate a 2d axissymmetric simulation.

The geometry objects and the materials were easily created. The problem is, that I struggle to assign the geometry to the materials.
Using the model.material('mat1').selection.set() seems intuitive, however I have no idea how I get the domain
information from the geometry objects.

Is there a simple way to assign the geometry to the materials?




3 Replies Last Post 02.05.2013, 09:37 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 02.05.2013, 08:43 GMT-4
Hi,

to learn these things, link the syntax, you better open Comsol GUI, define few simple features in a new model and export a .m file. There you'll read the correct syntax to apply your material!

hope it helps,
Mattia
Hi, to learn these things, link the syntax, you better open Comsol GUI, define few simple features in a new model and export a .m file. There you'll read the correct syntax to apply your material! hope it helps, Mattia

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 02.05.2013, 09:23 GMT-4
Hi!

Thanks for the post.

I already did it that way. The problem is, that the code shows absolut domain ids, f.e. something like model.material('mat1').selection.set([1 5 81 88]);

The problem is, that i don't know which object is 1 or 5 or so on. So I have to extract this information out of the geometry objects and that is exactly the problem I can't achive.


Hi! Thanks for the post. I already did it that way. The problem is, that the code shows absolut domain ids, f.e. something like model.material('mat1').selection.set([1 5 81 88]); The problem is, that i don't know which object is 1 or 5 or so on. So I have to extract this information out of the geometry objects and that is exactly the problem I can't achive.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 02.05.2013, 09:37 GMT-4
I understand and I agree with you.. as far as I know there is no way to know the geometries ids before/while Comsol builds the geometry. I'd also say this makes perfectly sense..

What I do circumvent this problem is to create groups of objects.; for my applications this suffices.

Sorry, I can't help much..
Mattia
I understand and I agree with you.. as far as I know there is no way to know the geometries ids before/while Comsol builds the geometry. I'd also say this makes perfectly sense.. What I do circumvent this problem is to create groups of objects.; for my applications this suffices. Sorry, I can't help much.. Mattia

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.