https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LinearFVGradientReader.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
13#include "MooseTypes.h"
14
15#include <string>
16#include <vector>
17
18class SystemBase;
19class ElemInfo;
20class FaceInfo;
22
23namespace libMesh
24{
25template <typename T>
26class NumericVector;
27}
28
33{
34public:
36 using GradientContainer = std::vector<libMesh::NumericVector<libMesh::Number> *>;
37
39 using GradientStateContainer = std::vector<GradientContainer>;
40
48 const GradientStateContainer & state_values,
50 unsigned int variable_number);
51
53 const GradientContainer & components() const;
54
59 const GradientContainer & components(const Moose::StateArg & state) const;
60
62 const SystemBase & system() const { return _sys; }
63
65 const FVGradientMethod & method() const { return _method; }
66
72 Real component(const ElemInfo & elem_info, unsigned int index) const;
73
80 Real
81 component(const ElemInfo & elem_info, unsigned int index, const Moose::StateArg & state) const;
82
87 RealVectorValue gradient(const ElemInfo & elem_info) const;
88
94 RealVectorValue gradient(const ElemInfo & elem_info, const Moose::StateArg & state) const;
95
100 RealVectorValue gradient(const FaceInfo & fi) const;
101
107 RealVectorValue gradient(const FaceInfo & fi, const Moose::StateArg & state) const;
108
109private:
111 const GradientContainer & stateComponents(const Moose::StateArg & state) const;
112
115
117 const unsigned int _system_number;
118
121
124
126 const unsigned int _variable_number;
127};
Class used for caching additional information for elements such as the volume and centroid.
Definition ElemInfo.h:26
Base class for linear finite-volume cell-gradient methods.
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
Read-only view of one variable's cell-centered linear finite-volume gradient values.
const GradientContainer & stateComponents(const Moose::StateArg &state) const
Validate and select the component vectors for a solution state.
const GradientContainer & components() const
Access the underlying component vectors keyed by spatial direction.
const GradientStateContainer & _state_values
Gradient fields indexed by solution time state.
Real component(const ElemInfo &elem_info, unsigned int index) const
Read one gradient component at an element.
const FVGradientMethod & method() const
Method object that produces the stored values.
std::vector< GradientContainer > GradientStateContainer
Gradient fields indexed by solution time state.
const FVGradientMethod & _method
Method object that produces the stored values.
const SystemBase & system() const
System whose DOF map indexes the stored values.
std::vector< libMesh::NumericVector< libMesh::Number > * > GradientContainer
One vector per spatial component of the cell-centered gradient.
RealVectorValue gradient(const ElemInfo &elem_info) const
Read the full gradient at an element.
const SystemBase & _sys
System the variable belongs to.
const unsigned int _variable_number
Variable number whose gradients are read by this object.
const unsigned int _system_number
System number cached for hot lookups (from faces to dofs).
Base class for a system (of equations)
Definition SystemBase.h:87
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
State argument for evaluating functors.