10#ifdef MOOSE_LIBTORCH_ENABLED
25 "Central difference time integrator using batched libtorch finite-element kernels (and "
26 "optionally NEML2 material models for the constitutive update).");
28 "assembly",
"The TorchAssembly object to use to provide assembly information");
30 "fe",
"The TorchFEInterpolation object to use to couple variables");
49 std::unordered_set<BoundaryID> bnds;
50 for (
const auto & ibc : ibcs.getObjects())
51 bnds.insert(ibc->boundaryIDs().begin(), ibc->boundaryIDs().end());
55 mooseInfo(
"Dectected BCs on ", bnds.size(),
" boundaries.");
58 std::unordered_set<const Elem *> unique_elems;
61 if (bnds.find((*it)->_bnd_id) != bnds.end())
62 unique_elems.insert((*it)->_elem);
registerMooseObject("SolidMechanicsApp", TorchCentralDifference)
Implements a form of the central difference time integrator that calculates acceleration directly fro...
virtual void postSolve() override
virtual void meshChanged() override
virtual void evaluateRHSResidual()
Evaluate the RHS residual.
static InputParameters validParams()
virtual void initialSetup() override
T & getUserObject(const std::string &name, unsigned int tid=0) const
void setCurrentAlgebraicNodeRange(libMesh::ConstNodeRange *range)
void setCurrentAlgebraicElementRange(libMesh::ConstElemRange *range)
virtual MooseMesh & mesh() override
void mooseInfo(Args &&... args) const
virtual bnd_elem_iterator bndElemsBegin()
virtual bnd_elem_iterator bndElemsEnd()
MooseObjectTagWarehouse< IntegratedBCBase > & getIntegratedBCWarehouse()
NonlinearSystemBase * _nl
FEProblemBase & _fe_problem
void postSolve() override
TorchAssembly * _assembly
The assembly object with cached assembly information.
void evaluateRHSResidual() override
Evaluate the RHS residual.
TorchFEInterpolation * _fe
The FE interface for getting variable values/gradients interpolated onto the finite element space.
static InputParameters validParams()
std::vector< const Node * > _no_node
Empty node vector to help zero out the algebraic range.
TorchCentralDifference(const InputParameters ¶meters)
void rebuildBoundaryElementList()
void meshChanged() override
void initialSetup() override
bool _boundary_elems_dirty
Whether the cached boundary element list needs rebuilding.
std::vector< const Elem * > _boundary_elems
Empty element vector to help zero out the algebraic range.
void invalidateInterpolations()
bool contextUpToDate() const