15 #include "neml2/models/Model.h" 34 virtual void act()
override;
82 const neml2::TensorType &
type)
const;
91 std::shared_ptr<neml2::Model>
_model;
129 template <
typename EnumType,
typename T>
131 std::tuple<std::vector<EnumType>, std::vector<T>>
134 const auto moose_types = getParam<MultiMooseEnum>(source_opt).getSetValueIDs<EnumType>();
135 const auto neml2_names = getParam<std::vector<T>>(name_opt);
137 if (moose_types.size() != neml2_names.size())
138 paramError(source_opt, source_opt,
" must have the same length as ", name_opt);
140 return {moose_types, neml2_names};
std::vector< DerivativeMapping > _param_derivs
MOOSE-NEML2 parameter derivative mappings.
std::vector< std::string > _cli_args
List of cli-args.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
std::size_t history_order
const FileName & fname() const
std::vector< DerivativeMapping > _derivs
MOOSE-NEML2 derivative mappings.
std::map< MaterialPropertyName, std::vector< OutputName > > _export_output_targets
Material property additional outputs.
Action to set up NEML2 objects.
Input parameters common to all block-restricted NEML2Actions.
void setupParameterDerivativeMappings(const neml2::Model &)
Set up MOOSE-NEML2 parameter derivative mappings.
NEML2Utils::MOOSEIOType moose_type
neml2::TensorType neml2_type
const std::vector< SubdomainName > _block
Blocks this sub-block action applies to.
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
const UserObjectName _executor_name
Name of the NEML2Executor user object.
const std::string & name() const
Get the name of the class.
std::shared_ptr< neml2::Model > _model
The neml2 model.
void printSummary() const
Print a summary of the NEML2 model.
const std::string & type() const
Get the type of this class.
std::map< MaterialPropertyName, MaterialPropertyName > _initialize_output_values
Material property initial conditions.
void setupParameterMappings(const neml2::Model &)
Set up MOOSE-NEML2 model parameter mappings.
FileName _fname
Name of the NEML2 input file.
const NEML2ActionCommon & getCommonAction() const
NEML2Action(const InputParameters &)
NEML2Utils::MOOSEIOType inferMOOSEIOType(const neml2::VariableName &name, const neml2::TensorType &type) const
Infer the MOOSE IO type from the variable name and type.
NEML2Utils::MOOSEIOType moose_type
void setupInputMappings(const neml2::Model &)
Set up MOOSE-NEML2 input variable mappings.
neml2::TensorType neml2_type
void setupDerivativeMappings(const neml2::Model &)
Set up MOOSE-NEML2 derivative mappings.
static InputParameters validParams()
std::vector< std::string > _skip_input_variables
Input variables to skip (i.e., not to set up mappings for)
void setupOutputMappings(const neml2::Model &)
Set up MOOSE-NEML2 output variable mappings.
const UserObjectName _idx_generator_name
Name of the NEML2BatchIndexGenerator user object.
std::size_t getLongestMOOSEName() const
Get the maximum length of all MOOSE names (for printing purposes)
std::vector< VariableMapping > _outputs
MOOSE-NEML2 output variable mappings.
std::vector< ParameterMapping > _params
MOOSE-NEML2 model parameter mappings.
std::vector< VariableMapping > _inputs
MOOSE-NEML2 input variable mappings.
std::tuple< std::vector< EnumType >, std::vector< T > > getInputParameterMapping(const std::string &source_opt, const std::string &name_opt) const
Get parameter lists for mapping between MOOSE and NEML2 quantities.