MFEMScalarQuadratureFunction

Overview

MFEMScalarQuadratureFunction declares a named scalar MFEM coefficient that holds precomputed values of a source scalar coefficient at the quadrature points of an MFEM QuadratureSpace of the requested integration rule order. The source may be any named scalar coefficient in the problem, including parsed functions and (grid)functions of problem variables. The declared coefficient can be used wherever a scalar coefficient name is accepted, in place of the source coefficient.

Values are projected from the source coefficient lazily, on the first evaluation of the declared coefficient after its stored values have been marked as changed. The updates parameter controls when this occurs:

  • none: the source never changes after initialization; it is projected exactly once.

  • time: the source changes with time only; it is re-projected when the simulation time is set, at most once per time step.

  • nonlinear (default): the source may additionally depend on solution variables; it is also re-projected whenever trial variables are updated, i.e. on each nonlinear iteration.

warningwarning

The integration rule used by objects consuming this coefficient must match the quadrature rule implied by the order parameter exactly. The underlying QuadratureFunctionCoefficient looks values up by quadrature point index, so evaluating it with a different integration rule returns values belonging to different points. For example, mfem::DomainLFIntegrator uses a rule of order by default for elements of order , whereas mfem::DiffusionIntegrator uses order on tensor-product elements of dimension . MOOSE will error out if the integration rules between the MFEMScalarQuadratureFunction and the selected kernel are not compatible, and suggest an order which could make them match.

Example Input File Syntax

[QuadratureFunctions<<<{"href": "../../../syntax/QuadratureFunctions/index.html"}>>>]
  [qf_source]
    type = MFEMScalarQuadratureFunction<<<{"description": "Declares a scalar MFEM coefficient holding precomputed values of a source coefficient at quadrature points. Values are (re)projected lazily when the coefficient is used.", "href": "MFEMScalarQuadratureFunction.html"}>>>
    coefficient<<<{"description": "Scalar coefficient to project onto the quadrature points. A functor is any of the following: a variable, an MFEM material property, a function, a postprocessor or a number."}>>> = source
    # match the default integration rule order used by DomainLFIntegrator
    # for first-order elements (oa * fe_order + ob = 2 * 1 + 0)
    order<<<{"description": "Order of the quadrature rule the projected values are stored on. This must match the integration rule used by the objects consuming this coefficient."}>>> = 2
  []
[]

[Kernels<<<{"href": "../../../syntax/Kernels/index.html"}>>>]
  [diff]
    type = MFEMDiffusionKernel<<<{"description": "Adds the domain integrator to an MFEM problem for the bilinear form $(k\\vec\\nabla u, \\vec\\nabla v)_\\Omega$ arising from the weak form of the Laplacian operator $- \\vec\\nabla \\cdot \\left( k \\vec \\nabla u \\right)$.", "href": "../kernels/MFEMDiffusionKernel.html"}>>>
    variable<<<{"description": "Variable labelling the weak form this kernel is added to"}>>> = variable
  []
  [source]
    type = MFEMDomainLFKernel<<<{"description": "Adds the domain integrator to an MFEM problem for the linear form $(f, v)_\\Omega$ arising from the weak form of the forcing term $f$.", "href": "../kernels/MFEMDomainLFKernel.html"}>>>
    variable<<<{"description": "Variable labelling the weak form this kernel is added to"}>>> = variable
    coefficient<<<{"description": "Name of scalar coefficient $f$. A functor is any of the following: a variable, an MFEM material property, a function, a postprocessor or a number."}>>> = qf_source
    block<<<{"description": "The list of subdomains (names or ids) that this object will be restricted to. Leave empty to apply to all subdomains."}>>> = wire
  []
[]
(test/tests/mfem/functions/quadrature_function_source.i)

Input Parameters

  • coefficientScalar coefficient to project onto the quadrature points. A functor is any of the following: a variable, an MFEM material property, a function, a postprocessor or a number.

    C++ Type:MFEMScalarCoefficientName

    Controllable:No

    Description:Scalar coefficient to project onto the quadrature points. A functor is any of the following: a variable, an MFEM material property, a function, a postprocessor or a number.

  • orderOrder of the quadrature rule the projected values are stored on. This must match the integration rule used by the objects consuming this coefficient.

    C++ Type:int

    Range:order>=0

    Controllable:No

    Description:Order of the quadrature rule the projected values are stored on. This must match the integration rule used by the objects consuming this coefficient.

Required Parameters

  • updatesNONLINEARWhen the stored values are re-projected from the source coefficient: 'none' projects exactly once, 'time' re-projects when the simulation time changes, 'nonlinear' additionally re-projects whenever solution variables change (i.e. on each nonlinear iteration).

    Default:NONLINEAR

    C++ Type:MooseEnum

    Options:NONE, TIME, NONLINEAR

    Controllable:No

    Description:When the stored values are re-projected from the source coefficient: 'none' projects exactly once, 'time' re-projects when the simulation time changes, 'nonlinear' additionally re-projects whenever solution variables change (i.e. on each nonlinear iteration).

Optional Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set the enabled status of the MooseObject.

Advanced Parameters

Input Files