27#include "neml2/equation_systems/AxisLayout.h"
28#include "neml2/equation_systems/EquationSystem.h"
29#include "neml2/equation_systems/NonlinearSystem.h"
30#include "neml2/models/ParameterStore.h"
31#include "neml2/models/BufferStore.h"
48 const std::shared_ptr<Model> &
model_ptr()
const {
return _model; }
73 void update_layouts();
75 bool _layouts_updated =
false;
78 const std::vector<std::vector<VariableName>> _unknown_groups;
80 std::vector<std::vector<VariableName>> _residual_groups;
82 const std::vector<AxisLayout::IStructure> _unknown_istrs;
84 const std::vector<AxisLayout::IStructure> _residual_istrs;
86 std::shared_ptr<Model> _model;
BufferStore(NEML2Object *object)
EquationSystem(const OptionSet &options)
AssembledMatrix A()
Assemble and return the operator, A.
AssembledVector b()
Assemble and return the right-hand side, b.
const Model & model() const
Definition ModelNonlinearSystem.h:49
void post_assemble(bool A, bool B, bool b) override
Callback after assembly to perform.
AssembledVector g() const override
Get the given variables g from the current step.
AssembledVector u() const override
Get the unknown u.
std::shared_ptr< AxisLayout > setup_ulayout() override
Setup the unknown layout, partitioned by variable group.
void set_g(const AssembledVector &) override
Set the given variables g from the current step.
void set_u(const AssembledVector &) override
Set the unknown u.
void to(const TensorOptions &) override
Change the device and dtype of the equation system's internal data.
void assemble(AssembledMatrix *A, AssembledMatrix *B, AssembledVector *b) override
Compute the operator and right-hand side.
void setup() override
Setup this object.
std::shared_ptr< AxisLayout > setup_blayout() override
Setup the RHS variable layout.
static OptionSet expected_options()
ModelNonlinearSystem(const OptionSet &options)
void pre_assemble(bool A, bool B, bool b) override
Callback before assembly to perform.
Model & model()
Definition ModelNonlinearSystem.h:50
std::shared_ptr< AxisLayout > setup_glayout() override
Setup the given variable layout.
const std::shared_ptr< Model > & model_ptr() const
Definition ModelNonlinearSystem.h:48
The base class for all constitutive models.
Definition Model.h:82
Definition of a nonlinear system of equations, r(u) = 0.
Definition NonlinearSystem.h:44
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:54
ParameterStore(NEML2Object *object)
Definition DiagnosticsInterface.h:31
c10::TensorOptions TensorOptions
Definition types.h:66
Dense representation of a matrix assembled from a 2D-list of tensors and their layout.
Definition AssembledMatrix.h:37
Dense representation of a tensor assembled from a list of tensors and their layout.
Definition AssembledVector.h:36