nedelec_elements.py

Define functions for Nedelec elements of lowest order.

petgem.efem.nedelec_elements.compute_analytic_element_matrix(eleNodes, eleVol, lengthE, signs)[source]

Compute tetrahedral elemental matrices in an analytic manner.

Parameters:
  • eleNodes (ndarray) – nodal spatial coordinates of the element.
  • eleVol (float) – element’s volume.
  • lengthE (ndarray) – element’s edges defined by their length.
  • signs (ndarray) – local edge signs.
Returns:

stiffness matrix and mass matrix.

Return type:

ndarray.

petgem.efem.nedelec_elements.compute_signs_edges(indx_nodes)[source]

Compute the local direction of element’s-th edges with respect to global direction of edges within the mesh. This data is needed in order to use linear Nedelec elements in 3D. The edge signs can be easily deduced from the mesh data itself by directly using the data structure which represents the elements (tetrahedrons) by their node indexes. As consequence, the signs are obtained with minimal matrix operations in a vectorized manner.

signs(i) is the sign related to i’th edge of the element-th.

edge1 = [1 2] edge2 = [1 3] edge3 = [1 4] edge4 = [2 3] edge5 = [4 2] edge6 = [3 4]

Parameters:indx_nodes (ndarray) – nodal indexes of the element.

Note

References:

Jin, Jian-Ming. The finite element method in electromagnetics. John Wiley & Sons, 2002.

petgem.efem.nedelec_elements.nedelec_basis_iterative(eleNodes, points, eleVol, lengthEdges)[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.
Returns:

values of Nedelec functions.

Return type:

ndarray.

petgem.efem.nedelec_elements.nedelec_basis_vectorized(eleNodes, points, eleVol, lengthEdges)[source]

Compute the basis Nedelec functions in a vectorized 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.
Returns:

values of Nedelec functions.

Return type:

ndarray.

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

Unitary test for nedelec_elements.py script.