Fe_nedelec module (fe_nedelec.h)

Functions

PetscInt feNedelecDofCount(PetscInt order)

Number of H(curl) DOFs for a Nedelec element of the given order.

This function returns the dimension of the arbitrary-order Nedelec space on a tetrahedron, order*(order+2)*(order+3)/2, or 0 for a non-positive order.

Parameters:
  • order[in] Polynomial order p (>= 1).

  • order[in] Polynomial order p (>= 1).

Returns:

order*(order+2)*(order+3)/2, or 0 when order < 1.

Returns:

The number of H(curl) DOFs, or 0 when order < 1.

PetscErrorCode feNedelecCreate(PetscInt order, FeNedelec **out)

Builds a Nedelec element of the given order.

This function allocates an opaque Nedelec handle, computes the open Gauss-Legendre defining points for edges, faces and the interior, builds the DOF nodes/tangents (feNdBuildNodes), and forms the Vandermonde matrix T(o,m) = U_o(node_m) . tk[m] of the raw space against the DOF functionals, storing its inverse Ti = T^{-1} for later value/curl evaluation. The caller owns the returned handle and must release it with feNedelecDestroy.

Parameters:
  • order[in] Polynomial order p (>= 1).

  • out[out] Newly created handle (caller destroys with feNedelecDestroy).

  • order[in] Polynomial order p (>= 1).

  • out[out] Newly created handle.

Returns:

PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code.

Returns:

PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code.

PetscErrorCode feNedelecDestroy(FeNedelec **fe)

Destroys a Nedelec element handle (no-op on NULL).

This function frees every buffer owned by the handle (Vandermonde inverse, nodes, tangent indices, evaluation scratch) and the handle itself, then sets the caller’s pointer to NULL. Passing a NULL or already-freed handle is safe.

Parameters:
  • fe[inout] Handle to free; set to NULL on return.

  • fe[inout] Handle to free; set to NULL on return.

Returns:

PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code.

Returns:

PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code.

PetscInt feNedelecGetDof(const FeNedelec *fe)

Returns the number of H(curl) DOFs (0 if fe is NULL).

Returns the number of H(curl) DOFs (0 if fe is NULL).

Parameters:
  • fe[in] Element handle (may be NULL).

Returns:

The DOF count, or 0 when fe is NULL.

PetscInt feNedelecGetOrder(const FeNedelec *fe)

Returns the polynomial order (0 if fe is NULL).

Returns the polynomial order (0 if fe is NULL).

Parameters:
  • fe[in] Element handle (may be NULL).

Returns:

The polynomial order, or 0 when fe is NULL.

PetscErrorCode feNedelecCalcVShape(const FeNedelec *fe, PetscReal x, PetscReal y, PetscReal z, PetscReal *shape)

Evaluates the reference Nedelec values at a reference-cell point.

This function evaluates the raw curl-conforming space at (x, y, z) and applies the stored Vandermonde inverse Ti to obtain the nodal basis values, writing them into shape as dof x 3 row-major. The handle’s 1D scratch is overwritten, so a single handle is not reentrant.

Parameters:
  • fe[in] Element handle.

  • z (x, y,) – [in] Reference-cell coordinates.

  • shape[out] dof x 3 row-major basis values.

  • fe[in] Element handle.

  • z[in] Reference-cell coordinates.

  • shape[out] dof x 3 row-major basis values.

Returns:

PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code.

Returns:

PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code.

PetscErrorCode feNedelecCalcCurlShape(const FeNedelec *fe, PetscReal x, PetscReal y, PetscReal z, PetscReal *curl)

Evaluates the reference Nedelec curls at a reference-cell point.

This function evaluates the raw curls at (x, y, z) and applies the stored Vandermonde inverse Ti to obtain the nodal basis curls, writing them into curl as dof x 3 row-major. The lambda-derivative sign from lambda = 1-x-y-z is already carried inside the raw-curl expressions, so the plain Chebyshev derivative is passed as the lambda factor. The handle’s 1D scratch is overwritten, so a single handle is not reentrant.

Parameters:
  • fe[in] Element handle.

  • z (x, y,) – [in] Reference-cell coordinates.

  • curl[out] dof x 3 row-major curl values.

  • fe[in] Element handle.

  • z[in] Reference-cell coordinates.

  • curl[out] dof x 3 row-major curl values.

Returns:

PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code.

Returns:

PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code.

PetscErrorCode feNedelecGetDofInfo(const FeNedelec *fe, PetscInt m, PetscReal node[3], PetscReal tangent[3])

Returns the defining-functional node and tangent of a DOF.

This function reports the reference-cell node coordinates and the tangent direction (from feNd_tk, via the DOF’s tangent index) of functional m. Either output may be NULL to skip it. The DOF index is bounds-checked.

Parameters:
  • fe[in] Element handle.

  • m[in] DOF index in [0, dof).

  • node[out] Reference-cell node coordinates (3); may be NULL.

  • tangent[out] DOF tangent direction (3); may be NULL.

  • fe[in] Element handle.

  • m[in] DOF index in [0, dof).

  • node[out] Reference-cell node coordinates (3); may be NULL.

  • tangent[out] DOF tangent direction (3); may be NULL.

Returns:

PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code.

Returns:

PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code.