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-------------------------------------------------------------------------------
11License
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
31inline const Foam::pointField&
33{
34 return vertices_;
35}
36
37
38inline const Foam::blockFaceList&
40{
41 return blockFaces_;
42}
43
44
45inline const Foam::cellShape&
47{
48 return blockShape_;
49}
50
51
52inline const Foam::labelVector&
54{
55 return ijkMesh::sizes();
56}
57
58
61{
62 return expand_;
63}
64
65
67{
68 return zoneName_;
69}
70
71
74{
75 return curvedFaces_;
76}
77
78
80{
81 return nCurvedFaces_;
82}
83
84
85inline 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
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// ************************************************************************* //
scalar y
label k
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: FixedList.H:81
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
label nCurvedFaces() const noexcept
Number of curved faces in this block.
const pointField & vertices() const noexcept
Reference to point field defining the block mesh.
const List< gradingDescriptors > & grading() const noexcept
Expansion ratios in all directions.
const FixedList< label, 6 > & curvedFaces() const noexcept
Curved-face labels for each block-face (-1 for flat faces)
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.
const point & blockPoint(const label i) const
Return block point for local label i.
bool vertex(const label i, const label j, const label k) const
True if point i,j,k addresses a block vertex.
label facePointLabel(const direction facei, const label i, const label j) const
const cellShape & blockShape() const noexcept
Return the block shape.
const labelVector & density() const noexcept
The mesh density (number of cells) in the i,j,k directions.
const word & zoneName() const noexcept
Return the (optional) zone name.
const blockFaceList & blockFaces() const noexcept
Return reference to the list of curved faces.
An analytical geometric cellShape.
Definition: cellShape.H:72
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:66
FixedList< label, nTypes > sizes() const
Processor-local sizes per element type.
Definition: ensightCells.C:98
A class for handling words, derived from Foam::string.
Definition: word.H:68
uint8_t direction
Definition: direction.H:56
const direction noexcept
Definition: Scalar.H:223