[Gmsh] Help understanding MSH file entries while using "Periodic surface with translate "

Ranga Sudarsan sudarsan77 at gmail.com
Thu Apr 27 12:55:42 CEST 2017


  Hi there,
     I am meshing a geometry with periodic (translated meshes) boundary 
conditions along one of the directions (X in my case). I am using
periodic surface with translate to setup the translated periodic meshes. 
I need help understanding some entries in the Msh file generated 
specifically the section under "$Periodic" (See attached image, in my 
case surfaces 1 and 8 are periodic). I understand that in my case their 
are totally 11 periodic entities -- 5 points , 5 lines and 1 surface and 
my trouble is in understanding the format of the output corresponding to 
each of these periodic entities. It will be of great help if some one 
explain to me what is the format for each of these entities so that I 
can write a code to read the msh file and generate relevant input files 
for my finite element solver. I have attached the geo and mesh file.

Thanks again
Ranga Sudarsan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20170427/a5f0f477/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmsh_periodic.jpg
Type: image/jpeg
Size: 132810 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20170427/a5f0f477/attachment-0001.jpg>
-------------- next part --------------
/*********************************************************************
 *
 *  Gmsh tutorial 16
 *
 *  Constructive Solid Geometry, OpenCASCADE geometry kernel
 *
 *********************************************************************/

// Instead of constructing a model in a bottom-up fashion with Gmsh's built-in
// geometry kernel, starting with version 3 Gmsh allows you to directly use
// alternative geometry kernels. Let us use the OpenCASCADE kernel:

SetFactory("OpenCASCADE");

// And let's build the same model as in t5.geo, but using constructive solid
// geometry:

Block(1) = {0,0,0, 5,5,5};
Sphere(2) = {0,0,0,1};
Sphere(3) = {2.5,5,0,1};
Sphere(4) = {5,0,0,1};
BooleanDifference(5) = { Volume{1}; Delete; }{ Volume{2}; Delete; };
BooleanDifference(6) = { Volume{5}; Delete; }{ Volume{3}; Delete; };
BooleanDifference(7) = { Volume{6}; Delete; }{ Volume{4}; Delete; };
Periodic Surface{8} = {1} Translate{5,0,0};

//-------------------------------------------
// Option #1 = Using mesh size at node
//------------------------------------------
// s() = Unique(Abs(Boundary{ Volume{5}; }));
// l() = Unique(Abs(Boundary{ Surface{s()}; }));
// p() = Unique(Abs(Boundary{ Line{l()}; }));
// // Characteristic Length{p()} = 0.001;
// Characteristic Length{1,2,3,4,5,6,7,8,9,10,11,12} = 0.1;

//--------------------------------------
// Option #2 = Using Ball with Field
//---------------------------------------
Field[1] = Ball;
Field[1].Radius=2.0;
Field[1].VIn=0.05;
Field[1].VOut=0.12;

Field[1].XCenter=0;
Field[1].YCenter=0;
Field[1].ZCenter=0;

Field[2] = Ball;
Field[2].Radius=2.0;
Field[2].VIn=0.05;
Field[2].VOut=0.12;

Field[2].XCenter=5;
Field[2].YCenter=0;
Field[2].ZCenter=0;

Field[3] = Ball;
Field[3].Radius=2.0;
Field[3].VIn=0.05;
Field[3].VOut=0.12;

Field[3].XCenter=2.5;
Field[3].YCenter=5;
Field[3].ZCenter=0;

Field[4] = Min;
Field[4].FieldsList = {1, 2, 3};
Background Field = 4; 
//-------------------------------------------
// Add Physical entities before saving mesh
//-------------------------------------------
Physical Volume(1) ={7};
Physical Surface(1)={1};  // Periodic master face along X direction
Physical Surface(2)={8};  // Periodic slave opposite to #1 along X direction 
Physical Surface(3)={2};  // Symmetry plane #1   (with Y = 0)
Physical Surface(4)={4};  // Symmetry plane #2  (With Y = Y_max of the cube)
Physical Surface(5)={3};  // Top moving wall
Physical Surface(6)={5};  // Bottom wall which has substratum
Physical Surface(7)={6};  // 1/4 Hemisphere #1 with center at Origin
Physical Surface(8)={7};  // 1/4 Hemisphere #2 with center at (Xmax,0,0)
Physical Surface(9)={9};  // 1/2 Hemisphere with center at (0.5*Xmax, Ymax, 0)

// Additional examples are available in the demos/boolean directory.


More information about the gmsh mailing list