Set up boundary id in gmsh

33 views
Skip to first unread message

yuesu jin

unread,
Aug 5, 2020, 8:36:09 PM8/5/20
to deal.II User Group
Dear all,
  I want to set up one Dirchlet boundary condition and one Neumann boundary condition on a 2d  mesh, which is generated by gmsh. How can I set up the mesh file in order to tell dealii with the boundary id when I input the .msh file into dealii? Thanks!
Best regards,
--
Yuesu Jin,
Ph.D student,
University of Houston,
College of Natural Sciences and Mathematics,
Department of Earth and Atmospheric Sciences,
Houston, Texas 77204-5008


Bruno Blais

unread,
Aug 5, 2020, 10:33:09 PM8/5/20
to deal.II User Group
The best way to proceed is to set the boundary conditions using Physical Entities in GMSH.
An example is always better. For example, the following GMSH code :

 lc
= 2.0e-1;
 lf
= 2.0e-1;
 RO
=1;
 RI
=0.25;
 
 
Point(0) = {0, 0, 0, lc};
 
Point(1) = {RO, 0, 0, lc};
 
Point(2) = {0, -RO , 0, lc};
 
Point(3) = {-RO, 0, 0, lc};
 
Point(4) = {0, RO, 0, lc};
 
 
Point(5) = {RI, 0, 0, lf};
 
Point(6) = {0, -RI , 0, lf};
 
Point(7) = {-RI, 0, 0, lf};
 
Point(8) = {0, RI, 0, lf};
 
 
Circle(1)={1,0,2};
 
Circle(2)={2,0,3};
 
Circle(3)={3,0,4};
 
Circle(4)={4,0,1};
 
 
Circle(5)={5,0,6};
 
Circle(6)={6,0,7};
 
Circle(7)={7,0,8};
 
Circle(8)={8,0,5};
 
 
Line Loop(1) = {1,2,3,4};
 
Line Loop(2) = {5,6,7,8};
 
 
Plane Surface(1) = {1,2} ;
 
//Transfinite Surface{1}={1,2,3,4};
 
Recombine Surface{1,2};
 
 
// Creates a physical entity 1 (i.e. for a BC)
 
//Physical Point(1) = {1,2} ;
 
Physical Line(0)={1,2,3,4};
 
Physical Line(1)={5,6,7,8};
 
 
Physical Surface(0) = {1};


Produces a 2D mesh of a single surface with id 0. It has two boundary conditions (0) and (1). One on the outer circle and the other on the inner circle. We use it to simulate a Taylor-Couette flow.
If you wanted to use a 3D mesh, then you would make a Physical Volume(0) and you would use the Physical Surface for the boundary conditions

Best
Bruno

yuesu jin

unread,
Aug 5, 2020, 10:44:11 PM8/5/20
to deal.II User Group
Dear Bruno,
  Thank you very much!!! This solved my problem. This is very helpful! 
Best regards,
Yuesu

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/756546c6-95a9-4b71-a58b-772a0884bb9do%40googlegroups.com.

Bruno Blais

unread,
Aug 5, 2020, 11:33:15 PM8/5/20
to deal.II User Group
The pleasure is mine.
You will find that people the deal.II community are very helpfull :)!
To unsubscribe from this group and stop receiving emails from it, send an email to dea...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages