Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
MooseVariableConstMonomial.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 
11 #include "SubProblem.h"
12 #include "SystemBase.h"
13 #include "Assembly.h"
14 
15 #include "libmesh/quadrature.h"
16 #include "libmesh/enum_to_string.h"
17 
19 
22 {
23  auto params = MooseVariableBase::validParams();
24  params.addClassDescription("Specialization for constant monomials that avoids unnecessary loops");
25  params.set<MooseEnum>("family") = "MONOMIAL";
26  params.set<MooseEnum>("order") = "CONSTANT";
27  return params;
28 }
29 
31  : MooseVariable(parameters)
32 {
34  mooseError("This type is only meant for a CONSTANT "
35  "MONOMIAL finite element basis. You have requested a ",
36  Utility::enum_to_string(_fe_type.family),
37  " family and order ",
38  Utility::enum_to_string(Order(_fe_type.order)));
39 }
40 
41 void
43 {
44  _element_data->setGeometry(Moose::Volume);
45  _element_data->computeMonomialValues();
46 }
47 
48 void
50 {
51  _element_data->setGeometry(Moose::Face);
52  _element_data->computeMonomialValues();
53 }
54 
55 void
57 {
58  _neighbor_data->setGeometry(Moose::Volume);
59  _neighbor_data->computeMonomialValues();
60 }
61 
62 void
64 {
65  _neighbor_data->setGeometry(Moose::Face);
66  _neighbor_data->computeMonomialValues();
67 }
static InputParameters validParams()
Order
virtual void computeElemValues() override
Actually compute variable values from the solution vectors.
MooseVariableConstMonomial(const InputParameters &parameters)
std::unique_ptr< MooseVariableData< Real > > _neighbor_data
Holder for all the data associated with the neighbor element.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
OrderWrapper order
registerMooseObject("MooseApp", MooseVariableConstMonomial)
virtual void computeNeighborValuesFace() override
Compute values at facial quadrature points for the neighbor.
CONSTANT
libMesh::FEType _fe_type
The FEType associated with this variable.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
MONOMIAL
virtual void computeNeighborValues() override
Compute values at quadrature points for the neighbor.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
std::unique_ptr< MooseVariableData< Real > > _element_data
Holder for all the data associated with the "main" element.
static InputParameters validParams()