https://mooseframework.inl.gov
ProjectedStatefulMaterialStorageAction.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 // MOOSE includes
12 #include "RankFourTensorForward.h"
13 #include "RankTwoTensorForward.h"
14 #include "AddAuxVariableAction.h"
15 #include "AddVariableAction.h"
16 #include "FEProblemBase.h"
17 #include "Factory.h"
18 
19 #include "libmesh/string_to_enum.h"
20 
21 // we need to add these variables after the material property types are known
22 registerMooseAction("MooseApp",
24  "setup_projected_properties");
25 
26 registerMooseAction("MooseApp", ProjectedStatefulMaterialStorageAction, "add_aux_kernel");
27 
30 {
32 
33  params.addClassDescription("Mark material properties for projected stateful storage.");
34 
35  params.addParam<MooseEnum>(
36  "family",
37  MooseEnum("LAGRANGE MONOMIAL L2_LAGRANGE L2_HIERARCHIC", "LAGRANGE"),
38  "Finite element variable family to project the material properties onto");
39  params.addParam<MooseEnum>(
40  "order",
42  "Finite element variable order to project the material properties onto");
43 
44  // block restrictions
46 
47  params.addParam<std::vector<MaterialPropertyName>>(
48  "projected_props", {}, "Material properties to project for stateful storage");
49  return params;
50 }
51 
53  const InputParameters & params)
54  : Action(params),
55  _prop_names(getParam<std::vector<MaterialPropertyName>>("projected_props")),
56  _order(params.get<MooseEnum>("order")),
57  _fe_type({Utility::string_to_enum<Order>(_order),
58  Utility::string_to_enum<FEFamily>(params.get<MooseEnum>("family"))}),
59  _var_type(AddVariableAction::variableType(_fe_type))
60 {
61 }
62 
63 void
65  Moose::RelationshipManagerType input_rm_type)
66 {
68  addRelationshipManagers(input_rm_type, params);
69 }
70 
71 void
73 {
74  for (const auto & prop_name : _prop_names)
75  {
76  // loop over all supported property types
77  Moose::typeLoop<ProcessProperty>(SupportedTypes{}, this, prop_name);
78  }
79 }
80 
83 {
84  return getTypeEnum(SupportedTypes{});
85 }
Set up AuxKernels and AuxVariables for projected material property storage (PoMPS).
const MooseEnum _order
Variable order to project the properties into.
RelationshipManagerType
Main types of Relationship Managers.
Definition: MooseTypes.h:963
registerMooseAction("MooseApp", ProjectedStatefulMaterialStorageAction, "setup_projected_properties")
const std::vector< MaterialPropertyName > & _prop_names
Property names for which we will do stateful material property projection.
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
Definition: MooseUtils.h:1155
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Base class for actions.
Definition: Action.h:33
static InputParameters validParams()
virtual void addRelationshipManagers(Moose::RelationshipManagerType input_rm_type) override
Method to add a relationship manager for the objects being added to the system.
static InputParameters validParams()
Definition: Action.C:24
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
static std::string variableType(const libMesh::FEType &fe_type, const bool is_fv=false, const bool is_array=false)
Determines a variable type.
ProjectedStatefulMaterialStorageAction(const InputParameters &parameters)
static MooseEnum getAuxVariableOrders()
Returns available orders for AuxVariables.
static MooseEnum getTypeEnum()
get an enum with all supported types
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
Helper structure to hold a list of types.
Definition: SerialAccess.h:158