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) 2011-2013 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::leastSquaresVectors
29 
30 Description
31  Least-squares gradient scheme vectors
32 
33 SourceFiles
34  leastSquaresVectors.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef leastSquaresVectors_H
39 #define leastSquaresVectors_H
40 
41 #include "MeshObject.H"
42 #include "fvMesh.H"
43 #include "surfaceFields.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class leastSquaresVectors Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public MeshObject<fvMesh, MoveableMeshObject, leastSquaresVectors>
57 {
58  // Private Typedefs
59 
60  typedef MeshObject
61  <
62  fvMesh,
66 
67 
68  // Private Data
69 
70  //- Owner least-squares gradient vectors
71  surfaceVectorField pVectors_;
72 
73  //- Neighbour least-squares gradient vectors
74  surfaceVectorField nVectors_;
75 
76 
77  // Private Member Functions
78 
79  //- Construct Least-squares gradient vectors
80  void calcLeastSquaresVectors();
81 
82 
83 public:
84 
85  // Declare name of the class and its debug switch
86  TypeName("leastSquaresVectors");
87 
88 
89  // Constructors
90 
91  //- Construct given an fvMesh
92  explicit leastSquaresVectors(const fvMesh&);
93 
94 
95  //- Destructor
96  virtual ~leastSquaresVectors();
97 
98 
99  // Member functions
100 
101  //- Return const reference to owner least square vectors
102  const surfaceVectorField& pVectors() const
103  {
104  return pVectors_;
105  }
106 
107  //- Return const reference to neighbour least square vectors
108  const surfaceVectorField& nVectors() const
109  {
110  return nVectors_;
111  }
112 
113  //- Delete the least square vectors when the mesh moves
114  virtual bool movePoints();
115 };
116 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace Foam
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
Foam::surfaceFields.
MoveableMeshObject(const word &objName, const objectRegistry &obr)
Construct from name and instance on registry.
Definition: MeshObject.H:326
const surfaceVectorField & pVectors() const
Return const reference to owner least square vectors.
leastSquaresVectors(const fvMesh &)
Construct given an fvMesh.
Least-squares gradient scheme vectors.
virtual bool movePoints()
Delete the least square vectors when the mesh moves.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:152
const surfaceVectorField & nVectors() const
Return const reference to neighbour least square vectors.
TypeName("leastSquaresVectors")
virtual ~leastSquaresVectors()
Destructor.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Namespace for OpenFOAM.