34 void Foam::starMesh::readCouples()
36 fileName couplesFileName(casePrefix_ +
".cpl");
42 IFstream couplesFile(couplesFileName);
44 if (couplesFile.good())
48 label matchLabel, nEntries, typeFlag;
49 label starMasterCell, rotXMasterFace;
50 label starSlaveCell, rotXSlaveFace;
53 while (!(couplesFile >> matchLabel).eof())
56 couplesFile >> nEntries;
58 couplesFile >> typeFlag;
61 couplesFile >> starMasterCell >> rotXMasterFace;
64 label nSlavesToRead = nEntries - 1;
66 nCouples += nSlavesToRead;
68 for (
int i = 0; i < nSlavesToRead; i++)
70 couplesFile >> starSlaveCell >> rotXSlaveFace;
74 Info<<
"Number of couples = " << nCouples << endl <<
endl;
78 Info<< endl <<
"No couple matches defined." <<
endl;
86 couples_.setSize(nCouples);
92 IFstream couplesFile(couplesFileName);
94 label matchLabel, nEntries, typeFlag;
95 label starMasterCell, masterCell, rotXMasterFace, rotZeroMasterFace;
96 label starSlaveCell, slaveCell, rotXSlaveFace, rotZeroSlaveFace;
98 while (!(couplesFile >> matchLabel).eof())
102 couplesFile >> nEntries;
104 couplesFile >> typeFlag;
107 couplesFile >> starMasterCell >> rotXMasterFace;
110 masterCell = starCellLabelLookup_[starMasterCell];
113 if (starCellPermutation_[masterCell] > -1)
115 const label curMasterPermutation =
116 starCellPermutation_[masterCell];
119 sammFacePermutationTable
120 [curMasterPermutation]
125 rotZeroMasterFace = rotXMasterFace;
131 [cellShapes_[masterCell].model().index()]
135 label nSlavesToRead = nEntries - 1;
137 for (
int i = 0; i < nSlavesToRead; i++)
139 couplesFile >> starSlaveCell >> rotXSlaveFace;
142 slaveCell = starCellLabelLookup_[starSlaveCell];
145 if (starCellPermutation_[slaveCell] > -1)
147 const label curSlavePermutation =
148 starCellPermutation_[slaveCell];
151 sammFacePermutationTable
152 [curSlavePermutation]
157 rotZeroSlaveFace = rotXSlaveFace;
162 [cellShapes_[slaveCell].model().index()]
172 masterCell, masterFaceID,
173 slaveCell, slaveFaceID,
180 Info<<
"finished reading couples" <<
endl;
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.