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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fv::LeastSquaresVectors
28 
29 Description
30  Least-squares gradient scheme vectors
31 
32 See also
33  Foam::fv::LeastSquaresGrad
34 
35 SourceFiles
36  LeastSquaresVectors.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef LeastSquaresVectors_H
41 #define LeastSquaresVectors_H
42 
44 #include "MeshObject.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace fv
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class LeastSquaresVectors Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class Stencil>
62 :
63  public MeshObject<fvMesh, MoveableMeshObject, LeastSquaresVectors<Stencil>>
64 {
65  // Private data
66 
67  //- Least-squares gradient vectors
68  List<List<vector>> vectors_;
69 
70 
71  // Private Member Functions
72 
73  //- Calculate Least-squares gradient vectors
74  void calcLeastSquaresVectors();
75 
76 
77 public:
78 
79  // Declare name of the class and its debug switch
80  TypeName("LeastSquaresVectors");
81 
82 
83  // Constructors
84 
85  //- Construct given an fvMesh and the minimum determinant criterion
87  (
88  const fvMesh&
89  );
90 
91 
92  //- Destructor
93  virtual ~LeastSquaresVectors();
94 
95 
96  // Member functions
97 
98  //- Return reference to the stencil
100  {
101  return Stencil::New(this->mesh_);
102  }
103 
104  //- Return reference to the least square vectors
105  const List<List<vector>>& vectors() const
106  {
107  return vectors_;
108  }
109 
110  //- Update the least square vectors when the mesh moves
111  virtual bool movePoints();
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace fv
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #ifdef NoRepository
126  #include "LeastSquaresVectors.C"
127 #endif
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
Foam::fv::LeastSquaresVectors::TypeName
TypeName("LeastSquaresVectors")
Foam::fv::LeastSquaresVectors::vectors
const List< List< vector > > & vectors() const
Return reference to the least square vectors.
Definition: LeastSquaresVectors.H:104
Foam::fv::LeastSquaresVectors::movePoints
virtual bool movePoints()
Update the least square vectors when the mesh moves.
Definition: LeastSquaresVectors.C:105
Foam::MeshObject::New
static const Type & New(const Mesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
Definition: MeshObject.C:48
Foam::extendedCentredCellToCellStencil
Definition: extendedCentredCellToCellStencil.H:52
Foam::fv::LeastSquaresVectors::~LeastSquaresVectors
virtual ~LeastSquaresVectors()
Destructor.
Definition: LeastSquaresVectors.C:49
extendedCentredCellToCellStencil.H
Foam::fv::LeastSquaresVectors::stencil
const extendedCentredCellToCellStencil & stencil() const
Return reference to the stencil.
Definition: LeastSquaresVectors.H:98
Foam::MeshObject< fvMesh, MoveableMeshObject, LeastSquaresVectors< Stencil > >::mesh_
const fvMesh & mesh_
Definition: MeshObject.H:96
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fv
labelList fv(nPoints)
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
MeshObject.H
LeastSquaresVectors.C
Foam::MeshObject
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:88
Foam::fv::LeastSquaresVectors
Least-squares gradient scheme vectors.
Definition: LeastSquaresVectors.H:60
Foam::fv::LeastSquaresVectors::LeastSquaresVectors
LeastSquaresVectors(const fvMesh &)
Construct given an fvMesh and the minimum determinant criterion.
Definition: LeastSquaresVectors.C:35