31 void Foam::blockDescriptor::check(
const Istream& is)
35 if (blockShape_[
pi] < 0)
38 <<
"Negative point label " << blockShape_[
pi]
39 <<
" in block " << *
this 42 else if (blockShape_[
pi] >= vertices_.
size())
45 <<
"Point label " << blockShape_[
pi]
46 <<
" out of range 0.." << vertices_.
size() - 1
47 <<
" in block " << *
this 52 const point blockCentre(blockShape_.
centre(vertices_));
56 label outwardFaceCount = 0;
61 point faceCentre(faces[i].centre(vertices_));
62 vector faceArea(faces[i].area(vertices_));
63 if (
mag(faceArea) > small)
65 if (((faceCentre - blockCentre) & faceArea) > 0)
71 correctFaces[i] =
false;
81 if (outwardFaceCount == 0)
84 <<
"Block " << *
this <<
" is inside-out" 87 else if (outwardFaceCount != faces.
size())
90 <<
"Block " << *
this <<
" has inward-pointing faces" 106 void Foam::blockDescriptor::findCurvedFaces()
110 forAll(blockFaces, blockFacei)
119 blockFaces[blockFacei]
123 curvedFaces_[blockFacei] = facei;
155 if (expand_.size() != 12)
158 <<
"Unknown definition of expansion ratios" 190 blockMeshTools::read<label>
222 ) <<
"incorrect token while reading n, expected '(', found " 243 if (expRatios.
size() == 1)
246 expand_ = expRatios[0];
248 else if (expRatios.
size() == 3)
251 expand_[0] = expRatios[0];
252 expand_[1] = expRatios[0];
253 expand_[2] = expRatios[0];
254 expand_[3] = expRatios[0];
257 expand_[4] = expRatios[1];
258 expand_[5] = expRatios[1];
259 expand_[6] = expRatios[1];
260 expand_[7] = expRatios[1];
263 expand_[8] = expRatios[2];
264 expand_[9] = expRatios[2];
265 expand_[10] = expRatios[2];
266 expand_[11] = expRatios[2];
268 else if (expRatios.
size() == 12)
275 <<
"Unknown definition of expansion ratios: " << expRatios
294 const label ni = density_.
x();
295 const label nj = density_.
y();
296 const label nk = density_.
z();
298 facePoints[0].
setSize((nj + 1)*(nk + 1));
299 facePoints[1].
setSize((nj + 1)*(nk + 1));
301 for (
label j=0; j<=nj; j++)
312 facePoints[2].
setSize((ni + 1)*(nk + 1));
313 facePoints[3].
setSize((ni + 1)*(nk + 1));
315 for (
label i=0; i<=ni; i++)
326 facePoints[4].
setSize((ni + 1)*(nj + 1));
327 facePoints[5].
setSize((ni + 1)*(nj + 1));
329 for (
label i=0; i<=ni; i++)
331 for (
label j=0; j<=nj; j++)
349 forAll(curvedFaces_, blockFacei)
351 if (curvedFaces_[blockFacei] != -1)
353 faces_[curvedFaces_[blockFacei]].project
357 facePoints[blockFacei]
398 os << blockLabels[
labelI];
408 <<
" simpleGrading (";
418 expand[0] == expand[1]
419 && expand[0] == expand[2]
420 && expand[0] == expand[3]
424 expand[4] == expand[5]
425 && expand[4] == expand[6]
426 && expand[4] == expand[7]
430 expand[8] == expand[9]
431 && expand[8] == expand[10]
432 && expand[8] == expand[11]
436 os << expand[0] <<
' ' << expand[4] <<
' ' << expand[8];
#define forAll(list, i)
Loop across all elements in list.
punctuationToken pToken() const
intWM_LABEL_SIZE_t 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.
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.
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.
point centre(const pointField &) const
Centroid of the cell.
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.