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_));
66 bool outwardFace =
false;
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"
208 <<
"Block type " <<
modelName <<
" not recognised"
214 blockMeshTools::read<label>
217 dict.subOrEmptyDict(
"namedVertices")
223 <<
"Block of type " <<
modelName <<
" has "
224 << blockShape_.
size() <<
" points rather than "
254 ) <<
"incorrect token while reading n, expected '(', found "
275 if (expRatios.
size() == 1)
278 expand_ = expRatios[0];
280 else if (expRatios.
size() == 3)
283 expand_[0] = expRatios[0];
284 expand_[1] = expRatios[0];
285 expand_[2] = expRatios[0];
286 expand_[3] = expRatios[0];
289 expand_[4] = expRatios[1];
290 expand_[5] = expRatios[1];
291 expand_[6] = expRatios[1];
292 expand_[7] = expRatios[1];
295 expand_[8] = expRatios[2];
296 expand_[9] = expRatios[2];
297 expand_[10] = expRatios[2];
298 expand_[11] = expRatios[2];
300 else if (expRatios.
size() == 12)
307 <<
"Unknown definition of expansion ratios: " << expRatios
329 const label ni = density_.x();
330 const label nj = density_.y();
331 const label nk = density_.z();
333 facePoints[0].
setSize((nj + 1)*(nk + 1));
334 facePoints[1].
setSize((nj + 1)*(nk + 1));
336 for (
label j=0; j<=nj; j++)
340 facePoints[0][facePointLabel(0, j,
k)] =
342 facePoints[1][facePointLabel(1, j,
k)] =
347 facePoints[2].
setSize((ni + 1)*(nk + 1));
348 facePoints[3].
setSize((ni + 1)*(nk + 1));
350 for (
label i=0; i<=ni; i++)
354 facePoints[2][facePointLabel(2, i,
k)] =
356 facePoints[3][facePointLabel(3, i,
k)] =
361 facePoints[4].
setSize((ni + 1)*(nj + 1));
362 facePoints[5].
setSize((ni + 1)*(nj + 1));
364 for (
label i=0; i<=ni; i++)
366 for (
label j=0; j<=nj; j++)
368 facePoints[4][facePointLabel(4, i, j)] =
369 points[pointLabel(i, j, 0)];
370 facePoints[5][facePointLabel(5, i, j)] =
371 points[pointLabel(i, j, nk)];
384 forAll(curvedFaces_, blockFacei)
386 if (curvedFaces_[blockFacei] != -1)
388 faces_[curvedFaces_[blockFacei]].project
392 facePoints[blockFacei]
433 os << blockLabels[
labelI];
443 <<
" 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.
Maps a geometry to a set of cell primitives, which enables geometric cell data to be calculated witho...
label nPoints() const
Return number of points.
const word & name() const
Return model name.
static const cellModel * lookup(const word &)
Look up a model by name and return a pointer to the model or nullptr.
An analytical geometric cellShape.
const cellModel & model() const
Model reference.
faceList faces() const
Faces of this cell.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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.
vector faceArea(const face &f, const point &fPAvg, const pointField &ps)
Compute the face-area.
const dimensionSet density
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.
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
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)