www.mooseframework.org
AddVariableAction.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #pragma once
11 
12 #include "MooseObjectAction.h"
13 
14 #include "libmesh/fe_type.h"
15 
20 {
21 public:
26 
27  AddVariableAction(const InputParameters & params);
28 
29  virtual void act() override;
30 
36 
42 
46  static FEType feType(const InputParameters & params);
47 
51  static std::string
52  determineType(const FEType & fe_type, unsigned int components, bool is_fv = false);
53 
60  static std::string
61  variableType(const FEType & fe_type, const bool is_fv = false, const bool is_array = false);
62 
63 protected:
67  virtual void init();
68 
74  void addVariable(const std::string & var_name);
75 
83 
88  std::set<SubdomainID> getSubdomainIDs();
89 
91  FEType _fe_type;
92 
95 
97  bool _fv_var;
98 
100  unsigned int _components;
101 
102  std::function<void(FEProblemBase &, const std::string &, const std::string &, InputParameters &)>
104 };
static InputParameters validParams()
Class constructor.
std::set< SubdomainID > getSubdomainIDs()
Get the block ids from the input parameters.
bool _scalar_var
True if the variable being created is a scalar.
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
static std::string variableType(const FEType &fe_type, const bool is_fv=false, const bool is_array=false)
Determines a variable type.
Adds nonlinear variable.
FEType _fe_type
FEType for the variable being created.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static MooseEnum getNonlinearVariableFamilies()
Get the possible variable families.
bool _fv_var
True if the variable being created is finite volume.
static MooseEnum getNonlinearVariableOrders()
Get the possible variable orders.
unsigned int _components
Number of components for an array variable.
static std::string determineType(const FEType &fe_type, unsigned int components, bool is_fv=false)
DEPRECATED: Use variableType instead.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
static FEType feType(const InputParameters &params)
determine the FEType by examining family and order in the provided parameters
virtual void init()
Initialize the action&#39;s member variables.
void addVariable(const std::string &var_name)
Adds a nonlinear variable to the system.
AddVariableAction(const InputParameters &params)
void createInitialConditionAction()
Create the action to generate the InitialCondition object.
std::function< void(FEProblemBase &, const std::string &, const std::string &, InputParameters &)> _problem_add_var_method