https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AddVariableAction.h
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#pragma once
11
12#include "MooseObjectAction.h"
13
14#include "libmesh/fe_type.h"
15
20{
21public:
23
24 AddVariableAction(const InputParameters & params);
25
26 virtual void act() override;
27
33
39
43 static libMesh::FEType feType(const InputParameters & params);
44
48 static std::string
49 determineType(const libMesh::FEType & fe_type, unsigned int components, bool is_fv = false);
50
57 static std::string variableType(const libMesh::FEType & fe_type,
58 const bool is_fv = false,
59 const bool is_array = false);
60
61protected:
65 virtual void init();
66
72 void addVariable(const std::string & var_name);
73
77 virtual std::string varName() const { return _name; }
78
85 void createInitialConditionAction(const std::vector<Real> & value);
86
91 std::set<SubdomainID> getSubdomainIDs();
92
95
98
101
103 unsigned int _components;
104
105 std::function<void(FEProblemBase &, const std::string &, const std::string &, InputParameters &)>
107};
Adds nonlinear variable.
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
void createInitialConditionAction(const std::vector< Real > &value)
Create the action to generate the InitialCondition object.
static MooseEnum getNonlinearVariableFamilies()
Get the possible variable families.
std::function< void(FEProblemBase &, const std::string &, const std::string &, InputParameters &)> _problem_add_var_method
libMesh::FEType _fe_type
FEType for the variable being created.
static libMesh::FEType feType(const InputParameters &params)
determine the FEType by examining family and order in the provided parameters
static MooseEnum getNonlinearVariableOrders()
Get the possible variable orders.
static std::string determineType(const libMesh::FEType &fe_type, unsigned int components, bool is_fv=false)
DEPRECATED: Use variableType instead.
static std::string variableType(const libMesh::FEType &fe_type, const bool is_fv=false, const bool is_array=false)
Determines a variable type.
unsigned int _components
Number of components for an array variable.
virtual std::string varName() const
Return the name of the nonlinear variable to be created.
std::set< SubdomainID > getSubdomainIDs()
Get the block ids from the input parameters.
bool _fv_var
True if the variable being created is finite volume.
static InputParameters validParams()
bool _scalar_var
True if the variable being created is a scalar.
virtual void init()
Initialize the action's member variables.
void addVariable(const std::string &var_name)
Adds a nonlinear variable to the system.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const std::string & _name
The name of this class.
Definition MooseBase.h:381
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55