Loading...
Searching...
No Matches
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 Typedefs
67
68 typedef MeshObject
69 <
70 fvMesh,
73 > MeshObject_type;
74
75
76 // Private Data
77
78 //- Least-squares gradient vectors
79 List<List<vector>> vectors_;
80
81
82 // Private Member Functions
83
84 //- Calculate Least-squares gradient vectors
85 void calcLeastSquaresVectors();
86
87
88public:
89
90 // Declare name of the class and its debug switch
91 TypeName("LeastSquaresVectors");
92
93
94 // Constructors
95
96 //- Construct given an fvMesh and the minimum determinant criterion
97 explicit LeastSquaresVectors(const fvMesh& mesh);
99
100 //- Destructor
101 virtual ~LeastSquaresVectors();
102
103
104 // Member Functions
105
106 //- Return const reference to the stencil
108 {
109 return Stencil::New(this->mesh_);
110 }
111
112 //- Return const reference to the least square vectors
113 const List<List<vector>>& vectors() const
114 {
115 return vectors_;
116 }
117
118 //- Update the least square vectors when the mesh moves
119 virtual bool movePoints();
121
122
123// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124
125} // End namespace fv
126
127// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129} // End namespace Foam
130
131// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132
133#ifdef NoRepository
134 #include "LeastSquaresVectors.C"
135#endif
136
137// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138
139#endif
140
141// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
static FOAM_NO_DANGLING_REFERENCE const cellCellStencilObject & New(const fvMesh &mesh, Args &&... args)
const Mesh & mesh() const noexcept
Reference to the mesh.
Definition MeshObject.H:257
const Mesh & mesh_
Reference to the mesh.
Definition MeshObject.H:161
MoveableMeshObject(const word &objName, const objectRegistry &obr)
Definition MeshObject.H:328
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
virtual bool movePoints()
Update the least square vectors when the mesh moves.
LeastSquaresVectors(const fvMesh &mesh)
Construct given an fvMesh and the minimum determinant criterion.
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 finite-volume.
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68