Go to the documentation of this file.
61 for(
int facePi=0; facePi<6; facePi++)
63 for(
int faceNi=0; faceNi<6; faceNi++)
69 for(
int Pp=0; Pp<2; Pp++)
72 int Np = (3 - Pp +
rot)%4;
78 if (
mag(map[0]) == 2 && map[0]*map[1] < 0)
100 if (faceN[
rot] == faceP[0])
107 <<
"Cannot find point correspondance for faces "
108 << faceP <<
" and " << faceN
123 forAll(topoInternalFaces, topoFacei)
125 label topoPi = topoFaceCell[topoFacei];
126 const labelList& topoPfaces = topoCells[topoPi];
128 bool foundFace =
false;
133 topoPfacei < topoPfaces.
size();
137 if (topoPfaces[topoPfacei] == topoFacei)
147 <<
"Cannot find merge face for block " << topoPi
151 mergeBlock[topoFacei].first() = topoPi;
152 mergeBlock[topoFacei].second() = topoPfacei;
185 return map < 0 ? -i-1 : i;
191 return i >= 0 ? i : ni + i + 1;
300 Info<<
"Creating block offsets" <<
endl;
312 nPoints_ += blocks[blockI].nPoints();
313 nCells_ += blocks[blockI].nCells();
318 Info<<
"Creating merge list using the fast topological search"
364 forAll(topoInternalFaces, topoFacei)
368 Info<<
"Processing face " << topoFacei <<
endl;
371 label blockPi = mergeBlockP[topoFacei].first();
372 label blockPfacei = mergeBlockP[topoFacei].second();
374 label blockNi = mergeBlockN[topoFacei].first();
375 label blockNfacei = mergeBlockN[topoFacei].second();
382 blocks[blockPi].blockShape().faces()[blockPfacei],
384 blocks[blockNi].blockShape().faces()[blockNfacei]
390 Info<<
" Face map for faces "
391 << blocks[blockPi].blockShape().faces()[blockPfacei] <<
" "
392 << blocks[blockNi].blockShape().faces()[blockNfacei] <<
": "
396 const pointField& blockPpoints = blocks[blockPi].points();
397 const pointField& blockNpoints = blocks[blockNi].points();
405 NPnij[0] = Nnij[
mag(fmap[0]) - 1];
406 NPnij[1] = Nnij[
mag(fmap[1]) - 1];
411 <<
"Sub-division mismatch between face "
412 << blockPfacei <<
" of block " << blockPi << Pnij
414 << blockNfacei <<
" of block " << blockNi << Nnij
422 const boundBox bb(topoCells[blockPi].
points(topoFaces, topoPoints));
426 scalar maxSqrDist = 0;
433 facePoint(blockPfacei, blocks[blockPi], i, j);
436 facePointN(blockNfacei, fmap, blocks[blockNi], i, j);
442 blockPpoints[blockPpointi]
443 - blockNpoints[blockNpointi]
447 if (sqrDist > testSqrDist)
450 <<
"Point merge failure between face "
451 << blockPfacei <<
" of block " << blockPi
453 << blockNfacei <<
" of block " << blockNi
455 <<
" Points: " << blockPpoints[blockPpointi]
456 <<
" " << blockNpoints[blockNpointi]
458 <<
" This may be due to inconsistent grading."
462 maxSqrDist =
max(maxSqrDist, sqrDist);
467 label minPNi =
min(Ppointi, Npointi);
485 Info<<
" Max distance between merge points: "
491 bool changedPointMerge =
false;
496 changedPointMerge =
false;
499 forAll(topoInternalFaces, topoFacei)
501 label blockPi = mergeBlockP[topoFacei].first();
502 label blockPfacei = mergeBlockP[topoFacei].second();
504 label blockNi = mergeBlockN[topoFacei].first();
505 label blockNfacei = mergeBlockN[topoFacei].second();
512 blocks[blockPi].blockShape().faces()[blockPfacei],
514 blocks[blockNi].blockShape().faces()[blockNfacei]
525 facePoint(blockPfacei, blocks[blockPi], i, j);
528 facePointN(blockNfacei, fmap, blocks[blockNi], i, j);
538 changedPointMerge =
true;
556 <<
"Point merging failed after 100 passes."
560 }
while (changedPointMerge);
564 label nUniqPoints = 0;
571 <<
"Merge list contains point index out of range"
label unsignIndex(const label i, const label ni)
Pair< label > faceNij(const label facei, const block &block)
virtual const pointField & points() const
Return raw points.
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
#define forAll(list, i)
Loop across all elements in list.
A List obtained as a section of another List.
const cellList & cells() const
const Type & first() const
Return first.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
label mapij(const int map, const label i, const label j)
const polyMesh & topology() const
Return the blockMesh topology as a polyMesh.
label facePoint(const int facei, const block &block, const label i, const label j)
vector span() const
The bounding box span (from minimum to maximum)
Ostream & flush(Ostream &os)
Flush stream.
label nCells_
The sum of all cells in each block.
void calcMergeInfoFast()
Determine the merge info and the final number of cells/points.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
virtual const labelList & faceOwner() const
Return face owner.
const Type & second() const
Return second.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
const double e
Elementary charge.
static Pair< int > faceFaceRotMap[6][6][4]
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label facePointN(const block &block, const label i, const label j, const label k)
An ordered pair of two objects of type <T> with first() and second() elements.
const pointField & points() const
The points for the entire mesh.
label signIndex(const int map, const label i)
static const int faceEdgeDirs[6][4]
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
label k
Boltzmann constant.
const Vector< label > & meshDensity() const
Return the mesh density (number of cells) in the i,j,k directions.
label size() const
Return the number of elements in the PtrList.
labelList blockOffsets_
The point offset added to each block.
A bounding box defined in terms of the points at its extremities.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
labelList mergeList_
The merge points information.
label size() const
Return the number of elements in the UList.
label vtxLabel(label i, label j, label k) const
Vertex label offset for a particular i,j,k position.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
static bool verboseOutput
Switch for verbose output.
virtual const labelList & faceNeighbour() const
Return face neighbour.
void setBlockFaceCorrespondence(const cellList &topoCells, const faceList::subList &topoInternalFaces, const labelList &topoFaceCell, List< Pair< label > > &mergeBlock)