I have been able to overcome the difficulty by important each part of the mesh separately as
load “medit”
include “cube.idp”
load “tetgen”
include “MeshSurface.idp”
/************************* SURFACE MESH OF THE COIL **********************/
meshS ThS0 = readmeshS(“cut1_0.mesh”);
meshS ThS1 = readmeshS(“cut1_1.mesh”);
meshS ThS2 = readmeshS(“cut1_2.mesh”);
meshS ThS4 = readmeshS(“cut1_4.mesh”);
meshS ThS5 = readmeshS(“cut1_5.mesh”);
/************** SURFACE MESH OF THE BOUNDING BOX **************************/
real eta = 0.2;
real[int,int] BB=[[11-eta,13+eta],[9-eta,11+eta],[1-eta,3+eta]]; // bounding bax
int[int,int] L=[[1,2],[3,4],[5,6]]; // the label of the 6 face left,right, front, back, down, right
int[int] N = [20, 20, 20];
meshS SURFbox = SurfaceHex(N, BB, L, 1); //discretization, size, label, orientation
/************************* COMBINE SURFACE MESH ***********************************/
meshS MESHTOT = SURFbox + ThS0 + ThS1 + ThS2 + ThS4 + ThS5 ;
/************************* CREATE VOLUME MESH ***********************************/
real x0 = ThS0[0][0].x;
real y0 = ThS0[0][0].y;
real z0 = ThS0[0][0].z;
real x1 = ThS1[0][0].x;
real y1 = ThS1[0][0].y;
real z1 = ThS1[0][0].z;
real x2 = ThS2[0][0].x;
real y2 = ThS2[0][0].y;
real z2 = ThS2[0][0].z;
real x4 = ThS4[0][0].x;
real y4 = ThS4[0][0].y;
real z4 = ThS4[0][0].z;
real x5 = ThS5[0][0].x;
real y5 = ThS5[0][0].y;
real z5 = ThS5[0][0].z;
real xb = 11-eta;
real yb = 9-eta;
real zb = 1-eta;
real[int] domain = [xb,yb,zb, 53, 1.e-4];
real[int] myholes = [x0,y0,z0, x1,y1, z1, x2,y2, z2, x4,y4, z4, x5,y5, z5];
mesh3 Th = tetg(MESHTOT, switch=“paAAQYY”, holelist=myholes, nbofregions=1, regionlist=domain);
medit(“mesh”, Th);
savemesh(Th,“RVE1.mesh”);
Everything works well.
But now, my last problem:
I
want to apply periodic boundary conditions on the border of the box as
fespace Vh(Th, [P2,P2,P2,P1], periodic=[[1, x, z], [3, x, z], [2, y, z], [4, y, z], [5, x, y], [6, x, y]]);
But I get this error:
Assertion fail : (hmn>1.0e-20)
line :215, in file lgmesh3.cpp
Normally, when we construct the box using SurfaceHex(N, BB, L, 1)
, the opposite faces of the box are generated with matching meshes, which allows to support periodic boundary conditions. Therefore, I’m not sure what is causing the issue here.
Could you have an idea how to fix this problem ?
I put all the materials to reproduce the problem in attachment.
Thank you in advance,
Best regards,
Loïc,
cut1_0.mesh (40.8 KB)
cut1_1.mesh (2.7 MB)
cut1_2.mesh (80.0 KB)
cut1_4.mesh (68.2 KB)
cut1_5.mesh (63.1 KB)
MWE_PER.edp (1.9 KB)