NEML2 1.4.0
Loading...
Searching...
No Matches
neml2 Namespace Reference

Namespaces

namespace  crystallography
 
namespace  indexing
 
namespace  math
 
namespace  utils
 

Classes

class  ArrheniusParameter
 A scalar-valued parameter following an Arrhenius type relation. More...
 
class  AssociativeIsotropicPlasticHardening
 
class  AssociativeKinematicPlasticHardening
 
class  AssociativePlasticFlow
 
class  BackwardEulerTimeIntegration
 
class  BufferStore
 Interface for object which can store buffers. More...
 
class  ChabochePlasticHardening
 
class  ComposedModel
 
class  ConstantParameter
 A parameter that is actually just a constant. More...
 
class  CopyVariable
 Copy the value of a variable into another variable. More...
 
class  CrossRef
 The wrapper (decorator) for cross-referencing unresolved values at parse time. More...
 
class  Data
 
class  DependencyDefinition
 
class  DependencyResolver
 The DependencyResolver identifies and resolves the dependencies among a set of objects derived from DependencyDefinition. More...
 
class  Derivative
 
class  Diagnosis
 Exception type reserved for diagnostics, so as to not conceptually clash with other exceptions. More...
 
class  DiagnosticsInterface
 Interface for object making diagnostics about common setup errors. More...
 
class  Driver
 The Driver drives the execution of a NEML2 Model. More...
 
class  Eigenstrain
 
class  Elasticity
 
class  ElasticStrainRate
 Calculate the elastic strain rate from crystal model kinematics. More...
 
class  EmptyPrimitiveTensor
 Create an empty PrimitiveTensor of type T from the input file. More...
 
class  EmptyTensor
 Create an empty Tensor from the input file. More...
 
class  EnumSelection
 
class  Factory
 
class  FillR2
 Create a filled R2 from the input file. More...
 
class  FillRot
 Create a filled R2 from the input file. More...
 
class  FillSR2
 Create a filled SR2 from the input file. More...
 
class  FillWR2
 Create a filled WR2 from the input file. More...
 
class  FixOrientation
 Swap orientation plane when the singularity at \( 2 \pi \) is met with the modified Rodrigues vector. More...
 
class  FlowRule
 
class  ForwardEulerTimeIntegration
 
class  FredrickArmstrongPlasticHardening
 
class  FullPrimitiveTensor
 Create a full PrimitiveTensor of type T from the input file. More...
 
class  FullTensor
 Create a full Tensor from the input file. More...
 
class  GTNYieldFunction
 
class  GursonCavitation
 
class  HITParser
 A parser is responsible for parsing an input file into a collection of options which can be used by the Factory to manufacture corresponding objects. More...
 
class  IdentityTensor
 Create an identity Tensor from the input file. More...
 
class  ImplicitUpdate
 
class  InputParameter
 A parameter that is defined by an input variable. More...
 
struct  InterOpThread
 
class  Interpolation
 The base class for interpolated nonlinear parameter. More...
 
struct  IntraOpThread
 
class  IsotropicHardening
 
class  IsotropicHardeningStaticRecovery
 
class  IsotropicMandelStress
 
class  KinematicHardening
 
class  KinematicHardeningStaticRecovery
 
class  KocksMeckingActivationEnergy
 
class  KocksMeckingFlowSwitch
 
class  KocksMeckingFlowViscosity
 A scalar-valued parameter defined by (mu0 - D/(exp(T0/T)-1)) * exp(_C) More...
 
class  KocksMeckingRateSensitivity
 A scalar-valued parameter defined by (mu0 - D/(exp(T0/T)-1)) * exp(_C) More...
 
class  KocksMeckingYieldStress
 A scalar-valued parameter defined by (mu0 - D/(exp(T0/T)-1)) * exp(_C) More...
 
class  LabeledAxis
 A labeled axis used to associate layout of a tensor with human-interpretable names. More...
 
class  LabeledAxisAccessor
 The accessor containing all the information needed to access an item in a LabeledAxis. More...
 
class  LabeledMatrix
 A single-batched, logically 2D LabeledTensor. More...
 
class  LabeledTensor
 The primary data structure in NEML2 for working with labeled tensor views. More...
 
class  LabeledTensor3D
 A single-batched, logically 3D LabeledTensor. More...
 
class  LabeledVector
 A single-batched, logically 1D LabeledTensor. More...
 
class  LargeDeformationIncrementalSolidMechanicsDriver
 The transient driver specialized for solid mechanics problems. More...
 
class  LinearCombination
 
class  LinearInterpolation
 Linearly interpolate the parameter along a single axis. More...
 
class  LinearIsotropicElasticity
 
class  LinearIsotropicHardening
 Simple linear map between equivalent strain and isotropic hardening. More...
 
class  LinearKinematicHardening
 Simple linear map between equivalent strain and hardening. More...
 
class  LinearSingleSlipHardeningRule
 Linear slip hardening of the type \(\dot{\bar{\tau}} = \theta \sum \left|\dot{\gamma}_i \right|\). More...
 
class  LinspacePrimitiveTensor
 Create a linspace PrimitiveTensor of type T from the input file. More...
 
class  LinspaceTensor
 Create a linspace Tensor from the input file. More...
 
class  LogspacePrimitiveTensor
 Create a logspace PrimitiveTensor of type T from the input file. More...
 
class  LogspaceTensor
 Create a logspace Tensor from the input file. More...
 
class  MandelStress
 
class  MillerIndex
 Represention of a crystal direction or plane a Miller Index. More...
 
class  MixedControlSetup
 
class  Model
 The base class for all constitutive models. More...
 
class  NEML2Object
 The base class of all "manufacturable" objects in the NEML2 library. More...
 
class  NEMLException
 
class  Newton
 The nonlinear solver solves a nonlinear system of equations. More...
 
class  NewtonWithLineSearch
 The nonlinear solver solves a nonlinear system of equations. More...
 
class  NewtonWithTrustRegion
 The nonlinear solver solves a nonlinear system of equations. More...
 
class  NonlinearParameter
 The base class for nonlinear parameters. More...
 
class  NonlinearSolver
 The nonlinear solver solves a nonlinear system of equations. More...
 
class  NonlinearSystem
 Definition of a nonlinear system of equations. More...
 
class  Normality
 
class  OlevskySinteringStress
 
class  OnesPrimitiveTensor
 Create a ones PrimitiveTensor of type T from the input file. More...
 
class  OnesTensor
 Create a ones Tensor from the input file. More...
 
class  OptionCollection
 A data structure that holds options of multiple objects. More...
 
class  OptionSet
 A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed. More...
 
class  Orientation
 Create batch of rotations, with various methods. More...
 
class  OrientationRate
 Calculate the orientation rate from the crystal model kinetics. More...
 
class  ParameterStore
 Interface for object which can store parameters. More...
 
class  Parser
 A parser is responsible for parsing an input file into a collection of options which can be used by the Factory to manufacture corresponding objects. More...
 
class  ParserException
 
class  PerzynaPlasticFlowRate
 
class  PlasticDeformationRate
 Plastic deformation rate with the default kinetics. More...
 
class  PlasticFlowRate
 
class  PlasticVorticity
 Calculate the plastic vorticity with the default crystal kinetics. More...
 
class  PowerLawIsotropicHardeningStaticRecovery
 
class  PowerLawKinematicHardeningStaticRecovery
 
class  PowerLawSlipRule
 Power law slip rate of the form \(\dot{\gamma}_i = \dot{\gamma}_0 \left| \frac{\tau_i}{\tau_{h,i}} \right| ^ {n-1} \frac{\tau_i}{\tau_{h,i}} \). More...
 
class  PrimitiveTensor
 PrimitiveTensor inherits from TensorBase and additionally templates on the base shape. More...
 
class  Quaternion
 A batched quaternion. More...
 
class  R2
 A basic R2. More...
 
class  R2Base
 The (logical) full second order tensor. More...
 
class  R3
 The (logical) full third order tensor. More...
 
class  R4
 The (logical) full fourth order tensor. More...
 
class  R5
 The (logical) full fifth order tensor. More...
 
class  RateIndependentPlasticFlowConstraint
 
class  Registry
 
class  ResolvedShear
 Calculate the resolved shears. More...
 
class  Rot
 Rotation stored as modified Rodrigues parameters. More...
 
class  RotationMatrix
 Convert a Rodrigues vector (Rot) to a second order tensor (R2). More...
 
class  Scalar
 The (logical) scalar. More...
 
class  Settings
 
class  SFFR4
 The logical fourth order tensor with minor symmetry in the 1st and 2nd dimensions. More...
 
class  SFR3
 The logical third order tensor with symmetry in the first two dimensions. More...
 
class  SingleSlipHardeningRule
 Any slip rule where all systems share the same strength. More...
 
class  SingleSlipStrengthMap
 A map between the internal variables and the slip strength, for the case where all systems share the same strength. More...
 
class  SlipRule
 Parent class of slip rules, mapping from resolved shear and internal state to slip rates. More...
 
class  SlipStrengthMap
 Parent class of maps between internal variables and the slip system strengths. More...
 
class  SlopeSaturationVoceIsotropicHardening
 
class  SolidMechanicsDriver
 The transient driver specialized for solid mechanics problems. More...
 
class  Solver
 The solver solves a system of equations. More...
 
struct  SolvingNonlinearSystem
 
class  SR2
 The (logical) symmetric second order tensor. More...
 
class  SR2Invariant
 
class  SSFR5
 The logical fifth order tensor with minor symmetry in the 1st and 2nd dimensions as well as in the 3rd and 4th dimensions. More...
 
class  SSR4
 The (logical) symmetric fourth order tensor, with symmetry in the first two dimensionss as well as in the last two dimensions. More...
 
class  Storage
 
class  SumSlipRates
 A helper model to calculate the sum of the absolute value of the slip rates. More...
 
class  SWR4
 The (logical) symmetric fourth order tensor, with symmetry in the first two dimensionss and skew-symmetry in the second two. More...
 
class  Tensor
 
class  TensorBase
 NEML2's enhanced tensor type. More...
 
struct  TensorTypeEnum
 
class  TensorValue
 Concrete definition of tensor value. More...
 
class  TensorValueBase
 The base class to allow us to set up a polymorphic container of Tensors. The concrete definitions will be templated on the actual tensor type. More...
 
class  ThermalEigenstrain
 
struct  TimedSection
 
class  Transformable
 Mixin class for things that can be transformed by a symmetry operator. More...
 
class  TransientDriver
 The driver for a transient initial-value problem. More...
 
class  TrustRegionSubProblem
 
class  TwoStageThermalAnnealing
 
class  UserPrimitiveTensor
 Create raw tensor of type T from the input file. More...
 
class  UserTensor
 Create raw Tensor from the input file. More...
 
class  UserTensorBase
 
class  Variable
 Concrete definition of a variable. More...
 
class  VariableBase
 
class  VariableRate
 
class  VariableStore
 
class  Vec
 The (logical) vector. More...
 
class  VecBase
 Base class for the (logical) vector. More...
 
class  VoceIsotropicHardening
 
class  VoceSingleSlipHardeningRule
 Voce slip hardening when all slip systems share the same hardening value, \(\dot{\bar{\tau}} = \theta_0 \left(1 - \frac{\bar{\tau}}{\tau_{sat}} \right) \sum \left|\dot{\gamma}_i \right|\). More...
 
class  WR2
 A skew rank 2, represented as an axial vector. More...
 
class  WR2ExplicitExponentialTimeIntegration
 Explicit exponential time integration for rotations. More...
 
class  WR2ImplicitExponentialTimeIntegration
 Implicit exponential time integration for rotations. More...
 
class  WSR4
 The (logical) symmetric fourth order tensor, with skew symmetry in the first two dimensionss and symmetry in the second two. More...
 
class  WWR4
 The (logical) symmetric fourth order tensor, with skew symmetry in the first two dimensions and last two dimensions. More...
 
class  YieldFunction
 
class  ZerosPrimitiveTensor
 Create a zeros PrimitiveTensor of type T from the input file. More...
 
class  ZerosTensor
 Create a zeros Tensor from the input file. More...
 

Typedefs

using BuildPtr = std::shared_ptr<NEML2Object> (*)(const OptionSet & options)
 
using VariableName = LabeledAxisAccessor
 
using Real = double
 
using Integer = int
 
using Size = int64_t
 
using TensorShape = torch::SmallVector<Size>
 
using TensorShapeRef = torch::IntArrayRef
 
typedef BackwardEulerTimeIntegration< ScalarScalarBackwardEulerTimeIntegration
 
typedef BackwardEulerTimeIntegration< VecVecBackwardEulerTimeIntegration
 
typedef BackwardEulerTimeIntegration< SR2SR2BackwardEulerTimeIntegration
 
typedef ForwardEulerTimeIntegration< ScalarScalarForwardEulerTimeIntegration
 
typedef ForwardEulerTimeIntegration< VecVecForwardEulerTimeIntegration
 
typedef ForwardEulerTimeIntegration< SR2SR2ForwardEulerTimeIntegration
 
typedef LinearCombination< ScalarScalarLinearCombination
 
typedef LinearCombination< VecVecLinearCombination
 
typedef LinearCombination< SR2SR2LinearCombination
 
typedef LinearInterpolation< ScalarScalarLinearInterpolation
 
typedef LinearInterpolation< VecVecLinearInterpolation
 
typedef LinearInterpolation< SR2SR2LinearInterpolation
 
typedef TwoStageThermalAnnealing< ScalarScalarTwoStageThermalAnnealing
 
typedef TwoStageThermalAnnealing< SR2SR2TwoStageThermalAnnealing
 
typedef VariableRate< ScalarScalarVariableRate
 
typedef VariableRate< VecVecVariableRate
 
typedef VariableRate< SR2SR2VariableRate
 

Enumerations

enum class  FType : int8_t {
  NONE , INPUT , OUTPUT , PARAMETER ,
  BUFFER
}
 Role in a function definition. More...
 
enum class  TensorType : int8_t { FOR_ALL_TENSORBASE_COMMA =(_tensor_type_enum) , kUknown }
 

Functions

 FOR_ALL_PRIMITIVETENSOR (CROSSREF_SPECIALIZE_PRIMITIVETENSOR_IMPL)
 
void diagnose (const DiagnosticsInterface &)
 Raise diagnostics as exception, if any.
 
std::ostream & operator<< (std::ostream &os, const EnumSelection &es)
 
std::stringstream & operator>> (std::stringstream &ss, EnumSelection &es)
 
void load_input (const std::filesystem::path &path, const std::string &additional_input="")
 A convenient function to parse all options from an input file.
 
void reload_input (const std::filesystem::path &path, const std::string &additional_input="")
 Similar to neml2::load_input, but additionally clear the Factory before loading the options, therefore all previously loaded models become dangling.
 
Modelget_model (const std::string &mname, bool enable_ad=true, bool force_create=true)
 A convenient function to manufacture a neml2::Model.
 
Modelload_model (const std::filesystem::path &path, const std::string &mname, bool enable_ad=true)
 A convenient function to load an input file and get a model.
 
Modelreload_model (const std::filesystem::path &path, const std::string &mname, bool enable_ad=true)
 Similar to neml2::load_model, but additionally clear the Factory before loading the model, therefore all previously loaded models become dangling.
 
Driverget_driver (const std::string &dname)
 A convenient function to manufacture a neml2::Driver.
 
std::map< std::string, std::map< std::string, unsigned long > > & timed_sections ()
 
std::ostream & operator<< (std::ostream &os, const OptionCollection &p)
 
bool options_compatible (const OptionSet &opts, const OptionSet &additional_opts)
 
std::ostream & operator<< (std::ostream &os, FType f)
 
std::ostream & operator<< (std::ostream &os, const OptionSet &p)
 
 register_NEML2_object (LargeDeformationIncrementalSolidMechanicsDriver)
 
 register_NEML2_object (SolidMechanicsDriver)
 
std::string & buffer_name_separator ()
 Default nested buffer name separator.
 
std::string & parameter_name_separator ()
 Default nested parameter name separator.
 
boolcurrently_solving_nonlinear_system ()
 
 register_NEML2_object (ArrheniusParameter)
 
 register_NEML2_object (ScalarBackwardEulerTimeIntegration)
 
 register_NEML2_object (VecBackwardEulerTimeIntegration)
 
 register_NEML2_object (SR2BackwardEulerTimeIntegration)
 
 register_NEML2_object (ComposedModel)
 
 FOR_ALL_PRIMITIVETENSOR (CONSTANTPARAMETER_REGISTER)
 
 FOR_ALL_PRIMITIVETENSOR (COPYVARIABLE_REGISTER_PRIMITIVETENSOR)
 
 FOR_ALL_PRIMITIVETENSOR (COPYVARIABLE_INSTANTIATE_PRIMITIVETENSOR)
 
 register_NEML2_object (ScalarForwardEulerTimeIntegration)
 
 register_NEML2_object (VecForwardEulerTimeIntegration)
 
 register_NEML2_object (SR2ForwardEulerTimeIntegration)
 
 register_NEML2_object (ImplicitUpdate)
 
 FOR_ALL_PRIMITIVETENSOR (INPUTPARAMETER_REGISTER)
 
 register_NEML2_object (ScalarLinearCombination)
 
 register_NEML2_object (VecLinearCombination)
 
 register_NEML2_object (SR2LinearCombination)
 
 register_NEML2_object (ScalarLinearInterpolation)
 
 register_NEML2_object (VecLinearInterpolation)
 
 register_NEML2_object (SR2LinearInterpolation)
 
 FOR_ALL_PRIMITIVETENSOR (NONLINEARPARAMETER_INSTANTIATE_PRIMITIVETENSOR)
 
 FOR_ALL_PRIMITIVETENSOR (PARAMETERSTORE_INTANTIATE_PRIMITIVETENSOR)
 
 register_NEML2_object (RotationMatrix)
 
 register_NEML2_object (AssociativeIsotropicPlasticHardening)
 
 register_NEML2_object (AssociativeKinematicPlasticHardening)
 
 register_NEML2_object (AssociativePlasticFlow)
 
 register_NEML2_object (ChabochePlasticHardening)
 
 register_NEML2_object (ElasticStrainRate)
 
 register_NEML2_object (FixOrientation)
 
 register_NEML2_object (LinearSingleSlipHardeningRule)
 
 register_NEML2_object (OrientationRate)
 
 register_NEML2_object (PlasticDeformationRate)
 
 register_NEML2_object (PlasticVorticity)
 
 register_NEML2_object (PowerLawSlipRule)
 
 register_NEML2_object (ResolvedShear)
 
 register_NEML2_object (SingleSlipStrengthMap)
 
 register_NEML2_object (SumSlipRates)
 
 register_NEML2_object (VoceSingleSlipHardeningRule)
 
 register_NEML2_object (FredrickArmstrongPlasticHardening)
 
 register_NEML2_object (GTNYieldFunction)
 
 register_NEML2_object (GursonCavitation)
 
 register_NEML2_object (IsotropicMandelStress)
 
 register_NEML2_object (KocksMeckingActivationEnergy)
 
 register_NEML2_object (KocksMeckingFlowSwitch)
 
 register_NEML2_object (KocksMeckingFlowViscosity)
 
 register_NEML2_object (KocksMeckingRateSensitivity)
 
 register_NEML2_object (KocksMeckingYieldStress)
 
 register_NEML2_object (LinearIsotropicElasticity)
 
 register_NEML2_object (LinearIsotropicHardening)
 
 register_NEML2_object (LinearKinematicHardening)
 
 register_NEML2_object (MixedControlSetup)
 
 register_NEML2_object (Normality)
 
 register_NEML2_object (OlevskySinteringStress)
 
 register_NEML2_object (PerzynaPlasticFlowRate)
 
 register_NEML2_object (PowerLawIsotropicHardeningStaticRecovery)
 
 register_NEML2_object (PowerLawKinematicHardeningStaticRecovery)
 
 register_NEML2_object (RateIndependentPlasticFlowConstraint)
 
 register_NEML2_object (SlopeSaturationVoceIsotropicHardening)
 
 register_NEML2_object (ThermalEigenstrain)
 
 register_NEML2_object (ScalarTwoStageThermalAnnealing)
 
 register_NEML2_object (SR2TwoStageThermalAnnealing)
 
 register_NEML2_object (VoceIsotropicHardening)
 
 register_NEML2_object (YieldFunction)
 
 register_NEML2_object (SR2Invariant)
 
 register_NEML2_object (ScalarVariableRate)
 
 register_NEML2_object (VecVariableRate)
 
 register_NEML2_object (SR2VariableRate)
 
 register_NEML2_object (WR2ExplicitExponentialTimeIntegration)
 
 register_NEML2_object (WR2ImplicitExponentialTimeIntegration)
 
 register_NEML2_object (Newton)
 
 register_NEML2_object (NewtonWithLineSearch)
 
 register_NEML2_object (NewtonWithTrustRegion)
 
std::ostream & operator<< (std::ostream &os, const LabeledAxis &axis)
 
bool operator== (const LabeledAxis &a, const LabeledAxis &b)
 
bool operator!= (const LabeledAxis &a, const LabeledAxis &b)
 
 LabeledAxisAccessor::operator std::vector< std::string > () const
 
bool operator!= (const LabeledAxisAccessor &a, const LabeledAxisAccessor &b)
 Compare for equality between two LabeledAxisAccessor.
 
bool operator== (const LabeledAxisAccessor &a, const LabeledAxisAccessor &b)
 Compare for equality between two LabeledAxisAccessor.
 
bool operator< (const LabeledAxisAccessor &a, const LabeledAxisAccessor &b)
 The (strict) smaller than operator is created so as to use LabeledAxisAccessor in sorted data structures.
 
std::ostream & operator<< (std::ostream &os, const LabeledAxisAccessor &accessor)
 Serialize the accessor into a string. The format is simply the concatenation of all the item names delimited by "/".
 
template<class Derived1 , class Derived2 , typename , typename >
Vec operator* (const Derived1 &A, const Derived2 &b)
 matrix-vector product
 
template<class Derived1 , class Derived2 , typename , typename >
R2 operator* (const Derived1 &A, const Derived2 &B)
 matrix-matrix product
 
template Vec operator* (const R2 &A, const Vec &b)
 
template R2 operator* (const R2 &A, const R2 &B)
 
Rot operator* (const Rot &r1, const Rot &r2)
 Composition of rotations r3 = r1 * r2 (r2 first, then r1)
 
Scalar operator* (const Scalar &a, const Scalar &b)
 
Scalar abs (const Scalar &a)
 Absolute value.
 
SR2 operator* (const SSR4 &a, const SR2 &b)
 
SR2 operator* (const SR2 &a, const SSR4 &b)
 
SSR4 operator* (const SSR4 &a, const SSR4 &b)
 
Tensor operator* (const Tensor &a, const Tensor &b)
 
 FOR_ALL_TENSORBASE (TENSORBASE_INSTANTIATE)
 
std::ostream & operator<< (std::ostream &os, const TensorType &t)
 
R2 transform_from_quaternion (const Quaternion &q)
 Construct from quaternions, useful for comparison to old NEML.
 
R2 identity_transform (const torch::TensorOptions &options=default_tensor_options())
 The identity transformation, i.e.e the Rank2 identity tensor.
 
R2 proper_rotation_transform (const Rot &rot)
 A proper rotation, here provided by a Rot object.
 
R2 improper_rotation_transform (const Rot &rot)
 An improper rotation (rotation + reflection), here provided by a rot object giving the rotation and reflection axis.
 
R2 reflection_transform (const Vec &v)
 A reflection, defined by the reflection plane.
 
R2 inversion_transform (const torch::TensorOptions &options=default_tensor_options())
 An inversion center.
 
 FOR_ALL_PRIMITIVETENSOR (EMPTYPRIMITIVETENSOR_REGISTER)
 
 FOR_ALL_PRIMITIVETENSOR (EMPTYPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR)
 
 register_NEML2_object (EmptyTensor)
 
 register_NEML2_object (FillR2)
 
 register_NEML2_object (FillRot)
 
 register_NEML2_object (FillSR2)
 
 register_NEML2_object (FillWR2)
 
 FOR_ALL_PRIMITIVETENSOR (FULLPRIMITIVETENSOR_REGISTER)
 
 FOR_ALL_PRIMITIVETENSOR (FULLPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR)
 
 register_NEML2_object (FullTensor)
 
 register_NEML2_object (IdentityTensor)
 
 FOR_ALL_PRIMITIVETENSOR (LINSPACEPRIMITIVETENSOR_REGISTER)
 
 FOR_ALL_PRIMITIVETENSOR (LINSPACEPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR)
 
 register_NEML2_object (LinspaceTensor)
 
 FOR_ALL_PRIMITIVETENSOR (LOGSPACEPRIMITIVETENSOR_REGISTER)
 
 FOR_ALL_PRIMITIVETENSOR (LOGSPACEPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR)
 
 register_NEML2_object (LogspaceTensor)
 
 FOR_ALL_PRIMITIVETENSOR (ONESPRIMITIVETENSOR_REGISTER)
 
 FOR_ALL_PRIMITIVETENSOR (ONESPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR)
 
 register_NEML2_object (OnesTensor)
 
 register_NEML2_object (Orientation)
 
 FOR_ALL_PRIMITIVETENSOR (USERPRIMITIVETENSOR_REGISTER)
 
 FOR_ALL_PRIMITIVETENSOR (USERPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR)
 
 register_NEML2_object_alias (UserTensor, "Tensor")
 
 FOR_ALL_PRIMITIVETENSOR (ZEROSPRIMITIVETENSOR_REGISTER)
 
 FOR_ALL_PRIMITIVETENSOR (ZEROSPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR)
 
 register_NEML2_object (ZerosTensor)
 
 FOR_ALL_VECBASE (VECBASE_INSTANTIATE)
 
template<typename T >
std::stringstream & operator>> (std::stringstream &, CrossRef< T > &)
 Stream into a CrossRef (used by Parsers to extract input options)
 
 FOR_ALL_PRIMITIVETENSOR (CROSSREF_SPECIALIZE_PRIMITIVETENSOR)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const CrossRef< T > &cr)
 
template<typename... Args>
void neml_assert (bool assertion, Args &&... args)
 
template<typename... Args>
void neml_assert_dbg (bool assertion, Args &&... args)
 
template<class... T>
bool broadcastable (T &&... tensors)
 
template<class... T>
Size broadcast_batch_dim (T &&...)
 The batch dimension after broadcasting.
 
template<class... T>
void neml_assert_broadcastable (T &&...)
 A helper function to assert that all tensors are broadcastable.
 
template<class... T>
void neml_assert_broadcastable_dbg (T &&...)
 A helper function to assert (in Debug mode) that all tensors are broadcastable.
 
template<class... T>
void neml_assert_batch_broadcastable (T &&...)
 A helper function to assert that all tensors are batch-broadcastable.
 
template<class... T>
void neml_assert_batch_broadcastable_dbg (T &&...)
 A helper function to assert that (in Debug mode) all tensors are batch-broadcastable.
 
template<class... T>
Size broadcast_batch_dim (T &&... tensor)
 
template<class... T>
void neml_assert_broadcastable (T &&... tensors)
 
template<class... T>
void neml_assert_broadcastable_dbg (T &&... tensors)
 
template<class... T>
void neml_assert_batch_broadcastable (T &&... tensors)
 
template<class... T>
void neml_assert_batch_broadcastable_dbg (T &&... tensors)
 
 FOR_ALL_PRIMITIVETENSOR (CONSTANTPARAMETER_TYPEDEF_PRIMITIVETENSOR)
 
 FOR_ALL_PRIMITIVETENSOR (COPYVARIABLE_TYPEDEF_PRIMITIVETENSOR)
 
 FOR_ALL_PRIMITIVETENSOR (INPUTPARAMETER_TYPEDEF_PRIMITIVETENSOR)
 
template<typename F , typename T1 , typename T2 >
Tensor list_derivative_outer_product_a (F &&f, const T1 &a, const T2 &b)
 outer product on lists, where the first input is a list tensor
 
template<typename F , typename T1 , typename T2 >
Tensor list_derivative_outer_product_b (F &&f, const T1 &a, const T2 &b)
 outer product on lists, where the second input is a list tensor
 
template<typename F , typename T1 , typename T2 >
Tensor list_derivative_outer_product_ab (F &&f, const T1 &a, const T2 &b)
 outer product on lists where both inputs are list tensors
 
template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator+ (const Derived &a, const Scalar &b)
 
template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator+ (const Scalar &a, const Derived &b)
 
template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator- (const Derived &a, const Scalar &b)
 
template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator- (const Scalar &a, const Derived &b)
 
template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator* (const Derived &a, const Scalar &b)
 
template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator* (const Scalar &a, const Derived &b)
 
template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator/ (const Derived &a, const Scalar &b)
 
template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator/ (const Scalar &a, const Derived &b)
 
template<class Derived , typename = typename std::enable_if<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator+ (const Derived &a, const Real &b)
 
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator+ (const Real &a, const Derived &b)
 
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator+ (const Derived &a, const Derived &b)
 
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator- (const Derived &a, const Real &b)
 
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator- (const Real &a, const Derived &b)
 
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator- (const Derived &a, const Derived &b)
 
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator* (const Derived &a, const Real &b)
 
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator* (const Real &a, const Derived &b)
 
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator/ (const Derived &a, const Real &b)
 
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator/ (const Real &a, const Derived &b)
 
template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator/ (const Derived &a, const Derived &b)
 
 FOR_ALL_TENSORBASE (_tensor_type_enum_specialize)
 
 FOR_ALL_PRIMITIVETENSOR (EMPTYPRIMITIVETENSOR_TYPEDEF)
 
 FOR_ALL_PRIMITIVETENSOR (FULLPRIMITIVETENSOR_TYPEDEF)
 
 FOR_ALL_PRIMITIVETENSOR (LINSPACEPRIMITIVETENSOR_TYPEDEF)
 
 FOR_ALL_PRIMITIVETENSOR (LOGSPACEPRIMITIVETENSOR_TYPEDEF)
 
 FOR_ALL_PRIMITIVETENSOR (ONESPRIMITIVETENSOR_TYPEDEF)
 
 FOR_ALL_PRIMITIVETENSOR (USERPRIMITIVETENSOR_TYPEDEF)
 
 FOR_ALL_PRIMITIVETENSOR (ZEROSPRIMITIVETENSOR_TYPEDEF)
 
template<typename T1 , typename T2 , typename = typename std::enable_if_t<std::is_base_of_v<VariableBase, T1> || std::is_base_of_v<VariableBase, T2>>>
auto operator+ (const T1 &a, const T2 &b)
 
template<typename T1 , typename T2 , typename = typename std::enable_if_t<std::is_base_of_v<VariableBase, T1> || std::is_base_of_v<VariableBase, T2>>>
auto operator- (const T1 &a, const T2 &b)
 
template<typename T1 , typename T2 , typename = typename std::enable_if_t<std::is_base_of_v<VariableBase, T1> || std::is_base_of_v<VariableBase, T2>>>
auto operator* (const T1 &a, const T2 &b)
 
template<typename T1 , typename T2 , typename = typename std::enable_if_t<std::is_base_of_v<VariableBase, T1> || std::is_base_of_v<VariableBase, T2>>>
auto operator/ (const T1 &a, const T2 &b)
 
RAII style default tensor options

The factory methods like torch::arange, torch::ones, torch::zeros, torch::rand etc. accept a common argument to configure the properties of the tensor being created. We predefine a default tensor configuration in NEML2. This default configuration is consistently used throughout NEML2.

See https://pytorch.org/cppdocs/notes/tensor_creation.html#configuring-properties-of-the-tensor for more details.

torch::TensorOptions & default_tensor_options ()
 
torch::TensorOptions & default_integer_tensor_options ()
 Default integral tensor options.
 
torch::Dtype & default_dtype ()
 Default floating point type.
 
torch::Dtype & default_integer_dtype ()
 Default integral type.
 
torch::Device & default_device ()
 Default device.
 
Default tolerances

Machine precision

Realmachine_precision ()
 
Realtolerance ()
 The tolerance used in various algorithms.
 
Realtighter_tolerance ()
 A tighter tolerance used in various algorithms.
 

Typedef Documentation

◆ BuildPtr

using BuildPtr = std::shared_ptr<NEML2Object> (*)(const OptionSet & options)

◆ Integer

◆ Real

◆ ScalarBackwardEulerTimeIntegration

◆ ScalarForwardEulerTimeIntegration

◆ ScalarLinearCombination

◆ ScalarLinearInterpolation

◆ ScalarTwoStageThermalAnnealing

◆ ScalarVariableRate

◆ Size

◆ SR2BackwardEulerTimeIntegration

◆ SR2ForwardEulerTimeIntegration

◆ SR2LinearCombination

◆ SR2LinearInterpolation

◆ SR2TwoStageThermalAnnealing

◆ SR2VariableRate

◆ TensorShape

using TensorShape = torch::SmallVector<Size>

◆ TensorShapeRef

using TensorShapeRef = torch::IntArrayRef

◆ VariableName

◆ VecBackwardEulerTimeIntegration

◆ VecForwardEulerTimeIntegration

◆ VecLinearCombination

◆ VecLinearInterpolation

◆ VecVariableRate

Enumeration Type Documentation

◆ FType

enum class FType : int8_t
strong

Role in a function definition.

NONE is the default value, INPUT stands for input variable, OUTPUT stands for output variable, PARAMETER stands for parameter (could request AD), BUFFER stands for buffer.

Enumerator
NONE 
INPUT 
OUTPUT 
PARAMETER 
BUFFER 

◆ TensorType

Enumerator
FOR_ALL_TENSORBASE_COMMA 
kUknown 

Function Documentation

◆ abs()

Scalar abs ( const Scalar & a)

Absolute value.

◆ broadcast_batch_dim() [1/2]

template<class... T>
Size broadcast_batch_dim ( T &&... tensor)

◆ broadcast_batch_dim() [2/2]

template<class... T>
Size broadcast_batch_dim ( T && ...)

The batch dimension after broadcasting.

This should be as simple as the maximum batch_dim() among all arguments.

◆ broadcastable()

template<class... T>
bool broadcastable ( T &&... tensors)

Two tensors are said to be broadcastable if

  1. Base shapes are the same
  2. Batch shapes are broadcastable (see sizes_broadcastable)

◆ buffer_name_separator()

std::string & buffer_name_separator ( )

Default nested buffer name separator.

◆ currently_solving_nonlinear_system()

bool & currently_solving_nonlinear_system ( )

A model can be _implicit. An implicit model need to be "solved": the state variables should be iteratively updated until the residual becomes zero. During the solve, we only need derivatives with respect to the input state. Therefore, the model can/should avoid unnecessary computations by examining whether the current evaluation is part of the solve.

◆ default_device()

torch::Device & default_device ( )

Default device.

◆ default_dtype()

torch::Dtype & default_dtype ( )

Default floating point type.

◆ default_integer_dtype()

torch::Dtype & default_integer_dtype ( )

Default integral type.

◆ default_integer_tensor_options()

torch::TensorOptions & default_integer_tensor_options ( )

Default integral tensor options.

◆ default_tensor_options()

torch::TensorOptions & default_tensor_options ( )

Default floating point tensor options

◆ diagnose()

void diagnose ( const DiagnosticsInterface & patient)

Raise diagnostics as exception, if any.

◆ FOR_ALL_PRIMITIVETENSOR() [1/32]

FOR_ALL_PRIMITIVETENSOR ( CONSTANTPARAMETER_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [2/32]

FOR_ALL_PRIMITIVETENSOR ( CONSTANTPARAMETER_TYPEDEF_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [3/32]

FOR_ALL_PRIMITIVETENSOR ( COPYVARIABLE_INSTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [4/32]

FOR_ALL_PRIMITIVETENSOR ( COPYVARIABLE_REGISTER_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [5/32]

FOR_ALL_PRIMITIVETENSOR ( COPYVARIABLE_TYPEDEF_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [6/32]

FOR_ALL_PRIMITIVETENSOR ( CROSSREF_SPECIALIZE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [7/32]

FOR_ALL_PRIMITIVETENSOR ( CROSSREF_SPECIALIZE_PRIMITIVETENSOR_IMPL )

◆ FOR_ALL_PRIMITIVETENSOR() [8/32]

FOR_ALL_PRIMITIVETENSOR ( EMPTYPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [9/32]

FOR_ALL_PRIMITIVETENSOR ( EMPTYPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [10/32]

FOR_ALL_PRIMITIVETENSOR ( EMPTYPRIMITIVETENSOR_TYPEDEF )

◆ FOR_ALL_PRIMITIVETENSOR() [11/32]

FOR_ALL_PRIMITIVETENSOR ( FULLPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [12/32]

FOR_ALL_PRIMITIVETENSOR ( FULLPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [13/32]

FOR_ALL_PRIMITIVETENSOR ( FULLPRIMITIVETENSOR_TYPEDEF )

◆ FOR_ALL_PRIMITIVETENSOR() [14/32]

FOR_ALL_PRIMITIVETENSOR ( INPUTPARAMETER_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [15/32]

FOR_ALL_PRIMITIVETENSOR ( INPUTPARAMETER_TYPEDEF_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [16/32]

FOR_ALL_PRIMITIVETENSOR ( LINSPACEPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [17/32]

FOR_ALL_PRIMITIVETENSOR ( LINSPACEPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [18/32]

FOR_ALL_PRIMITIVETENSOR ( LINSPACEPRIMITIVETENSOR_TYPEDEF )

◆ FOR_ALL_PRIMITIVETENSOR() [19/32]

FOR_ALL_PRIMITIVETENSOR ( LOGSPACEPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [20/32]

FOR_ALL_PRIMITIVETENSOR ( LOGSPACEPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [21/32]

FOR_ALL_PRIMITIVETENSOR ( LOGSPACEPRIMITIVETENSOR_TYPEDEF )

◆ FOR_ALL_PRIMITIVETENSOR() [22/32]

FOR_ALL_PRIMITIVETENSOR ( NONLINEARPARAMETER_INSTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [23/32]

FOR_ALL_PRIMITIVETENSOR ( ONESPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [24/32]

FOR_ALL_PRIMITIVETENSOR ( ONESPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [25/32]

FOR_ALL_PRIMITIVETENSOR ( ONESPRIMITIVETENSOR_TYPEDEF )

◆ FOR_ALL_PRIMITIVETENSOR() [26/32]

FOR_ALL_PRIMITIVETENSOR ( PARAMETERSTORE_INTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [27/32]

FOR_ALL_PRIMITIVETENSOR ( USERPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [28/32]

FOR_ALL_PRIMITIVETENSOR ( USERPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [29/32]

FOR_ALL_PRIMITIVETENSOR ( USERPRIMITIVETENSOR_TYPEDEF )

◆ FOR_ALL_PRIMITIVETENSOR() [30/32]

FOR_ALL_PRIMITIVETENSOR ( ZEROSPRIMITIVETENSOR_INSTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [31/32]

FOR_ALL_PRIMITIVETENSOR ( ZEROSPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [32/32]

FOR_ALL_PRIMITIVETENSOR ( ZEROSPRIMITIVETENSOR_TYPEDEF )

◆ FOR_ALL_TENSORBASE() [1/2]

FOR_ALL_TENSORBASE ( _tensor_type_enum_specialize )

◆ FOR_ALL_TENSORBASE() [2/2]

FOR_ALL_TENSORBASE ( TENSORBASE_INSTANTIATE )

◆ FOR_ALL_VECBASE()

FOR_ALL_VECBASE ( VECBASE_INSTANTIATE )

◆ get_driver()

Driver & get_driver ( const std::string & dname)

A convenient function to manufacture a neml2::Driver.

The input file must have already been parsed and loaded.

Parameters
dnameName of the driver

◆ get_model()

Model & get_model ( const std::string & mname,
bool enable_ad = true,
bool force_create = true )

A convenient function to manufacture a neml2::Model.

The input file must have already been parsed and loaded.

Parameters
mnameName of the model
enable_adEnable automatic differentiation
force_createWhether to force create the model even if one has already been manufactured

◆ identity_transform()

R2 identity_transform ( const torch::TensorOptions & options)

The identity transformation, i.e.e the Rank2 identity tensor.

◆ improper_rotation_transform()

R2 improper_rotation_transform ( const Rot & rot)

An improper rotation (rotation + reflection), here provided by a rot object giving the rotation and reflection axis.

◆ inversion_transform()

R2 inversion_transform ( const torch::TensorOptions & option)

An inversion center.

◆ LabeledAxisAccessor::operator std::vector< std::string >()

LabeledAxisAccessor::operator std::vector< std::string > ( ) const

◆ list_derivative_outer_product_a()

template<typename F , typename T1 , typename T2 >
Tensor list_derivative_outer_product_a ( F && f,
const T1 & a,
const T2 & b )

outer product on lists, where the first input is a list tensor

◆ list_derivative_outer_product_ab()

template<typename F , typename T1 , typename T2 >
Tensor list_derivative_outer_product_ab ( F && f,
const T1 & a,
const T2 & b )

outer product on lists where both inputs are list tensors

◆ list_derivative_outer_product_b()

template<typename F , typename T1 , typename T2 >
Tensor list_derivative_outer_product_b ( F && f,
const T1 & a,
const T2 & b )

outer product on lists, where the second input is a list tensor

◆ load_input()

void load_input ( const std::filesystem::path & path,
const std::string & additional_input = "" )

A convenient function to parse all options from an input file.

Previously loaded input options will be discarded!

Parameters
pathPath to the input file to be parsed
additional_inputAdditional cliargs to pass to the parser

◆ load_model()

Model & load_model ( const std::filesystem::path & path,
const std::string & mname,
bool enable_ad = true )

A convenient function to load an input file and get a model.

Parameters
pathPath to the input file to be parsed
mnameName of the model
enable_adEnable automatic differentiation

◆ machine_precision()

Real & machine_precision ( )

◆ neml_assert()

template<typename... Args>
void neml_assert ( bool assertion,
Args &&... args )

◆ neml_assert_batch_broadcastable() [1/2]

template<class... T>
void neml_assert_batch_broadcastable ( T &&... tensors)

◆ neml_assert_batch_broadcastable() [2/2]

template<class... T>
void neml_assert_batch_broadcastable ( T && ...)

A helper function to assert that all tensors are batch-broadcastable.

In most cases, this assertion is necessary as libTorch will raise runtime_errors if things go wrong. Therefore, this function is just so that we can detect errors before libTorch does and emit some more mearningful error messages within the NEML2 context.

◆ neml_assert_batch_broadcastable_dbg() [1/2]

template<class... T>
void neml_assert_batch_broadcastable_dbg ( T &&... tensors)

◆ neml_assert_batch_broadcastable_dbg() [2/2]

template<class... T>
void neml_assert_batch_broadcastable_dbg ( T && ...)

A helper function to assert that (in Debug mode) all tensors are batch-broadcastable.

In most cases, this assertion is necessary as libTorch will raise runtime_errors if things go wrong. Therefore, this function is just so that we can detect errors before libTorch does and emit some more mearningful error messages within the NEML2 context.

◆ neml_assert_broadcastable() [1/2]

template<class... T>
void neml_assert_broadcastable ( T &&... tensors)

◆ neml_assert_broadcastable() [2/2]

template<class... T>
void neml_assert_broadcastable ( T && ...)

A helper function to assert that all tensors are broadcastable.

In most cases, this assertion is necessary as libTorch will raise runtime_errors if things go wrong. Therefore, this function is just so that we can detect errors before libTorch does and emit some more mearningful error messages within the NEML2 context.

◆ neml_assert_broadcastable_dbg() [1/2]

template<class... T>
void neml_assert_broadcastable_dbg ( T &&... tensors)

◆ neml_assert_broadcastable_dbg() [2/2]

template<class... T>
void neml_assert_broadcastable_dbg ( T && ...)

A helper function to assert (in Debug mode) that all tensors are broadcastable.

In most cases, this assertion is necessary as libTorch will raise runtime_errors if things go wrong. Therefore, this function is just so that we can detect errors before libTorch does and emit some more mearningful error messages within the NEML2 context.

◆ neml_assert_dbg()

template<typename... Args>
void neml_assert_dbg ( bool assertion,
Args &&... args )

◆ operator!=() [1/2]

◆ operator!=() [2/2]

Compare for equality between two LabeledAxisAccessor.

◆ operator*() [1/15]

template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator* ( const Derived & a,
const Real & b )

◆ operator*() [2/15]

template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator* ( const Derived & a,
const Scalar & b )

◆ operator*() [3/15]

matrix-vector product

◆ operator*() [4/15]

matrix-matrix product

◆ operator*() [5/15]

template R2 operator* ( const R2 & A,
const R2 & B )

◆ operator*() [6/15]

template Vec operator* ( const R2 & A,
const Vec & b )

◆ operator*() [7/15]

template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator* ( const Real & a,
const Derived & b )

◆ operator*() [8/15]

Rot operator* ( const Rot & r1,
const Rot & r2 )

Composition of rotations r3 = r1 * r2 (r2 first, then r1)

◆ operator*() [9/15]

template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator* ( const Scalar & a,
const Derived & b )

◆ operator*() [10/15]

◆ operator*() [11/15]

SR2 operator* ( const SR2 & a,
const SSR4 & b )

◆ operator*() [12/15]

SR2 operator* ( const SSR4 & a,
const SR2 & b )

◆ operator*() [13/15]

SSR4 operator* ( const SSR4 & a,
const SSR4 & b )

◆ operator*() [14/15]

template<typename T1 , typename T2 , typename = typename std::enable_if_t<std::is_base_of_v<VariableBase, T1> || std::is_base_of_v<VariableBase, T2>>>
auto operator* ( const T1 & a,
const T2 & b )

◆ operator*() [15/15]

◆ operator+() [1/6]

template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator+ ( const Derived & a,
const Derived & b )

◆ operator+() [2/6]

template<class Derived , typename = typename std::enable_if<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator+ ( const Derived & a,
const Real & b )

◆ operator+() [3/6]

template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator+ ( const Derived & a,
const Scalar & b )

◆ operator+() [4/6]

template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator+ ( const Real & a,
const Derived & b )

◆ operator+() [5/6]

template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator+ ( const Scalar & a,
const Derived & b )

◆ operator+() [6/6]

template<typename T1 , typename T2 , typename = typename std::enable_if_t<std::is_base_of_v<VariableBase, T1> || std::is_base_of_v<VariableBase, T2>>>
auto operator+ ( const T1 & a,
const T2 & b )

◆ operator-() [1/6]

template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator- ( const Derived & a,
const Derived & b )

◆ operator-() [2/6]

template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator- ( const Derived & a,
const Real & b )

◆ operator-() [3/6]

template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator- ( const Derived & a,
const Scalar & b )

◆ operator-() [4/6]

template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator- ( const Real & a,
const Derived & b )

◆ operator-() [5/6]

template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator- ( const Scalar & a,
const Derived & b )

◆ operator-() [6/6]

template<typename T1 , typename T2 , typename = typename std::enable_if_t<std::is_base_of_v<VariableBase, T1> || std::is_base_of_v<VariableBase, T2>>>
auto operator- ( const T1 & a,
const T2 & b )

◆ operator/() [1/6]

template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator/ ( const Derived & a,
const Derived & b )

◆ operator/() [2/6]

template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator/ ( const Derived & a,
const Real & b )

◆ operator/() [3/6]

template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator/ ( const Derived & a,
const Scalar & b )

◆ operator/() [4/6]

template<class Derived , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator/ ( const Real & a,
const Derived & b )

◆ operator/() [5/6]

template<class Derived , typename = typename std::enable_if_t<!std::is_same_v<Derived, Scalar>>, typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<Derived>, Derived>>>
Derived operator/ ( const Scalar & a,
const Derived & b )

◆ operator/() [6/6]

template<typename T1 , typename T2 , typename = typename std::enable_if_t<std::is_base_of_v<VariableBase, T1> || std::is_base_of_v<VariableBase, T2>>>
auto operator/ ( const T1 & a,
const T2 & b )

◆ operator<()

The (strict) smaller than operator is created so as to use LabeledAxisAccessor in sorted data structures.

◆ operator<<() [1/8]

template<typename T >
std::ostream & operator<< ( std::ostream & os,
const CrossRef< T > & cr )

◆ operator<<() [2/8]

std::ostream & operator<< ( std::ostream & os,
const EnumSelection & es )

◆ operator<<() [3/8]

std::ostream & operator<< ( std::ostream & os,
const LabeledAxis & axis )

◆ operator<<() [4/8]

std::ostream & operator<< ( std::ostream & os,
const LabeledAxisAccessor & accessor )

Serialize the accessor into a string. The format is simply the concatenation of all the item names delimited by "/".

◆ operator<<() [5/8]

std::ostream & operator<< ( std::ostream & os,
const OptionCollection & p )

◆ operator<<() [6/8]

std::ostream & operator<< ( std::ostream & os,
const OptionSet & p )

◆ operator<<() [7/8]

std::ostream & operator<< ( std::ostream & os,
const TensorType & t )

◆ operator<<() [8/8]

std::ostream & operator<< ( std::ostream & os,
FType f )

◆ operator==() [1/2]

◆ operator==() [2/2]

Compare for equality between two LabeledAxisAccessor.

◆ operator>>() [1/2]

template<typename T >
std::stringstream & operator>> ( std::stringstream & ss,
CrossRef< T > & cr )

Stream into a CrossRef (used by Parsers to extract input options)

◆ operator>>() [2/2]

std::stringstream & operator>> ( std::stringstream & ss,
EnumSelection & es )

The input stream operator shall be the only entry point to modify the selection other than the assignment operator

◆ options_compatible()

bool options_compatible ( const OptionSet & opts,
const OptionSet & additional_opts )

◆ parameter_name_separator()

std::string & parameter_name_separator ( )

Default nested parameter name separator.

◆ proper_rotation_transform()

R2 proper_rotation_transform ( const Rot & rot)

A proper rotation, here provided by a Rot object.

◆ reflection_transform()

R2 reflection_transform ( const Vec & v)

A reflection, defined by the reflection plane.

◆ register_NEML2_object() [1/79]

register_NEML2_object ( ArrheniusParameter )

◆ register_NEML2_object() [2/79]

register_NEML2_object ( AssociativeIsotropicPlasticHardening )

◆ register_NEML2_object() [3/79]

register_NEML2_object ( AssociativeKinematicPlasticHardening )

◆ register_NEML2_object() [4/79]

register_NEML2_object ( AssociativePlasticFlow )

◆ register_NEML2_object() [5/79]

register_NEML2_object ( ChabochePlasticHardening )

◆ register_NEML2_object() [6/79]

register_NEML2_object ( ComposedModel )

◆ register_NEML2_object() [7/79]

register_NEML2_object ( ElasticStrainRate )

◆ register_NEML2_object() [8/79]

register_NEML2_object ( EmptyTensor )

◆ register_NEML2_object() [9/79]

register_NEML2_object ( FillR2 )

◆ register_NEML2_object() [10/79]

register_NEML2_object ( FillRot )

◆ register_NEML2_object() [11/79]

register_NEML2_object ( FillSR2 )

◆ register_NEML2_object() [12/79]

register_NEML2_object ( FillWR2 )

◆ register_NEML2_object() [13/79]

register_NEML2_object ( FixOrientation )

◆ register_NEML2_object() [14/79]

register_NEML2_object ( FredrickArmstrongPlasticHardening )

◆ register_NEML2_object() [15/79]

register_NEML2_object ( FullTensor )

◆ register_NEML2_object() [16/79]

register_NEML2_object ( GTNYieldFunction )

◆ register_NEML2_object() [17/79]

register_NEML2_object ( GursonCavitation )

◆ register_NEML2_object() [18/79]

register_NEML2_object ( IdentityTensor )

◆ register_NEML2_object() [19/79]

register_NEML2_object ( ImplicitUpdate )

◆ register_NEML2_object() [20/79]

register_NEML2_object ( IsotropicMandelStress )

◆ register_NEML2_object() [21/79]

register_NEML2_object ( KocksMeckingActivationEnergy )

◆ register_NEML2_object() [22/79]

register_NEML2_object ( KocksMeckingFlowSwitch )

◆ register_NEML2_object() [23/79]

register_NEML2_object ( KocksMeckingFlowViscosity )

◆ register_NEML2_object() [24/79]

register_NEML2_object ( KocksMeckingRateSensitivity )

◆ register_NEML2_object() [25/79]

register_NEML2_object ( KocksMeckingYieldStress )

◆ register_NEML2_object() [26/79]

◆ register_NEML2_object() [27/79]

register_NEML2_object ( LinearIsotropicElasticity )

◆ register_NEML2_object() [28/79]

register_NEML2_object ( LinearIsotropicHardening )

◆ register_NEML2_object() [29/79]

register_NEML2_object ( LinearKinematicHardening )

◆ register_NEML2_object() [30/79]

register_NEML2_object ( LinearSingleSlipHardeningRule )

◆ register_NEML2_object() [31/79]

register_NEML2_object ( LinspaceTensor )

◆ register_NEML2_object() [32/79]

register_NEML2_object ( LogspaceTensor )

◆ register_NEML2_object() [33/79]

register_NEML2_object ( MixedControlSetup )

◆ register_NEML2_object() [34/79]

register_NEML2_object ( Newton )

◆ register_NEML2_object() [35/79]

register_NEML2_object ( NewtonWithLineSearch )

◆ register_NEML2_object() [36/79]

register_NEML2_object ( NewtonWithTrustRegion )

◆ register_NEML2_object() [37/79]

register_NEML2_object ( Normality )

◆ register_NEML2_object() [38/79]

register_NEML2_object ( OlevskySinteringStress )

◆ register_NEML2_object() [39/79]

register_NEML2_object ( OnesTensor )

◆ register_NEML2_object() [40/79]

register_NEML2_object ( Orientation )

◆ register_NEML2_object() [41/79]

register_NEML2_object ( OrientationRate )

◆ register_NEML2_object() [42/79]

register_NEML2_object ( PerzynaPlasticFlowRate )

◆ register_NEML2_object() [43/79]

register_NEML2_object ( PlasticDeformationRate )

◆ register_NEML2_object() [44/79]

register_NEML2_object ( PlasticVorticity )

◆ register_NEML2_object() [45/79]

register_NEML2_object ( PowerLawIsotropicHardeningStaticRecovery )

◆ register_NEML2_object() [46/79]

register_NEML2_object ( PowerLawKinematicHardeningStaticRecovery )

◆ register_NEML2_object() [47/79]

register_NEML2_object ( PowerLawSlipRule )

◆ register_NEML2_object() [48/79]

register_NEML2_object ( RateIndependentPlasticFlowConstraint )

◆ register_NEML2_object() [49/79]

register_NEML2_object ( ResolvedShear )

◆ register_NEML2_object() [50/79]

register_NEML2_object ( RotationMatrix )

◆ register_NEML2_object() [51/79]

register_NEML2_object ( ScalarBackwardEulerTimeIntegration )

◆ register_NEML2_object() [52/79]

register_NEML2_object ( ScalarForwardEulerTimeIntegration )

◆ register_NEML2_object() [53/79]

register_NEML2_object ( ScalarLinearCombination )

◆ register_NEML2_object() [54/79]

register_NEML2_object ( ScalarLinearInterpolation )

◆ register_NEML2_object() [55/79]

register_NEML2_object ( ScalarTwoStageThermalAnnealing )

◆ register_NEML2_object() [56/79]

register_NEML2_object ( ScalarVariableRate )

◆ register_NEML2_object() [57/79]

register_NEML2_object ( SingleSlipStrengthMap )

◆ register_NEML2_object() [58/79]

register_NEML2_object ( SlopeSaturationVoceIsotropicHardening )

◆ register_NEML2_object() [59/79]

register_NEML2_object ( SolidMechanicsDriver )

◆ register_NEML2_object() [60/79]

register_NEML2_object ( SR2BackwardEulerTimeIntegration )

◆ register_NEML2_object() [61/79]

register_NEML2_object ( SR2ForwardEulerTimeIntegration )

◆ register_NEML2_object() [62/79]

register_NEML2_object ( SR2Invariant )

◆ register_NEML2_object() [63/79]

register_NEML2_object ( SR2LinearCombination )

◆ register_NEML2_object() [64/79]

register_NEML2_object ( SR2LinearInterpolation )

◆ register_NEML2_object() [65/79]

register_NEML2_object ( SR2TwoStageThermalAnnealing )

◆ register_NEML2_object() [66/79]

register_NEML2_object ( SR2VariableRate )

◆ register_NEML2_object() [67/79]

register_NEML2_object ( SumSlipRates )

◆ register_NEML2_object() [68/79]

register_NEML2_object ( ThermalEigenstrain )

◆ register_NEML2_object() [69/79]

register_NEML2_object ( VecBackwardEulerTimeIntegration )

◆ register_NEML2_object() [70/79]

register_NEML2_object ( VecForwardEulerTimeIntegration )

◆ register_NEML2_object() [71/79]

register_NEML2_object ( VecLinearCombination )

◆ register_NEML2_object() [72/79]

register_NEML2_object ( VecLinearInterpolation )

◆ register_NEML2_object() [73/79]

register_NEML2_object ( VecVariableRate )

◆ register_NEML2_object() [74/79]

register_NEML2_object ( VoceIsotropicHardening )

◆ register_NEML2_object() [75/79]

register_NEML2_object ( VoceSingleSlipHardeningRule )

◆ register_NEML2_object() [76/79]

register_NEML2_object ( WR2ExplicitExponentialTimeIntegration )

◆ register_NEML2_object() [77/79]

register_NEML2_object ( WR2ImplicitExponentialTimeIntegration )

◆ register_NEML2_object() [78/79]

register_NEML2_object ( YieldFunction )

◆ register_NEML2_object() [79/79]

register_NEML2_object ( ZerosTensor )

◆ register_NEML2_object_alias()

register_NEML2_object_alias ( UserTensor ,
"Tensor"  )

◆ reload_input()

void reload_input ( const std::filesystem::path & path,
const std::string & additional_input = "" )

Similar to neml2::load_input, but additionally clear the Factory before loading the options, therefore all previously loaded models become dangling.

Previously loaded input options will be discarded!

Parameters
pathPath to the input file to be parsed
additional_inputAdditional cliargs to pass to the parser

◆ reload_model()

Model & reload_model ( const std::filesystem::path & path,
const std::string & mname,
bool enable_ad = true )

Similar to neml2::load_model, but additionally clear the Factory before loading the model, therefore all previously loaded models become dangling.

Parameters
pathPath to the input file to be parsed
mnameName of the model
enable_adEnable automatic differentiation

◆ tighter_tolerance()

Real & tighter_tolerance ( )

A tighter tolerance used in various algorithms.

◆ timed_sections()

std::map< std::string, std::map< std::string, unsigned long > > & timed_sections ( )

◆ tolerance()

Real & tolerance ( )

The tolerance used in various algorithms.

◆ transform_from_quaternion()

R2 transform_from_quaternion ( const Quaternion & q)

Construct from quaternions, useful for comparison to old NEML.