CentredFitSnGradData.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::CentredFitSnGradData
26 
27 Description
28  Data for centred fit snGrad schemes
29 
30 SourceFiles
31  CentredFitSnGradData.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef CentredFitSnGradData_H
36 #define CentredFitSnGradData_H
37 
38 #include "FitData.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 class extendedCentredCellToFaceStencil;
46 
47 /*---------------------------------------------------------------------------*\
48  Class CentredFitSnGradData Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Polynomial>
53 :
54  public FitData
55  <
56  CentredFitSnGradData<Polynomial>,
57  extendedCentredCellToFaceStencil,
58  Polynomial
59  >
60 {
61  // Private Data
62 
63  //- For each cell in the mesh store the values which multiply the
64  // values of the stencil to obtain the gradient for each direction
65  List<scalarList> coeffs_;
66 
67 
68 public:
69 
70  TypeName("CentredFitSnGradData");
71 
72 
73  // Constructors
74 
75  //- Construct from components
77  (
78  const fvMesh& mesh,
80  const scalar linearLimitFactor,
81  const scalar centralWeight
82  );
83 
84 
85  //- Destructor
86  virtual ~CentredFitSnGradData()
87  {}
88 
89 
90  // Member Functions
91 
92  //- Return reference to fit coefficients
93  const List<scalarList>& coeffs() const
94  {
95  return coeffs_;
96  }
97 
98  //- Calculate the fit for the specified face and set the coefficients
99  void calcFit
100  (
101  scalarList& coeffsi, // coefficients to be set
102  const List<point>&, // Stencil points
103  const scalar wLin, // Weight for linear approximation (weights
104  // nearest neighbours)
105  const scalar deltaCoeff, // uncorrected delta coefficient
106  const label faci // Current face index
107  );
108 
109  void calcFit();
110 };
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #ifdef NoRepository
120  #include "CentredFitSnGradData.C"
121 #endif
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const List< scalarList > & coeffs() const
Return reference to fit coefficients.
CentredFitSnGradData(const fvMesh &mesh, const extendedCentredCellToFaceStencil &stencil, const scalar linearLimitFactor, const scalar centralWeight)
Construct from components.
const extendedCentredCellToFaceStencil & stencil() const
Return reference to the stencil.
Definition: FitData.H:116
TypeName("CentredFitSnGradData")
void calcFit()
Calculate the fit for all the faces.
scalar linearLimitFactor() const
Factor the fit is allowed to deviate from the base scheme.
Definition: FitData.H:122
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Data for centred fit snGrad schemes.
Data for the upwinded and centred polynomial fit interpolation schemes. The linearCorrection_ determi...
Definition: FitData.H:54
virtual ~CentredFitSnGradData()
Destructor.
Namespace for OpenFOAM.