MPLICcellStorage.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::MPLICcellStorage
26 
27 Description
28  Provides local cell addressing for geometry and data for MPLIC class.
29 
30 SourceFiles
31  MPLICcellStorage.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef MPLICcellStorage_H
36 #define MPLICcellStorage_H
37 
38 #include "primitiveMesh.H"
39 #include "UIndirectList.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class MPLICcell Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class MPLICcellStorage
52 {
53  // Private data
54 
55  //- Reference to the mesh points
56  const pointField& points_;
57 
58  //- Reference to the mesh faces
59  const faceList& faces_;
60 
61  //- Reference to the mesh edges
62  const edgeList& edges_;
63 
64  //- Reference to the mesh face edges
65  const labelListList& edgeFaces_;
66 
67  //- Reference to the cell points
68  const labelList& cPoints_;
69 
70  //- Reference to face list
71  const labelList& cFaces_;
72 
73  //- Reference to cell edges
74  const labelList& cEdges_;
75 
76  //- Alpha at the cell vertices
77  const scalarField& pointsAlpha_;
78 
79  //- Velocity at the cell vertices
80  const vectorField& pointsU_;
81 
82  //- Cell centre value of alpha
83  const scalar cellAlpha_;
84 
85  //- Cell centre value of velocity
86  const vector& celllU_;
87 
88  //- Owner? For all faces on the cell
89  const boolList owns_;
90 
91  //- Cell volume
92  const scalar volume_;
93 
94  //- Cell centre
95  const vector& centre_;
96 
97  //- Face area vectors
98  const UIndirectList<vector> Sf_;
99 
100  //- Face centres
101  const UIndirectList<vector> Cf_;
102 
103  //- Face areas
104  const UIndirectList<scalar> magSf_;
105 
106  //- Cell alpha min
107  const scalar cellAlphaMin_;
108 
109  //- Cell alpha max
110  const scalar cellAlphaMax_;
111 
112  //- Face alpha mins
113  const scalarField facesAlphaMin_;
114 
115  //- Face alpha maxs
116  const scalarField facesAlphaMax_;
117 
118  //- Global face edges
119  const labelListList& faceEdges_;
120 
121 
122  // Private Member Functions
123 
124  //- Return the face owner list for the faces of the cell
125  boolList calcIsOwner
126  (
127  const primitiveMesh& mesh, const label celli
128  ) const;
129 
130  //- Calculate minimum point alpha value in the cell
131  scalar calcAlphaMin() const;
132 
133  //- Calculate maximum point alpha value in the cell
134  scalar calcAlphaMax() const;
135 
136  //- Calculate minimum point alpha value on the cell faces
137  scalarField calcFacesAlphaMin() const;
138 
139  //- Calculate maximum point alpha value on the cell faces
140  scalarField calcFacesAlphaMax() const;
141 
142 
143  public:
144 
145  // Constructors
146 
147  //- Construct from components
149  (
150  const primitiveMesh& mesh,
151  const scalarField& pointsAlpha,
152  const vectorField& pointsU,
153  const scalar cellAlpha,
154  const vector& cellU,
155  const label celli
156  );
157 
158 
159  // Public Member Functions
160 
161  //- Return reference to mesh points
162  inline const pointField& points() const;
163 
164  //- Return reference to the mesh faces
165  inline const faceList& faces() const;
166 
167  //- Return reference to the mesh edges
168  inline const edgeList& edges() const;
169 
170  //- Return reference to the mesh face edges
171  inline const labelListList& faceEdges() const;
172 
173  //- Return reference to the cell points
174  inline const labelList& cellPoints() const;
175 
176  //- Return reference to face list
177  inline const labelList& cellFaces() const;
178 
179  //- Return reference to cell edges
180  inline const labelList& cellEdges() const;
181 
182  //- Return isOwners
183  inline const boolList& isOwner() const;
184 
185  //- Return point alphas
186  inline const scalarField& pointsAlpha() const;
187 
188  //- Return point velocities
189  inline const vectorField& pointsU() const;
190 
191  //- Return cell alpha
192  inline scalar cellAlpha() const;
193 
194  //- Return cell velocity
195  inline const vector& cellU() const;
196 
197  //- Return cell volume
198  inline scalar V() const;
199 
200  //- Return cell centre
201  inline const vector& C() const;
202 
203  //- Return face surface area vectors
204  inline const UIndirectList<vector>& Sf() const;
205 
206  //- Return face centres
207  inline const UIndirectList<vector>& Cf() const;
208 
209  //- Return face areas
210  inline const UIndirectList<scalar>& magSf() const;
211 
212  //- Return maximum point alpha value in the cell
213  inline scalar cellAlphaMax() const;
214 
215  //- Return minimum point alpha value in the cell
216  inline scalar cellAlphaMin() const;
217 
218  //- Return minimum point alpha value on the cell faces
219  inline const scalarField& facesAlphaMin() const;
220 
221  //- Return maximum point alpha value on the cell faces
222  inline const scalarField& facesAlphaMax() const;
223 
224  //- Return number of faces in the the cell
225  inline label size() const;
226 };
227 
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 }// End namespace Foam
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 #include "MPLICcellStorageI.H"
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const labelList & cellPoints() const
Return reference to the cell points.
scalar cellAlphaMin() const
Return minimum point alpha value in the cell.
const edgeList & edges() const
Return reference to the mesh edges.
const boolList & isOwner() const
Return isOwners.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:74
const faceList & faces() const
Return reference to the mesh faces.
Provides local cell addressing for geometry and data for MPLIC class.
MPLICcellStorage(const primitiveMesh &mesh, const scalarField &pointsAlpha, const vectorField &pointsU, const scalar cellAlpha, const vector &cellU, const label celli)
Construct from components.
const UIndirectList< scalar > & magSf() const
Return face areas.
const vector & C() const
Return cell centre.
dynamicFvMesh & mesh
const pointField & points() const
Return reference to mesh points.
const UIndirectList< vector > & Sf() const
Return face surface area vectors.
label size() const
Return number of faces in the the cell.
const labelList & cellFaces() const
Return reference to face list.
const labelListList & faceEdges() const
Return reference to the mesh face edges.
const UIndirectList< vector > & Cf() const
Return face centres.
const vectorField & pointsU() const
Return point velocities.
const scalarField & pointsAlpha() const
Return point alphas.
const scalarField & facesAlphaMax() const
Return maximum point alpha value on the cell faces.
const labelList & cellEdges() const
Return reference to cell edges.
scalar cellAlpha() const
Return cell alpha.
A List with indirect addressing.
Definition: fvMatrix.H:106
scalar V() const
Return cell volume.
scalar cellAlphaMax() const
Return maximum point alpha value in the cell.
const vector & cellU() const
Return cell velocity.
const scalarField & facesAlphaMin() const
Return minimum point alpha value on the cell faces.
Namespace for OpenFOAM.