31 "Makes sure that the correct nodal and/or qp materials are added for each property");
50 for (
auto & action : actions)
60 const std::string pf_material_type = pars.
get<std::string>(
"pf_material_type");
64 if (pf_material_type !=
"joiner")
75 bool qp_material_required =
false;
80 const bool at_nodes =
true;
86 pars.
set<
bool>(
"at_nodes") = !at_nodes;
87 qp_material_required =
true;
98 if (!qp_material_required)
99 pars.
set<
bool>(
"at_nodes") = at_nodes;
114 for (
auto & kernel : kernels)
119 for (
auto & action : actions)
124 for (
auto & auxkernel : auxkernels)
129 for (
auto & postprocessor : postprocessors)
134 for (
auto & userobject : userobjects)
139 for (
auto & bc : bcs)
144 for (
auto & dirac : diracs)
151 const std::string nodal_ext = at_nodes ?
"_nodal" :
"_qp";
154 bool required =
false;
168 bool is_present =
false;
174 if (ama_material->name() != material->
name() &&
178 const bool mat_at_nodes = mat_params.
get<
bool>(
"at_nodes");
184 if (mat_at_nodes == at_nodes && !pars.isParamValid(
"phase"))
190 if (pars.isParamValid(
"phase"))
192 const unsigned int phase = pars.
get<
unsigned int>(
"phase");
194 if (mat_params.
isParamValid(
"phase") && mat_params.
get<
unsigned int>(
"phase") == phase)
200 if (mat_params.
get<std::vector<SubdomainName>>(
"block") !=
201 pars.get<std::vector<SubdomainName>>(
"block"))
212 const std::string nodal_ext = at_nodes ?
"_nodal" :
"_qp";
218 const std::string pf_material_type = pars.
get<std::string>(
"pf_material_type");
222 std::string phase_str;
225 unsigned int phase = pars.
get<
unsigned int>(
"phase");
234 action_params.
set<std::string>(
"type") = moose_object_type;
236 const std::string material_name = material->
name() + phase_str + nodal_ext;
242 action->getObjectParams().set<
bool>(
"at_nodes") = at_nodes;
bool isPFMaterialPresent(AddMaterialAction *material, bool at_nodes)
Check to see if the material with a given at_nodes parameter has already been included in the input f...
void addPFMaterial(AddMaterialAction *material, bool at_nodes)
Adds the material for the given at_nodes parameter.
PorousFlowAddMaterialAction(const InputParameters ¶ms)
InputParameters getValidParams(const std::string &name)
bool dependsOn(const std::string &key, const std::string &value)
void addActionBlock(std::shared_ptr< Action > blk)
bool isPFMaterialRequired(std::string pf_material_type, bool at_nodes)
Check to see if the material with a given at_nodes parameter is required.
virtual const std::string & name() const
virtual void act() override
static InputParameters validParams()
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters ¶meters)
std::set< std::string > _dependency_list
List of kernels, actions etc that may depend on PorousFlow materials.
static InputParameters validParams()
InputParameters & getObjectParams()
Base class for PorousFlow actions.
ActionFactory & _action_factory
std::string stringify(const T &t)
const std::string & getMooseObjectType() const
Holds the PorousFlow dependencies of kernels, auxkernels, materials, etc.
Action to automatically ensure that PorousFlowMaterials are correctly evaluated at either the qps...
std::vector< AddMaterialAction * > _ama_materials
List of all materials added in the input file by AddMaterialAction.
std::vector< const T *> getActions()
registerMooseAction("PorousFlowApp", PorousFlowAddMaterialAction, "meta_action")
void createDependencyList()
Creates a set of all actions, kernels, etc to check material dependency against in order to determine...
DependencyResolver< std::string > _deps
All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.