www.mooseframework.org
SetupQuadratureAction.C
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 #include "SetupQuadratureAction.h"
11 #include "Conversion.h"
12 #include "FEProblem.h"
13 #include "MooseEnum.h"
14 
15 registerMooseAction("MooseApp", SetupQuadratureAction, "setup_quadrature");
16 
17 template <>
20 {
21  MooseEnum types("CLOUGH CONICAL GAUSS GRID MONOMIAL SIMPSON TRAP GAUSS_LOBATTO", "GAUSS");
22  MooseEnum order("AUTO CONSTANT FIRST SECOND THIRD FOURTH FIFTH SIXTH SEVENTH EIGHTH NINTH TENTH "
23  "ELEVENTH TWELFTH THIRTEENTH FOURTEENTH FIFTEENTH SIXTEENTH SEVENTEENTH "
24  "EIGHTTEENTH NINTEENTH TWENTIETH",
25  "AUTO");
26 
28 
29  params.addParam<MooseEnum>("type", types, "Type of the quadrature rule");
30  params.addParam<MooseEnum>("order", order, "Order of the quadrature");
31  params.addParam<MooseEnum>("element_order", order, "Order of the quadrature for elements");
32  params.addParam<MooseEnum>("side_order", order, "Order of the quadrature for sides");
33 
34  return params;
35 }
36 
38  : Action(parameters),
39  _type(Moose::stringToEnum<QuadratureType>(getParam<MooseEnum>("type"))),
40  _order(Moose::stringToEnum<Order>(getParam<MooseEnum>("order"))),
41  _element_order(Moose::stringToEnum<Order>(getParam<MooseEnum>("element_order"))),
42  _side_order(Moose::stringToEnum<Order>(getParam<MooseEnum>("side_order")))
43 {
44 }
45 
46 void
48 {
49  if (_problem.get() != NULL)
51 }
Sets the quadrature.
T stringToEnum(const std::string &s)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
SetupQuadratureAction(InputParameters parameters)
registerMooseAction("MooseApp", SetupQuadratureAction, "setup_quadrature")
Base class for actions.
Definition: Action.h:35
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition: Action.h:216
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
Definition: Moose.h:112
InputParameters validParams< SetupQuadratureAction >()
InputParameters validParams< Action >()
Definition: Action.C:22