ngsPETSc.utils.fenicsx

This module contains all the functions related to wrapping NGSolve meshes to FEniCSx We adopt the same docstring conventiona as the FEniCSx project, since this part of the package will only be used in combination with FEniCSx.

Attributes

_ngs_to_cells

Classes

GeometricModel

This class is used to wrap a Netgen geometric model to a DOLFINx mesh.

Module Contents

ngsPETSc.utils.fenicsx._ngs_to_cells
class ngsPETSc.utils.fenicsx.GeometricModel(geo, comm: mpi4py.MPI.Comm)

This class is used to wrap a Netgen geometric model to a DOLFINx mesh. Args:

geo: The Netgen model comm: The MPI communicator to use for mesh creation

geo
comm
model_to_mesh(hmax: float, gdim: int = 2, partitioner: Callable[[mpi4py.MPI.Comm, int, int, dolfinx.cpp.graph.AdjacencyList_int32], dolfinx.cpp.graph.AdjacencyList_int32] = dolfinx.mesh.create_cell_partitioner(dolfinx.mesh.GhostMode.none), transform: Any = None, routine: Any = None) dolfinx.mesh.Mesh

Given a NetGen model, take all physical entities of the highest topological dimension and create the corresponding DOLFINx mesh.

This function only works in serial, at the moment.

Args:

hmax: The maximum diameter of the elements in the triangulation model: The NetGen model gdim: Geometrical dimension of the mesh partitioner: Function that computes the parallel

distribution of cells across MPI ranks

transform: PETSc DMPLEX Transformation to be applied to the mesh routine: Function to be applied to the mesh after generation

takes as plan the mesh and the NetGen model and returns the same objects after the routine has been applied.

Returns:

A DOLFINx mesh for the given NetGen model.