https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NEML2Assembly.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#ifdef NEML2_ENABLED
13
14// MOOSE includes
15#include "ElementUserObject.h"
16
17#include "neml2/tensors/Tensor.h"
18
21{
22public:
24
26
28 int64_t numElem() const { return _nelem; }
29
31 int64_t numQP() const { return _nqp; }
32
41 const neml2::Tensor & JxWxT() const { return _neml2_JxWxT; }
42
44 bool upToDate() const { return _up_to_date; }
45
47 void invalidate();
48
49 void meshChanged() override { invalidate(); }
50
51 void initialize() override;
52 void execute() override;
53 void finalize() override;
54 void threadJoin(const UserObject &) override;
55
56protected:
58 bool _up_to_date = false;
59
61 int64_t _nelem;
63 int64_t _nqp;
64
66 std::vector<Real> _moose_JxWxT;
67 neml2::Tensor _neml2_JxWxT;
68};
69
70#endif
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
This user object caches assembly information from MOOSE.
void finalize() override
Finalize.
const neml2::Tensor & JxWxT() const
Get the cached JxWxT for each element, each quadrature point.
void execute() override
Execute method.
void initialize() override
Called before execute() is ever called so that data can be cleared.
std::vector< Real > _moose_JxWxT
JxWxT (product of Jacobian determinant, quadrature weight, and coordinate transformation factor) for ...
int64_t numQP() const
Number of quadrature points per element.
void invalidate()
Invalidate the cached assembly information.
int64_t numElem() const
Number of active elements on this rank.
bool _up_to_date
Whether the current assembly cache is up to date.
static InputParameters validParams()
int64_t _nqp
number of quadrature points per element
int64_t _nelem
number of elements on this rank
void threadJoin(const UserObject &) override
Must override.
neml2::Tensor _neml2_JxWxT
void meshChanged() override
Called on this object when the mesh changes.
bool upToDate() const
Whether the current assembly cache is up to date.
Base class for user-specific data.
Definition UserObject.h:20