1 ifstream
kivaFile(kivaFileName.c_str());
6 <<
"Cannot open file " << kivaFileName
10 Info <<
"Reading kiva grid from file " << kivaFileName <<
endl;
31 if (kivaVersion == kiva3v)
43 f(nPoints),
bcl(nPoints),
bcf(nPoints),
bcb(nPoints);
50 scalar
ff, fbcl, fbcf, fbcb;
53 >> i1 >> i3 >> i4 >> i8
54 >> ff >> fbcl >> fbcf >> fbcb
68 if (
bcl[i] > 0 &&
bcl[i] != 4) nBfaces++;
69 if (
bcf[i] > 0 &&
bcf[i] != 4) nBfaces++;
70 if (
bcb[i] > 0 &&
bcb[i] != 4) nBfaces++;
80 <<
"mTable == 0. This is not supported."
81 " kivaToFoam needs complete neighbour information"
99 Info <<
"Finished reading KIVA file" <<
endl;
105 const cellModel&
hex = *(cellModeller::lookup(
"hex"));
107 label activeCells = 0;
123 hexLabels[1] =
i1tab[i];
125 hexLabels[3] =
i3tab[i];
126 hexLabels[4] =
i8tab[i];
127 hexLabels[5] = i1tab[
i8tab[i]];
128 hexLabels[6] =
i3tab[i1tab[i8tab[i]]];
129 hexLabels[7] =
i3tab[i8tab[i]];
131 cellShapes[activeCells] = cellShape(hex, hexLabels);
139 label start = pointMap[edges[ei].start()];
140 while (start != pointMap[start])
142 start = pointMap[start];
145 label end = pointMap[edges[ei].end()];
146 while (end != pointMap[end])
151 label minLabel =
min(start, end);
153 pointMap[start] = pointMap[end] = minLabel;
158 cellZoning[activeCells] =
idreg[i];
166 cellZoning.setSize(activeCells);
176 cs[i] = pointMap[cs[i]];
182 label
bcIDs[11] = {-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};
188 &wallPolyPatch::typeName,
189 &wallPolyPatch::typeName,
190 &wallPolyPatch::typeName,
191 &wallPolyPatch::typeName,
192 &symmetryPolyPatch::typeName,
193 &wedgePolyPatch::typeName,
194 &polyPatch::typeName,
195 &polyPatch::typeName,
196 &polyPatch::typeName,
197 &polyPatch::typeName,
198 &symmetryPolyPatch::typeName,
199 &cyclicPolyPatch::typeName
286 quadFace[2] = i8tab[i1tab[i3tab[i]]];
310 quadFace[2] = i3tab[i1tab[i8tab[i]]];
323 && pFaces[
LINER][0].size()
332 SLList<face>::iterator iter = pFaces[
CYLINDERHEAD][0].begin();
337 const face& pf = iter();
347 SLList<face> newLinerFaces;
351 SLList<face>::iterator iter = pFaces[
LINER][0].begin();
352 iter != pFaces[
LINER][0].end();
356 const face& pf = iter();
358 scalar minfz = GREAT;
370 newLinerFaces.append(pf);
374 if (pFaces[
LINER][0].size() != newLinerFaces.size())
376 Info<<
"Transfered " << pFaces[
LINER][0].size() - newLinerFaces.size()
377 <<
" faces from liner region to cylinder head" <<
endl;
378 pFaces[
LINER][0] = newLinerFaces;
381 SLList<face> newCylinderHeadFaces;
385 SLList<face>::iterator iter = pFaces[
CYLINDERHEAD][0].begin();
390 const face& pf = iter();
392 scalar minfz = GREAT;
398 if (minfz < zHeadMin)
400 pFaces[
LINER][0].append(pf);
404 newCylinderHeadFaces.append(pf);
408 if (pFaces[
CYLINDERHEAD][0].size() != newCylinderHeadFaces.size())
410 Info<<
"Transfered faces from cylinder-head region to linder" <<
endl;
418 for (
int bci=0; bci<
nBCs; bci++)
422 if (pFaces[bci][rgi].size())
439 SLList<face>::iterator iterf = pFaces[
WEDGE][0].begin();
440 SLList<face>::iterator iterb = pFaces[
WEDGE][1].begin();
444 iterf != pFaces[
WEDGE][0].end(), iterb != pFaces[
WEDGE][1].end();
457 pFaces[
CYCLIC].setSize(1);
461 SLList<face>::iterator iterb = pFaces[
WEDGE][1].begin();
462 iterb != pFaces[
WEDGE][1].end();
466 pFaces[
CYCLIC][0].append(iterb());
469 pFaces[
WEDGE].clear();
486 for (
int bci=0; bci<
nBCs; bci++)
490 if (pFaces[bci][rgi].size())
496 if (pFaces[bci].size() > 1)
531 points.setSize(newPointi);
562 polyMesh::defaultRegion,
575 polyMesh::defaultRegion,
594 runTime.path()/runTime.constant()/polyMesh::defaultRegion/
"cellZoning"
596 Info <<
"Writing cell zoning info to file: " << czPath <<
endl;
599 cz << cellZoning <<
endl;