- active__all__ If specified only the blocks named will be visited and made active
Default:__all__
C++ Type:std::vector<std::string>
Controllable:No
Description:If specified only the blocks named will be visited and made active
- auto_outputTrueWhether to automatically retrieve all NEML2 output variables as MOOSE material properties.
Default:True
C++ Type:bool
Controllable:No
Description:Whether to automatically retrieve all NEML2 output variables as MOOSE material properties.
- cli_argsAdditional command line arguments to use when parsing the NEML2 input file.
C++ Type:std::vector<std::string>
Controllable:No
Description:Additional command line arguments to use when parsing the NEML2 input file.
- derivativesList of NEML2 derivatives to retrieve. Each entry is (output, input) -- the derivative of 'output' w.r.t. 'input' -- with an optional third element aliasing it to a custom MOOSE material property name (default d(output)/d(input)).
C++ Type:std::vector<std::vector<std::string>>
Controllable:No
Description:List of NEML2 derivatives to retrieve. Each entry is (output, input) -- the derivative of 'output' w.r.t. 'input' -- with an optional third element aliasing it to a custom MOOSE material property name (default d(output)/d(input)).
- deviceCompute device(s) for the NEML2 model, each following the schema (cpu|cuda)[:
] (e.g. 'cpu', 'cuda:1'). cpp-eager pins the model to the first device. cpp-aoti dispatches over the list: a CUDA list is round-robined over the MPI ranks on each node (one device per rank when counts match, sharing when there are more ranks than devices, an error when there are fewer); a single 'cpu' runs each rank's local batch on CPU. If not specified, defaults to the compute device from the --compute-device command line argument. C++ Type:std::vector<std::string>
Controllable:No
Description:Compute device(s) for the NEML2 model, each following the schema (cpu|cuda)[:
] (e.g. 'cpu', 'cuda:1'). cpp-eager pins the model to the first device. cpp-aoti dispatches over the list: a CUDA list is round-robined over the MPI ranks on each node (one device per rank when counts match, sharing when there are more ranks than devices, an error when there are fewer); a single 'cpu' runs each rank's local batch on CPU. If not specified, defaults to the compute device from the --compute-device command line argument. - device_batchPer-device chunk size along the leading batch axis (0 = run the whole local batch at once). Must have length 1 (broadcast to all devices) or match the length of 'device'. Defaults to 0.
C++ Type:std::vector<unsigned int>
Controllable:No
Description:Per-device chunk size along the leading batch axis (0 = run the whole local batch at once). Must have length 1 (broadcast to all devices) or match the length of 'device'. Defaults to 0.
- dump_inputs_on_failureFalseWhen a NEML2 constitutive solve fails (recoverable convergence failure), serialize the input tensors to a per-rank TorchScript file '
_count _rank .pt' (c is a persistent failure counter). The file can be loaded offline with torch.jit.load to re-evaluate the model on the failing batch, independently of MOOSE. Default:False
C++ Type:bool
Controllable:No
Description:When a NEML2 constitutive solve fails (recoverable convergence failure), serialize the input tensors to a per-rank TorchScript file '
_count _rank .pt' (c is a persistent failure counter). The file can be loaded offline with torch.jit.load to re-evaluate the model on the failing batch, independently of MOOSE. - eagerFalseUse the cpp-eager NEML2 runtime, which embeds a Python interpreter and loads the model from the source 'input' file at runtime. Default false -- use the cpp-aoti runtime, which loads an ahead-of-time-compiled artifact (no Python at runtime) from the artifact folder given by 'input'. The 'load' parameter is only valid with eager=true.
Default:False
C++ Type:bool
Controllable:No
Description:Use the cpp-eager NEML2 runtime, which embeds a Python interpreter and loads the model from the source 'input' file at runtime. Default false -- use the cpp-aoti runtime, which loads an ahead-of-time-compiled artifact (no Python at runtime) from the artifact folder given by 'input'. The 'load' parameter is only valid with eager=true.
- export_output_targetsThe export targets corresponding to each MOOSE material property specified in export_outputs.
C++ Type:std::vector<std::vector<OutputName>>
Controllable:No
Description:The export targets corresponding to each MOOSE material property specified in export_outputs.
- export_outputsList of MOOSE material properties to export which correspond to NEML2 output variables or output derivatives. Each material property's export targets can be specified by export_output_targets. The default export target is 'none'.
C++ Type:std::vector<MaterialPropertyName>
Unit:(no unit assumed)
Controllable:No
Description:List of MOOSE material properties to export which correspond to NEML2 output variables or output derivatives. Each material property's export targets can be specified by export_output_targets. The default export target is 'none'.
- inactiveIf specified blocks matching these identifiers will be skipped.
C++ Type:std::vector<std::string>
Controllable:No
Description:If specified blocks matching these identifiers will be skipped.
- initialize_output_valuesList of MOOSE material properties whose initial values (evaluated at the 0th time step) will be used to initialize stateful properties. See the description of initialize_outputs for more details.
C++ Type:std::vector<MaterialPropertyName>
Unit:(no unit assumed)
Controllable:No
Description:List of MOOSE material properties whose initial values (evaluated at the 0th time step) will be used to initialize stateful properties. See the description of initialize_outputs for more details.
- initialize_outputsList of MOOSE material properties to be initialized. Each these properties must correspond to a stateful NEML2 variable (which appears on both the input old state sub-axis and the output state sub-axis). These MOOSE material properties will be initialized with the values of properties specified in the initialize_output_values list.
C++ Type:std::vector<MaterialPropertyName>
Unit:(no unit assumed)
Controllable:No
Description:List of MOOSE material properties to be initialized. Each these properties must correspond to a stateful NEML2 variable (which appears on both the input old state sub-axis and the output state sub-axis). These MOOSE material properties will be initialized with the values of properties specified in the initialize_output_values list.
- inputFor the cpp-eager runtime, the path to the source NEML2 '.i' model file. For the cpp-aoti runtime, any of: the artifact folder produced by neml2-compile (a self-describing directory holding metadata.json plus per-
/ '.pt2' binaries), the metadata.json inside it, or the neml2-compile stub '.i'. Prefer the artifact folder -- it is self-contained and relocatable as a unit, and needs no 'model' name. The stub '.i' is accepted for compatibility but points at its artifact folder by path, so the two must stay together. C++ Type:DataFileName
Controllable:No
Description:For the cpp-eager runtime, the path to the source NEML2 '.i' model file. For the cpp-aoti runtime, any of: the artifact folder produced by neml2-compile (a self-describing directory holding metadata.json plus per-
/ '.pt2' binaries), the metadata.json inside it, or the neml2-compile stub '.i'. Prefer the artifact folder -- it is self-contained and relocatable as a unit, and needs no 'model' name. The stub '.i' is accepted for compatibility but points at its artifact folder by path, so the two must stay together. - input_kernelsNEML2 kernels defined in MOOSE that provides input data. The object name must match the input variable name.
C++ Type:std::vector<std::string>
Controllable:No
Description:NEML2 kernels defined in MOOSE that provides input data. The object name must match the input variable name.
- input_typesType of each MOOSE data to be used as NEML2 input variable
C++ Type:MultiMooseEnum
Controllable:No
Description:Type of each MOOSE data to be used as NEML2 input variable
- inputsList of NEML2 input variables corresponding to each MOOSE data.
C++ Type:std::vector<std::string>
Controllable:No
Description:List of NEML2 input variables corresponding to each MOOSE data.
- loadExternal Python extension files (paths to .py files or package directories, resolved relative to the input file and the application's data search path) imported into the embedded interpreter before the NEML2 model is built. Importing them registers any @register_neml2_object types they define -- e.g. NEML2 models hosted inside a MOOSE app -- so the NEML2 input file can reference them. Mirrors the neml2 CLI --load flag. Only valid with the cpp-eager runtime (eager=true).
C++ Type:std::vector<DataFileName>
Controllable:No
Description:External Python extension files (paths to .py files or package directories, resolved relative to the input file and the application's data search path) imported into the embedded interpreter before the NEML2 model is built. Importing them registers any @register_neml2_object types they define -- e.g. NEML2 models hosted inside a MOOSE app -- so the NEML2 input file can reference them. Mirrors the neml2 CLI --load flag. Only valid with the cpp-eager runtime (eager=true).
- manage_state_advanceFalseKeep state and forces on the device and advance it to old state and old forces without a roundtrip through MOOSE materials. This is only recommended for explicit time integration or when absolutely no restepping occurs (e.g. failed timesteps).
Default:False
C++ Type:bool
Controllable:No
Description:Keep state and forces on the device and advance it to old state and old forces without a roundtrip through MOOSE materials. This is only recommended for explicit time integration or when absolutely no restepping occurs (e.g. failed timesteps).
- modelName of the NEML2 model, i.e., the string inside the brackets [] in the NEML2 input file that corresponds to the model you want to use. Required for the cpp-eager runtime, and for cpp-aoti only when 'input' is a stub '.i'; the cpp-aoti folder and metadata.json forms use the single model recorded in the artifact metadata and ignore it.
C++ Type:std::string
Controllable:No
Description:Name of the NEML2 model, i.e., the string inside the brackets [] in the NEML2 input file that corresponds to the model you want to use. Required for the cpp-eager runtime, and for cpp-aoti only when 'input' is a stub '.i'; the cpp-aoti folder and metadata.json forms use the single model recorded in the artifact metadata and ignore it.
- num_threadsNumber of threads to use when evaluating the NEML2 model. Defaults to the number of threads MOOSE is run with (the --n-threads command-line value). Some models evaluate fastest with a single thread regardless of --n-threads; set this to 1 in that case.
C++ Type:unsigned int
Controllable:No
Description:Number of threads to use when evaluating the NEML2 model. Defaults to the number of threads MOOSE is run with (the --n-threads command-line value). Some models evaluate fastest with a single thread regardless of --n-threads; set this to 1 in that case.
- output_deviceDevice on which to store the model outputs, following the same schema as a single 'device' entry. Defaults to cpu, where MOOSE consumes them. Set this only if a downstream object needs the outputs on a specific device.
C++ Type:std::string
Controllable:No
Description:Device on which to store the model outputs, following the same schema as a single 'device' entry. Defaults to cpu, where MOOSE consumes them. Set this only if a downstream object needs the outputs on a specific device.
- parameter_derivativesList of NEML2 parameter derivatives to retrieve. Each entry is (output, parameter) -- the derivative of 'output' w.r.t. model 'parameter' -- with an optional third element aliasing it to a custom MOOSE material property name (default d(output)/d(parameter)).
C++ Type:std::vector<std::vector<std::string>>
Controllable:No
Description:List of NEML2 parameter derivatives to retrieve. Each entry is (output, parameter) -- the derivative of 'output' w.r.t. model 'parameter' -- with an optional third element aliasing it to a custom MOOSE material property name (default d(output)/d(parameter)).
- parameter_typesType of each MOOSE data to be used as NEML2 model parameter
C++ Type:MultiMooseEnum
Controllable:No
Description:Type of each MOOSE data to be used as NEML2 model parameter
- parametersList of NEML2 model parameters corresponding to each MOOSE data.
C++ Type:std::vector<std::string>
Controllable:No
Description:List of NEML2 model parameters corresponding to each MOOSE data.
- skip_input_variablesList of NEML2 variables to skip when setting up the model input. If an input variable is skipped, its value will stay zero. If a required input variable is skipped, an error will be raised.
C++ Type:std::vector<std::string>
Controllable:No
Description:List of NEML2 variables to skip when setting up the model input. If an input variable is skipped, its value will stay zero. If a required input variable is skipped, an error will be raised.
NEML2ActionCommon
Parse a NEML2 input file
This page is developer-facing. Users please refer to the NEML2 syntax documentation.
Overview
This action corresponds to the common area directly underneath the [NEML2] block in the input file. It defines common parameters that are also applied to each of the sub-block.
This action does not construct any object by itself. All NEML2 object construction is handled by the sub-blocks which correspond to NEML2Action.
Input Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
These input parameters correspond to the common area under the [NEML2] block. The usage of the [NEML2] block is explained in details in the NEML2 syntax documentation.
The detailed documentation of this object/syntax is only available when MOOSE is compiled with NEML2. To enable NEML2, please follow the NEML2 installation guide.