37 std::shared_ptr<neml2::Model>
38 getModel(neml2::Factory & factory,
const std::string & name, neml2::Dtype dtype)
40 const auto prev_dtype = neml2::get_default_dtype();
41 neml2::set_default_dtype(dtype);
42 auto model = factory.get_model(
name);
44 neml2::set_default_dtype(prev_dtype);
47 #endif // NEML2_ENABLED 49 static const std::string
missing_neml2 =
"The `NEML2` library is required but not enabled. Refer " 50 "to the documentation for guidance on how to enable it.";
74 return missing_neml2 +
" (Original description: " + desc +
")";
std::string name(const ElemQuality q)
virtual bool computingScalingJacobian() const =0
Getter for whether we're computing the scaling jacobian.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
bool shouldCompute(const SubProblem &)
Determine whether the NEML2 material model should be evaluated.
const bool & currentlyComputingResidualAndJacobian() const
Returns true if the problem is in the process of computing the residual and the Jacobian.
std::string stringify(MOOSEIOType type)
std::string docstring(const std::string &desc)
Augment docstring if NEML2 is not enabled.
void assertNEML2Enabled()
Assert that NEML2 is enabled.
std::shared_ptr< neml2::Model > getModel(neml2::Factory &factory, const std::string &name, neml2::Dtype dtype=neml2::kFloat64)
Get the NEML2 Model.
Generic class for solving transient nonlinear problems.
const bool & currentlyComputingJacobian() const
Returns true if the problem is in the process of computing the Jacobian.
static const std::string missing_neml2