38 bool Foam::layerAdditionRemoval::setLayerPairing()
const 58 mesh.faceZones()[faceZoneID_.
index()].masterCells();
63 mesh.faceZones()[faceZoneID_.
index()].flipMap();
65 const faceList& faces = mesh.faces();
66 const cellList& cells = mesh.cells();
70 mesh.faceZones()[faceZoneID_.
index()]().localFaces();
73 mesh.faceZones()[faceZoneID_.
index()]().meshPoints();
77 if (pointsPairingPtr_ || facesPairingPtr_)
80 <<
"Problem with layer pairing data" 84 pointsPairingPtr_ =
new labelList(meshPoints.size(), -1);
87 facesPairingPtr_ =
new labelList(mf.size(), -1);
92 Pout<<
"meshPoints: " << meshPoints <<
nl 94 << mesh.faceZones()[faceZoneID_.
index()]().localPoints()
99 label nPointErrors = 0;
100 label nFaceErrors = 0;
105 face curLocalFace = mlf[facei];
114 oppositeFace lidFace =
115 cells[mc[facei]].opposingFace(mf[facei], faces);
117 if (!lidFace.found())
126 Pout<<
"curMasterFace: " << faces[mf[facei]] <<
nl 127 <<
"cell shape: " << mesh.cellShapes()[mc[facei]] <<
nl 128 <<
"curLocalFace: " << curLocalFace <<
nl 129 <<
"lidFace: " << lidFace
130 <<
" master index: " << lidFace.masterIndex()
131 <<
" oppositeIndex: " << lidFace.oppositeIndex() <<
endl;
135 ftc[facei] = lidFace.oppositeIndex();
138 forAll(curLocalFace, pointi)
140 const label clp = curLocalFace[pointi];
145 ptc[clp] = lidFace[pointi];
150 if (ptc[clp] != lidFace[pointi])
156 Pout<<
"Topological error in cell layer pairing. " 157 <<
"This mesh is either topologically incorrect " 158 <<
"or the master face layer is not defined " 159 <<
"consistently. Please check the " 160 <<
"face zone flip map." <<
nl 161 <<
"First index: " << ptc[clp]
162 <<
" new index: " << lidFace[pointi] <<
endl;
169 reduce(nPointErrors, sumOp<label>());
170 reduce(nFaceErrors, sumOp<label>());
172 if (nPointErrors > 0 || nFaceErrors > 0)
186 const Foam::labelList& Foam::layerAdditionRemoval::pointsPairing()
const 188 if (!pointsPairingPtr_)
191 <<
"Problem with layer pairing data for object " <<
name()
195 return *pointsPairingPtr_;
198 const Foam::labelList& Foam::layerAdditionRemoval::facesPairing()
const 200 if (!facesPairingPtr_)
203 <<
"Problem with layer pairing data for object " <<
name()
207 return *facesPairingPtr_;
220 Pout<<
"void layerAdditionRemoval::modifyMotionPoints(" 221 <<
"pointField& motionPoints) const for object " 227 Pout<<
"No motion point adjustment" <<
endl;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< bool > boolList
Bool container classes.
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
label index() const
Return index of first matching zone.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
prefixOSstream Pout(cout, "Pout")
const word & name() const
Return name of this modifier.
const polyMesh & mesh() const
Return the mesh reference.
List< cell > cellList
list of cells