Skip to content
Snippets Groups Projects
Select Git revision
  • 14745dc74fd7eded39a9d5cc9f1fb675699098d7
  • master default protected
2 results

microstrip.pro

Blame
  • microstrip.pro 9.27 KiB
    /* -------------------------------------------------------------------
       Tutorial 1 : electrostatic field of a microstrip
    
       Features:
       - Physical and abstract regions
       - Scalar FunctionSpace with Dirichlet constraint
       - Galerkin term for stiffness matrix
    
       To compute the solution in a terminal:
           getdp microstrip -solve EleSta_v
           getdp microstrip -pos Map
           getdp microstrip -pos Cut
    
       To compute the solution interactively from the Gmsh GUI:
           File > Open > microstrip.pro
           Run (button at the bottom of the left panel)
       ------------------------------------------------------------------- */
    
    Group {
      /* One starts by giving explicit meaningful names to
         the Physical regions defined in the "microstrip.msh" mesh file.
         There are 2 volume regions and 3 surface regions in this model. */
    
      Air = Region[101];
      Diel1 = Region[111];
    
      Ground = Region[120];
      Electrode = Region[121];
      SurfInf = Region[130];
    
      /* We now define abstract regions to be used below
         in the definition of the scalar electric potential formulation:
    
         Vol_Dielectric_Ele : dielectric volume regions where
                              "Div ( epsr[] Grad v)" is solved
         Sur_Dir_Ele        : Dirichlet boundary condition (v imposed)
         Sur_Neu_Ele        : Neumann bondary condition ( epsr[] n.Grad v = 0 )
    
         Vol_xxx groups contain only volume elements of the mesh (triangles here).
         Sur_xxx groups contain only surface elements of the mesh (lines here).
      */
    
      Vol_Dielectric_Ele = Region[ {Air, Diel1} ];
      Sur_Dir_Ele = Region[ {Ground, Electrode} ];
      Sur_Neu_Ele = Region[ {SurfInf} ];
    }
    
    Function {
      /* Material laws (here the relative permittivity)
         are defined piecewise in terms of the above defined physical regions */
    
      epsr[Air] = 1.;
      epsr[Diel1] = 9.8;
    }
    
    Constraint {
      /* As for material laws, the Dirichlet boundary condition
         is defined piecewise.
         The constraint "Dirichlet_Ele" is invoked in the FunctionSpace below */
    
      { Name Dirichlet_Ele; Type Assign;
        Case {
          { Region Ground; Value 0.; }
          { Region Electrode; Value 1.e-3; }
        }
      }
    }
    
    Group{
      /* The domain of definition of a FunctionSpace lists all regions