kqcircuits.simulations.export.elmer.mesh_size_helpers

kqcircuits.simulations.export.elmer.mesh_size_helpers.refine_metal_edges(size: float = 5.0, slope: float = 0.3, excitation: int = -1, region: str = '', ignore_region: str = '', face_id: str = '*')[source]

Returns the mesh_size dictionary to refine the Gmsh mesh at base metal edges.

This function is useful for most Elmer 3d simulations. The field usually concentrates near the base metal edges, so it’s beneficial to refine the mesh there.

The default value for slope argument is chosen to be suitable for typical capacitance or EPR simulations. Make sure that the size value match the requirements of your simulation.

Typical usage is to pass parameter mesh_size=refine_metal_edges(size) for a 3d ElmerSolution. Do not use this function with ElmerCrossSectionSolution.

Parameters:
  • size – mesh element length at base-metal edges [µm]

  • slope – determines how fast the mesh element length can increase outside the edge [µm/µm] (0 < slope <= 1)

  • excitation – metal excitation value where the refinement is applied, or -1 to cover all excitations

  • region – partition region name in which the refinement is applied, or empty string to cover all regions

  • ignore_region – partition region name in which the refinement is ignored, or empty string to not use limitation

  • face_id – the string face id where the refinement is applied, or * to cover all faces

../_images/kqcircuits.simulations.export.elmer.mesh_size_helpers.png