18#include "libmesh/fe_type.h"
35 virtual void act()
override;
46 template <
typename T,
bool is_ad>
50 template <
typename T,
int I>
54 const MaterialPropertyName & prop_name)
61 template <
typename... Ts>
77template <
typename... Ts>
84template <
typename T,
bool is_ad>
91 if (!block_data.haveGenericProperty<T, is_ad>(prop_name) &&
92 !boundary_data.haveGenericProperty<T, is_ad>(prop_name))
99 std::vector<VariableName>
vars;
100 for (
const auto i : make_range(size))
106 for (
const auto & var :
vars)
110 params.set<std::vector<OutputName>>(
"outputs") = {
"none"};
116 const auto type = Registry::getClassName<InterpolatedStatefulMaterialTempl<T>>();
119 params.template set<std::vector<VariableName>>(
"old_state") =
vars;
120 params.template set<MaterialPropertyName>(
"prop_name") = prop_name;
121 _problem->addMaterial(
type,
"_mat_" + prop_name, params);
129 Registry::getClassName<ProjectedStatefulMaterialNodalPatchRecoveryTempl<T, is_ad>>();
132 params.template set<MaterialPropertyName>(
"property") = prop_name;
133 params.template set<MooseEnum>(
"patch_polynomial_order") =
_order;
135 params.template set<bool>(
"force_preaux") =
true;
136 _problem->addUserObject(
type,
"_npruo_" + prop_name, params);
143 std::vector<std::string> auxnames;
144 for (
const auto i : make_range(size))
151 const auto &
type =
"ProjectedMaterialPropertyNodalPatchRecoveryAux";
152 for (
const auto i : make_range(size))
156 params.template set<AuxVariableName>(
"variable") =
vars[i];
157 params.template set<unsigned int>(
"component") = i;
158 params.template set<UserObjectName>(
"nodal_patch_recovery_uo") =
"_npruo_" + prop_name;
166 const auto &
type = Registry::getClassName<ProjectedStatefulMaterialAuxTempl<T, is_ad>>();
167 for (
const auto i : make_range(size))
171 params.template set<AuxVariableName>(
"variable") =
vars[i];
172 params.template set<unsigned int>(
"component") = i;
173 params.template set<MaterialPropertyName>(
"prop") = prop_name;
const ExecFlagType EXEC_TIMESTEP_END
const ExecFlagType EXEC_INITIAL
bool addRelationshipManagers(Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
Method to add a relationship manager for the objects being added to the system.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
const std::string & _current_task
The current action (even though we have separate instances for each action)
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
const InputParameters & parameters() const
Get the parameters of the object.
const std::string & type() const
Get the type of this class.
const std::string & name() const
Get the name of the class.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Factory & _factory
The Factory associated with the MooseApp.
Set up AuxKernels and AuxVariables for projected material property storage (PoMPS).
static InputParameters validParams()
static MooseEnum getTypeEnum()
get an enum with all supported types
void processProperty(const MaterialPropertyName &prop_name)
FEType _fe_type
FEType for the variables to project the properties into.
const std::vector< MaterialPropertyName > & _prop_names
Property names for which we will do stateful material property projection.
const MooseEnum _order
Variable order to project the properties into.
virtual void addRelationshipManagers(Moose::RelationshipManagerType input_rm_type) override
Method to add a relationship manager for the objects being added to the system.
const std::string _var_type
MooseObject name for the underlying variable type.
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
Moose::TypeList< Real, RealVectorValue, RankTwoTensor, RankFourTensor > SupportedTypes
List of supported raw types (equivalent AD types are also supported)
std::string stringify(const T &t)
conversion to string
RelationshipManagerType
Main types of Relationship Managers.
Serial access requires object data to be stored contiguously.
Helper structure to hold a list of types.
static void apply(ProjectedStatefulMaterialStorageAction *self, const MaterialPropertyName &prop_name)