NEML2FEInterpolation

This userobject provides an interface to NEML2 for finite element interpolation (at quadrature points) of variables and their gradients. It loops through elements to cache shape functions, shape function gradients, and DOF maps, then provides them as NEML2 tensors for use in NEML2 models.

Example usage

This object requires a NEML2Assembly object to provide assembly information:


[UserObjects]
  [assembly]
    type = NEML2Assembly
  []
  [fe]
    type = NEML2FEInterpolation
    assembly = 'assembly'
  []
[]

Implementation details

Once the shape function caching is done, this object does not actively update the function space information unless the invalidateFEMContext() method is called. The contextUpToDate() method can be used to check if the current FE context cache is up-to-date. Similarly, the variable interpolations are not actively updated until the invalidateInterpolations() method is called.

The FE context cache is automatically invalidated when the mesh changes, so this object works correctly with mesh adaptivity.

Getter methods

Several getter methods are provided to access cached data. All tensors are stored in device memory and are only available after finalize() is called.

MethodBatch shapeBase shapeDescription
getValueVariable value at quadrature points
getGradientVariable gradient at quadrature points
getPhiShape function values
getPhiGradientShape function gradients
getDofMapLocal DOF indices
getGlobalDofMapGlobal DOF indices (as std::vector<dof_id_type>)
local_ndofNumber of local DOFs including ghost DOFs

where is the number of elements, is the number of quadrature points per element, and is the number of degrees of freedom per element.

Restrictions

  • Only variables of type MooseVariableFE<Real> are supported

  • Variable scaling factors other than unity are not supported

  • All elements handled by a single NEML2FEInterpolation must share the same number of quadrature points and the same number of dofs per element for each FEType. Mixed element topologies or p-adaptivity need to be split into multiple block-restricted NEML2FEInterpolation/NEML2Assembly pairs (one per element type).

  • Only the current solution is interpolated; old variable values/gradients are not provided to NEML2 through this path.

  • The implementation currently assumes PETSc vectors for the solution transfer.

Syntax

Input Parameters

  • assemblyThe NEML2Assembly object to use to provide assembly information

    C++ Type:UserObjectName

    Controllable:No

    Description:The NEML2Assembly object to use to provide assembly information

Required Parameters

  • blockThe list of blocks (ids or names) that this object will be applied

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

    Controllable:No

    Description:The list of blocks (ids or names) that this object will be applied

Optional Parameters

  • allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

    Default:False

    C++ Type:bool

    Controllable:No

    Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

  • execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

    Default:0

    C++ Type:int

    Controllable:No

    Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

  • force_postauxFalseForces the UserObject to be executed in POSTAUX

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in POSTAUX

  • force_preauxFalseForces the UserObject to be executed in PREAUX

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in PREAUX

  • force_preicFalseForces the UserObject to be executed in PREIC during initial setup

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in PREIC during initial setup

Execution Scheduling 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:Yes

    Description:Set the enabled status of the MooseObject.

  • implicitTrueDetermines whether this object is calculated using an implicit or explicit form

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Determines whether this object is calculated using an implicit or explicit form

  • seed0The seed for the master random number generator

    Default:0

    C++ Type:unsigned int

    Controllable:No

    Description:The seed for the master random number generator

  • use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

Advanced Parameters

  • prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Unit:(no unit assumed)

    Controllable:No

    Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

  • use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

warningwarning

The detailed documentation of this object/syntax is only available when MOOSE is compiled with NEML2. To enable NEML2, please follow the NEML2 installation guide.

Material Property Retrieval Parameters