TorchCentralDifference

This object functions in much the same way as ExplicitMixedOrder, but completely skips the regular element/node loops when evaluating the right-hand-side residual. It is designed to drive batched libtorch finite-element kernels (and, together with a NEML2 model, to perform the material model evaluation and residual assembly).

Implementation details

This object caches the finite element context using the TorchAssembly and TorchFEInterpolation objects. The solution is re-interpolated onto the finite element function space after each explicit solution update.

In addition, this object zeros out the algebraic element/node ranges before evaluating the residual. Therefore, regular MOOSE kernels don't work with this time integrator.

Limitations

  • Designed for explicit solves only; no Jacobian contributions are produced by the Torch FEM kernels in this workflow.

  • Requires the Torch assembly/interpolation objects to have compatible element types within each block (one per element type/order when mixing).

Syntax

Input Parameters

  • assemblyThe TorchAssembly object to use to provide assembly information

    C++ Type:UserObjectName

    Controllable:No

    Description:The TorchAssembly object to use to provide assembly information

  • feThe TorchFEInterpolation object to use to couple variables

    C++ Type:UserObjectName

    Controllable:No

    Description:The TorchFEInterpolation object to use to couple variables

Required Parameters

  • first_order_varsA subset of variables that require first-order integration (velocity only) to be applied by this time integrator.

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

    Unit:(no unit assumed)

    Controllable:No

    Description:A subset of variables that require first-order integration (velocity only) to be applied by this time integrator.

  • mass_matrix_tagmassThe tag for the mass matrix

    Default:mass

    C++ Type:TagName

    Controllable:No

    Description:The tag for the mass matrix

  • recompute_mass_matrix_after_mesh_changeFalseIf set to true, the mass matrix will be recomputed when the mesh changes (e.g. through adaptivity). If use_constant_mass is set to true, adadaptivity is used, and this parameter is not set to true, the simulation will error out when the mesh changes.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:If set to true, the mass matrix will be recomputed when the mesh changes (e.g. through adaptivity). If use_constant_mass is set to true, adadaptivity is used, and this parameter is not set to true, the simulation will error out when the mesh changes.

  • second_order_varsA subset of variables that require second-order integration (velocity and acceleration) to be applied by this time integrator.

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

    Unit:(no unit assumed)

    Controllable:No

    Description:A subset of variables that require second-order integration (velocity and acceleration) to be applied by this time integrator.

  • use_constant_massFalseIf set to true, will only compute the mass matrix in the first time step, and keep using it throughout the simulation.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:If set to true, will only compute the mass matrix in the first time step, and keep using it throughout the simulation.

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

Example input files

Input Files

warningwarning

The detailed documentation of this object is only available when Moose is compiled with Libtorch. For instructions on how to compile Moose with Libtorch, visit the general installation webpage or click here.