16 params.addRequiredParam<std::string>(
28 : _mode(Mode::UNDEFINED), _raw_name(params.
get<
std::string>(
"to_neml2"))
43 mooseError(
"Encountered invalid Mode in MOOSEToNEML2::setMode");
57 const neml2::VariableName &
61 "Mode must be VARIABLE or OLD_VARIABLE when calling NEML2Variable");
74 std::map<std::string, neml2::Tensor> & params)
const 81 mooseError(
"Encountered invalid Mode in MOOSEToNEML2::insertInto");
neml2::VariableName _neml2_variable
NEML2 input variable to transfer data to.
void insertInto(neml2::ValueMap &, std::map< std::string, neml2::Tensor > &) const
Insert the gathered data into the NEML2 material model.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
void assertOldVariable(const neml2::VariableName &)
Assert that the NEML2 variable name sits on either the old_forces or the old_state subaxis...
Mode _mode
Whether we should insert into NEML2 input variable or NEML2 model parameter.
void setMode(Mode) const
Change the mode of operation.
MOOSEToNEML2(const InputParameters ¶ms)
std::string docstring(const std::string &desc)
Augment docstring if NEML2 is not enabled.
const neml2::VariableName & NEML2VariableName() const
Name of the NEML2 input variable (only meaningful when _mode == VARIABLE)
virtual neml2::Tensor gatheredData() const =0
Convert data gathered from MOOSE into neml2::Tensor.
void assertNEML2Enabled()
Assert that NEML2 is enabled.
void assertVariable(const neml2::VariableName &)
Assert that the NEML2 variable name sits on either the forces or the state subaxis.
static InputParameters validParams()
const std::string & NEML2ParameterName() const
Name of the NEML2 parameter (only meaningful when _mode == PARAMETER)
virtual void checkMode() const
Perform error checking after _mode has been set.
std::string _neml2_parameter
NEML2 parameter to transfer data to.
neml2::VariableName parseVariableName(const std::string &)
Parse a raw string into NEML2 variable name.
const std::string _raw_name
Raw name of the input variable or model parameter.