load "PETSc" load "SLEPc" macro dimension()2//EOM include "macro_ddm.idp" // Creating the mesh real Rout=1.0, Rin=0.5 ; // Rout outer radius, Rin inner radius border C1(t=0,2*pi){x=Rout*cos(t) ; y=Rout*sin(t) ; label=1 ;} ; // outer boundary circle border C2(t=0,2*pi){x=Rin*cos(t) ; y=Rin*sin(t) ; label=1 ;} ; // inner boundary circle int nn=250; // parameter for number of nodes on boundaries mesh Th = buildmesh( C1(Rout*nn) + C2(-Rin*nn) ) ; // building mesh on annulus // Creating Finite Element Spaces func Pk = P1 ; fespace Vh(Th, Pk); // space we want solution on //plotDmesh(Th, cmm="Initial Mesh") ; mesh ThBackup = Th ; fespace VhBackup(ThBackup, Pk) ; int[int] myN2O ; macro ThN2O() myN2O // this tells buildDmesh to keep the local to global correspondence int[int] subIdx = restrict(Vh, VhBackup, myN2O) ; VhBackup hGlob, sum ; buildDmesh(Th)