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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::fv::LeastSquaresVectors
29 
30 Description
31  Least-squares gradient scheme vectors
32 
33 See also
34  Foam::fv::LeastSquaresGrad
35 
36 SourceFiles
37  LeastSquaresVectors.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef LeastSquaresVectors_H
42 #define LeastSquaresVectors_H
43 
45 #include "MeshObject.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace fv
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class LeastSquaresVectors Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<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 
78 public:
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 // ************************************************************************* //
Foam::fv::LeastSquaresVectors::TypeName
TypeName("LeastSquaresVectors")
Foam::fv::LeastSquaresVectors::vectors
const List< List< vector > > & vectors() const
Return const reference to the least square vectors.
Definition: LeastSquaresVectors.H:105
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 const reference to the stencil.
Definition: LeastSquaresVectors.H:99
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:85
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:61
Foam::fv::LeastSquaresVectors::LeastSquaresVectors
LeastSquaresVectors(const fvMesh &)
Construct given an fvMesh and the minimum determinant criterion.
Definition: LeastSquaresVectors.C:35