-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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