Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
MooseVariableFieldBase.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 "MooseVariableBase.h"
13 
14 namespace libMesh
15 {
16 template <typename>
17 class DenseVector;
18 template <typename>
19 class NumericVector;
20 class Point;
21 }
22 
23 class FaceInfo;
24 
30 {
31 public:
33 
35 
40  virtual void clearDofIndices() = 0;
41 
45  virtual void prepare() = 0;
46 
50  virtual void prepareNeighbor() = 0;
51 
55  virtual void prepareLowerD() = 0;
56 
57  virtual void prepareAux() = 0;
58 
59  virtual void reinitNode() = 0;
60  virtual void reinitAux() = 0;
61  virtual void reinitAuxNeighbor() = 0;
62 
63  virtual void reinitNodes(const std::vector<dof_id_type> & nodes) = 0;
64  virtual void reinitNodesNeighbor(const std::vector<dof_id_type> & nodes) = 0;
65 
69  virtual Moose::VarFieldType fieldType() const = 0;
70 
74  virtual bool isArray() const = 0;
75 
79  std::string componentName(const unsigned int comp) const;
80 
84  virtual bool isVector() const = 0;
85 
86  virtual bool isFV() const { return false; }
87 
92  virtual bool isNodalDefined() const = 0;
93 
94  virtual const dof_id_type & nodalDofIndex() const = 0;
95  virtual const dof_id_type & nodalDofIndexNeighbor() const = 0;
96 
100  virtual const Elem * const & currentElem() const = 0;
101 
105  const std::set<SubdomainID> & activeSubdomains() const;
106 
112  bool activeOnSubdomain(SubdomainID subdomain) const;
113 
119  bool activeOnSubdomains(const std::set<SubdomainID> & subdomains) const;
120 
125  virtual bool needsGradientVectorStorage() const { return false; }
126 
130  virtual void prepareIC() = 0;
131 
136  virtual void computeFaceValues(const FaceInfo & /*fi*/) { mooseError("not implemented"); }
137 
141  virtual void computeElemValues() = 0;
145  virtual void computeElemValuesFace() = 0;
149  virtual void computeNeighborValuesFace() = 0;
153  virtual void computeNeighborValues() = 0;
157  virtual void computeLowerDValues() = 0;
161  virtual void computeNodalNeighborValues() = 0;
165  virtual void computeNodalValues() = 0;
166 
171  virtual const std::vector<dof_id_type> & dofIndicesNeighbor() const = 0;
172 
178  virtual const std::vector<dof_id_type> & dofIndicesLower() const = 0;
179 
180  virtual unsigned int numberOfDofsNeighbor() = 0;
181 
185  virtual void insert(libMesh::NumericVector<libMesh::Number> & vector) = 0;
186 
191  virtual void insertLower(libMesh::NumericVector<libMesh::Number> & vector) = 0;
192 
196  virtual void add(libMesh::NumericVector<libMesh::Number> & vector) = 0;
197 
201  virtual std::size_t phiSize() const = 0;
205  virtual std::size_t phiFaceSize() const = 0;
209  virtual std::size_t phiNeighborSize() const = 0;
213  virtual std::size_t phiFaceNeighborSize() const = 0;
217  virtual std::size_t phiLowerSize() const = 0;
218 
223  virtual unsigned int oldestSolutionStateRequested() const = 0;
224 };
225 
226 #define usingMooseVariableFieldBaseMembers usingMooseVariableBaseMembers
virtual unsigned int numberOfDofsNeighbor()=0
VarFieldType
Definition: MooseTypes.h:715
virtual void clearDofIndices()=0
Clear out the dof indices.
static InputParameters validParams()
virtual bool needsGradientVectorStorage() const
Check if this variable needs a raw vector of gradients at dof-values.
virtual void prepareNeighbor()=0
Prepare the neighbor element degrees of freedom.
virtual void reinitAuxNeighbor()=0
virtual void computeNodalValues()=0
Compute nodal values of this variable.
virtual void computeNeighborValuesFace()=0
Compute values at facial quadrature points for the neighbor.
virtual std::size_t phiLowerSize() const =0
Return the number of shape functions on the lower dimensional element for this variable.
virtual bool isFV() const
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void prepareIC()=0
Prepare the initial condition.
virtual void reinitAux()=0
This class provides an interface for common operations on field variables of both FE and FV types wit...
virtual const dof_id_type & nodalDofIndex() const =0
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
virtual bool isArray() const =0
virtual void computeFaceValues(const FaceInfo &)
Compute values at face quadrature points for the element+neighbor (both sides of the face)...
virtual bool isVector() const =0
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:36
virtual void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes)=0
virtual std::size_t phiFaceNeighborSize() const =0
Return phiFaceNeighbor size.
virtual const std::vector< dof_id_type > & dofIndicesNeighbor() const =0
Get neighbor DOF indices for currently selected element.
bool activeOnSubdomains(const std::set< SubdomainID > &subdomains) const
Is the variable active on the subdomains?
virtual std::size_t phiFaceSize() const =0
Return phiFace size.
virtual void computeLowerDValues()=0
compute values at quadrature points on the lower dimensional element
virtual void add(libMesh::NumericVector< libMesh::Number > &vector)=0
Add the currently cached degree of freedom values into the provided vector.
virtual void reinitNodes(const std::vector< dof_id_type > &nodes)=0
virtual void reinitNode()=0
virtual std::size_t phiNeighborSize() const =0
Return phiNeighbor size.
virtual const Elem *const & currentElem() const =0
Current element this variable is evaluated at.
virtual void prepare()=0
Prepare the elemental degrees of freedom.
virtual unsigned int oldestSolutionStateRequested() const =0
The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc).
virtual void insert(libMesh::NumericVector< libMesh::Number > &vector)=0
Insert the currently cached degree of freedom values into the provided vector.
virtual void insertLower(libMesh::NumericVector< libMesh::Number > &vector)=0
Insert the currently cached degree of freedom values for a lower-dimensional element into the provide...
MooseVariableFieldBase(const InputParameters &parameters)
virtual bool isNodalDefined() const =0
Is this variable defined at nodes.
virtual void computeElemValues()=0
Compute values at interior quadrature points.
std::string componentName(const unsigned int comp) const
Get the variable name of a component in libMesh.
const std::set< SubdomainID > & activeSubdomains() const
The subdomains the variable is active on.
virtual void computeElemValuesFace()=0
Compute values at facial quadrature points.
virtual void prepareAux()=0
virtual void computeNeighborValues()=0
Compute values at quadrature points for the neighbor.
virtual Moose::VarFieldType fieldType() const =0
Filed type of this variable.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
virtual std::size_t phiSize() const =0
Return phi size.
const InputParameters & parameters() const
Get the parameters of the object.
bool activeOnSubdomain(SubdomainID subdomain) const
Is the variable active on the subdomain?
virtual void computeNodalNeighborValues()=0
Compute nodal values of this variable in the neighbor.
virtual const std::vector< dof_id_type > & dofIndicesLower() const =0
Get dof indices for the current lower dimensional element (this is meaningful when performing mortar ...
virtual const dof_id_type & nodalDofIndexNeighbor() const =0
virtual void prepareLowerD()=0
Prepare a lower dimensional element&#39;s degrees of freedom.
uint8_t dof_id_type