25#include "neml2/models/solid_mechanics/crystal_plasticity/PlasticVorticity.h"
26#include "neml2/models/crystallography/CrystalGeometry.h"
28#include "neml2/tensors/tensors.h"
29#include "neml2/tensors/list_tensors.h"
40 options.doc() =
"Caclulates the plastic vorcitity as \\f$ w^p = \\sum_{i=1}^{n_{slip}} "
41 "\\dot{\\gamma}_i Q \\operatorname{skew}{\\left(d_i \\otimes n_i \\right)} Q^T "
42 "\\f$ with \\f$ d^p \\f$ the plastic deformation rate, \\f$ \\dot{\\gamma}_i "
43 "\\f$ the slip rate on the ith slip system, \\f$Q \\f$ the orientation, \\f$ d_i "
44 "\\f$ the slip system direction, and \\f$ n_i \\f$ the slip system normal.";
48 options.set(
"plastic_vorticity").doc() =
"The name of the plastic vorticity tensor";
51 options.set(
"orientation").doc() =
"The name of the orientation matrix tensor";
54 options.set(
"slip_rates").doc() =
"The name of the tensor containg the current slip rates";
56 options.set<std::string>(
"crystal_geometry_name") =
"crystal_geometry";
57 options.set(
"crystal_geometry_name").doc() =
58 "The name of the Data object containing the crystallographic information for the material";
65 _crystal_geometry(register_data<crystallography::CrystalGeometry>(
66 options.get<std::
string>(
"crystal_geometry_name"))),
67 _Wp(declare_output_variable<
WR2>(
"plastic_vorticity")),
68 _R(declare_input_variable<
R2>(
"orientation")),
69 _gamma_dot(declare_input_variable_list<
Scalar>(_crystal_geometry.nslip(),
"slip_rates"))
BatchTensor base_transpose(TorchSize d1, TorchSize d2) const
Transpose two base dimensions.
Definition BatchTensorBase.cxx:299
Definition BatchTensor.h:32
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
The accessor containing all the information needed to access an item in a LabeledAxis.
Definition LabeledAxisAccessor.h:44
The base class for all constitutive models.
Definition Model.h:53
TorchSize batch_dim() const
This model's batch dim.
Definition Model.h:110
const torch::TensorOptions & options() const
This model's tensor options.
Definition Model.h:116
static OptionSet expected_options()
Definition Model.cxx:33
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
Calculate the plastic vorticity with the default crystal kinetics.
Definition PlasticVorticity.h:38
PlasticVorticity(const OptionSet &options)
Definition PlasticVorticity.cxx:63
const Variable< R2 > & _R
Orientation.
Definition PlasticVorticity.h:55
const Variable< BatchTensor > & _gamma_dot
Slip rate.
Definition PlasticVorticity.h:58
const crystallography::CrystalGeometry & _crystal_geometry
Crystal geometry class with slip geometry.
Definition PlasticVorticity.h:49
Variable< WR2 > & _Wp
Plastic vorticity.
Definition PlasticVorticity.h:52
static OptionSet expected_options()
Definition PlasticVorticity.cxx:36
void set_value(bool out, bool dout_din, bool d2out_din2) override
Set the plastic vorticity and derivatives.
Definition PlasticVorticity.cxx:74
A basic R2.
Definition R2.h:42
The (logical) scalar.
Definition Scalar.h:38
A skew rank 2, represented as an axial vector.
Definition WR2.h:43
Definition CrossRef.cxx:32
void neml_assert_dbg(bool assertion, Args &&... args)
Definition error.h:85
LabeledAxisAccessor VariableName
Definition Variable.h:35