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.

Defining boundary node sets in .mphtxt or in MATLAB fem.mesh structure

Please login with a confirmed email address before reporting spam

Hi all,

Perhaps this question had already been asked in this forum, but I could not find it. My problem is to define a node set in the mesh file *.mphtxt to import it into comsole.

The problem at hand is to model a complicated geometry like the one attached with this message. It has been generated from tomographic anaysis and I have meshed it in MATLAB. I used the MATLAB to export the elements and coordinate to export into fem.mesh, following the commands in the documentation. But now I cannot precisely select only the top and bottom surface nodes using "box" tool; it always selects some more nodes from other planes below. So I started to wonder if I can define a group of a boundary node set (for example like in ABAQUS), then BC application will be precisely imposed on the desired nodes. However, I could not find how to define a node set in the MATLAB. I figured out how to create a new group in "fem.bnd.constrant and fem.bdn.ind". The problem remains to how to associate some nodes to this new group. The fem.mesh object is not accessible in matlab workspace so I cannot see/over ride the values.

I tried to understand the format of .mphtxt of a simple unit cube. There I found a the domain numbers of vertices. But if change the number of domains from 7 to 3 (for athe unit cube 6 faces and interior) and import it in COMSOL nothing seems to be changed- I see the same original number of groups inside COMSOL.

I would prefer a way to define the group in matlab and pass it on to COMSOL as I will be dealing with complicated geometries.

Any help is greately appreciated.

Regards,
Kodanda


3 Replies Last Post 25 mai 2011, 15:13 UTC−4
COMSOL Moderator

Hello kodanda

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 25 mai 2011, 12:36 UTC−4
I am having a problem very similar to this one, the only difference being my complicated geometry is in 2D. Was anyone successful in finding a solution to this issue?

I am also struggling to find a way to define my material properties based on the mesh I created in Matlab. Any help on these questions will be greatly appreciated.

Thank you!
I am having a problem very similar to this one, the only difference being my complicated geometry is in 2D. Was anyone successful in finding a solution to this issue? I am also struggling to find a way to define my material properties based on the mesh I created in Matlab. Any help on these questions will be greatly appreciated. Thank you!

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 25 mai 2011, 13:53 UTC−4
The answer to your first question is YES. I have been doing this in 4.x version. After the question I posted, I never tried it in 3.5a but I guess a similar option would also be possible.

How you can do this is by reverse engineering. Start a simple geometry like a square in COMSOL desktop, create boundary sets, create material groups, etc.. Then save it as a m file from the file menu. Have a look at this file and use the commands in your MATLAB script to generate a *.mph file. This is how I did it, and this philosophy works till now.

second qn:
What do mean by "material properties based on the mesh"? Do you want to assign different material properties to different domains of your model? If you have a means to identify different geometries in side MATLAB, then you can do that following the above strategy by creating different domain groups.

Kodanda

The answer to your first question is YES. I have been doing this in 4.x version. After the question I posted, I never tried it in 3.5a but I guess a similar option would also be possible. How you can do this is by reverse engineering. Start a simple geometry like a square in COMSOL desktop, create boundary sets, create material groups, etc.. Then save it as a m file from the file menu. Have a look at this file and use the commands in your MATLAB script to generate a *.mph file. This is how I did it, and this philosophy works till now. second qn: What do mean by "material properties based on the mesh"? Do you want to assign different material properties to different domains of your model? If you have a means to identify different geometries in side MATLAB, then you can do that following the above strategy by creating different domain groups. Kodanda

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 25 mai 2011, 15:13 UTC−4
Thank you very much! This will be a huge help.

As far as my second question goes, I am trying to mesh the attached picture in Matlab, and then give different material properties to the white and black sections pictured. The designed mesh is directly orientated with the elements so by sorting black and white I hope to define the material properties. Does this make sense?
Thank you very much! This will be a huge help. As far as my second question goes, I am trying to mesh the attached picture in Matlab, and then give different material properties to the white and black sections pictured. The designed mesh is directly orientated with the elements so by sorting black and white I hope to define the material properties. Does this make sense?

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.