efem.py

Define the classes, methods and functions for Edge Finite Element Method (EFEM) of lowest order in tetrahedral meshes, namely, Nedelec elements.

petgem.efem.efem.computeBoundaryDofs(edgesN, bfacesN)[source]

Compute boundary dofs of a tetrahedral mesh.

Parameters:
  • edgesN (ndarray) – edges-nodes connectivity.
  • bfacesN (ndarray) – boundary-faces-nodes connectivity.
Returns:

boundary-edges connectivity.

Return type:

ndarray

petgem.efem.efem.computeBoundaryFaces(elemsF, facesN)[source]

Compute boundary faces of a tetrahedral mesh.

Parameters:
  • elemsF (ndarray) – elements-face connectivity.
  • facesN (ndarray) – faces-nodes connectivity.
Returns:

boundary-faces connectivity.

Return type:

ndarray

petgem.efem.efem.computeDofs(elemsN, nElems)[source]

Compute degrees of freedom (DOF) of a 3D tetrahedral mesh. Here, dofs are defined for edge finite element computations.

Parameters:
  • elemsN (ndarray) – elements-nodes connectivity.
  • nElems (int) – number of tetrahedral elements in the mesh.
Returns:

dof connectivity and dofsNodes connectivity.

Return type:

ndarray

petgem.efem.efem.computeFaces(elemsN, nElems)[source]

Compute the element’s faces of a 3D tetrahedral mesh.

Parameters:matrix (ndarray) – elements-nodes connectivity.
Returns:element/faces connectivity.
Return type:ndarray

Note

References:

Rognes, Marie E., Robert Cndarray. Kirby, and Anders Logg. “Efficient assembly of H(div) and H(curl) conforming finite elements.” SIAM Journal on Scientific Computing 31.6 (2009): 4130-4151.

petgem.efem.efem.defineEFEMConstants()[source]

Set constants for edge finite element computations, namely, order linear edge finite elements (edgeOrder), order linear nodal finite elements (nodalOrder) and number of dimensions (numDimensions).

Param:None.
Returns:edgeOrder, nodalOrder and numDimensions.
Return type:integer.
petgem.efem.efem.nedelecBasisIterative(eleNodes, points, eleVol, lengthEdges, edgeOrder)[source]

Compute the basis Nedelec functions in an iterative way for a set of points in a given element.

Parameters:
  • eleNodes (ndarray) – nodal spatial coordinates of the element
  • points (ndarray) – spatial coordinates of the evaluation points
  • eleVol (float) – element’s volume
  • lengthEdges (ndarray) – element’s edges defined by their length
  • edgeOrder (int) – order of tetrahedral edge element
Returns:

values of Nedelec functions.

Return type:

ndarray.

petgem.efem.efem.unitary_test()[source]

Unitary test for efem.py script.