blockDescriptorI.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-2016 OpenFOAM Foundation
9  Copyright (C) 2019 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 \*---------------------------------------------------------------------------*/
28 
29 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
30 
32 {
33  return vertices_;
34 }
35 
36 
38 {
39  return blockFaces_;
40 }
41 
42 
44 {
45  return blockShape_;
46 }
47 
48 
50 {
51  return ijkMesh::sizes();
52 }
53 
54 
57 {
58  return expand_;
59 }
60 
61 
63 {
64  return zoneName_;
65 }
66 
67 
70 {
71  return curvedFaces_;
72 }
73 
74 
75 inline Foam::label Foam::blockDescriptor::nCurvedFaces() const
76 {
77  return nCurvedFaces_;
78 }
79 
80 
81 inline const Foam::point& Foam::blockDescriptor::blockPoint(const label i) const
82 {
83  return vertices_[blockShape_[i]];
84 }
85 
86 
88 (
89  const direction facei,
90  const label i,
91  const label j
92 ) const
93 {
94  if (facei == 0 || facei == 1)
95  {
96  // x-min, x-max
97  return
98  (
99  i
100  + j*(sizes().y() + 1)
101  );
102  }
103  else if (facei == 2 || facei == 3)
104  {
105  // y-min, y-max
106  return
107  (
108  i
109  + j*(sizes().x() + 1)
110  );
111  }
112  else
113  {
114  // z-min, z-max
115  return
116  (
117  i
118  + j*(sizes().x() + 1)
119  );
120  }
121 }
122 
123 
125 (
126  const label i, const label j, const label k
127 ) const
128 {
129  bool iEnd = (i == 0 || i == sizes().x());
130  bool jEnd = (j == 0 || j == sizes().y());
131  bool kEnd = (k == 0 || k == sizes().z());
132 
133  return (iEnd && jEnd && kEnd);
134 }
135 
136 
137 inline bool Foam::blockDescriptor::edge
138 (
139  const label i, const label j, const label k
140 ) const
141 {
142  bool iEnd = (i == 0 || i == sizes().x());
143  bool jEnd = (j == 0 || j == sizes().y());
144  bool kEnd = (k == 0 || k == sizes().z());
145 
146  return (iEnd && jEnd) || (iEnd && kEnd) || (jEnd && kEnd);
147 }
148 
149 
151 (
152  const label i, const label j, const label k
153 ) const
154 {
155  if (i == 0 && curvedFaces_[0] == -1) return true;
156  if (i == sizes().x() && curvedFaces_[1] == -1) return true;
157  if (j == 0 && curvedFaces_[2] == -1) return true;
158  if (j == sizes().y() && curvedFaces_[3] == -1) return true;
159  if (k == 0 && curvedFaces_[4] == -1) return true;
160  if (k == sizes().z() && curvedFaces_[5] == -1) return true;
161 
162  return this->edge(i, j, k);
163 }
164 
165 
166 // ************************************************************************* //
Foam::blockDescriptor::blockPoint
const point & blockPoint(const label i) const
Return block point for local label i.
Definition: blockDescriptorI.H:81
Foam::blockDescriptor::vertices
const pointField & vertices() const
Reference to point field defining the block mesh.
Definition: blockDescriptorI.H:31
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::blockDescriptor::blockShape
const cellShape & blockShape() const
Return the block shape.
Definition: blockDescriptorI.H:43
Foam::blockDescriptor::facePointLabel
label facePointLabel(const direction facei, const label i, const label j) const
Definition: blockDescriptorI.H:88
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:63
Foam::ijkAddressing::sizes
const labelVector & sizes() const
The (i,j,k) addressing dimensions.
Definition: ijkAddressingI.H:69
Foam::blockDescriptor::zoneName
const word & zoneName() const
Return the (optional) zone name.
Definition: blockDescriptorI.H:62
Foam::blockDescriptor::vertex
bool vertex(const label i, const label j, const label k) const
Return true if point i,j,k addresses a block vertex.
Definition: blockDescriptorI.H:125
Foam::blockDescriptor::nCurvedFaces
label nCurvedFaces() const
Number of curved faces in this block.
Definition: blockDescriptorI.H:75
Foam::blockDescriptor::curvedFaces
const FixedList< label, 6 > & curvedFaces() const
Curved-face labels for each block-face (-1 for flat faces)
Definition: blockDescriptorI.H:69
Foam::Field< vector >
Foam::PtrList< blockFace >
Foam::blockDescriptor::grading
const List< gradingDescriptors > & grading() const
Expansion ratios in all directions.
Definition: blockDescriptorI.H:56
Foam::blockDescriptor::flatFaceOrEdge
bool flatFaceOrEdge(const label i, const label j, const label k) const
Return true if point i,j,k addresses a block flat face or edge.
Definition: blockDescriptorI.H:151
Foam::cellShape
An analytical geometric cellShape.
Definition: cellShape.H:69
Foam::blockDescriptor::edge
bool edge(const label i, const label j, const label k) const
Return true if point i,j,k addresses a block edge.
Definition: blockDescriptorI.H:138
Foam::Vector< label >
Foam::List< Foam::gradingDescriptors >
Foam::FixedList
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: HashTable.H:104
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
Foam::direction
uint8_t direction
Definition: direction.H:52
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::blockDescriptor::density
const labelVector & density() const
Return the mesh density (number of cells) in the i,j,k directions.
Definition: blockDescriptorI.H:49
Foam::blockDescriptor::blockFaces
const blockFaceList & blockFaces() const
Return reference to the list of curved faces.
Definition: blockDescriptorI.H:37
y
scalar y
Definition: LISASMDCalcMethod1.H:14