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_));
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()
125 const faceList blockFaces(blockShape().faces());
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>
210 dict.subOrEmptyDict(
"namedVertices")
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++)
325 facePoints[0][facePointLabel(0, j,
k)] =
327 facePoints[1][facePointLabel(1, j,
k)] =
332 facePoints[2].
setSize((ni + 1)*(nk + 1));
333 facePoints[3].
setSize((ni + 1)*(nk + 1));
335 for (
label i=0; i<=ni; i++)
339 facePoints[2][facePointLabel(2, i,
k)] =
341 facePoints[3][facePointLabel(3, i,
k)] =
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++)
353 facePoints[4][facePointLabel(4, i, j)] =
354 points[pointLabel(i, j, 0)];
355 facePoints[5][facePointLabel(5, i, j)] =
356 points[pointLabel(i, j, nk)];
369 forAll(curvedFaces_, blockFacei)
371 if (curvedFaces_[blockFacei] != -1)
373 faces_[curvedFaces_[blockFacei]].project
377 facePoints[blockFacei]
418 os << blockLabels[
labelI];
428 <<
" simpleGrading (";
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> with a fixed size <Size>.
void setSize(const label)
Dummy setSize function.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void putBack(const token &)
Put back token.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const
Return the number of elements in the UPtrList.
Takes the description of the block and the list of curved edges and creates a list of points on edges...
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.
const word & zoneName() const
Return the (optional) zone name.
const blockFaceList & faces() const
Return reference to the list of curved faces.
static void write(Ostream &, const label blocki, const dictionary &)
Write block index with dictionary lookup.
const Vector< label > & density() const
Return the mesh density (number of cells) in the i,j,k directions.
void correctFacePoints(FixedList< pointField, 6 > &) const
Correct the location of the given face-points.
FixedList< pointField, 6 > facePoints(const pointField &points) const
Return the list of face-points for all of the faces of the block.
static Switch checkBlockFaceOrientation
Switch checking block face orientation.
const word & name() const
Return model name.
An analytical geometric cellShape.
const cellModel & model() const
Model reference.
faceList faces() const
Faces of this cell.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const dictionary * subDictPtr(const word &) const
Find and return a sub-dictionary pointer if present.
static bool sameVertices(const face &, const face &)
Return true if the faces have the same vertices.
List of gradingDescriptor for the sections of a block with additional IO functionality.
A token holds items read from Istream.
bool isPunctuation() const
punctuationToken pToken() const
InfoProxy< token > info() const
Return info proxy.
const word & wordToken() const
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
pointField vertices(const blockVertexList &bvl)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static const labelSphericalTensor labelI(1)
Identity labelTensor.
List< bool > boolList
Bool container classes.
vector point
Point is a vector.
Vector< scalar > vector
A scalar version of the templated Vector.
dimensioned< scalar > mag(const dimensioned< Type > &)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
string expand(const string &s, string::size_type &index, const dictionary &dict, const bool allowEnvVars, const bool allowEmpty)