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
12#include "MooseTypes.h"
13
14#include <memory>
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<std::unique_ptr<libMesh::NumericVector<libMesh::Number>>>;
37
47 unsigned int variable_number);
48
50 const GradientContainer & components() const { return _components; }
51
53 const SystemBase & system() const { return _sys; }
54
56 const FVGradientMethod & method() const { return _method; }
57
63 Real component(const ElemInfo & elem_info, unsigned int index) const;
64
69 RealVectorValue gradient(const ElemInfo & elem_info) const;
70
75 RealVectorValue gradient(const FaceInfo & fi) const;
76
77private:
80
82 const unsigned int _system_number;
83
86
89
91 const unsigned int _variable_number;
92};
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.
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.
const GradientContainer & _components
Component vectors keyed by spatial direction.
const FVGradientMethod & _method
Method object that produces the stored values.
const SystemBase & system() const
System whose DOF map indexes the stored values.
std::vector< std::unique_ptr< 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).
const GradientContainer & components() const
Access the underlying component vectors keyed by spatial direction.
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...