13 #include <ATen/ops/from_blob.h> 28 "This user object gathers the JxWxT values from all elements in the assembly and " 29 "provides them as a neml2 tensor. This is useful for assembling NEML2 models that " 30 "require the JxWxT values for each element.");
64 "NEML2Assembly becomes out of sync with other thread");
70 mooseAssert(
_nqp == other._nqp,
71 "The number of quadrature points per element must be the same in all threads.");
86 mooseError(
"All elements must have the same number of quadrature points per element for all " 98 TIME_SECTION(
"finalize", 1,
"Updating FEM assembly for NEML2");
A MultiMooseEnum object to hold "execute_on" flags.
int64_t _nelem
number of elements on this rank
const MooseArray< Point > & _q_point
const MooseArray< Real > & _coord
static InputParameters validParams()
bool _up_to_date
Whether the current assembly cache is up to date.
void finalize() override
Finalize.
int64_t _nqp
number of quadrature points per element
void initialize() override
Called before execute() is ever called so that data can be cleared.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
void threadJoin(const UserObject &) override
Must override.
std::vector< Real > _moose_JxWxT
JxWxT (product of Jacobian determinant, quadrature weight, and coordinate transformation factor) for ...
ExecFlagEnum getDefaultExecFlagEnum()
static InputParameters validParams()
unsigned int size() const
The number of elements that can currently be stored in the array.
registerMooseObject("MooseApp", NEML2Assembly)
torch::DeviceType getLibtorchDevice() const
Get the device torch is supposed to be running on.
NEML2Assembly(const InputParameters ¶meters)
MooseApp & _app
The MOOSE application this is associated with.
const ExecFlagType EXEC_LINEAR
void execute() override
Execute method.
void invalidate()
Invalidate the cached assembly information.
This user object caches assembly information from MOOSE.
const MooseArray< Real > & _JxW
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
neml2::Tensor _neml2_JxWxT
auto index_range(const T &sizable)
Base class for user-specific data.
const ExecFlagType EXEC_INITIAL