Skip to content

Add two MFEM auxkernels for L2-averaged inner and cross product of two source (par)gridfucntions projected onto an MFEM AuxVariable #31612

@Giannis95

Description

@Giannis95

Motivation

There is currently no AuxKernels that compute the inner (u.v) and cross (u x v) products of MFEM source gridfunctions and project them onto an MFEM auxvariable. Adding these will allow user to to calculate physical quantities such as the joule heating, field orientations etc.

Design

Add two auxkernels inherriting from the MFEMAuxKernel and compute:

  • MFEMDotProductAux computes and projects : $s(x)\left(\mathbf{U}\cdot \mathbf{V}\right)$ onto a scalar MFEM AuxVariable, where $s(x)$ is a scale factor, U and V are the source gridfunctions or vectors.
  • MFEMCrossProductAux computes and projects : $s(x)(\mathbf{U}\times \mathbf{V})$ onto a vector MFEM AuxVariable
    Both associate classes wrap the inputs with VectorGridFunctionCoefficient and build the product via InnerProductCoefficient and VectorCrossProductCoefficient respectively and is projected into the MFEM auxvariable via GridFunction::ProjectCoefficient(...). There is an optional costant scale factor $s(x)$

other design considerations:

  • AuxVariable must use L2_FECollection with map_type = FiniteElement::INTEGRAL
  • only the interior DOFs are supported (no shared/constrained DOFs): we enforce fes->GetTrueVSize() == fes->GetVSize() (at this time).

Example user input:
[AuxKernels]
[uv_dot]
type = MFEMDotProductAux
u = U
v = V
scale_factor = 1.0
variable = U_dot_V
[ ]
[uv_cross]
type = MFEMCrossProductAux
u = U
v = V
scale_factor = 1.0
variable = U_cross_V
[ ]
[ ]

Impact

New capability: Users can directly calculate the inner (dot) and cross products of MFEM vector fields as AuxVariables with no changes to existing APIs or kernels (these two are additional auxkernels).
Perfomance: Element-wise projection - no global linear solve, so runtime impact is minimal

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: taskAn enhancement to the software.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions