27#include "neml2/base/Registry.h"
28#include "neml2/models/Data.h"
29#include "neml2/tensors/BatchTensorBase.h"
39namespace crystallography
88 const R2 &
A()
const {
return _A; };
90 const SR2 &
M()
const {
return _M; };
92 const WR2 &
W()
const {
return _W; };
101 typename =
typename std::enable_if_t<std::is_base_of_v<BatchTensorBase<Derived>,
Derived>>>
115 static std::tuple<Vec, Vec, Scalar, std::vector<TorchSize>>
116 setup_schmid_tensors(
const Vec &
A,
128 const Vec & _lattice_vectors;
130 const Vec & _reciprocal_lattice_vectors;
137 const Vec & _cartesian_slip_directions;
139 const Vec & _cartesian_slip_planes;
143 const std::vector<TorchSize> _slip_offsets;
153template <
class Derived,
typename>
158 return tensor.batch_index({torch::indexing::Ellipsis,
159 torch::indexing::Slice(_slip_offsets[
grp], _slip_offsets[
grp + 1])});
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
Represention of a crystal direction or plane a Miller Index.
Definition MillerIndex.h:38
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
A basic R2.
Definition R2.h:42
The (logical) symmetric second order tensor.
Definition SR2.h:46
The (logical) scalar.
Definition Scalar.h:38
The (logical) vector.
Definition Vec.h:42
A skew rank 2, represented as an axial vector.
Definition WR2.h:43
Defines the geometry of a crystal system This includes a basic definition of the crystal lattice,...
Definition CrystalGeometry.h:48
Vec b3() const
accessor for the third reciprocal lattice vector
Definition CrystalGeometry.cxx:118
const R2 & symmetry_operators() const
Accessor for the crystal class symmetry operators.
Definition CrystalGeometry.h:95
const R2 & A() const
Accessor for the full Schmid tensors.
Definition CrystalGeometry.h:88
const Vec & cartesian_slip_directions() const
Accessor for the slip directions.
Definition CrystalGeometry.h:81
const WR2 & W() const
Accessor for the skew-symmetric Schmid tensors.
Definition CrystalGeometry.h:92
Vec a1() const
accessor for the first lattice vector
Definition CrystalGeometry.cxx:88
const SR2 & M() const
Accessor for the symmetric Schmid tensors.
Definition CrystalGeometry.h:90
Derived slip_slice(const Derived &tensor, TorchSize grp) const
Slice a BatchTensor to provide only the batch associated with a slip system.
Definition CrystalGeometry.h:155
const Scalar & burgers() const
Accessor for the burgers vector.
Definition CrystalGeometry.h:85
const Vec & cartesian_slip_planes() const
Accessor for the slip planes.
Definition CrystalGeometry.h:83
CrystalGeometry(const OptionSet &options)
Setup from parameter set.
Definition CrystalGeometry.cxx:63
Vec a3() const
accessor for the third lattice vector
Definition CrystalGeometry.cxx:100
Vec b2() const
accessor for the second reciprocal lattice vector
Definition CrystalGeometry.cxx:112
TorchSize nslip_groups() const
Number of slip groups.
Definition CrystalGeometry.cxx:130
TorchSize nslip() const
Total number of slip systems.
Definition CrystalGeometry.cxx:124
static OptionSet expected_options()
Input options.
Definition CrystalGeometry.cxx:40
Vec a2() const
accessor for the second lattice vector
Definition CrystalGeometry.cxx:94
Vec b1() const
accessor for the first reciprocal lattice vector
Definition CrystalGeometry.cxx:106
TorchSize nslip_in_group(TorchSize i) const
Number of slip systems in a given group.
Definition CrystalGeometry.cxx:136
Definition CrossRef.cxx:32
void neml_assert_dbg(bool assertion, Args &&... args)
Definition error.h:85
int64_t TorchSize
Definition types.h:35