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