https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
24 "setup_projected_properties");
25
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
63void
70
71void
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
registerMooseAction("MooseApp", ProjectedStatefulMaterialStorageAction, "setup_projected_properties")
Base class for actions.
Definition Action.h:38
static InputParameters validParams()
Definition Action.C:26
static MooseEnum getAuxVariableOrders()
Returns available orders for AuxVariables.
static std::string variableType(const libMesh::FEType &fe_type, const bool is_fv=false, const bool is_array=false)
Determines a variable type.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
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.
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.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
Set up AuxKernels and AuxVariables for projected material property storage (PoMPS).
static MooseEnum getTypeEnum()
get an enum with all supported types
ProjectedStatefulMaterialStorageAction(const InputParameters &parameters)
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.
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
RelationshipManagerType
Main types of Relationship Managers.
Helper structure to hold a list of types.