https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
33 if (_fe_type.order != CONSTANT || _fe_type.family != MONOMIAL)
34 mooseError("This type is only meant for a CONSTANT "
35 "MONOMIAL finite element basis. You have requested a ",
37 " family and order ",
39}
40
41void
43{
44 _element_data->setGeometry(Moose::Volume);
45 _element_data->computeConstantMonomialValues();
46}
47
48void
50{
51 _element_data->setGeometry(Moose::Face);
52 _element_data->computeConstantMonomialValues();
53}
54
55void
57{
58 _neighbor_data->setGeometry(Moose::Volume);
59 _neighbor_data->computeConstantMonomialValues();
60}
61
62void
64{
65 _neighbor_data->setGeometry(Moose::Face);
66 _neighbor_data->computeConstantMonomialValues();
67}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
registerMooseObject("MooseApp", MooseVariableConstMonomial)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
libMesh::FEType _fe_type
The FEType associated with this variable.
static InputParameters validParams()
virtual void computeNeighborValuesFace() override
Compute values at facial quadrature points for the neighbor.
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
virtual void computeElemValues() override
Actually compute variable values from the solution vectors.
static InputParameters validParams()
MooseVariableConstMonomial(const InputParameters &parameters)
virtual void computeNeighborValues() override
Compute values at quadrature points for the neighbor.
std::unique_ptr< MooseVariableData< Real > > _element_data
Holder for all the data associated with the "main" element.
std::unique_ptr< MooseVariableData< Real > > _neighbor_data
Holder for all the data associated with the neighbor element.
OrderWrapper order
std::string enum_to_string(const T e)