41 bool Foam::layerAdditionRemoval::setLayerPairing()
const 61 mesh.faceZones()[faceZoneID_.
index()].masterCells();
66 mesh.faceZones()[faceZoneID_.
index()].flipMap();
73 mesh.faceZones()[faceZoneID_.
index()]().localFaces();
76 mesh.faceZones()[faceZoneID_.
index()]().meshPoints();
80 if (pointsPairingPtr_ || facesPairingPtr_)
83 <<
"Problem with layer pairing data" 87 pointsPairingPtr_.reset(
new labelList(meshPoints.size(), -1));
88 facesPairingPtr_.reset(
new labelList(mf.size(), -1));
90 auto& ptc = *pointsPairingPtr_;
91 auto& ftc = *facesPairingPtr_;
95 Pout<<
"meshPoints: " << meshPoints <<
nl 97 <<
mesh.faceZones()[faceZoneID_.
index()]().localPoints()
102 label nPointErrors = 0;
103 label nFaceErrors = 0;
108 face curLocalFace = mlf[facei];
117 oppositeFace lidFace =
118 cells[mc[facei]].opposingFace(mf[facei], faces);
129 Pout<<
"curMasterFace: " << faces[mf[facei]] <<
nl 130 <<
"cell shape: " <<
mesh.cellShapes()[mc[facei]] <<
nl 131 <<
"curLocalFace: " << curLocalFace <<
nl 132 <<
"lidFace: " << lidFace
133 <<
" master index: " << lidFace.masterIndex()
134 <<
" oppositeIndex: " << lidFace.oppositeIndex() <<
endl;
138 ftc[facei] = lidFace.oppositeIndex();
141 forAll(curLocalFace, pointi)
143 const label clp = curLocalFace[pointi];
148 ptc[clp] = lidFace[pointi];
153 if (ptc[clp] != lidFace[pointi])
159 Pout<<
"Topological error in cell layer pairing. " 160 <<
"This mesh is either topologically incorrect " 161 <<
"or the master face layer is not defined " 162 <<
"consistently. Please check the " 163 <<
"face zone flip map." <<
nl 164 <<
"First index: " << ptc[clp]
165 <<
" new index: " << lidFace[pointi] <<
endl;
184 const Foam::labelList& Foam::layerAdditionRemoval::pointsPairing()
const 186 if (!pointsPairingPtr_)
189 <<
"Problem with layer pairing data for object " <<
name()
193 return *pointsPairingPtr_;
197 const Foam::labelList& Foam::layerAdditionRemoval::facesPairing()
const 199 if (!facesPairingPtr_)
202 <<
"Problem with layer pairing data for object " <<
name()
206 return *facesPairingPtr_;
219 Pout<<
"void layerAdditionRemoval::modifyMotionPoints(" 220 <<
"pointField& motionPoints) const for object " 226 Pout<<
"No motion point adjustment" <<
endl;
List< cell > cellList
List of cell.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAll(list, i)
Loop across all elements in list.
List< face > faceList
List of faces.
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManip< error > abort(error &err)
label index() const
The index of the first matching items, -1 if no matches.
int debug
Static debugging option.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
List< label > labelList
A List of labels.
const polyMesh & mesh() const
Return the mesh reference.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
List< bool > boolList
A List of bools.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.