|
NEML2 2.0.0
|
@insert-title:tutorials-naming-conventions
NEML2 models group variables onto different axes by their names, and the collection of variable names (with their corresponding layout) is called a labeled axis (LabeledAxis). NEML2 predefines six sub-axes to categorize all the input, output and intermediate variables:
state): Variables collectively characterizing the current state of the material subject to given external forces. The state variables are usually the output of a physically meaningful material model.forces): Variables defining the external forces that drive the response of the material.old_state): The state variables prior to the current material update. In the time-discrete setting, these are the state variables from the previous time step.old_forces): The external forces prior to the current material update. In the time-discrete setting, these are the forces from the previous time step.residual): The residual defines an implicit model/function. An implicit model is updated by solving for the state variables that result in zero residual.parameters): The (nonlinear) parameters.const string names (defined in neml2/models/LabeledAxisAccessor.h) should be used wherever possible, i.e. STATE, OLD_STATE, FORCES, OLD_FORCES, RESIDUAL, and PARAMETERS.Variable names have the type neml2::VariableName which is an alias to neml2::LabeledAxisAccessor. The following characters are not allowed in variable names:
,: input file parsing ambiguity;: input file parsing ambiguity.: clash with PyTorch parameter/buffer naming convention/: separator reserved for nested variable nameIn the input file, the separator / is used to denote nested variable names. For example, A/B/foo specifies a variable named "foo" defined on the sub-axis named "B" which is a nested sub-axis of "A".
In NEML2 source code, the following naming conventions are recommended:
ep. However, if the member variable is protected or private, it is recommended to prefix it with an underscore, i.e. _ep.PascalCase.snake_case.