[Gmsh] saving the mesh for a subdomain separately

Abiti Adili aadili1 at lsu.edu
Tue Nov 20 02:27:33 CET 2018


Thank you so much for your patience and  I indeed was able to generate the separate msh files.

To generate the mesh over sphere:

 I imported the sphere.geo file and  clicked on "3D" in Mesh module.  Then I refined  the mesh by "Refine by Splitting". When I saved  the mesh file, it is indeed the mesh for the sphere inside(sphere.msh), which exactly what I wanted for the sphere.


To generate the mesh over the whole cube:

 I repeated the same steps for box.geo, I got the mesh for the whole cube(box.msh) including the sphere.

(1) What needs to be done to guarantee  that sphere.msh  is identical(conforming) to the portion of  box.msh  that accounts for the  sphere? Or  am I missing something again in your idea  to extract the sphere.msh portion directly from box.msh?

(2) If I need to generate a  third portion of the box.msh that  accounts for  the volume= cube/sphere( sphere subtracted from the cube), do I need to  create cube/sphere.geo and insert geomtry.geo into it as you have shown me or it is just the volume(2) you had in your last reply, that is:


Volume(1) = {1}; // the sphere
Volume(2) = {1, 2};  // outside the sphere


Thank you very much for your kindness and willing to walk me through this. I appreciated it.

Best,

Abiti Adili

________________________________________
From: G. D. McBain <gdmcbain at protonmail.com>
Sent: Monday, November 19, 2018 5:34:17 PM
To: Abiti Adili
Cc: gmsh
Subject: Re: [Gmsh] saving the mesh for a subdomain separately

©\©\©\©\©\©\©\ Original Message ©\©\©\©\©\©\©\
Le mardi, novembre 20, 2018 10:07 AM, Abiti Adili <aadili1 at lsu.edu> a ¨¦crit :

> Thank you very much for your time.

You're welcome.

> I am a quite a beginner in Gmsh and I am grateful for your kind reply. I would appreciate it if I could ask the following questions.

Do remember to 'reply all' so that the conversation remains on the list for all to see.

> (1) Does that mean I have to define a physical volume for the sphere as well?

Yes.

> (2) I might not have understood what you meant and I am a little bit confused about the idea of including the whole .geo file into the scripts that define the subdomain.

"Include" is a keyword in the Gmsh GEO file syntax; see

http://gmsh.info/doc/texinfo/gmsh.html#index-Include-char_002dexpression_003b

The idea is to have something like the "sphere.geo" attached.  In full, it is:

Include "geometry.geo";
Physical Volume("sphere") = {1};

And then similarly for the box.

> If I assume the .geo file I included in my last email is geometry.geo and it creates cube with a sphere in it. Would it be possible for you to give a bit more elaboration on how the idea of splitting and syntax of inclusion achieve the mesh for my desired subdomain?

Sure.   See attached.  Actually I missed a couple of defects in the original GEO code:

* The Volume defined there is the whole box, and hasn't had the sphere subtracted.  It should read

Volume(1) = {1}; // the sphere
Volume(2) = {1, 2};  // outside the sphere


* Don't define any physical entities in the common geometry.geo file.

These are rectified in the attached geometry.geo.



More information about the gmsh mailing list