https://mooseframework.inl.gov
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 {
22 public:
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 
56 protected:
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
int64_t _nelem
number of elements on this rank
Definition: NEML2Assembly.h:61
int64_t numQP() const
Number of quadrature points per element.
Definition: NEML2Assembly.h:31
bool _up_to_date
Whether the current assembly cache is up to date.
Definition: NEML2Assembly.h:58
bool upToDate() const
Whether the current assembly cache is up to date.
Definition: NEML2Assembly.h:44
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
void finalize() override
Finalize.
Definition: NEML2Assembly.C:96
int64_t _nqp
number of quadrature points per element
Definition: NEML2Assembly.h:63
void initialize() override
Called before execute() is ever called so that data can be cleared.
Definition: NEML2Assembly.C:49
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void threadJoin(const UserObject &) override
Must override.
Definition: NEML2Assembly.C:60
std::vector< Real > _moose_JxWxT
JxWxT (product of Jacobian determinant, quadrature weight, and coordinate transformation factor) for ...
Definition: NEML2Assembly.h:66
static InputParameters validParams()
Definition: NEML2Assembly.C:23
const neml2::Tensor & JxWxT() const
Get the cached JxWxT for each element, each quadrature point.
Definition: NEML2Assembly.h:41
NEML2Assembly(const InputParameters &parameters)
Definition: NEML2Assembly.C:40
void execute() override
Execute method.
Definition: NEML2Assembly.C:77
void invalidate()
Invalidate the cached assembly information.
Definition: NEML2Assembly.C:43
int64_t numElem() const
Number of active elements on this rank.
Definition: NEML2Assembly.h:28
This user object caches assembly information from MOOSE.
Definition: NEML2Assembly.h:20
void meshChanged() override
Called on this object when the mesh changes.
Definition: NEML2Assembly.h:49
neml2::Tensor _neml2_JxWxT
Definition: NEML2Assembly.h:67
Base class for user-specific data.
Definition: UserObject.h:19