This is no so difficult
let us call Thc the coarse mesh and Thp the mesh with perforation.
load "msh3"
meshL ThLc= extract(Thc); // border mesh
fespace Ehc(Thc,P0Edge); // Constant fonction of edge
Ehc ul = label+0.5; // get the label on the each boundary edge
Thp = change(Thp, flabel= dist(ThLc) < 1e-6 ? ul : 4) ;
Now the label of Thp mesh are 1,2,3 of Coarse mesh border and 4 if not on border of ThLc (dist > 1e-6)
But it seems that this method does not work. I have this code :
meshL THL= extract(THK); // border mesh
meshL ThL=extract(ThK);
fespace Ehc(THL,P0edge); // Constant fonction of edge
Ehc ul = label+0.5; // get the label on the each boundary edge
ThK = change(ThK, flabel= dist(THL) < 1e-6 ? ul : 4 ) ;
And I get this error:
44 : meshL THL= extract(THK); // border mesh
45 : meshL ThL=extract(ThK);
46 : fespace Ehc(THL,P0edge); // Constant fonction of edge
47 : Ehc ul = label+0.5; // get the label on the each boundary edge
48 : ThK = change(ThK, flabel= dist(THL) error operator ( <PPKN5Fem2D5MeshLE>
List of choices
( <d> : <d>, <d> )
( <d> : <d>, <d>, <d> )
Error line number 48, in file ReadMeshMED.edp, before token )
meshL THL= extract(THK); // border mesh
meshL ThL=extract(ThK);
fespace Ehc(THL,P0edge); // Constant fonction of edge
Ehc ul = label+0.5; // get the label on the each boundary edge
//ThK = change(ThK, flabel= dist(THL) < 1e-6 ? ul : 4 ) ;
fespace WHK(THK,P1b); // p1 bubble
WHK ong ;
varf von(u,v) = on(1,2,3,u=1); // 1 on border
ong[]= von(0,WHK,tgv=1); // 1 ON BORDER …
ThK = change(ThK, flabel= ong>0.999999 ? ul : 4 ) ;
and the error:
sorry no cast to this curve finite element
current line = 47
Exec error : sorry no cast to this curve finite element
-- number :1
Exec error : sorry no cast to this curve finite element
-- number :1
err code 8 , mpirank 0
47 meshL THL= extract(THK); // border mesh
48 fespace Ehc(THL,P0edge); // Constant fonction of edge
49 Ehc ul = label+0.5; // get the label on the each boundary edge
50 fespace WHK(THK,P1b); // p1 bubble
51 WHK ong ;
52 varf von(u,v) = on(1,2,3,u=1); // 1 on border
53 ong[]= von(0,WHK,tgv=1); // 1 ON BORDER …
54 ThK = change(ThK, flabel= ong>0.999999 ? ul : 4 ) ;
sorry no cast to this curve finite element
current line = 48
Exec error : sorry no cast to this curve finite element
-- number :1
Exec error : sorry no cast to this curve finite element
-- number :1
err code 8 , mpirank 0
The error comes from the line fespace Ehc(THL,P0edge);
Besides, I would like to understand why I have not access to the function dist. I think this function will be very useful for me.