Group { Core = Region[ 102 ]; Wall_d = Region[ 1101 ]; Wall_1 = Region[ 1102 ]; Wall_2 = Region[ 1103 ]; Wall_n = Region[ 1104 ]; Vol_Mag = Region[ {Core} ]; Vol_tot =Region[ {Vol_Mag,Wall_n,Wall_1,Wall_2} ]; } Function { gamma = 15; mu0 = 4.e-7 * Pi; ep0 = 8.854187817e-12; A1=100e-3; H = 26.225e-3; EY[] = Vector[0,1,0] ; epsilon [] = ep0 ; mu[]=mu0; gam[] = gamma; nu [] = 1. / (mu0); } Constraint { { Name Dirichlet; Case { { Region Wall_d ; Value 0.; } } } { Name periodic ; Case { { Region Wall_2; Type LinkCplx; RegionRef Wall_1; Coefficient Exp[-gam[]*H]; Function Vector[$X,$Y-H,$Z]; } } } } FunctionSpace { { Name H_2D; Type Form1P; BasisFunction { { Name se; NameOfCoef ae; Function BF_PerpendicularEdge; Support Vol_tot ; Entity NodesOf[ All ]; } } Constraint { { NameOfCoef ae; EntityType NodesOf; NameOfConstraint periodic; } { NameOfCoef ae; EntityType NodesOf; NameOfConstraint Dirichlet; } } } } Jacobian { { Name Vol ; Case {{ Region Vol_Mag ; Jacobian VolAxiSqu ; } { Region Wall_n ; Jacobian SurAxi ; } { Region Wall_1 ; Jacobian SurAxi ; } { Region Wall_2 ; Jacobian SurAxi ; } } } } Integration { { Name Int ; Case { { Type Gauss ; Case { { GeoElement Line ; NumberOfPoints 2 ; } { GeoElement Triangle ; NumberOfPoints 3 ; } { GeoElement Quadrangle ; NumberOfPoints 4 ; } } } } } } Formulation { { Name MW_h_2D; Type FemEquation; Quantity { { Name h ; Type Local; NameOfSpace H_2D; } } Equation { Galerkin { [ Dof{d h} , {d h} ]; In Vol_Mag; Jacobian Vol; Integration Int; } Galerkin { DtDtDof[ (epsilon[]/nu[])*Dof{h} , {h} ]; In Vol_Mag; Jacobian Vol; Integration Int; } // -gamma*U : Galerkin { [-gam[]*Dof{h} , {h} ]; In Wall_1; Jacobian Vol; Integration Int; } Galerkin { [gam[]*Dof{h} , {h} ]; In Wall_2; Jacobian Vol; Integration Int; } // dU/dy : // Galerkin { [-EY[]/\Dof{Curl h} , {h} ]; // In Wall_1; Jacobian Vol; Integration Int; } // Galerkin { [EY[]/\Dof{Curl h} , {h} ]; // In Wall_2; Jacobian Vol; Integration Int; } } } } Resolution { { Name MagSta_a; System { { Name Sys_Mag; NameOfFormulation MW_h_2D; Type ComplexValue;} } Operation { GenerateSeparate[Sys_Mag]; EigenSolve[Sys_Mag,1,(2*Pi*2.5e9)^2,0]; Print[Sys_Mag]; } } } PostProcessing { { Name MagSta_h_2D; NameOfFormulation MW_h_2D; Quantity { { Name h; Value { Term { [ {h} ]; In Vol_Mag; Jacobian Vol; } } } { Name Norm_h; Value { Term { [ Norm[{h}] ]; In Vol_Mag; Jacobian Vol; } } } { Name dh_dy; Value { Term { [ -EY[]/\{Curl h} ]; In Vol_Mag; Jacobian Vol; } } } { Name gamma_h; Value { Term { [ -gam[]*{h} ]; In Vol_Mag; Jacobian Vol; } } } } } } PostOperation { { Name Map_a; NameOfPostProcessing MagSta_h_2D; Operation { Print[ h, OnElementsOf Vol_Mag, File "h.pos" ]; Print[ Norm_h, OnElementsOf Vol_Mag, File "Norm_h.pos" ]; Print[ dh_dy, OnElementsOf Vol_Mag, File "dh_dy.pos" ]; Print[ gamma_h, OnElementsOf Vol_Mag, File "gamma_h.pos" ]; Print[ dh_dy, OnGrid {$A, $B, $C} { 0:A1:A1/10, 0:H:H, 0 }, Format SimpleTable, File Sprintf("dh_dy.txt") ] ; Print[ gamma_h, OnGrid {$A, $B, $C} { 0:A1:A1/10, 0:H:H, 0 }, Format SimpleTable, File Sprintf("gamma_h.txt") ] ; } } }