Include "par.dat"; Group { Lplus= #2002; Lminus= #2003; cluster= #2001; Gate= #2004; air=#3003;diel=#3001;subs=#3002; domain= #{air,diel,subs}; Grouped = #{Lplus,Lminus,cluster,Gate}; } Function { epsr[#air]=1.; epsr[#diel]=epsrdiel; epsr[#subs]=epsrsubs; } Jacobian { { Name Vol ; Case {{ Region All ; Jacobian Vol ; }}}} Integration { { Name Int ; Case { { Type Gauss ; Case { { GeoElement Point ; NumberOfPoints 1 ; } { GeoElement Line ; NumberOfPoints 3 ; } { GeoElement Line ; NumberOfPoints 3 ; } { GeoElement Triangle ; NumberOfPoints 4 ; } { GeoElement Quadrangle ; NumberOfPoints 4 ; } { GeoElement Tetrahedron ; NumberOfPoints 4 ; } { GeoElement Hexahedron ; NumberOfPoints 6 ; } { GeoElement Pyramid ; NumberOfPoints 8 ; } { GeoElement Prism ; NumberOfPoints 6 ; } // { GeoElement Point ; NumberOfPoints 1 ; } // { GeoElement Line ; NumberOfPoints 3 ; } // { GeoElement Triangle ; NumberOfPoints intri ; } // { GeoElement Tetrahedron ; NumberOfPoints intet ; } }}}}} Constraint { { Name GlobalElectricPotential ; Case { //Boundary condition using fixed Voltages { Region Lplus; Value Va ; } { Region Lminus; Value 0. ; } { Region Gate; Value Vg ; } }} { Name GlobalElectricCharge ; Case { { Region cluster; Value charge; } // sphere a potentiel flottant }}} If(ord==1) FunctionSpace { { Name fs_vglob ; Type Form0 ; BasisFunction { { Name sn ; NameOfCoef vn ; Function BF_Node ; Support domain ; Entity NodesOf[ All,Not Grouped]; } { Name sf ; NameOfCoef vfu; Function BF_GroupOfNodes ; Support domain ; Entity GroupsOfNodesOf[ Grouped] ; } } GlobalQuantity { { Name GlobalElectricPotential ; Type AliasOf ; NameOfCoef vfu ; } { Name GlobalElectricCharge ; Type AssociatedWith ; NameOfCoef vfu; } } Constraint { { NameOfCoef GlobalElectricCharge ; EntityType GroupsOfNodesOf ; NameOfConstraint GlobalElectricCharge ; } { NameOfCoef GlobalElectricPotential ; EntityType GroupsOfNodesOf ; NameOfConstraint GlobalElectricPotential ; } }}} EndIf If(ord==2) FunctionSpace { { Name fs_vglob ; Type Form0 ; BasisFunction { { Name sn ; NameOfCoef vn ; Function BF_Node ; Support domain ; Entity NodesOf[ All,Not Grouped]; } { Name sn2; NameOfCoef vn2; Function BF_Node_2E; Support domain ; Entity EdgesOf[ All,Not Grouped]; } { Name sf ; NameOfCoef vfu; Function BF_GroupOfNodes ; Support domain ; Entity GroupsOfNodesOf[ Grouped] ; } } GlobalQuantity { { Name GlobalElectricPotential ; Type AliasOf ; NameOfCoef vfu ; } { Name GlobalElectricCharge ; Type AssociatedWith ; NameOfCoef vfu; } } Constraint { { NameOfCoef GlobalElectricCharge ; EntityType GroupsOfNodesOf ; NameOfConstraint GlobalElectricCharge ; } { NameOfCoef GlobalElectricPotential ; EntityType GroupsOfNodesOf ; NameOfConstraint GlobalElectricPotential ; } }}} EndIf Formulation { { Name for_v ; Type FemEquation ; Quantity { { Name v; Type Local; NameOfSpace fs_vglob; } { Name Q; Type Global; NameOfSpace fs_vglob [GlobalElectricCharge]; } { Name V; Type Global; NameOfSpace fs_vglob [GlobalElectricPotential]; } } Equation { Galerkin { [ epsr[]*Dof{d v} , {d v} ] ; In domain; Jacobian Vol ; Integration Int ; } GlobalTerm { [ -Dof{Q}/eps0 , {V} ] ; In Grouped ; } }}} Resolution { { Name all;System {{ Name A1 ; NameOfFormulation for_v ;}} Operation { Generate[A1] ; Solve[A1] ; SaveSolution[A1] ;} }} PostProcessing { { Name all ; NameOfFormulation for_v; Quantity { { Name v ; Value { Local { [ {v} ] ; In domain ; Jacobian Vol; } } } { Name e ; Value { Local { [ {d v} ] ; In domain ; Jacobian Vol; } } } { Name ne ; Value { Local { [ Norm[{d v}] ] ; In domain ; Jacobian Vol; } } } { Name Q ; Value { Term { [ {Q} ] ; In Grouped ; } } } { Name V ; Value { Term { [ {V} ] ; In Grouped ; } } } // { Name C ; Value { Term { [ {Q}/{V} ] ; In Grouped; } } } }}} PostOperation{ { Name all ; NameOfPostProcessing all; Operation { Print[ v , OnElementsOf domain , File "v.pos" , Depth 3] ; // Print[ e , OnElementsOf domain , File "e.pos", Depth 3] ; // Print [ v, OnGrid {$A, 0, $C} {-50:50:2,0,-40:40:2 } , File "v.pos" ]; // Print [ e, OnGrid {$A, 0, $C} {-50:50:2,0,-40:40:2 } , File "eg.pos" ]; Print[Q, OnRegion Grouped, Format Table, File "result.pos"]; Print[V, OnRegion Grouped, Format Table, File >"result.pos"]; }}} // at home // alias gmsh='/home/alain/codes/gmsh-2.5.0-Linux/bin/gmsh' // alias gdp='/home/alain/codes/getdp-2.1.1/getdp' // at work // alias gmsh='/local/Alain//codes/gmsh-2.5.0-Linux/bin/gmsh' // alias gdp='/local/Alain/codes/getdp-2.1.1/getdp' // gmsh fem.geo -1 -2 -3 -optimize // gdp fem.pro -pre all -cal -pos all // gmsh fem.geo v.pos opt.opt