PDRmeshArrays.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) 2019 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::PDRmeshArrays
28 
29 Description
30  OpenFOAM/PDRblock addressing information
31 
32  Provides mapping for a rectilinear OpenFOAM mesh in terms of
33  i-j-k indices for faces and cells.
34 
35  The mesh points are first binned according to their i-j-k locations.
36  Next the faces are classified according to their lowest x/y/z
37  coordinates and the face orientation as x/y/z.
38  Orientation in the sense +x or -x is not noted.
39  The cell faces are then examined to determine the appropriate i-j-k
40  location.
41 
42 SourceFiles
43  PDRmeshmeshArraysIO.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef PDRmeshArrays_H
48 #define PDRmeshArrays_H
49 
50 #include "labelVector.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 // Forward Declarations
58 class PDRblock;
59 class polyMesh;
60 class Time;
61 
62 /*---------------------------------------------------------------------------*\
63  Class PDRmeshArrays Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 class PDRmeshArrays
67 {
68 public:
69 
70  //- Relative tolerance when matching grid points. Default = 0.02
71  static scalar gridPointRelTol;
72 
73  //- The cell i-j-k addressing range
75 
76  //- The face i-j-k addressing range
78 
79  //- For each cell, the corresponding i-j-k address.
81 
82  //- For each face, the corresponding i-j-k address.
84 
85  //- For each face, the x/y/z orientation
87 
88 
89  // Constructors
90 
91  //- Default construct
92  PDRmeshArrays() = default;
93 
94 
95  //- Destructor
96  ~PDRmeshArrays() = default;
97 
98 
99  // Member Functions
100 
101  //- The number of cells
102  label nCells() const
103  {
104  return cellIndex.size();
105  }
106 
107  //- The number of faces
108  label nFaces() const
109  {
110  return faceIndex.size();
111  }
112 
113 
114  //- Determine i-j-k indices for faces/cells
115  void classify(const polyMesh& mesh, const PDRblock& pdrBlock);
116 
117  //- Read OpenFOAM mesh and determine i-j-k indices for faces/cells
118  void read(const Time& runTime, const PDRblock& pdrBlock);
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
Foam::PDRmeshArrays::faceIndex
List< labelVector > faceIndex
For each face, the corresponding i-j-k address.
Definition: PDRmeshArrays.H:82
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::PDRmeshArrays::classify
void classify(const polyMesh &mesh, const PDRblock &pdrBlock)
Determine i-j-k indices for faces/cells.
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::PDRmeshArrays::cellDims
labelVector cellDims
The cell i-j-k addressing range.
Definition: PDRmeshArrays.H:73
Foam::PDRmeshArrays::PDRmeshArrays
PDRmeshArrays()=default
Default construct.
labelVector.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::PDRmeshArrays::faceDims
labelVector faceDims
The face i-j-k addressing range.
Definition: PDRmeshArrays.H:76
Foam::PDRmeshArrays::nFaces
label nFaces() const
The number of faces.
Definition: PDRmeshArrays.H:107
Foam::PDRmeshArrays::nCells
label nCells() const
The number of cells.
Definition: PDRmeshArrays.H:101
Foam::PDRmeshArrays::faceOrient
List< direction > faceOrient
For each face, the x/y/z orientation.
Definition: PDRmeshArrays.H:85
Foam::PDRmeshArrays::cellIndex
List< labelVector > cellIndex
For each cell, the corresponding i-j-k address.
Definition: PDRmeshArrays.H:79
Foam::PDRmeshArrays::~PDRmeshArrays
~PDRmeshArrays()=default
Destructor.
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::PDRblock
A single block x-y-z rectilinear mesh addressable as i,j,k with simplified creation....
Definition: PDRblock.H:153
Foam::PDRmeshArrays::read
void read(const Time &runTime, const PDRblock &pdrBlock)
Read OpenFOAM mesh and determine i-j-k indices for faces/cells.
Foam::Vector< label >
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
Foam::PDRmeshArrays
OpenFOAM/PDRblock addressing information.
Definition: PDRmeshArrays.H:65
Foam::PDRmeshArrays::gridPointRelTol
static scalar gridPointRelTol
Relative tolerance when matching grid points. Default = 0.02.
Definition: PDRmeshArrays.H:70