LeastSquaresVectors.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2013 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 "MeshObject.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 :
61  public MeshObject<fvMesh, MoveableMeshObject, LeastSquaresVectors<Stencil> >
62 {
63  // Private data
64 
65  //- Least-squares gradient vectors
66  List<List<vector> > vectors_;
67 
68 
69  // Private Member Functions
70 
71  //- Calculate Least-squares gradient vectors
72  void calcLeastSquaresVectors();
73 
74 
75 public:
76 
77  // Declare name of the class and its debug switch
78  TypeName("LeastSquaresVectors");
79 
80 
81  // Constructors
82 
83  //- Construct given an fvMesh and the minimum determinant criterion
85  (
86  const fvMesh&
87  );
88 
89 
90  //- Destructor
91  virtual ~LeastSquaresVectors();
92 
93 
94  // Member functions
95 
96  //- Return reference to the stencil
98  {
99  return Stencil::New(this->mesh_);
100  }
101 
102  //- Return reference to the least square vectors
103  const List<List<vector> >& vectors() const
104  {
105  return vectors_;
106  }
107 
108  //- Update the least square vectors when the mesh moves
109  virtual bool movePoints();
110 };
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace fv
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #ifdef NoRepository
124 # include "LeastSquaresVectors.C"
125 #endif
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #endif
130 
131 // ************************************************************************* //
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const extendedCentredCellToCellStencil & stencil() const
Return reference to the stencil.
TypeName("LeastSquaresVectors")
Namespace for OpenFOAM.
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
virtual ~LeastSquaresVectors()
Destructor.
const List< List< vector > > & vectors() const
Return reference to the least square vectors.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:81
Least-squares gradient scheme vectors.
labelList fv(nPoints)
LeastSquaresVectors(const fvMesh &)
Construct given an fvMesh and the minimum determinant criterion.
virtual bool movePoints()
Update the least square vectors when the mesh moves.