https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NEML2ActionCommon.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#include "NEML2ActionCommon.h"
11#include "NEML2Action.h"
12#include "NEML2Utils.h"
13#include "NEML2ModelExecutor.h"
14
15registerMooseAction("MooseApp", NEML2ActionCommon, "parse_neml2");
16
19{
22
23 MultiMooseEnum moose_types("TIME SCALAR FUNCTION VARIABLE MATERIAL");
24
25 // Inputs
26 params.addParam<MultiMooseEnum>(
27 "input_types", moose_types, "Type of each MOOSE data to be used as NEML2 input variable");
28 params.addParam<std::vector<std::string>>(
29 "inputs", {}, "List of NEML2 input variables corresponding to each MOOSE data.");
30 params.addParam<std::vector<std::string>>(
31 "input_kernels",
32 {},
33 "NEML2 kernels defined in MOOSE that provides input data. The object name must match the "
34 "input variable name.");
35
36 // Model parameters
37 params.addParam<MultiMooseEnum>("parameter_types",
38 moose_types,
39 "Type of each MOOSE data to be used as NEML2 model parameter");
40 params.addParam<std::vector<std::string>>(
41 "parameters", {}, "List of NEML2 model parameters corresponding to each MOOSE data.");
42
43 // Output
44 params.addParam<bool>("auto_output",
45 true,
46 "Whether to automatically retrieve all NEML2 output variables as MOOSE "
47 "material properties.");
48
49 // Derivatives
50 params.addParam<std::vector<std::vector<std::string>>>(
51 "derivatives",
52 {},
53 "List of NEML2 derivatives to retrieve. Each entry is (output, input) -- the derivative of "
54 "'output' w.r.t. 'input' -- with an optional third element aliasing it to a custom MOOSE "
55 "material property name (default d(output)/d(input)).");
56
57 // Parameter derivatives
58 params.addParam<std::vector<std::vector<std::string>>>(
59 "parameter_derivatives",
60 {},
61 "List of NEML2 parameter derivatives to retrieve. Each entry is (output, parameter) -- the "
62 "derivative of 'output' w.r.t. model 'parameter' -- with an optional third element aliasing "
63 "it to a custom MOOSE material property name (default d(output)/d(parameter)).");
64
65 // Error checking, logging, etc
66 params.addParam<std::vector<std::string>>(
67 "skip_input_variables",
68 {},
69 "List of NEML2 variables to skip when setting up the model input. If an input variable is "
70 "skipped, its value will stay zero. If a required input variable is skipped, an error "
71 "will be raised.");
72
73 params.addParam<std::vector<MaterialPropertyName>>(
74 "initialize_outputs",
75 {},
76 "List of MOOSE material properties to be initialized. Each these properties must correspond "
77 "to a stateful NEML2 variable (which appears on both the input old state sub-axis and the "
78 "output state sub-axis). These MOOSE material properties will be initialized with the values "
79 "of properties specified in the initialize_output_values list.");
80 params.addParam<std::vector<MaterialPropertyName>>(
81 "initialize_output_values",
82 {},
83 "List of MOOSE material properties whose initial values (evaluated at the 0th time step) "
84 "will be used to initialize stateful properties. See the description of initialize_outputs "
85 "for more details.");
86
87 params.addParam<std::vector<MaterialPropertyName>>(
88 "export_outputs",
89 {},
90 "List of MOOSE material properties to export which correspond to NEML2 output variables or "
91 "output derivatives. Each material property's export targets can be specified by "
92 "export_output_targets. The default export target is 'none'.");
93 params.addParam<std::vector<std::vector<OutputName>>>(
94 "export_output_targets",
95 {},
96 "The export targets corresponding to each MOOSE material property specified in "
97 "export_outputs.");
98
99 return params;
100}
101
104{
105 auto params = NEML2ActionCommon::commonParams();
106 params.addClassDescription("Parse a NEML2 input file");
107 return params;
108}
109
registerMooseAction("MooseApp", NEML2ActionCommon, "parse_neml2")
Base class for actions.
Definition Action.h:38
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
Input parameters common to all block-restricted NEML2Actions.
static InputParameters commonParams()
Parameters that can be specified EITHER under the common area OR under sub-blocks.
static InputParameters validParams()
Parameters that can ONLY be specified under the common area.
NEML2ActionCommon(const InputParameters &)
static InputParameters actionParams()
Parameters that can be specified under the NEML2Action common area.
static InputParameters validParams()
void assertNEML2Enabled()
Assert that NEML2 is enabled.
Definition NEML2Utils.C:90