41bool Foam::layerAdditionRemoval::setLayerPairing()
const
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
102 label nPointErrors = 0;
103 label nFaceErrors = 0;
108 face curLocalFace = mlf[facei];
117 oppositeFace lidFace =
118 cells[mc[facei]].opposingFace(mf[facei], faces);
120 if (!lidFace.found())
129 Pout<<
"curMasterFace: " << faces[mf[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;
172 reduce(nPointErrors, sumOp<label>());
173 reduce(nFaceErrors, sumOp<label>());
175 if (nPointErrors > 0 || nFaceErrors > 0)
187const Foam::labelList& Foam::layerAdditionRemoval::pointsPairing()
const
189 if (!pointsPairingPtr_)
192 <<
"Problem with layer pairing data for object " <<
name()
196 return *pointsPairingPtr_;
202 if (!facesPairingPtr_)
205 <<
"Problem with layer pairing data for object " <<
name()
209 return *facesPairingPtr_;
222 Pout<<
"void layerAdditionRemoval::modifyMotionPoints("
223 <<
"pointField& motionPoints) const for object "
229 Pout<<
"No motion point adjustment" <<
endl;
label index() const
The index of the first matching items, -1 if no matches.
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
virtual const faceList & faces() const
Return raw faces.
const polyMesh & mesh() const
Return the mesh reference.
const cellShapeList & cellShapes() const
Return cell shapes.
const cellList & cells() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< label > labelList
A List of labels.
List< cell > cellList
A List of cells.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
errorManip< error > abort(error &err)
List< bool > boolList
A List of bools.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
List< face > faceList
A List of faces.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.