https://mooseframework.inl.gov
AddAuxVariableAction.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 #include "AddAuxVariableAction.h"
11 #include "FEProblem.h"
12 
13 registerMooseAction("MooseApp", AddAuxVariableAction, "add_aux_variable");
14 
17 {
19  params.addClassDescription("Add auxiliary variable to the simulation.");
20  return params;
21 }
22 
24  : AddVariableAction(params)
25 {
26 }
27 
30 {
31  return MooseEnum("LAGRANGE MONOMIAL SCALAR LAGRANGE_VEC MONOMIAL_VEC L2_HIERARCHIC "
32  "L2_HIERARCHIC_VEC L2_LAGRANGE L2_LAGRANGE_VEC L2_RAVIART_THOMAS",
33  "LAGRANGE",
34  true);
35 }
36 
39 {
40  return MooseEnum(
41  "CONSTANT FIRST SECOND THIRD FOURTH FIFTH SIXTH SEVENTH EIGHTH NINTH", "FIRST", true);
42 }
43 
44 void
46 {
48 
50  mooseError("Non-scalar AuxVariables must be CONSTANT, FIRST, SECOND, THIRD, FOURTH, FIFTH, "
51  "SIXTH, SEVENTH, EIGHTH or NINTH order (",
53  " supplied)");
54 
55  // Need static_cast to resolve overloads
56  _problem_add_var_method = static_cast<void (FEProblemBase::*)(
57  const std::string &, const std::string &, InputParameters &)>(&FEProblemBase::addAuxVariable);
58 }
static InputParameters validParams()
bool _scalar_var
True if the variable being created is a scalar.
Adds nonlinear variable.
AddAuxVariableAction(const InputParameters &params)
void init() override
Initialize the action&#39;s member variables.
static MooseEnum getAuxVariableFamilies()
Returns available families for AuxVariables.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
OrderWrapper order
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
Canonical method for adding an auxiliary variable.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
libMesh::FEType _fe_type
FEType for the variable being created.
Action for creating Auxiliary variables.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
static MooseEnum getAuxVariableOrders()
Returns available orders for AuxVariables.
virtual void init()
Initialize the action&#39;s member variables.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
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...
static InputParameters validParams()
registerMooseAction("MooseApp", AddAuxVariableAction, "add_aux_variable")
std::function< void(FEProblemBase &, const std::string &, const std::string &, InputParameters &)> _problem_add_var_method