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

Namespaces

namespace  crystallography
 
namespace  indexing
 
namespace  math
 
namespace  utils
 

Classes

class  AnisotropicElasticity
 
class  ArrheniusParameter
 A scalar-valued parameter following an Arrhenius type relation. More...
 
class  AssociativeIsotropicPlasticHardening
 
class  AssociativeJ2FlowDirection
 The plastic flow direction assuming an associative J2 flow. More...
 
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  CrystalMean
 
class  CubicElasticityConverter
 Converter for linearized elastic constants assuming cubic symmetry. More...
 
class  CubicElasticityTensor
 Define an cubic symmetry elasticity tensor in various ways. 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  ElasticityConverter
 Base class for converters responsible for converting between different parameterizations of the linear elasticity tensor in different symmetry groups. More...
 
class  ElasticityInterface
 Interface for objects defining elasticity tensors in terms of other parameters. More...
 
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
 Selection of an enum value from a list of candidates. More...
 
class  EnumSelectionBase
 
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  GeneralElasticity
 
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  IsotropicElasticityConverter
 Converter for linearized elastic constants assuming isotropic symmetry. More...
 
class  IsotropicElasticityTensor
 Define an isotropoic elasticity tensor in various ways. More...
 
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  KocksMeckingIntercept
 A scalar-valued parameter defined by (C-B) / A. 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  LDISolidMechanicsDriver
 Large deformation incremental solid mechanics driver. More...
 
class  LinearCombination
 
class  LinearInterpolation
 Linearly interpolate the parameter along a single axis. More...
 
class  LinearIsotropicElasticity
 
class  LinearIsotropicElasticJ2TrialStressUpdate
 Update the trial stress under the assumptions of J2 plasticity and isotropic linear elasticity. More...
 
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  MatrixAssembler
 Helper to assemble a matrix of tensors into a single tensor and also to split a tensor into a map of map of tensors. More...
 
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  MultiEnumSelection
 Selection of multiple enum value from a list of candidates. 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
 Second order tensor without symmetry. More...
 
class  R2Base
 Base class for second order tensor. More...
 
class  R3
 Third order tensor without symmetry. More...
 
class  R4
 Fourth order tensor without symmetry. More...
 
class  R5
 Fifth order tensor without symmetry. More...
 
class  R8
 The (logical) full eighth 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
 Scalar. More...
 
class  SDTSolidMechanicsDriver
 Small deformation total solid mechanics driver. More...
 
class  Settings
 
class  SFFR4
 The fourth order tensor with minor symmetry in the 1st and 2nd dimensions. More...
 
class  SFR3
 The 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 symmetric second order tensor. More...
 
class  SR2Invariant
 
class  SSFR5
 The 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 symmetric fourth order tensor, with symmetry in the first two dimensionss as well as in the last two dimensions. More...
 
class  SSSSR8
 The logical eigth order tensor with minor symmetry in the 1st and 2nd dimensions, the 3rd and 4th dimensions, the 5th and 6th dimensions, and the 7th and 8th 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 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
 
struct  TraceableSize
 Traceable size. More...
 
struct  TraceableTensorShape
 Traceable tensor shape. More...
 
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
 Base class of variable. More...
 
class  VariableRate
 
class  VariableStore
 
class  Vec
 3-vector. More...
 
class  VecBase
 Base class 3-vector. More...
 
class  VectorAssembler
 Helper to assemble a vector of tensors into a single tensor and also to split a tensor into a map of tensors. 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-symmetric second order tensor, 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 symmetric fourth order tensor, with skew symmetry in the first two dimensionss and symmetry in the second two. More...
 
class  WWR4
 The 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 SR2CrystalMean = CrystalMean<SR2>
 
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
 
using SubaxisName = LabeledAxisAccessor
 
typedef LinearCombination< ScalarScalarLinearCombination
 
typedef LinearCombination< VecVecLinearCombination
 
typedef LinearCombination< SR2SR2LinearCombination
 
typedef LinearInterpolation< ScalarScalarLinearInterpolation
 
typedef LinearInterpolation< VecVecLinearInterpolation
 
typedef LinearInterpolation< SR2SR2LinearInterpolation
 
using ValueMap = std::map<LabeledAxisAccessor, Tensor>
 
using DerivMap = std::map<LabeledAxisAccessor, ValueMap>
 
using SecDerivMap = std::map<LabeledAxisAccessor, DerivMap>
 
typedef TwoStageThermalAnnealing< ScalarScalarTwoStageThermalAnnealing
 
typedef TwoStageThermalAnnealing< SR2SR2TwoStageThermalAnnealing
 
typedef VariableRate< ScalarScalarVariableRate
 
typedef VariableRate< VecVecVariableRate
 
typedef VariableRate< SR2SR2VariableRate
 

Enumerations

enum class  FType : int8_t {
  NONE = 0 , INPUT = 1 << 0 , OUTPUT = 1 << 1 , PARAMETER = 1 << 2 ,
  BUFFER = 1 << 3
}
 Role in a function definition. More...
 
enum class  ElasticConstant : std::uint8_t {
  INVALID = 0 , LAME_LAMBDA = 1 , BULK_MODULUS = 2 , SHEAR_MODULUS = 3 ,
  YOUNGS_MODULUS = 4 , POISSONS_RATIO = 5 , P_WAVE_MODULUS = 6 , CUBIC_C1 = 7 ,
  CUBIC_C2 = 8 , CUBIC_C3 = 9
}
 
enum class  TensorType : int8_t { FOR_ALL_TENSORBASE_COMMA =(_tensor_type_enum) , kUknown }
 

Functions

 FOR_ALL_PRIMITIVETENSOR (CROSSREF_SPECIALIZE_PRIMITIVETENSOR_IMPL)
 
 FOR_ALL_TENSORBASE (INSTANTIATE_CROSSREF)
 
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 force_create=true)
 A convenient function to manufacture a neml2::Model.
 
Modelload_model (const std::filesystem::path &path, const std::string &mname)
 A convenient function to load an input file and get a model.
 
Modelreload_model (const std::filesystem::path &path, const std::string &mname)
 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 MultiEnumSelection &es)
 
std::stringstream & operator>> (std::stringstream &ss, MultiEnumSelection &es)
 
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 (LDISolidMechanicsDriver)
 
 register_NEML2_object (SDTSolidMechanicsDriver)
 
template<typename T >
void set_ic (ValueMap &storage, const OptionSet &options, const std::string &name_opt, const std::string &value_opt, const torch::Device &device)
 
void neml_assert_tracing ()
 Assert that we are currently tracing.
 
void neml_assert_tracing_dbg ()
 Assert that we are currently tracing (only effective in debug mode)
 
std::ostream & operator<< (std::ostream &os, const TraceableSize &s)
 Streaming operator.
 
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)
 
 FOR_ALL_TENSORBASE (BUFFERSTORE_INTANTIATE_TENSORBASE)
 
 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)
 
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)
 
std::vector< std::string > reserved_subaxis_names ()
 
 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 "/".
 
 register_NEML2_object (ScalarLinearCombination)
 
 register_NEML2_object (VecLinearCombination)
 
 register_NEML2_object (SR2LinearCombination)
 
 register_NEML2_object (ScalarLinearInterpolation)
 
 register_NEML2_object (VecLinearInterpolation)
 
 register_NEML2_object (SR2LinearInterpolation)
 
std::ostream & operator<< (std::ostream &os, const Model &model)
 
 FOR_ALL_PRIMITIVETENSOR (NONLINEARPARAMETER_INSTANTIATE_PRIMITIVETENSOR)
 
 FOR_ALL_TENSORBASE (PARAMETERSTORE_INTANTIATE_TENSORBASE)
 
 FOR_ALL_PRIMITIVETENSOR (PARAMETERSTORE_INTANTIATE_PRIMITIVETENSOR)
 
 register_NEML2_object (RotationMatrix)
 
 register_NEML2_object (AssociativeIsotropicPlasticHardening)
 
 register_NEML2_object (AssociativeJ2FlowDirection)
 
 register_NEML2_object (AssociativeKinematicPlasticHardening)
 
 register_NEML2_object (AssociativePlasticFlow)
 
 register_NEML2_object (ChabochePlasticHardening)
 
 register_NEML2_object (SR2CrystalMean)
 
 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 (CubicElasticityTensor)
 
std::string name (ElasticConstant p)
 
 register_NEML2_object (GeneralElasticity)
 
 register_NEML2_object (IsotropicElasticityTensor)
 
 register_NEML2_object (LinearIsotropicElasticity)
 
 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 (KocksMeckingIntercept)
 
 register_NEML2_object (KocksMeckingRateSensitivity)
 
 register_NEML2_object (KocksMeckingYieldStress)
 
 register_NEML2_object (LinearIsotropicElasticJ2TrialStressUpdate)
 
 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)
 
void assign_or_add (Tensor &dest, const Tensor &val)
 
 FOR_ALL_TENSORBASE (INSTANTIATE_VARIABLE)
 
 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)
 
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 (INSTANTIATE_TENSORBASE)
 
std::ostream & operator<< (std::ostream &os, const TensorType &t)
 
 FOR_ALL_TENSORBASE (INSTANTIATE_TENSORVALUE)
 
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)
 
 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)
 
 register_NEML2_object (FullTensor)
 
 register_NEML2_object (IdentityTensor)
 
 FOR_ALL_PRIMITIVETENSOR (LINSPACEPRIMITIVETENSOR_REGISTER)
 
 register_NEML2_object (LinspaceTensor)
 
 FOR_ALL_PRIMITIVETENSOR (LOGSPACEPRIMITIVETENSOR_REGISTER)
 
 register_NEML2_object (LogspaceTensor)
 
 FOR_ALL_PRIMITIVETENSOR (ONESPRIMITIVETENSOR_REGISTER)
 
 register_NEML2_object (OnesTensor)
 
 register_NEML2_object (Orientation)
 
 FOR_ALL_PRIMITIVETENSOR (USERPRIMITIVETENSOR_REGISTER)
 
 register_NEML2_object_alias (UserTensor, "Tensor")
 
 FOR_ALL_PRIMITIVETENSOR (ZEROSPRIMITIVETENSOR_REGISTER)
 
 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)
 
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 (const T &... tensors)
 
template<class... T>
Size broadcast_batch_dim (const T &...)
 The batch dimension after broadcasting.
 
template<class... T>
void neml_assert_broadcastable (const T &...)
 A helper function to assert that all tensors are broadcastable.
 
template<class... T>
void neml_assert_broadcastable_dbg (const T &...)
 A helper function to assert (in Debug mode) that all tensors are broadcastable.
 
template<class... T>
void neml_assert_batch_broadcastable (const T &...)
 A helper function to assert that all tensors are batch-broadcastable.
 
template<class... T>
void neml_assert_batch_broadcastable_dbg (const T &...)
 A helper function to assert that (in Debug mode) all tensors are batch-broadcastable.
 
template<class... T>
Size broadcast_batch_dim (const T &... tensor)
 
template<class... T>
void neml_assert_broadcastable (const T &... tensors)
 
template<class... T>
void neml_assert_broadcastable_dbg (const T &... tensors)
 
template<class... T>
void neml_assert_batch_broadcastable (const T &... tensors)
 
template<class... T>
void neml_assert_batch_broadcastable_dbg (const T &... tensors)
 
 FOR_ALL_PRIMITIVETENSOR (CONSTANTPARAMETER_TYPEDEF_PRIMITIVETENSOR)
 
 FOR_ALL_PRIMITIVETENSOR (COPYVARIABLE_TYPEDEF_PRIMITIVETENSOR)
 
 FOR_ALL_PRIMITIVETENSOR (INPUTPARAMETER_TYPEDEF_PRIMITIVETENSOR)
 
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)
 
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_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 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)
 
bool operator== (const TraceableSize &lhs, const TraceableSize &rhs)
 
bool operator!= (const TraceableSize &lhs, const TraceableSize &rhs)
 
bool operator== (const TraceableTensorShape &lhs, const TraceableTensorShape &rhs)
 
bool operator!= (const TraceableTensorShape &lhs, const TraceableTensorShape &rhs)
 
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.
 

Variables

const std::string STATE = "state"
 
const std::string OLD_STATE = "old_state"
 
const std::string FORCES = "forces"
 
const std::string OLD_FORCES = "old_forces"
 
const std::string RESIDUAL = "residual"
 
const std::string PARAMETERS = "parameters"
 

Detailed Description

This file contains implementation details of the TensorBase class. Refer to TensorBase.h for the class definition.

Typedef Documentation

◆ BuildPtr

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

◆ DerivMap

◆ Integer

◆ Real

◆ ScalarBackwardEulerTimeIntegration

◆ ScalarForwardEulerTimeIntegration

◆ ScalarLinearCombination

◆ ScalarLinearInterpolation

◆ ScalarTwoStageThermalAnnealing

◆ ScalarVariableRate

◆ SecDerivMap

◆ Size

◆ SR2BackwardEulerTimeIntegration

◆ SR2CrystalMean

◆ SR2ForwardEulerTimeIntegration

◆ SR2LinearCombination

◆ SR2LinearInterpolation

◆ SR2TwoStageThermalAnnealing

◆ SR2VariableRate

◆ SubaxisName

◆ TensorShape

using TensorShape = torch::SmallVector<Size>

◆ TensorShapeRef

using TensorShapeRef = torch::IntArrayRef

◆ ValueMap

◆ VariableName

◆ VecBackwardEulerTimeIntegration

◆ VecForwardEulerTimeIntegration

◆ VecLinearCombination

◆ VecLinearInterpolation

◆ VecVariableRate

Enumeration Type Documentation

◆ ElasticConstant

enum class ElasticConstant : std::uint8_t
strong
Enumerator
INVALID 
LAME_LAMBDA 
BULK_MODULUS 
SHEAR_MODULUS 
YOUNGS_MODULUS 
POISSONS_RATIO 
P_WAVE_MODULUS 
CUBIC_C1 
CUBIC_C2 
CUBIC_C3 

◆ 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.

◆ assign_or_add()

void assign_or_add ( Tensor & dest,
const Tensor & val )

◆ broadcast_batch_dim() [1/2]

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

◆ broadcast_batch_dim() [2/2]

template<class... T>
Size broadcast_batch_dim ( const 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 ( const 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/17]

FOR_ALL_PRIMITIVETENSOR ( CONSTANTPARAMETER_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [2/17]

FOR_ALL_PRIMITIVETENSOR ( CONSTANTPARAMETER_TYPEDEF_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [3/17]

FOR_ALL_PRIMITIVETENSOR ( COPYVARIABLE_INSTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [4/17]

FOR_ALL_PRIMITIVETENSOR ( COPYVARIABLE_REGISTER_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [5/17]

FOR_ALL_PRIMITIVETENSOR ( COPYVARIABLE_TYPEDEF_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [6/17]

FOR_ALL_PRIMITIVETENSOR ( CROSSREF_SPECIALIZE_PRIMITIVETENSOR_IMPL )

◆ FOR_ALL_PRIMITIVETENSOR() [7/17]

FOR_ALL_PRIMITIVETENSOR ( EMPTYPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [8/17]

FOR_ALL_PRIMITIVETENSOR ( FULLPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [9/17]

FOR_ALL_PRIMITIVETENSOR ( INPUTPARAMETER_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [10/17]

FOR_ALL_PRIMITIVETENSOR ( INPUTPARAMETER_TYPEDEF_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [11/17]

FOR_ALL_PRIMITIVETENSOR ( LINSPACEPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [12/17]

FOR_ALL_PRIMITIVETENSOR ( LOGSPACEPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [13/17]

FOR_ALL_PRIMITIVETENSOR ( NONLINEARPARAMETER_INSTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [14/17]

FOR_ALL_PRIMITIVETENSOR ( ONESPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [15/17]

FOR_ALL_PRIMITIVETENSOR ( PARAMETERSTORE_INTANTIATE_PRIMITIVETENSOR )

◆ FOR_ALL_PRIMITIVETENSOR() [16/17]

FOR_ALL_PRIMITIVETENSOR ( USERPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_PRIMITIVETENSOR() [17/17]

FOR_ALL_PRIMITIVETENSOR ( ZEROSPRIMITIVETENSOR_REGISTER )

◆ FOR_ALL_TENSORBASE() [1/7]

FOR_ALL_TENSORBASE ( _tensor_type_enum_specialize )

◆ FOR_ALL_TENSORBASE() [2/7]

FOR_ALL_TENSORBASE ( BUFFERSTORE_INTANTIATE_TENSORBASE )

◆ FOR_ALL_TENSORBASE() [3/7]

FOR_ALL_TENSORBASE ( INSTANTIATE_CROSSREF )

◆ FOR_ALL_TENSORBASE() [4/7]

FOR_ALL_TENSORBASE ( INSTANTIATE_TENSORBASE )

◆ FOR_ALL_TENSORBASE() [5/7]

FOR_ALL_TENSORBASE ( INSTANTIATE_TENSORVALUE )

◆ FOR_ALL_TENSORBASE() [6/7]

FOR_ALL_TENSORBASE ( INSTANTIATE_VARIABLE )

◆ FOR_ALL_TENSORBASE() [7/7]

FOR_ALL_TENSORBASE ( PARAMETERSTORE_INTANTIATE_TENSORBASE )

◆ 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 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
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 )

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

◆ machine_precision()

Real & machine_precision ( )

◆ name()

std::string name ( ElasticConstant p)

◆ 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 ( const T &... tensors)

◆ neml_assert_batch_broadcastable() [2/2]

template<class... T>
void neml_assert_batch_broadcastable ( const 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 ( const T &... tensors)

◆ neml_assert_batch_broadcastable_dbg() [2/2]

template<class... T>
void neml_assert_batch_broadcastable_dbg ( const 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 ( const T &... tensors)

◆ neml_assert_broadcastable() [2/2]

template<class... T>
void neml_assert_broadcastable ( const 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 ( const T &... tensors)

◆ neml_assert_broadcastable_dbg() [2/2]

template<class... T>
void neml_assert_broadcastable_dbg ( const 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 )

◆ neml_assert_tracing()

void neml_assert_tracing ( )

Assert that we are currently tracing.

◆ neml_assert_tracing_dbg()

void neml_assert_tracing_dbg ( )

Assert that we are currently tracing (only effective in debug mode)

◆ operator!=() [1/4]

◆ operator!=() [2/4]

Compare for equality between two LabeledAxisAccessor.

◆ operator!=() [3/4]

◆ operator!=() [4/4]

◆ 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_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/() [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/11]

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

◆ operator<<() [2/11]

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

◆ operator<<() [3/11]

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

◆ operator<<() [4/11]

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/11]

std::ostream & operator<< ( std::ostream & os,
const Model & model )

◆ operator<<() [6/11]

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

◆ operator<<() [7/11]

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

◆ operator<<() [8/11]

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

◆ operator<<() [9/11]

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

◆ operator<<() [10/11]

std::ostream & operator<< ( std::ostream & os,
const TraceableSize & s )

Streaming operator.

◆ operator<<() [11/11]

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

◆ operator==() [1/4]

◆ operator==() [2/4]

Compare for equality between two LabeledAxisAccessor.

◆ operator==() [3/4]

Comparison operators

◆ operator==() [4/4]

Comparison operators

◆ operator>>() [1/3]

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/3]

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

◆ operator>>() [3/3]

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

◆ 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/86]

register_NEML2_object ( ArrheniusParameter )

◆ register_NEML2_object() [2/86]

register_NEML2_object ( AssociativeIsotropicPlasticHardening )

◆ register_NEML2_object() [3/86]

register_NEML2_object ( AssociativeJ2FlowDirection )

◆ register_NEML2_object() [4/86]

register_NEML2_object ( AssociativeKinematicPlasticHardening )

◆ register_NEML2_object() [5/86]

register_NEML2_object ( AssociativePlasticFlow )

◆ register_NEML2_object() [6/86]

register_NEML2_object ( ChabochePlasticHardening )

◆ register_NEML2_object() [7/86]

register_NEML2_object ( ComposedModel )

◆ register_NEML2_object() [8/86]

register_NEML2_object ( CubicElasticityTensor )

◆ register_NEML2_object() [9/86]

register_NEML2_object ( ElasticStrainRate )

◆ register_NEML2_object() [10/86]

register_NEML2_object ( EmptyTensor )

◆ register_NEML2_object() [11/86]

register_NEML2_object ( FillR2 )

◆ register_NEML2_object() [12/86]

register_NEML2_object ( FillRot )

◆ register_NEML2_object() [13/86]

register_NEML2_object ( FillSR2 )

◆ register_NEML2_object() [14/86]

register_NEML2_object ( FillWR2 )

◆ register_NEML2_object() [15/86]

register_NEML2_object ( FixOrientation )

◆ register_NEML2_object() [16/86]

register_NEML2_object ( FredrickArmstrongPlasticHardening )

◆ register_NEML2_object() [17/86]

register_NEML2_object ( FullTensor )

◆ register_NEML2_object() [18/86]

register_NEML2_object ( GeneralElasticity )

◆ register_NEML2_object() [19/86]

register_NEML2_object ( GTNYieldFunction )

◆ register_NEML2_object() [20/86]

register_NEML2_object ( GursonCavitation )

◆ register_NEML2_object() [21/86]

register_NEML2_object ( IdentityTensor )

◆ register_NEML2_object() [22/86]

register_NEML2_object ( ImplicitUpdate )

◆ register_NEML2_object() [23/86]

register_NEML2_object ( IsotropicElasticityTensor )

◆ register_NEML2_object() [24/86]

register_NEML2_object ( IsotropicMandelStress )

◆ register_NEML2_object() [25/86]

register_NEML2_object ( KocksMeckingActivationEnergy )

◆ register_NEML2_object() [26/86]

register_NEML2_object ( KocksMeckingFlowSwitch )

◆ register_NEML2_object() [27/86]

register_NEML2_object ( KocksMeckingFlowViscosity )

◆ register_NEML2_object() [28/86]

register_NEML2_object ( KocksMeckingIntercept )

◆ register_NEML2_object() [29/86]

register_NEML2_object ( KocksMeckingRateSensitivity )

◆ register_NEML2_object() [30/86]

register_NEML2_object ( KocksMeckingYieldStress )

◆ register_NEML2_object() [31/86]

register_NEML2_object ( LDISolidMechanicsDriver )

◆ register_NEML2_object() [32/86]

register_NEML2_object ( LinearIsotropicElasticity )

◆ register_NEML2_object() [33/86]

register_NEML2_object ( LinearIsotropicElasticJ2TrialStressUpdate )

◆ register_NEML2_object() [34/86]

register_NEML2_object ( LinearIsotropicHardening )

◆ register_NEML2_object() [35/86]

register_NEML2_object ( LinearKinematicHardening )

◆ register_NEML2_object() [36/86]

register_NEML2_object ( LinearSingleSlipHardeningRule )

◆ register_NEML2_object() [37/86]

register_NEML2_object ( LinspaceTensor )

◆ register_NEML2_object() [38/86]

register_NEML2_object ( LogspaceTensor )

◆ register_NEML2_object() [39/86]

register_NEML2_object ( MixedControlSetup )

◆ register_NEML2_object() [40/86]

register_NEML2_object ( Newton )

◆ register_NEML2_object() [41/86]

register_NEML2_object ( NewtonWithLineSearch )

◆ register_NEML2_object() [42/86]

register_NEML2_object ( NewtonWithTrustRegion )

◆ register_NEML2_object() [43/86]

register_NEML2_object ( Normality )

◆ register_NEML2_object() [44/86]

register_NEML2_object ( OlevskySinteringStress )

◆ register_NEML2_object() [45/86]

register_NEML2_object ( OnesTensor )

◆ register_NEML2_object() [46/86]

register_NEML2_object ( Orientation )

◆ register_NEML2_object() [47/86]

register_NEML2_object ( OrientationRate )

◆ register_NEML2_object() [48/86]

register_NEML2_object ( PerzynaPlasticFlowRate )

◆ register_NEML2_object() [49/86]

register_NEML2_object ( PlasticDeformationRate )

◆ register_NEML2_object() [50/86]

register_NEML2_object ( PlasticVorticity )

◆ register_NEML2_object() [51/86]

register_NEML2_object ( PowerLawIsotropicHardeningStaticRecovery )

◆ register_NEML2_object() [52/86]

register_NEML2_object ( PowerLawKinematicHardeningStaticRecovery )

◆ register_NEML2_object() [53/86]

register_NEML2_object ( PowerLawSlipRule )

◆ register_NEML2_object() [54/86]

register_NEML2_object ( RateIndependentPlasticFlowConstraint )

◆ register_NEML2_object() [55/86]

register_NEML2_object ( ResolvedShear )

◆ register_NEML2_object() [56/86]

register_NEML2_object ( RotationMatrix )

◆ register_NEML2_object() [57/86]

register_NEML2_object ( ScalarBackwardEulerTimeIntegration )

◆ register_NEML2_object() [58/86]

register_NEML2_object ( ScalarForwardEulerTimeIntegration )

◆ register_NEML2_object() [59/86]

register_NEML2_object ( ScalarLinearCombination )

◆ register_NEML2_object() [60/86]

register_NEML2_object ( ScalarLinearInterpolation )

◆ register_NEML2_object() [61/86]

register_NEML2_object ( ScalarTwoStageThermalAnnealing )

◆ register_NEML2_object() [62/86]

register_NEML2_object ( ScalarVariableRate )

◆ register_NEML2_object() [63/86]

register_NEML2_object ( SDTSolidMechanicsDriver )

◆ register_NEML2_object() [64/86]

register_NEML2_object ( SingleSlipStrengthMap )

◆ register_NEML2_object() [65/86]

register_NEML2_object ( SlopeSaturationVoceIsotropicHardening )

◆ register_NEML2_object() [66/86]

register_NEML2_object ( SR2BackwardEulerTimeIntegration )

◆ register_NEML2_object() [67/86]

register_NEML2_object ( SR2CrystalMean )

◆ register_NEML2_object() [68/86]

register_NEML2_object ( SR2ForwardEulerTimeIntegration )

◆ register_NEML2_object() [69/86]

register_NEML2_object ( SR2Invariant )

◆ register_NEML2_object() [70/86]

register_NEML2_object ( SR2LinearCombination )

◆ register_NEML2_object() [71/86]

register_NEML2_object ( SR2LinearInterpolation )

◆ register_NEML2_object() [72/86]

register_NEML2_object ( SR2TwoStageThermalAnnealing )

◆ register_NEML2_object() [73/86]

register_NEML2_object ( SR2VariableRate )

◆ register_NEML2_object() [74/86]

register_NEML2_object ( SumSlipRates )

◆ register_NEML2_object() [75/86]

register_NEML2_object ( ThermalEigenstrain )

◆ register_NEML2_object() [76/86]

register_NEML2_object ( VecBackwardEulerTimeIntegration )

◆ register_NEML2_object() [77/86]

register_NEML2_object ( VecForwardEulerTimeIntegration )

◆ register_NEML2_object() [78/86]

register_NEML2_object ( VecLinearCombination )

◆ register_NEML2_object() [79/86]

register_NEML2_object ( VecLinearInterpolation )

◆ register_NEML2_object() [80/86]

register_NEML2_object ( VecVariableRate )

◆ register_NEML2_object() [81/86]

register_NEML2_object ( VoceIsotropicHardening )

◆ register_NEML2_object() [82/86]

register_NEML2_object ( VoceSingleSlipHardeningRule )

◆ register_NEML2_object() [83/86]

register_NEML2_object ( WR2ExplicitExponentialTimeIntegration )

◆ register_NEML2_object() [84/86]

register_NEML2_object ( WR2ImplicitExponentialTimeIntegration )

◆ register_NEML2_object() [85/86]

register_NEML2_object ( YieldFunction )

◆ register_NEML2_object() [86/86]

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 )

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

◆ reserved_subaxis_names()

std::vector< std::string > reserved_subaxis_names ( )

◆ set_ic()

template<typename T >
void set_ic ( ValueMap & storage,
const OptionSet & options,
const std::string & name_opt,
const std::string & value_opt,
const torch::Device & device )

◆ 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.

Variable Documentation

◆ FORCES

const std::string FORCES = "forces"
inline

◆ OLD_FORCES

const std::string OLD_FORCES = "old_forces"
inline

◆ OLD_STATE

const std::string OLD_STATE = "old_state"
inline

◆ PARAMETERS

const std::string PARAMETERS = "parameters"
inline

◆ RESIDUAL

const std::string RESIDUAL = "residual"
inline

◆ STATE

const std::string STATE = "state"
inline