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