LeastSquaresVectors.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-2022 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::fv::LeastSquaresVectors
26 
27 Description
28  Least-squares gradient scheme vectors
29 
30 See also
31  Foam::fv::LeastSquaresGrad
32 
33 SourceFiles
34  LeastSquaresVectors.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef LeastSquaresVectors_H
39 #define LeastSquaresVectors_H
40 
42 #include "DemandDrivenMeshObject.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace fv
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class LeastSquaresVectors Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class Stencil>
60 :
62  <
63  fvMesh,
64  MoveableMeshObject,
65  LeastSquaresVectors<Stencil>
66  >
67 {
68  // Private Data
69 
70  //- Least-squares gradient vectors
71  List<List<vector>> vectors_;
72 
73 
74  // Private Member Functions
75 
76  //- Calculate Least-squares gradient vectors
77  void calcLeastSquaresVectors();
78 
79 
80 protected:
81 
82  friend class DemandDrivenMeshObject
83  <
84  fvMesh,
86  LeastSquaresVectors<Stencil>
87  >;
88 
89  // Protected Constructors
90 
91  //- Construct given an fvMesh and the minimum determinant criterion
93  (
94  const fvMesh&
95  );
96 
97 
98 public:
99 
100  // Declare name of the class and its debug switch
101  TypeName("LeastSquaresVectors");
102 
103 
104  //- Destructor
105  virtual ~LeastSquaresVectors();
106 
107 
108  // Member Functions
109 
110  //- Return reference to the stencil
112  {
113  return Stencil::New(this->mesh());
114  }
115 
116  //- Return reference to the least square vectors
117  const List<List<vector>>& vectors() const
118  {
119  return vectors_;
120  }
121 
122  //- Update the least square vectors when the mesh moves
123  virtual bool movePoints();
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace fv
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #ifdef NoRepository
138  #include "LeastSquaresVectors.C"
139 #endif
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Least-squares gradient scheme vectors.
virtual bool movePoints()
Update the least square vectors when the mesh moves.
const List< List< vector > > & vectors() const
Return reference to the least square vectors.
LeastSquaresVectors(const fvMesh &)
Construct given an fvMesh and the minimum determinant criterion.
virtual ~LeastSquaresVectors()
Destructor.
TypeName("LeastSquaresVectors")
const extendedCentredCellToCellStencil & stencil() const
Return reference to the stencil.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
Namespace for OpenFOAM.
labelList fv(nPoints)