32 void Foam::blockDescriptor::check(
const Istream& is)
36 if (blockShape_[
pi] < 0)
39 <<
"Negative point label " << blockShape_[
pi]
40 <<
" in block " << *
this 43 else if (blockShape_[
pi] >= vertices_.
size())
46 <<
"Point label " << blockShape_[
pi]
47 <<
" out of range 0.." << vertices_.
size() - 1
48 <<
" in block " << *
this 56 label outwardFaceCount = 0;
61 const point faceCentre(faces[i].centre(vertices_));
62 const vector faceArea(faces[i].area(vertices_));
64 if (
mag(faceArea) > small)
66 bool outwardFace =
false;
73 ((faceCentre - faces[j].centre(vertices_)) & faceArea)
88 correctFaces[i] =
false;
98 if (outwardFaceCount == 0)
101 <<
"Block " << *
this <<
" is inside-out" 104 else if (outwardFaceCount != faces.
size())
107 <<
"Block " << *
this <<
" has inward-pointing faces" 112 if (!correctFaces[i])
123 void Foam::blockDescriptor::findCurvedFaces()
127 forAll(blockFaces, blockFacei)
136 blockFaces[blockFacei]
140 curvedFaces_[blockFacei] = facei;
172 if (expand_.size() != 12)
175 <<
"Unknown definition of expansion ratios" 207 blockMeshTools::read<label>
239 ) <<
"incorrect token while reading n, expected '(', found " 260 if (expRatios.
size() == 1)
263 expand_ = expRatios[0];
265 else if (expRatios.
size() == 3)
268 expand_[0] = expRatios[0];
269 expand_[1] = expRatios[0];
270 expand_[2] = expRatios[0];
271 expand_[3] = expRatios[0];
274 expand_[4] = expRatios[1];
275 expand_[5] = expRatios[1];
276 expand_[6] = expRatios[1];
277 expand_[7] = expRatios[1];
280 expand_[8] = expRatios[2];
281 expand_[9] = expRatios[2];
282 expand_[10] = expRatios[2];
283 expand_[11] = expRatios[2];
285 else if (expRatios.
size() == 12)
292 <<
"Unknown definition of expansion ratios: " << expRatios
314 const label ni = density_.x();
315 const label nj = density_.y();
316 const label nk = density_.z();
318 facePoints[0].
setSize((nj + 1)*(nk + 1));
319 facePoints[1].
setSize((nj + 1)*(nk + 1));
321 for (
label j=0; j<=nj; j++)
332 facePoints[2].
setSize((ni + 1)*(nk + 1));
333 facePoints[3].
setSize((ni + 1)*(nk + 1));
335 for (
label i=0; i<=ni; i++)
346 facePoints[4].
setSize((ni + 1)*(nj + 1));
347 facePoints[5].
setSize((ni + 1)*(nj + 1));
349 for (
label i=0; i<=ni; i++)
351 for (
label j=0; j<=nj; j++)
369 forAll(curvedFaces_, blockFacei)
371 if (curvedFaces_[blockFacei] != -1)
373 faces_[curvedFaces_[blockFacei]].project
377 facePoints[blockFacei]
418 os << blockLabels[
labelI];
428 <<
" simpleGrading (";
438 expand[0] == expand[1]
439 && expand[0] == expand[2]
440 && expand[0] == expand[3]
444 expand[4] == expand[5]
445 && expand[4] == expand[6]
446 && expand[4] == expand[7]
450 expand[8] == expand[9]
451 && expand[8] == expand[10]
452 && expand[8] == expand[11]
456 os << expand[0] <<
' ' << expand[4] <<
' ' << expand[8];
#define forAll(list, i)
Loop across all elements in list.
punctuationToken pToken() const
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A 1D vector of objects of type <T> with a fixed size <Size>.
const Vector< label > & density() const
Return the mesh density (number of cells) in the i,j,k directions.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
InfoProxy< token > info() const
Return info proxy.
const word & wordToken() const
An analytical geometric cellShape.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Takes the description of the block and the list of curved edges and creates a list of points on edges...
void size(const label)
Override size to be inconsistent with allocated storage.
A token holds items read from Istream.
void putBack(const token &)
Put back token.
Vector< scalar > vector
A scalar version of the templated Vector.
label k
Boltzmann constant.
FixedList< pointField, 6 > facePoints(const pointField &points) const
Return the list of face-points for all of the faces of the block.
static void write(Ostream &, const label blocki, const dictionary &)
Write block index with dictionary lookup.
List< bool > boolList
Bool container classes.
const cellShape & blockShape() const
Return the block shape.
blockDescriptor(const cellShape &, const pointField &vertices, const blockEdgeList &, const blockFaceList &, const Vector< label > &density, const UList< gradingDescriptors > &expand, const word &zoneName="")
Construct from components. Optional cellSet/zone name.
label facePointLabel(const label facei, const label i, const label j) const
Face vertex label offset for a particular i,j,k position.
faceList faces() const
Faces of this cell.
static const labelSphericalTensor labelI(1)
Identity labelTensor.
A class for handling words, derived from string.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const dictionary * subDictPtr(const word &) const
Find and return a sub-dictionary pointer if present.
void correctFacePoints(FixedList< pointField, 6 > &) const
Correct the location of the given face-points.
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross product operators.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const pointField & vertices() const
Reference to point field defining the block mesh.
static Switch checkBlockFaceOrientation
Switch checking block face orientation.
label size() const
Return the number of elements in the UPtrList.
static bool sameVertices(const face &, const face &)
Return true if the faces have the same vertices.
const cellModel & model() const
Model reference.
vector point
Point is a vector.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Ostream & operator<<(Ostream &, const ensightPart &)
label pointLabel(const label i, const label j, const label k) const
Vertex label offset for a particular i,j,k position.
dimensioned< scalar > mag(const dimensioned< Type > &)
void setSize(const label)
Dummy setSize function.
const word & zoneName() const
Return the (optional) zone name.
const word & name() const
Return model name.
List of gradingDescriptor for the sections of a block with additional IO functionality.
const blockFaceList & faces() const
Return reference to the list of curved faces.
bool isPunctuation() const
dictionary subOrEmptyDict(const word &, const bool mustRead=false) const
Find and return a sub-dictionary as a copy, or.