mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
GIT: Initial state after latest Foundation merge
This commit is contained in:
@ -18,7 +18,7 @@ $WM_THIRD_PARTY_DIR/makeCCMIO lib # libso
|
||||
if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
|
||||
-a \( -e $CCMIO_ARCH_PATH/lib/libccmio.a -o $FOAM_EXT_LIBBIN/libccmio.so \) ]
|
||||
then
|
||||
wmake ccm26ToFoam
|
||||
wmake $targetType ccm26ToFoam
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -71,32 +71,32 @@ labelList getInternalFaceOrder
|
||||
labelList oldToNew(owner.size(), -1);
|
||||
|
||||
// First unassigned face
|
||||
label newFaceI = 0;
|
||||
label newFacei = 0;
|
||||
|
||||
forAll(cells, cellI)
|
||||
forAll(cells, celli)
|
||||
{
|
||||
const labelList& cFaces = cells[cellI];
|
||||
const labelList& cFaces = cells[celli];
|
||||
|
||||
SortableList<label> nbr(cFaces.size());
|
||||
|
||||
forAll(cFaces, i)
|
||||
{
|
||||
label faceI = cFaces[i];
|
||||
label facei = cFaces[i];
|
||||
|
||||
label nbrCellI = neighbour[faceI];
|
||||
label nbrCelli = neighbour[facei];
|
||||
|
||||
if (nbrCellI != -1)
|
||||
if (nbrCelli != -1)
|
||||
{
|
||||
// Internal face. Get cell on other side.
|
||||
if (nbrCellI == cellI)
|
||||
if (nbrCelli == celli)
|
||||
{
|
||||
nbrCellI = owner[faceI];
|
||||
nbrCelli = owner[facei];
|
||||
}
|
||||
|
||||
if (cellI < nbrCellI)
|
||||
if (celli < nbrCelli)
|
||||
{
|
||||
// CellI is master
|
||||
nbr[i] = nbrCellI;
|
||||
// Celli is master
|
||||
nbr[i] = nbrCelli;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -117,15 +117,15 @@ labelList getInternalFaceOrder
|
||||
{
|
||||
if (nbr[i] != -1)
|
||||
{
|
||||
oldToNew[cFaces[nbr.indices()[i]]] = newFaceI++;
|
||||
oldToNew[cFaces[nbr.indices()[i]]] = newFacei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Keep boundary faces in same order.
|
||||
for (label faceI = newFaceI; faceI < owner.size(); faceI++)
|
||||
for (label facei = newFacei; facei < owner.size(); facei++)
|
||||
{
|
||||
oldToNew[faceI] = faceI;
|
||||
oldToNew[facei] = facei;
|
||||
}
|
||||
|
||||
return oldToNew;
|
||||
@ -134,7 +134,7 @@ labelList getInternalFaceOrder
|
||||
|
||||
void storeCellInZone
|
||||
(
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label cellType,
|
||||
Map<label>& typeToZone,
|
||||
List<DynamicList<label>>& zoneCells
|
||||
@ -155,12 +155,12 @@ void storeCellInZone
|
||||
<< zoneI << endl;
|
||||
typeToZone.insert(cellType, zoneI);
|
||||
|
||||
zoneCells[zoneI].append(cellI);
|
||||
zoneCells[zoneI].append(celli);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Existing zone for type
|
||||
zoneCells[zoneFnd()].append(cellI);
|
||||
zoneCells[zoneFnd()].append(celli);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -192,7 +192,7 @@ void ReadVertices
|
||||
// any chunk. Normally this would be in a for loop.
|
||||
|
||||
CCMIOSize nVertices;
|
||||
CCMIOEntitySize(&err, vertices, &nVertices, NULL);
|
||||
CCMIOEntitySize(&err, vertices, &nVertices, nullptr);
|
||||
|
||||
List<int> mapData(nVertices, 0);
|
||||
List<float> verts(3*nVertices, 0);
|
||||
@ -211,9 +211,9 @@ void ReadVertices
|
||||
CCMIOReadMap(&err, mapID, mapData.begin(), offset, offsetPlusSize);
|
||||
|
||||
//CCMIOSize size;
|
||||
//CCMIOEntityDescription(&err, vertices, &size, NULL);
|
||||
//CCMIOEntityDescription(&err, vertices, &size, nullptr);
|
||||
//char *desc = new char[size + 1];
|
||||
//CCMIOEntityDescription(&err, vertices, NULL, desc);
|
||||
//CCMIOEntityDescription(&err, vertices, nullptr, desc);
|
||||
//Pout<< "label: '" << desc << "'" << endl;
|
||||
//delete [] desc;
|
||||
|
||||
@ -249,7 +249,7 @@ void ReadProblem
|
||||
int i = 0;
|
||||
while
|
||||
(
|
||||
CCMIONextEntity(NULL, problem, kCCMIOCellType, &i, &next)
|
||||
CCMIONextEntity(nullptr, problem, kCCMIOCellType, &i, &next)
|
||||
== kCCMIONoErr
|
||||
)
|
||||
{
|
||||
@ -261,10 +261,10 @@ void ReadProblem
|
||||
// an array to get the name because we do not know how long the
|
||||
// string is yet. Many parameters to CCMIO functions that
|
||||
// return
|
||||
// data can be NULL if that data is not needed.)
|
||||
// data can be nullptr if that data is not needed.)
|
||||
if
|
||||
(
|
||||
CCMIOReadOptstr(NULL, next, "MaterialType", &size, NULL)
|
||||
CCMIOReadOptstr(nullptr, next, "MaterialType", &size, nullptr)
|
||||
== kCCMIONoErr
|
||||
)
|
||||
{
|
||||
@ -286,19 +286,19 @@ void ReadProblem
|
||||
int k = 0;
|
||||
while
|
||||
(
|
||||
CCMIONextEntity(NULL, problem, kCCMIOBoundaryRegion, &k, &boundary)
|
||||
CCMIONextEntity(nullptr, problem, kCCMIOBoundaryRegion, &k, &boundary)
|
||||
== kCCMIONoErr
|
||||
)
|
||||
{
|
||||
// Index of foam patch
|
||||
label foamPatchI = -1;
|
||||
label foamPatchi = -1;
|
||||
|
||||
// Read prostar id
|
||||
|
||||
int prostarI = -1;
|
||||
if
|
||||
(
|
||||
CCMIOReadOpti(NULL, boundary, "ProstarRegionNumber", &prostarI)
|
||||
CCMIOReadOpti(nullptr, boundary, "ProstarRegionNumber", &prostarI)
|
||||
== kCCMIONoErr
|
||||
)
|
||||
{
|
||||
@ -317,21 +317,27 @@ void ReadProblem
|
||||
|
||||
if (prostarToFoamPatch.found(prostarI))
|
||||
{
|
||||
foamPatchI = prostarToFoamPatch[prostarI];
|
||||
foamPatchi = prostarToFoamPatch[prostarI];
|
||||
|
||||
// Read boundary type
|
||||
|
||||
int size;
|
||||
if
|
||||
(
|
||||
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, NULL)
|
||||
== kCCMIONoErr
|
||||
CCMIOReadOptstr
|
||||
(
|
||||
nullptr,
|
||||
boundary,
|
||||
"BoundaryType",
|
||||
&size,
|
||||
nullptr
|
||||
) == kCCMIONoErr
|
||||
)
|
||||
{
|
||||
char* s = new char[size + 1];
|
||||
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, s);
|
||||
CCMIOReadOptstr(nullptr, boundary, "BoundaryType", &size, s);
|
||||
s[size] = '\0';
|
||||
foamPatchTypes[foamPatchI] = string::validate<word>(string(s));
|
||||
foamPatchTypes[foamPatchi] = string::validate<word>(string(s));
|
||||
delete [] s;
|
||||
}
|
||||
|
||||
@ -346,42 +352,48 @@ void ReadProblem
|
||||
|
||||
if
|
||||
(
|
||||
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, NULL)
|
||||
== kCCMIONoErr
|
||||
CCMIOReadOptstr
|
||||
(
|
||||
nullptr,
|
||||
boundary,
|
||||
"BoundaryName",
|
||||
&size,
|
||||
nullptr
|
||||
) == kCCMIONoErr
|
||||
)
|
||||
{
|
||||
char* name = new char[size + 1];
|
||||
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, name);
|
||||
CCMIOReadOptstr(nullptr, boundary, "BoundaryName", &size, name);
|
||||
name[size] = '\0';
|
||||
foamPatchNames[foamPatchI] =
|
||||
foamPatchNames[foamPatchi] =
|
||||
string::validate<word>(string(name));
|
||||
delete [] name;
|
||||
}
|
||||
else if
|
||||
(
|
||||
CCMIOReadOptstr(NULL, boundary, "Label", &size, NULL)
|
||||
CCMIOReadOptstr(nullptr, boundary, "Label", &size, nullptr)
|
||||
== kCCMIONoErr
|
||||
)
|
||||
{
|
||||
char* name = new char[size + 1];
|
||||
CCMIOReadOptstr(NULL, boundary, "Label", &size, name);
|
||||
CCMIOReadOptstr(nullptr, boundary, "Label", &size, name);
|
||||
name[size] = '\0';
|
||||
foamPatchNames[foamPatchI] =
|
||||
foamPatchNames[foamPatchi] =
|
||||
string::validate<word>(string(name));
|
||||
delete [] name;
|
||||
}
|
||||
else
|
||||
{
|
||||
foamPatchNames[foamPatchI] =
|
||||
foamPatchTypes[foamPatchI]
|
||||
+ Foam::name(foamPatchI);
|
||||
Pout<< "Made up name:" << foamPatchNames[foamPatchI]
|
||||
foamPatchNames[foamPatchi] =
|
||||
foamPatchTypes[foamPatchi]
|
||||
+ Foam::name(foamPatchi);
|
||||
Pout<< "Made up name:" << foamPatchNames[foamPatchi]
|
||||
<< endl;
|
||||
}
|
||||
|
||||
Pout<< "Read patch:" << foamPatchI
|
||||
<< " name:" << foamPatchNames[foamPatchI]
|
||||
<< " foamPatchTypes:" << foamPatchTypes[foamPatchI]
|
||||
Pout<< "Read patch:" << foamPatchi
|
||||
<< " name:" << foamPatchNames[foamPatchi]
|
||||
<< " foamPatchTypes:" << foamPatchTypes[foamPatchi]
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -413,7 +425,7 @@ void ReadCells
|
||||
CCMIOID id;
|
||||
CCMIOGetEntity(&err, topology, kCCMIOCells, 0, &id);
|
||||
CCMIOSize nCells;
|
||||
CCMIOEntitySize(&err, id, &nCells, NULL);
|
||||
CCMIOEntitySize(&err, id, &nCells, nullptr);
|
||||
|
||||
std::vector<int> mapData(nCells);
|
||||
std::vector<int> cellType(nCells);
|
||||
@ -437,7 +449,7 @@ void ReadCells
|
||||
|
||||
CCMIOGetEntity(&err, topology, kCCMIOInternalFaces, 0, &id);
|
||||
CCMIOSize nInternalFaces;
|
||||
CCMIOEntitySize(&err, id, &nInternalFaces, NULL);
|
||||
CCMIOEntitySize(&err, id, &nInternalFaces, nullptr);
|
||||
Pout<< "nInternalFaces:" << nInternalFaces << endl;
|
||||
|
||||
// Determine patch sizes before reading internal faces
|
||||
@ -445,12 +457,12 @@ void ReadCells
|
||||
int index = 0;
|
||||
while
|
||||
(
|
||||
CCMIONextEntity(NULL, topology, kCCMIOBoundaryFaces, &index, &id)
|
||||
CCMIONextEntity(nullptr, topology, kCCMIOBoundaryFaces, &index, &id)
|
||||
== kCCMIONoErr
|
||||
)
|
||||
{
|
||||
CCMIOSize size;
|
||||
CCMIOEntitySize(&err, id, &size, NULL);
|
||||
CCMIOEntitySize(&err, id, &size, nullptr);
|
||||
|
||||
Pout<< "Read kCCMIOBoundaryFaces entry with " << size
|
||||
<< " faces." << endl;
|
||||
@ -469,10 +481,10 @@ void ReadCells
|
||||
mapData.resize(nInternalFaces);
|
||||
CCMIOGetEntity(&err, topology, kCCMIOInternalFaces, 0, &id);
|
||||
CCMIOSize size;
|
||||
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, NULL, &size, NULL,
|
||||
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, nullptr, &size, nullptr,
|
||||
kCCMIOStart, kCCMIOEnd);
|
||||
std::vector<int> faces(size);
|
||||
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, &mapID, NULL, &faces[0],
|
||||
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, &mapID, nullptr, &faces[0],
|
||||
kCCMIOStart, kCCMIOEnd);
|
||||
std::vector<int> faceCells(2*nInternalFaces);
|
||||
CCMIOReadFaceCells(&err, id, kCCMIOInternalFaces, &faceCells[0],
|
||||
@ -488,12 +500,12 @@ void ReadCells
|
||||
|
||||
unsigned int pos = 0;
|
||||
|
||||
for (unsigned int faceI = 0; faceI < nInternalFaces; faceI++)
|
||||
for (unsigned int facei = 0; facei < nInternalFaces; facei++)
|
||||
{
|
||||
foamFaceMap[faceI] = mapData[faceI];
|
||||
foamOwner[faceI] = faceCells[2*faceI];
|
||||
foamNeighbour[faceI] = faceCells[2*faceI+1];
|
||||
face& f = foamFaces[faceI];
|
||||
foamFaceMap[facei] = mapData[facei];
|
||||
foamOwner[facei] = faceCells[2*facei];
|
||||
foamNeighbour[facei] = faceCells[2*facei+1];
|
||||
face& f = foamFaces[facei];
|
||||
|
||||
f.setSize(faces[pos++]);
|
||||
forAll(f, fp)
|
||||
@ -509,22 +521,38 @@ void ReadCells
|
||||
label regionI = 0;
|
||||
while
|
||||
(
|
||||
CCMIONextEntity(NULL, topology, kCCMIOBoundaryFaces, &index, &id)
|
||||
CCMIONextEntity(nullptr, topology, kCCMIOBoundaryFaces, &index, &id)
|
||||
== kCCMIONoErr
|
||||
)
|
||||
{
|
||||
CCMIOSize nFaces;
|
||||
CCMIOEntitySize(&err, id, &nFaces, NULL);
|
||||
CCMIOEntitySize(&err, id, &nFaces, nullptr);
|
||||
|
||||
mapData.resize(nFaces);
|
||||
faceCells.resize(nFaces);
|
||||
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, NULL, &size, NULL,
|
||||
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, nullptr, &size, nullptr,
|
||||
kCCMIOStart, kCCMIOEnd);
|
||||
faces.resize(size);
|
||||
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, &mapID, NULL, &faces[0],
|
||||
kCCMIOStart, kCCMIOEnd);
|
||||
CCMIOReadFaceCells(&err, id, kCCMIOBoundaryFaces, &faceCells[0],
|
||||
kCCMIOStart, kCCMIOEnd);
|
||||
CCMIOReadFaces
|
||||
(
|
||||
&err,
|
||||
id,
|
||||
kCCMIOBoundaryFaces,
|
||||
&mapID,
|
||||
nullptr,
|
||||
&faces[0],
|
||||
kCCMIOStart,
|
||||
kCCMIOEnd
|
||||
);
|
||||
CCMIOReadFaceCells
|
||||
(
|
||||
&err,
|
||||
id,
|
||||
kCCMIOBoundaryFaces,
|
||||
&faceCells[0],
|
||||
kCCMIOStart,
|
||||
kCCMIOEnd
|
||||
);
|
||||
CCMIOReadMap(&err, mapID, &mapData[0], kCCMIOStart, kCCMIOEnd);
|
||||
CheckError(err, "Error reading boundary faces");
|
||||
|
||||
@ -532,7 +560,7 @@ void ReadCells
|
||||
int prostarI;
|
||||
if
|
||||
(
|
||||
CCMIOReadOpti(NULL, id, "ProstarRegionNumber", &prostarI)
|
||||
CCMIOReadOpti(nullptr, id, "ProstarRegionNumber", &prostarI)
|
||||
== kCCMIONoErr
|
||||
)
|
||||
{
|
||||
@ -563,12 +591,12 @@ void ReadCells
|
||||
|
||||
for (unsigned int i = 0; i < nFaces; i++)
|
||||
{
|
||||
label foamFaceI = foamPatchStarts[regionI] + i;
|
||||
label foamFacei = foamPatchStarts[regionI] + i;
|
||||
|
||||
foamFaceMap[foamFaceI] = mapData[i];
|
||||
foamOwner[foamFaceI] = faceCells[i];
|
||||
foamNeighbour[foamFaceI] = -1;
|
||||
face& f = foamFaces[foamFaceI];
|
||||
foamFaceMap[foamFacei] = mapData[i];
|
||||
foamOwner[foamFacei] = faceCells[i];
|
||||
foamNeighbour[foamFacei] = -1;
|
||||
face& f = foamFaces[foamFacei];
|
||||
|
||||
f.setSize(faces[pos++]);
|
||||
forAll(f, fp)
|
||||
@ -645,12 +673,12 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Open the file. Because we did not initialize 'err' we need to pass
|
||||
// in NULL (which always means kCCMIONoErr) and then assign the return
|
||||
// value to 'err'.).
|
||||
// in nullptr (which always means kCCMIONoErr) and then assign the
|
||||
// return value to 'err'.).
|
||||
CCMIOID root;
|
||||
CCMIOError err = CCMIOOpenFile
|
||||
(
|
||||
NULL,
|
||||
nullptr,
|
||||
ccmFile.c_str(),
|
||||
kCCMIORead,
|
||||
&root
|
||||
@ -665,9 +693,9 @@ int main(int argc, char *argv[])
|
||||
CheckError(err, "Error opening state");
|
||||
|
||||
unsigned int size;
|
||||
CCMIOEntityDescription(&err, state, &size, NULL);
|
||||
CCMIOEntityDescription(&err, state, &size, nullptr);
|
||||
char *desc = new char[size + 1];
|
||||
CCMIOEntityDescription(&err, state, NULL, desc);
|
||||
CCMIOEntityDescription(&err, state, nullptr, desc);
|
||||
Pout<< "Reading state '" << kDefaultState << "' (" << desc << ")"
|
||||
<< endl;
|
||||
delete [] desc;
|
||||
@ -684,7 +712,7 @@ int main(int argc, char *argv[])
|
||||
processor,
|
||||
&vertices,
|
||||
&topology,
|
||||
NULL,
|
||||
nullptr,
|
||||
&solution
|
||||
);
|
||||
|
||||
@ -698,8 +726,8 @@ int main(int argc, char *argv[])
|
||||
processor,
|
||||
&vertices,
|
||||
&topology,
|
||||
NULL,
|
||||
NULL
|
||||
nullptr,
|
||||
nullptr
|
||||
);
|
||||
if (err != kCCMIONoErr)
|
||||
{
|
||||
@ -807,19 +835,19 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Renumber vertex labels to Foam point labels
|
||||
{
|
||||
label maxCCMPointI = max(foamPointMap);
|
||||
labelList toFoamPoints(invert(maxCCMPointI+1, foamPointMap));
|
||||
label maxCCMPointi = max(foamPointMap);
|
||||
labelList toFoamPoints(invert(maxCCMPointi+1, foamPointMap));
|
||||
|
||||
forAll(foamFaces, faceI)
|
||||
forAll(foamFaces, facei)
|
||||
{
|
||||
inplaceRenumber(toFoamPoints, foamFaces[faceI]);
|
||||
inplaceRenumber(toFoamPoints, foamFaces[facei]);
|
||||
}
|
||||
}
|
||||
|
||||
// Renumber cell labels
|
||||
{
|
||||
label maxCCMCellI = max(foamCellMap);
|
||||
labelList toFoamCells(invert(maxCCMCellI+1, foamCellMap));
|
||||
label maxCCMCelli = max(foamCellMap);
|
||||
labelList toFoamCells(invert(maxCCMCelli+1, foamCellMap));
|
||||
|
||||
inplaceRenumber(toFoamCells, foamOwner);
|
||||
inplaceRenumber(toFoamCells, foamNeighbour);
|
||||
@ -837,15 +865,15 @@ int main(int argc, char *argv[])
|
||||
// Set owner/neighbour so owner < neighbour
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
forAll(foamNeighbour, faceI)
|
||||
forAll(foamNeighbour, facei)
|
||||
{
|
||||
label nbr = foamNeighbour[faceI];
|
||||
label own = foamOwner[faceI];
|
||||
label nbr = foamNeighbour[facei];
|
||||
label own = foamOwner[facei];
|
||||
|
||||
if (nbr >= foamCellType.size() || own >= foamCellType.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "face:" << faceI
|
||||
<< "face:" << facei
|
||||
<< " nbr:" << nbr
|
||||
<< " own:" << own
|
||||
<< " nCells:" << foamCellType.size()
|
||||
@ -856,15 +884,15 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (nbr < own)
|
||||
{
|
||||
foamOwner[faceI] = foamNeighbour[faceI];
|
||||
foamNeighbour[faceI] = own;
|
||||
foamFaces[faceI].flip();
|
||||
foamOwner[facei] = foamNeighbour[facei];
|
||||
foamNeighbour[facei] = own;
|
||||
foamFaces[facei].flip();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// And check the face
|
||||
const face& f = foamFaces[faceI];
|
||||
const face& f = foamFaces[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -903,9 +931,9 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Reorder faces accordingly
|
||||
forAll(foamCells, cellI)
|
||||
forAll(foamCells, celli)
|
||||
{
|
||||
inplaceRenumber(oldToNew, foamCells[cellI]);
|
||||
inplaceRenumber(oldToNew, foamCells[celli]);
|
||||
}
|
||||
|
||||
// Reorder faces.
|
||||
@ -935,40 +963,40 @@ int main(int argc, char *argv[])
|
||||
// Create patches. Use patch types to determine what Foam types to generate.
|
||||
List<polyPatch*> newPatches(foamPatchNames.size());
|
||||
|
||||
label meshFaceI = foamPatchStarts[0];
|
||||
label meshFacei = foamPatchStarts[0];
|
||||
|
||||
forAll(newPatches, patchI)
|
||||
forAll(newPatches, patchi)
|
||||
{
|
||||
const word& patchName = foamPatchNames[patchI];
|
||||
const word& patchType = foamPatchTypes[patchI];
|
||||
const word& patchName = foamPatchNames[patchi];
|
||||
const word& patchType = foamPatchTypes[patchi];
|
||||
|
||||
Pout<< "Patch:" << patchName << " start at:" << meshFaceI
|
||||
<< " size:" << foamPatchSizes[patchI]
|
||||
<< " end at:" << meshFaceI+foamPatchSizes[patchI]
|
||||
Pout<< "Patch:" << patchName << " start at:" << meshFacei
|
||||
<< " size:" << foamPatchSizes[patchi]
|
||||
<< " end at:" << meshFacei+foamPatchSizes[patchi]
|
||||
<< endl;
|
||||
|
||||
if (patchType == "wall")
|
||||
{
|
||||
newPatches[patchI] =
|
||||
newPatches[patchi] =
|
||||
new wallPolyPatch
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchI],
|
||||
meshFaceI,
|
||||
patchI,
|
||||
foamPatchSizes[patchi],
|
||||
meshFacei,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
);
|
||||
}
|
||||
else if (patchType == "symmetryplane")
|
||||
{
|
||||
newPatches[patchI] =
|
||||
newPatches[patchi] =
|
||||
new symmetryPolyPatch
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchI],
|
||||
meshFaceI,
|
||||
patchI,
|
||||
foamPatchSizes[patchi],
|
||||
meshFacei,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
);
|
||||
@ -976,13 +1004,13 @@ int main(int argc, char *argv[])
|
||||
else if (patchType == "empty")
|
||||
{
|
||||
// Note: not ccm name, introduced by us above.
|
||||
newPatches[patchI] =
|
||||
newPatches[patchi] =
|
||||
new emptyPolyPatch
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchI],
|
||||
meshFaceI,
|
||||
patchI,
|
||||
foamPatchSizes[patchi],
|
||||
meshFacei,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
);
|
||||
@ -991,25 +1019,25 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// All other ccm types become straight polyPatch:
|
||||
// 'inlet', 'outlet', ...
|
||||
newPatches[patchI] =
|
||||
newPatches[patchi] =
|
||||
new polyPatch
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchI],
|
||||
meshFaceI,
|
||||
patchI,
|
||||
foamPatchSizes[patchi],
|
||||
meshFacei,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
word::null
|
||||
);
|
||||
}
|
||||
|
||||
meshFaceI += foamPatchSizes[patchI];
|
||||
meshFacei += foamPatchSizes[patchi];
|
||||
}
|
||||
|
||||
if (meshFaceI != foamOwner.size())
|
||||
if (meshFacei != foamOwner.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "meshFaceI:" << meshFaceI
|
||||
<< "meshFacei:" << meshFacei
|
||||
<< " nFaces:" << foamOwner.size()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -1030,12 +1058,12 @@ int main(int argc, char *argv[])
|
||||
// Storage for cell zones.
|
||||
List<DynamicList<label>> zoneCells(0);
|
||||
|
||||
forAll(foamCellType, cellI)
|
||||
forAll(foamCellType, celli)
|
||||
{
|
||||
storeCellInZone
|
||||
(
|
||||
cellI,
|
||||
foamCellType[cellI],
|
||||
celli,
|
||||
foamCellType[celli],
|
||||
typeToZone,
|
||||
zoneCells
|
||||
);
|
||||
@ -1100,9 +1128,9 @@ int main(int argc, char *argv[])
|
||||
dimensionedScalar("cellId", dimless, 0.0)
|
||||
);
|
||||
|
||||
forAll(foamCellMap, cellI)
|
||||
forAll(foamCellMap, celli)
|
||||
{
|
||||
cellIdField[cellI] = foamCellMap[cellI];
|
||||
cellIdField[celli] = foamCellMap[celli];
|
||||
}
|
||||
|
||||
// Construct field with calculated bc to hold cell type.
|
||||
@ -1120,9 +1148,9 @@ int main(int argc, char *argv[])
|
||||
dimensionedScalar("cellType", dimless, 0.0)
|
||||
);
|
||||
|
||||
forAll(foamCellType, cellI)
|
||||
forAll(foamCellType, celli)
|
||||
{
|
||||
cellTypeField[cellI] = foamCellType[cellI];
|
||||
cellTypeField[celli] = foamCellType[celli];
|
||||
}
|
||||
|
||||
Info<< "Writing cellIds as volScalarField to " << cellIdField.objectPath()
|
||||
|
||||
@ -280,11 +280,11 @@ label findFace(const polyMesh& mesh, const face& f)
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
label facei = pFaces[i];
|
||||
|
||||
if (mesh.faces()[faceI] == f)
|
||||
if (mesh.faces()[facei] == f)
|
||||
{
|
||||
return faceI;
|
||||
return facei;
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,7 +318,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "createTime.H"
|
||||
|
||||
fileName ansysFile(args.additionalArgs()[0]);
|
||||
fileName ansysFile(args[1]);
|
||||
ifstream ansysStream(ansysFile.c_str());
|
||||
|
||||
if (!ansysStream)
|
||||
@ -488,18 +488,18 @@ int main(int argc, char *argv[])
|
||||
faceListList boundary(slPatchCells.size());
|
||||
wordList patchNames(slPatchCells.size());
|
||||
|
||||
forAll(slPatchCells, patchI)
|
||||
forAll(slPatchCells, patchi)
|
||||
{
|
||||
SLList<face> patchFaces;
|
||||
|
||||
SLList<label>::iterator cellIter(slPatchCells[patchI].begin());
|
||||
SLList<label>::iterator faceIter(slPatchCellFaces[patchI].begin());
|
||||
SLList<label>::iterator cellIter(slPatchCells[patchi].begin());
|
||||
SLList<label>::iterator faceIter(slPatchCellFaces[patchi].begin());
|
||||
|
||||
for
|
||||
(
|
||||
;
|
||||
cellIter != slPatchCells[patchI].end()
|
||||
&& faceIter != slPatchCellFaces[patchI].end();
|
||||
cellIter != slPatchCells[patchi].end()
|
||||
&& faceIter != slPatchCellFaces[patchi].end();
|
||||
++cellIter, ++faceIter
|
||||
)
|
||||
{
|
||||
@ -516,8 +516,8 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
}
|
||||
|
||||
boundary[patchI] = patchFaces;
|
||||
patchNames[patchI] = word("patch") + name(patchI + 1);
|
||||
boundary[patchi] = patchFaces;
|
||||
patchNames[patchi] = word("patch") + name(patchi + 1);
|
||||
}
|
||||
|
||||
|
||||
@ -525,10 +525,10 @@ int main(int argc, char *argv[])
|
||||
// Lookup the face labels for all the boundary faces
|
||||
//
|
||||
labelListList boundaryFaceLabels(boundary.size());
|
||||
forAll(boundary, patchI)
|
||||
forAll(boundary, patchi)
|
||||
{
|
||||
const faceList& bFaces = boundary[patchI];
|
||||
labelList& bFaceLabels = boundaryFaceLabels[patchI];
|
||||
const faceList& bFaces = boundary[patchi];
|
||||
labelList& bFaceLabels = boundaryFaceLabels[patchi];
|
||||
bFaceLabels.setSize(bFaces.size());
|
||||
forAll(bFaces, i)
|
||||
{
|
||||
@ -541,24 +541,24 @@ int main(int argc, char *argv[])
|
||||
// faces go into faceZones and external faces go into patches.
|
||||
List<faceList> patchFaces(slPatchCells.size());
|
||||
labelList patchNFaces(slPatchCells.size(), 0);
|
||||
forAll(boundary, patchI)
|
||||
forAll(boundary, patchi)
|
||||
{
|
||||
const faceList& bFaces = boundary[patchI];
|
||||
const labelList& bFaceLabels = boundaryFaceLabels[patchI];
|
||||
const faceList& bFaces = boundary[patchi];
|
||||
const labelList& bFaceLabels = boundaryFaceLabels[patchi];
|
||||
|
||||
patchFaces[patchI].setSize(bFaces.size());
|
||||
patchFaces[patchi].setSize(bFaces.size());
|
||||
|
||||
forAll(bFaces, i)
|
||||
{
|
||||
if (!dummyMesh().isInternalFace(bFaceLabels[i]))
|
||||
{
|
||||
patchFaces[patchI][patchNFaces[patchI]++] = bFaces[i];
|
||||
patchFaces[patchi][patchNFaces[patchi]++] = bFaces[i];
|
||||
}
|
||||
}
|
||||
patchFaces[patchI].setSize(patchNFaces[patchI]);
|
||||
patchFaces[patchi].setSize(patchNFaces[patchi]);
|
||||
|
||||
Info<< "Patch " << patchI << " named " << patchNames[patchI]
|
||||
<< ": " << boundary[patchI].size() << " faces" << endl;
|
||||
Info<< "Patch " << patchi << " named " << patchNames[patchi]
|
||||
<< ": " << boundary[patchi].size() << " faces" << endl;
|
||||
}
|
||||
|
||||
// We no longer need the dummyMesh
|
||||
@ -586,14 +586,14 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Add information to dictionary
|
||||
forAll(patchNames, patchI)
|
||||
forAll(patchNames, patchi)
|
||||
{
|
||||
if (!patchDicts.set(patchI))
|
||||
if (!patchDicts.set(patchi))
|
||||
{
|
||||
patchDicts.set(patchI, new dictionary());
|
||||
patchDicts.set(patchi, new dictionary());
|
||||
}
|
||||
// Add but not overwrite
|
||||
patchDicts[patchI].add("type", polyPatch::typeName, false);
|
||||
patchDicts[patchi].add("type", polyPatch::typeName, false);
|
||||
}
|
||||
|
||||
|
||||
@ -622,27 +622,27 @@ int main(int argc, char *argv[])
|
||||
DynamicList<cellZone*> cz;
|
||||
|
||||
// FaceZones
|
||||
forAll(boundaryFaceLabels, patchI)
|
||||
forAll(boundaryFaceLabels, patchi)
|
||||
{
|
||||
if (boundaryFaceLabels[patchI].size())
|
||||
if (boundaryFaceLabels[patchi].size())
|
||||
{
|
||||
// Re-do the boundaryFaceLabels since the boundary face
|
||||
// labels will be different on the pShapeMesh.
|
||||
const faceList& bFaces = boundary[patchI];
|
||||
labelList& bFaceLabels = boundaryFaceLabels[patchI];
|
||||
const faceList& bFaces = boundary[patchi];
|
||||
labelList& bFaceLabels = boundaryFaceLabels[patchi];
|
||||
forAll(bFaceLabels, i)
|
||||
{
|
||||
bFaceLabels[i] = findFace(pShapeMesh, bFaces[i]);
|
||||
}
|
||||
|
||||
Info<< "Creating faceZone " << patchNames[patchI]
|
||||
Info<< "Creating faceZone " << patchNames[patchi]
|
||||
<< " with " << bFaceLabels.size() << " faces" << endl;
|
||||
|
||||
fz.append
|
||||
(
|
||||
new faceZone
|
||||
(
|
||||
patchNames[patchI],
|
||||
patchNames[patchi],
|
||||
bFaceLabels,
|
||||
boolList(bFaceLabels.size(), false),
|
||||
fz.size(),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -106,14 +106,14 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
label no, blkNo, patchLabel;
|
||||
|
||||
forAll(cfxPatchTypes, patchI)
|
||||
forAll(cfxPatchTypes, patchi)
|
||||
{
|
||||
// Grab patch type and name
|
||||
cfxFile >> cfxPatchTypes[patchI] >> cfxPatchNames[patchI] >> no;
|
||||
cfxFile >> cfxPatchTypes[patchi] >> cfxPatchNames[patchi] >> no;
|
||||
|
||||
// Grab patch range
|
||||
patchRanges[patchI].setSize(6);
|
||||
labelList& curRange = patchRanges[patchI];
|
||||
patchRanges[patchi].setSize(6);
|
||||
labelList& curRange = patchRanges[patchi];
|
||||
|
||||
forAll(curRange, rI)
|
||||
{
|
||||
@ -125,9 +125,9 @@ int main(int argc, char *argv[])
|
||||
// 0 = solid (3-D patch),
|
||||
// 1 = high i, 2 = high j, 3 = high k
|
||||
// 4 = low i, 5 = low j, 6 = low k
|
||||
cfxFile >> patchDirections[patchI] >> blkNo >> patchLabel;
|
||||
cfxFile >> patchDirections[patchi] >> blkNo >> patchLabel;
|
||||
|
||||
patchMasterBlocks[patchI] = blkNo - 1;
|
||||
patchMasterBlocks[patchi] = blkNo - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,9 +181,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
faceListList rawPatches(npatch);
|
||||
|
||||
forAll(rawPatches, patchI)
|
||||
forAll(rawPatches, patchi)
|
||||
{
|
||||
const word& patchType = cfxPatchTypes[patchI];
|
||||
const word& patchType = cfxPatchTypes[patchi];
|
||||
|
||||
// reject volume patches
|
||||
if
|
||||
@ -192,17 +192,17 @@ int main(int argc, char *argv[])
|
||||
|| patchType == "SOLCON" || patchType == "USER3D"
|
||||
)
|
||||
{
|
||||
patchMasterBlocks[patchI] = -1;
|
||||
rawPatches[patchI].setSize(0);
|
||||
patchMasterBlocks[patchi] = -1;
|
||||
rawPatches[patchi].setSize(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// read and create a 2-D patch
|
||||
rawPatches[patchI] =
|
||||
blocks[patchMasterBlocks[patchI]].patchFaces
|
||||
rawPatches[patchi] =
|
||||
blocks[patchMasterBlocks[patchi]].patchFaces
|
||||
(
|
||||
patchDirections[patchI],
|
||||
patchRanges[patchI]
|
||||
patchDirections[patchi],
|
||||
patchRanges[patchi]
|
||||
);
|
||||
|
||||
}
|
||||
@ -257,11 +257,11 @@ int main(int argc, char *argv[])
|
||||
const labelList& blockPFacePoints =
|
||||
blockPFaces[blockPFaceLabel];
|
||||
|
||||
forAll(blockPFacePoints, blockPFacePointI)
|
||||
forAll(blockPFacePoints, blockPFacePointi)
|
||||
{
|
||||
forAll(blockPFacePoints, blockPFacePointI2)
|
||||
forAll(blockPFacePoints, blockPFacePointi2)
|
||||
{
|
||||
if (blockPFacePointI != blockPFacePointI2)
|
||||
if (blockPFacePointi != blockPFacePointi2)
|
||||
{
|
||||
sqrMergeTol =
|
||||
min
|
||||
@ -270,9 +270,9 @@ int main(int argc, char *argv[])
|
||||
magSqr
|
||||
(
|
||||
blockPpoints
|
||||
[blockPFacePoints[blockPFacePointI]]
|
||||
[blockPFacePoints[blockPFacePointi]]
|
||||
- blockPpoints
|
||||
[blockPFacePoints[blockPFacePointI2]]
|
||||
[blockPFacePoints[blockPFacePointi2]]
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -294,7 +294,7 @@ int main(int argc, char *argv[])
|
||||
labelList& cp = curPairs[blockPFaceLabel];
|
||||
cp.setSize(blockPFacePoints.size());
|
||||
|
||||
forAll(blockPFacePoints, blockPFacePointI)
|
||||
forAll(blockPFacePoints, blockPFacePointi)
|
||||
{
|
||||
found = false;
|
||||
|
||||
@ -303,16 +303,16 @@ int main(int argc, char *argv[])
|
||||
const labelList& blockNFacePoints =
|
||||
blockNFaces[blockNFaceLabel];
|
||||
|
||||
forAll(blockNFacePoints, blockNFacePointI)
|
||||
forAll(blockNFacePoints, blockNFacePointi)
|
||||
{
|
||||
if
|
||||
(
|
||||
magSqr
|
||||
(
|
||||
blockPpoints
|
||||
[blockPFacePoints[blockPFacePointI]]
|
||||
[blockPFacePoints[blockPFacePointi]]
|
||||
- blockNpoints
|
||||
[blockNFacePoints[blockNFacePointI]]
|
||||
[blockNFacePoints[blockNFacePointi]]
|
||||
)
|
||||
< sqrMergeTol
|
||||
)
|
||||
@ -320,15 +320,15 @@ int main(int argc, char *argv[])
|
||||
// Found a new pair
|
||||
found = true;
|
||||
|
||||
cp[blockPFacePointI] =
|
||||
blockNFacePoints[blockNFacePointI];
|
||||
cp[blockPFacePointi] =
|
||||
blockNFacePoints[blockNFacePointi];
|
||||
|
||||
label PpointLabel =
|
||||
blockPFacePoints[blockPFacePointI]
|
||||
blockPFacePoints[blockPFacePointi]
|
||||
+ blockOffsets[blockPlabel];
|
||||
|
||||
label NpointLabel =
|
||||
blockNFacePoints[blockNFacePointI]
|
||||
blockNFacePoints[blockNFacePointi]
|
||||
+ blockOffsets[blockNlabel];
|
||||
|
||||
label minPN = min(PpointLabel, NpointLabel);
|
||||
@ -384,14 +384,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
const labelList& cp = curPairs[blockPFaceLabel];
|
||||
|
||||
forAll(cp, blockPFacePointI)
|
||||
forAll(cp, blockPFacePointi)
|
||||
{
|
||||
label PpointLabel =
|
||||
blockPFacePoints[blockPFacePointI]
|
||||
blockPFacePoints[blockPFacePointi]
|
||||
+ blockOffsets[blockPlabel];
|
||||
|
||||
label NpointLabel =
|
||||
cp[blockPFacePointI]
|
||||
cp[blockPFacePointi]
|
||||
+ blockOffsets[blockNlabel];
|
||||
|
||||
if
|
||||
@ -443,16 +443,16 @@ int main(int argc, char *argv[])
|
||||
const labelList& blockPFacePoints
|
||||
= blockPFaces[blockPFaceLabel];
|
||||
|
||||
forAll(blockPFacePoints, blockPFacePointI)
|
||||
forAll(blockPFacePoints, blockPFacePointi)
|
||||
{
|
||||
label PpointLabel =
|
||||
blockPFacePoints[blockPFacePointI]
|
||||
blockPFacePoints[blockPFacePointi]
|
||||
+ blockOffsets[blockPlabel];
|
||||
|
||||
if (pointMergeList[PpointLabel] == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unable to merge point " << blockPFacePointI
|
||||
<< "Unable to merge point " << blockPFacePointi
|
||||
<< " of face " << blockPFaceLabel
|
||||
<< " of block " << blockPlabel
|
||||
<< abort(FatalError);
|
||||
@ -465,16 +465,16 @@ int main(int argc, char *argv[])
|
||||
const labelList& blockNFacePoints
|
||||
= blockNFaces[blockNFaceLabel];
|
||||
|
||||
forAll(blockNFacePoints, blockNFacePointI)
|
||||
forAll(blockNFacePoints, blockNFacePointi)
|
||||
{
|
||||
label NpointLabel =
|
||||
blockNFacePoints[blockNFacePointI]
|
||||
blockNFacePoints[blockNFacePointi]
|
||||
+ blockOffsets[blockNlabel];
|
||||
|
||||
if (pointMergeList[NpointLabel] == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unable to merge point " << blockNFacePointI
|
||||
<< "Unable to merge point " << blockNFacePointi
|
||||
<< " of face " << blockNFaceLabel
|
||||
<< " of block " << blockNlabel
|
||||
<< abort(FatalError);
|
||||
@ -553,16 +553,16 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
labelListList curBlockCells = blocks[blockI].blockCells();
|
||||
|
||||
forAll(curBlockCells, blockCellI)
|
||||
forAll(curBlockCells, blockCelli)
|
||||
{
|
||||
labelList cellPoints(curBlockCells[blockCellI].size());
|
||||
labelList cellPoints(curBlockCells[blockCelli].size());
|
||||
|
||||
forAll(cellPoints, pointI)
|
||||
forAll(cellPoints, pointi)
|
||||
{
|
||||
cellPoints[pointI] =
|
||||
cellPoints[pointi] =
|
||||
pointMergeList
|
||||
[
|
||||
curBlockCells[blockCellI][pointI]
|
||||
curBlockCells[blockCelli][pointi]
|
||||
+ blockOffsets[blockI]
|
||||
];
|
||||
}
|
||||
@ -583,30 +583,30 @@ int main(int argc, char *argv[])
|
||||
|
||||
label nCreatedPatches = 0;
|
||||
|
||||
forAll(rawPatches, patchI)
|
||||
forAll(rawPatches, patchi)
|
||||
{
|
||||
if (rawPatches[patchI].size() && cfxPatchTypes[patchI] != "BLKBDY")
|
||||
if (rawPatches[patchi].size() && cfxPatchTypes[patchi] != "BLKBDY")
|
||||
{
|
||||
// Check if this name has been already created
|
||||
label existingPatch = -1;
|
||||
|
||||
for (label oldPatchI = 0; oldPatchI < nCreatedPatches; oldPatchI++)
|
||||
for (label oldPatchi = 0; oldPatchi < nCreatedPatches; oldPatchi++)
|
||||
{
|
||||
if (patchNames[oldPatchI] == cfxPatchNames[patchI])
|
||||
if (patchNames[oldPatchi] == cfxPatchNames[patchi])
|
||||
{
|
||||
existingPatch = oldPatchI;
|
||||
existingPatch = oldPatchi;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const faceList& curRawPatch = rawPatches[patchI];
|
||||
label curBlock = patchMasterBlocks[patchI];
|
||||
const faceList& curRawPatch = rawPatches[patchi];
|
||||
label curBlock = patchMasterBlocks[patchi];
|
||||
|
||||
if (existingPatch >= 0)
|
||||
{
|
||||
Info<< "CFX patch " << patchI
|
||||
<< ", of type " << cfxPatchTypes[patchI]
|
||||
<< ", name " << cfxPatchNames[patchI]
|
||||
Info<< "CFX patch " << patchi
|
||||
<< ", of type " << cfxPatchTypes[patchi]
|
||||
<< ", name " << cfxPatchNames[patchi]
|
||||
<< " already exists as OpenFOAM patch " << existingPatch
|
||||
<< ". Adding faces." << endl;
|
||||
|
||||
@ -614,19 +614,19 @@ int main(int argc, char *argv[])
|
||||
label oldSize = renumberedPatch.size();
|
||||
renumberedPatch.setSize(oldSize + curRawPatch.size());
|
||||
|
||||
forAll(curRawPatch, faceI)
|
||||
forAll(curRawPatch, facei)
|
||||
{
|
||||
const face& oldFace = curRawPatch[faceI];
|
||||
const face& oldFace = curRawPatch[facei];
|
||||
|
||||
face& newFace = renumberedPatch[oldSize + faceI];
|
||||
face& newFace = renumberedPatch[oldSize + facei];
|
||||
newFace.setSize(oldFace.size());
|
||||
|
||||
forAll(oldFace, pointI)
|
||||
forAll(oldFace, pointi)
|
||||
{
|
||||
newFace[pointI] =
|
||||
newFace[pointi] =
|
||||
pointMergeList
|
||||
[
|
||||
oldFace[pointI]
|
||||
oldFace[pointi]
|
||||
+ blockOffsets[curBlock]
|
||||
];
|
||||
}
|
||||
@ -638,66 +638,66 @@ int main(int argc, char *argv[])
|
||||
faceList& renumberedPatch = boundary[nCreatedPatches];
|
||||
renumberedPatch.setSize(curRawPatch.size());
|
||||
|
||||
forAll(curRawPatch, faceI)
|
||||
forAll(curRawPatch, facei)
|
||||
{
|
||||
const face& oldFace = curRawPatch[faceI];
|
||||
const face& oldFace = curRawPatch[facei];
|
||||
|
||||
face& newFace = renumberedPatch[faceI];
|
||||
face& newFace = renumberedPatch[facei];
|
||||
newFace.setSize(oldFace.size());
|
||||
|
||||
forAll(oldFace, pointI)
|
||||
forAll(oldFace, pointi)
|
||||
{
|
||||
newFace[pointI] =
|
||||
newFace[pointi] =
|
||||
pointMergeList
|
||||
[
|
||||
oldFace[pointI]
|
||||
oldFace[pointi]
|
||||
+ blockOffsets[curBlock]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "CFX patch " << patchI
|
||||
<< ", of type " << cfxPatchTypes[patchI]
|
||||
<< ", name " << cfxPatchNames[patchI]
|
||||
Info<< "CFX patch " << patchi
|
||||
<< ", of type " << cfxPatchTypes[patchi]
|
||||
<< ", name " << cfxPatchNames[patchi]
|
||||
<< " converted into OpenFOAM patch " << nCreatedPatches
|
||||
<< " type ";
|
||||
|
||||
if (cfxPatchTypes[patchI] == "WALL")
|
||||
if (cfxPatchTypes[patchi] == "WALL")
|
||||
{
|
||||
Info<< "wall." << endl;
|
||||
|
||||
patchTypes[nCreatedPatches] = wallPolyPatch::typeName;
|
||||
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
|
||||
patchNames[nCreatedPatches] = cfxPatchNames[patchi];
|
||||
nCreatedPatches++;
|
||||
}
|
||||
else if (cfxPatchTypes[patchI] == "SYMMET")
|
||||
else if (cfxPatchTypes[patchi] == "SYMMET")
|
||||
{
|
||||
Info<< "symmetryPlane." << endl;
|
||||
|
||||
patchTypes[nCreatedPatches] = symmetryPolyPatch::typeName;
|
||||
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
|
||||
patchNames[nCreatedPatches] = cfxPatchNames[patchi];
|
||||
nCreatedPatches++;
|
||||
}
|
||||
else if
|
||||
(
|
||||
cfxPatchTypes[patchI] == "INLET"
|
||||
|| cfxPatchTypes[patchI] == "OUTLET"
|
||||
|| cfxPatchTypes[patchI] == "PRESS"
|
||||
|| cfxPatchTypes[patchI] == "CNDBDY"
|
||||
|| cfxPatchTypes[patchI] == "USER2D"
|
||||
cfxPatchTypes[patchi] == "INLET"
|
||||
|| cfxPatchTypes[patchi] == "OUTLET"
|
||||
|| cfxPatchTypes[patchi] == "PRESS"
|
||||
|| cfxPatchTypes[patchi] == "CNDBDY"
|
||||
|| cfxPatchTypes[patchi] == "USER2D"
|
||||
)
|
||||
{
|
||||
Info<< "generic." << endl;
|
||||
|
||||
patchTypes[nCreatedPatches] = polyPatch::typeName;
|
||||
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
|
||||
patchNames[nCreatedPatches] = cfxPatchNames[patchi];
|
||||
nCreatedPatches++;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unrecognised CFX patch type "
|
||||
<< cfxPatchTypes[patchI]
|
||||
<< cfxPatchTypes[patchi]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -722,14 +722,14 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Add information to dictionary
|
||||
forAll(patchNames, patchI)
|
||||
forAll(patchNames, patchi)
|
||||
{
|
||||
if (!patchDicts.set(patchI))
|
||||
if (!patchDicts.set(patchi))
|
||||
{
|
||||
patchDicts.set(patchI, new dictionary());
|
||||
patchDicts.set(patchi, new dictionary());
|
||||
}
|
||||
// Add but not overwrite
|
||||
patchDicts[patchI].add("type", patchTypes[patchI], false);
|
||||
patchDicts[patchi].add("type", patchTypes[patchi], false);
|
||||
}
|
||||
|
||||
polyMesh pShapeMesh
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -367,9 +367,9 @@ faceList hexBlock::patchFaces(const label direc, const labelList& range) const
|
||||
else if (blockHandedness_ == left)
|
||||
{
|
||||
// turn all faces inside out
|
||||
forAll(result, faceI)
|
||||
forAll(result, facei)
|
||||
{
|
||||
result[faceI].flip();
|
||||
result[facei].flip();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -85,24 +85,24 @@ cellShape create3DCellShape
|
||||
// make a list of outward-pointing faces
|
||||
labelListList localFaces(faceLabels.size());
|
||||
|
||||
forAll(faceLabels, faceI)
|
||||
forAll(faceLabels, facei)
|
||||
{
|
||||
const label curFaceLabel = faceLabels[faceI];
|
||||
const label curFaceLabel = faceLabels[facei];
|
||||
|
||||
const labelList& curFace = faces[curFaceLabel];
|
||||
|
||||
if (owner[curFaceLabel] == cellIndex)
|
||||
{
|
||||
localFaces[faceI] = curFace;
|
||||
localFaces[facei] = curFace;
|
||||
}
|
||||
else if (neighbour[curFaceLabel] == cellIndex)
|
||||
{
|
||||
// Reverse the face
|
||||
localFaces[faceI].setSize(curFace.size());
|
||||
localFaces[facei].setSize(curFace.size());
|
||||
|
||||
forAllReverse(curFace, i)
|
||||
{
|
||||
localFaces[faceI][curFace.size() - i - 1] =
|
||||
localFaces[facei][curFace.size() - i - 1] =
|
||||
curFace[i];
|
||||
}
|
||||
}
|
||||
@ -144,20 +144,20 @@ cellShape create3DCellShape
|
||||
|
||||
bool found = false;
|
||||
|
||||
forAll(localFaces, meshFaceI)
|
||||
forAll(localFaces, meshFacei)
|
||||
{
|
||||
if (localFaces[meshFaceI].size() == firstModelFace.size())
|
||||
if (localFaces[meshFacei].size() == firstModelFace.size())
|
||||
{
|
||||
// Match. Insert points into the pointLabels
|
||||
found = true;
|
||||
|
||||
const labelList& curMeshFace = localFaces[meshFaceI];
|
||||
const labelList& curMeshFace = localFaces[meshFacei];
|
||||
|
||||
meshFaceUsed[meshFaceI] = true;
|
||||
meshFaceUsed[meshFacei] = true;
|
||||
|
||||
forAll(curMeshFace, pointI)
|
||||
forAll(curMeshFace, pointi)
|
||||
{
|
||||
pointLabels[firstModelFace[pointI]] = curMeshFace[pointI];
|
||||
pointLabels[firstModelFace[pointi]] = curMeshFace[pointi];
|
||||
}
|
||||
|
||||
break;
|
||||
@ -173,26 +173,26 @@ cellShape create3DCellShape
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
for (label modelFaceI = 1; modelFaceI < modelFaces.size(); modelFaceI++)
|
||||
for (label modelFacei = 1; modelFacei < modelFaces.size(); modelFacei++)
|
||||
{
|
||||
// get the next model face
|
||||
const labelList& curModelFace =
|
||||
modelFaces
|
||||
[faceMatchingOrder[fluentCellModelID][modelFaceI]];
|
||||
[faceMatchingOrder[fluentCellModelID][modelFacei]];
|
||||
|
||||
found = false;
|
||||
|
||||
// Loop through mesh faces until a match is found
|
||||
forAll(localFaces, meshFaceI)
|
||||
forAll(localFaces, meshFacei)
|
||||
{
|
||||
if
|
||||
(
|
||||
!meshFaceUsed[meshFaceI]
|
||||
&& localFaces[meshFaceI].size() == curModelFace.size()
|
||||
!meshFaceUsed[meshFacei]
|
||||
&& localFaces[meshFacei].size() == curModelFace.size()
|
||||
)
|
||||
{
|
||||
// A possible match. A mesh face will be rotated, so make a copy
|
||||
labelList meshFaceLabels = localFaces[meshFaceI];
|
||||
labelList meshFaceLabels = localFaces[meshFacei];
|
||||
|
||||
for
|
||||
(
|
||||
@ -204,12 +204,12 @@ cellShape create3DCellShape
|
||||
// try matching the face
|
||||
label nMatchedLabels = 0;
|
||||
|
||||
forAll(meshFaceLabels, pointI)
|
||||
forAll(meshFaceLabels, pointi)
|
||||
{
|
||||
if
|
||||
(
|
||||
pointLabels[curModelFace[pointI]]
|
||||
== meshFaceLabels[pointI]
|
||||
pointLabels[curModelFace[pointi]]
|
||||
== meshFaceLabels[pointi]
|
||||
)
|
||||
{
|
||||
nMatchedLabels++;
|
||||
@ -225,13 +225,13 @@ cellShape create3DCellShape
|
||||
if (found)
|
||||
{
|
||||
// match found. Insert mesh face
|
||||
forAll(meshFaceLabels, pointI)
|
||||
forAll(meshFaceLabels, pointi)
|
||||
{
|
||||
pointLabels[curModelFace[pointI]] =
|
||||
meshFaceLabels[pointI];
|
||||
pointLabels[curModelFace[pointi]] =
|
||||
meshFaceLabels[pointi];
|
||||
}
|
||||
|
||||
meshFaceUsed[meshFaceI] = true;
|
||||
meshFaceUsed[meshFacei] = true;
|
||||
|
||||
break;
|
||||
}
|
||||
@ -258,7 +258,7 @@ cellShape create3DCellShape
|
||||
// A model face is not matched. Shape detection failed
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find match for face "
|
||||
<< modelFaceI
|
||||
<< modelFacei
|
||||
<< ".\nModel: " << curModel.name() << " model face: "
|
||||
<< curModelFace << " Mesh faces: " << localFaces
|
||||
<< "Matched points: " << pointLabels
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,7 +47,7 @@ cellShape extrudedQuadCellShape
|
||||
faceList& frontAndBackFaces
|
||||
)
|
||||
{
|
||||
static const cellModel* hexModelPtr_ = NULL;
|
||||
static const cellModel* hexModelPtr_ = nullptr;
|
||||
|
||||
if (!hexModelPtr_)
|
||||
{
|
||||
@ -67,9 +67,9 @@ cellShape extrudedQuadCellShape
|
||||
// make a list of outward-pointing faces
|
||||
labelListList localFaces(4);
|
||||
|
||||
forAll(faceLabels, faceI)
|
||||
forAll(faceLabels, facei)
|
||||
{
|
||||
const label curFaceLabel = faceLabels[faceI];
|
||||
const label curFaceLabel = faceLabels[facei];
|
||||
|
||||
const face& curFace = faces[curFaceLabel];
|
||||
|
||||
@ -83,18 +83,18 @@ cellShape extrudedQuadCellShape
|
||||
|
||||
if (owner[curFaceLabel] == cellIndex)
|
||||
{
|
||||
localFaces[faceI] = curFace;
|
||||
localFaces[facei] = curFace;
|
||||
}
|
||||
else if (neighbour[curFaceLabel] == cellIndex)
|
||||
{
|
||||
// Reverse the face. Note: it is necessary to reverse by
|
||||
// hand to preserve connectivity of a 2-D mesh.
|
||||
//
|
||||
localFaces[faceI].setSize(curFace.size());
|
||||
localFaces[facei].setSize(curFace.size());
|
||||
|
||||
forAllReverse(curFace, i)
|
||||
{
|
||||
localFaces[faceI][curFace.size() - i - 1] =
|
||||
localFaces[facei][curFace.size() - i - 1] =
|
||||
curFace[i];
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -48,7 +48,7 @@ cellShape extrudedTriangleCellShape
|
||||
faceList& frontAndBackFaces
|
||||
)
|
||||
{
|
||||
static const cellModel* prismModelPtr_ = NULL;
|
||||
static const cellModel* prismModelPtr_ = nullptr;
|
||||
|
||||
if (!prismModelPtr_)
|
||||
{
|
||||
@ -69,9 +69,9 @@ cellShape extrudedTriangleCellShape
|
||||
// make a list of outward-pointing faces
|
||||
labelListList localFaces(3);
|
||||
|
||||
forAll(faceLabels, faceI)
|
||||
forAll(faceLabels, facei)
|
||||
{
|
||||
const label curFaceLabel = faceLabels[faceI];
|
||||
const label curFaceLabel = faceLabels[facei];
|
||||
|
||||
const face& curFace = faces[curFaceLabel];
|
||||
|
||||
@ -85,18 +85,18 @@ cellShape extrudedTriangleCellShape
|
||||
|
||||
if (owner[curFaceLabel] == cellIndex)
|
||||
{
|
||||
localFaces[faceI] = curFace;
|
||||
localFaces[facei] = curFace;
|
||||
}
|
||||
else if (neighbour[curFaceLabel] == cellIndex)
|
||||
{
|
||||
// Reverse the face. Note: it is necessary to reverse by
|
||||
// hand to preserve connectivity of a 2-D mesh.
|
||||
//
|
||||
localFaces[faceI].setSize(curFace.size());
|
||||
localFaces[facei].setSize(curFace.size());
|
||||
|
||||
forAllReverse(curFace, i)
|
||||
{
|
||||
localFaces[faceI][curFace.size() - i - 1] =
|
||||
localFaces[facei][curFace.size() - i - 1] =
|
||||
curFace[i];
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,11 +240,11 @@ endOfSection {space}")"{space}
|
||||
%{
|
||||
// Point data
|
||||
label pointGroupNumberOfComponents = 3;
|
||||
label pointI = 0; // index used for reading points
|
||||
label pointi = 0; // index used for reading points
|
||||
|
||||
// Face data
|
||||
label faceGroupElementType = -1;
|
||||
label faceI = 0;
|
||||
label facei = 0;
|
||||
|
||||
// Cell data
|
||||
label cellGroupElementType = -1;
|
||||
@ -346,7 +346,7 @@ endOfSection {space}")"{space}
|
||||
readHexLabel(pointGroupDataStream);
|
||||
|
||||
// In FOAM, indices start from zero - adjust
|
||||
pointI = pointGroupStartIndex.last() - 1;
|
||||
pointi = pointGroupStartIndex.last() - 1;
|
||||
|
||||
// reset number of components to default
|
||||
pointGroupNumberOfComponents = 3;
|
||||
@ -384,8 +384,8 @@ endOfSection {space}")"{space}
|
||||
scalar x = readScalar(vertexXyzStream);
|
||||
scalar y = readScalar(vertexXyzStream);
|
||||
|
||||
points[pointI] = point(x, y, 0);
|
||||
pointI++;
|
||||
points[pointi] = point(x, y, 0);
|
||||
pointi++;
|
||||
}
|
||||
|
||||
<readPoints3D>{spaceNl}{scalarList} {
|
||||
@ -397,19 +397,19 @@ endOfSection {space}")"{space}
|
||||
scalar y = readScalar(vertexXyzStream);
|
||||
scalar z = readScalar(vertexXyzStream);
|
||||
|
||||
points[pointI] = convertToMeters*point(x, y, z);
|
||||
pointI++;
|
||||
points[pointi] = convertToMeters*point(x, y, z);
|
||||
pointi++;
|
||||
}
|
||||
|
||||
<readPoints2D,readPoints3D>{spaceNl}{endOfSection} {
|
||||
|
||||
// check read of points
|
||||
if (pointI != pointGroupEndIndex.last())
|
||||
if (pointi != pointGroupEndIndex.last())
|
||||
{
|
||||
Info<< "problem with reading points: "
|
||||
<< "start index: " << pointGroupStartIndex.last()
|
||||
<< " end index: " << pointGroupEndIndex.last()
|
||||
<< " last points read: " << pointI << endl;
|
||||
<< " last points read: " << pointi << endl;
|
||||
}
|
||||
|
||||
yy_pop_state();
|
||||
@ -461,7 +461,7 @@ endOfSection {space}")"{space}
|
||||
faceGroupElementType = readHexLabel(faceGroupDataStream);
|
||||
|
||||
// In FOAM, indices start from zero - adjust
|
||||
faceI = faceGroupStartIndex.last() - 1;
|
||||
facei = faceGroupStartIndex.last() - 1;
|
||||
}
|
||||
|
||||
<readNumberOfFaces,readFaceGroupData>{spaceNl}{endOfSection} {
|
||||
@ -486,7 +486,7 @@ endOfSection {space}")"{space}
|
||||
|
||||
IStringStream mixedFaceStream(YYText());
|
||||
|
||||
face& curFaceLabels = faces[faceI];
|
||||
face& curFaceLabels = faces[facei];
|
||||
|
||||
// set size of label list
|
||||
curFaceLabels.setSize(readLabel(mixedFaceStream));
|
||||
@ -497,16 +497,16 @@ endOfSection {space}")"{space}
|
||||
}
|
||||
|
||||
// read neighbour and owner. Neighbour comes first
|
||||
neighbour[faceI] = readHexLabel(mixedFaceStream) - 1;
|
||||
owner[faceI] = readHexLabel(mixedFaceStream) - 1;
|
||||
faceI++;
|
||||
neighbour[facei] = readHexLabel(mixedFaceStream) - 1;
|
||||
owner[facei] = readHexLabel(mixedFaceStream) - 1;
|
||||
facei++;
|
||||
}
|
||||
|
||||
<readFacesUniform>{spaceNl}{hexLabelList} {
|
||||
|
||||
IStringStream mixedFaceStream(YYText());
|
||||
|
||||
face& curFaceLabels = faces[faceI];
|
||||
face& curFaceLabels = faces[facei];
|
||||
|
||||
// set size of label list. This is OK because in Fluent the type
|
||||
// for edge is 2, for triangle is 3 and for quad is 4
|
||||
@ -518,20 +518,20 @@ endOfSection {space}")"{space}
|
||||
}
|
||||
|
||||
// read neighbour and owner. Neighbour comes first
|
||||
neighbour[faceI] = readHexLabel(mixedFaceStream) - 1;
|
||||
owner[faceI] = readHexLabel(mixedFaceStream) - 1;
|
||||
faceI++;
|
||||
neighbour[facei] = readHexLabel(mixedFaceStream) - 1;
|
||||
owner[facei] = readHexLabel(mixedFaceStream) - 1;
|
||||
facei++;
|
||||
}
|
||||
|
||||
<readFacesMixed,readFacesUniform>{spaceNl}{endOfSection} {
|
||||
|
||||
// check read of fluentFaces
|
||||
if (faceI != faceGroupEndIndex.last())
|
||||
if (facei != faceGroupEndIndex.last())
|
||||
{
|
||||
Info<< "problem with reading fluentFaces: "
|
||||
<< "start index: " << faceGroupStartIndex.last()
|
||||
<< " end index: " << faceGroupEndIndex.last()
|
||||
<< " last fluentFaces read: " << faceI << endl;
|
||||
<< " last fluentFaces read: " << facei << endl;
|
||||
}
|
||||
|
||||
yy_pop_state();
|
||||
@ -847,11 +847,11 @@ label findFace(const primitiveMesh& mesh, const face& f)
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
label facei = pFaces[i];
|
||||
|
||||
if (f == mesh.faces()[faceI])
|
||||
if (f == mesh.faces()[facei])
|
||||
{
|
||||
return faceI;
|
||||
return facei;
|
||||
}
|
||||
}
|
||||
|
||||
@ -935,23 +935,23 @@ int main(int argc, char *argv[])
|
||||
|
||||
// fill in owner and neighbour
|
||||
|
||||
forAll(owner, faceI)
|
||||
forAll(owner, facei)
|
||||
{
|
||||
if (owner[faceI] > -1)
|
||||
if (owner[facei] > -1)
|
||||
{
|
||||
label curCell = owner[faceI];
|
||||
cellFaces[curCell][nFacesInCell[curCell] ] = faceI;
|
||||
label curCell = owner[facei];
|
||||
cellFaces[curCell][nFacesInCell[curCell] ] = facei;
|
||||
|
||||
nFacesInCell[curCell]++;
|
||||
}
|
||||
}
|
||||
|
||||
forAll(neighbour, faceI)
|
||||
forAll(neighbour, facei)
|
||||
{
|
||||
if (neighbour[faceI] > -1)
|
||||
if (neighbour[facei] > -1)
|
||||
{
|
||||
label curCell = neighbour[faceI];
|
||||
cellFaces[curCell][nFacesInCell[curCell] ] = faceI;
|
||||
label curCell = neighbour[facei];
|
||||
cellFaces[curCell][nFacesInCell[curCell] ] = facei;
|
||||
|
||||
nFacesInCell[curCell]++;
|
||||
}
|
||||
@ -989,18 +989,18 @@ int main(int argc, char *argv[])
|
||||
// points given by Fluent need to represent the FRONT plane of the
|
||||
// geometry. Therefore, the extrusion will be in -z direction
|
||||
//
|
||||
forAll(oldPoints, pointI)
|
||||
forAll(oldPoints, pointi)
|
||||
{
|
||||
points[nNewPoints] = oldPoints[pointI];
|
||||
points[nNewPoints] = oldPoints[pointi];
|
||||
|
||||
points[nNewPoints].z() = zOffset;
|
||||
|
||||
nNewPoints++;
|
||||
}
|
||||
|
||||
forAll(oldPoints, pointI)
|
||||
forAll(oldPoints, pointi)
|
||||
{
|
||||
points[nNewPoints] = oldPoints[pointI];
|
||||
points[nNewPoints] = oldPoints[pointi];
|
||||
|
||||
points[nNewPoints].z() = -zOffset;
|
||||
|
||||
@ -1065,17 +1065,17 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Create new faces
|
||||
forAll(faces, faceI)
|
||||
forAll(faces, facei)
|
||||
{
|
||||
|
||||
if (faces[faceI].size() != 2)
|
||||
if (faces[facei].size() != 2)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "fluentMeshToFoam: a 2-D face defined with "
|
||||
<< faces[faceI].size() << " points." << endl;
|
||||
<< faces[facei].size() << " points." << endl;
|
||||
}
|
||||
|
||||
labelList& newFace = faces[faceI];
|
||||
labelList& newFace = faces[facei];
|
||||
|
||||
newFace.setSize(4);
|
||||
|
||||
@ -1128,16 +1128,16 @@ int main(int argc, char *argv[])
|
||||
// area vector points into the domain. Turn them round before making patches
|
||||
// for Foam compatibility
|
||||
|
||||
forAll(faces, faceI)
|
||||
forAll(faces, facei)
|
||||
{
|
||||
if (owner[faceI] == -1)
|
||||
if (owner[facei] == -1)
|
||||
{
|
||||
// reverse face
|
||||
labelList oldFace = faces[faceI];
|
||||
labelList oldFace = faces[facei];
|
||||
|
||||
forAllReverse(oldFace, i)
|
||||
{
|
||||
faces[faceI][oldFace.size() - i - 1] =
|
||||
faces[facei][oldFace.size() - i - 1] =
|
||||
oldFace[i];
|
||||
}
|
||||
}
|
||||
@ -1244,7 +1244,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
faceList patchFaces(faceGroupEndIndexIter() - faceLabel);
|
||||
|
||||
forAll(patchFaces, faceI)
|
||||
forAll(patchFaces, facei)
|
||||
{
|
||||
if
|
||||
(
|
||||
@ -1252,14 +1252,14 @@ int main(int argc, char *argv[])
|
||||
|| faces[faceLabel].size() == 4
|
||||
)
|
||||
{
|
||||
patchFaces[faceI] = face(faces[faceLabel]);
|
||||
patchFaces[facei] = face(faces[faceLabel]);
|
||||
faceLabel++;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "unrecognised face shape with "
|
||||
<< patchFaces[faceI].size() << " vertices"
|
||||
<< patchFaces[facei].size() << " vertices"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -1380,9 +1380,9 @@ int main(int argc, char *argv[])
|
||||
label nBoundaries = 0;
|
||||
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const faceList& bFaces = patches[patchI];
|
||||
const faceList& bFaces = patches[patchi];
|
||||
|
||||
label sz = bFaces.size();
|
||||
labelList meshFaces(sz,-1);
|
||||
@ -1405,7 +1405,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if
|
||||
(
|
||||
patchTypes[patchI] != "internal"
|
||||
patchTypes[patchi] != "internal"
|
||||
&& !pShapeMesh.isInternalFace(meshFaces[0])
|
||||
)
|
||||
{
|
||||
@ -1415,34 +1415,34 @@ int main(int argc, char *argv[])
|
||||
//and mark patch number to global list
|
||||
forAll(meshFaces, i)
|
||||
{
|
||||
label faceI = meshFaces[i];
|
||||
label facei = meshFaces[i];
|
||||
|
||||
if (pShapeMesh.isInternalFace(faceI))
|
||||
if (pShapeMesh.isInternalFace(facei))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Face " << faceI << " on new patch "
|
||||
<< patchNames[patchI]
|
||||
<< "Face " << facei << " on new patch "
|
||||
<< patchNames[patchi]
|
||||
<< " is not an external face of the mesh." << endl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (facePatchID[faceI - pShapeMesh.nInternalFaces()]!= -1)
|
||||
if (facePatchID[facei - pShapeMesh.nInternalFaces()]!= -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Face " << faceI << " on new patch "
|
||||
<< patchNames[patchI]
|
||||
<< "Face " << facei << " on new patch "
|
||||
<< patchNames[patchi]
|
||||
<< " has already been marked for repatching to"
|
||||
<< " patch "
|
||||
<< facePatchID[faceI - pShapeMesh.nInternalFaces()]
|
||||
<< facePatchID[facei - pShapeMesh.nInternalFaces()]
|
||||
<< exit(FatalError);
|
||||
}
|
||||
facePatchID[faceI - pShapeMesh.nInternalFaces()] = nBoundaries;
|
||||
facePatchID[facei - pShapeMesh.nInternalFaces()] = nBoundaries;
|
||||
}
|
||||
|
||||
//add to boundary patch
|
||||
|
||||
Info<< "Adding new patch " << patchNames[patchI]
|
||||
<< " of type " << patchTypes[patchI]
|
||||
Info<< "Adding new patch " << patchNames[patchi]
|
||||
<< " of type " << patchTypes[patchi]
|
||||
<< " as patch " << nBoundaries << endl;
|
||||
|
||||
// Add patch to new patch list
|
||||
@ -1450,8 +1450,8 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
polyPatch::New
|
||||
(
|
||||
patchTypes[patchI],
|
||||
patchNames[patchI],
|
||||
patchTypes[patchi],
|
||||
patchNames[patchi],
|
||||
sz,
|
||||
cMeshFace,
|
||||
nBoundaries,
|
||||
@ -1463,7 +1463,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Patch " << patchNames[patchI]
|
||||
Info<< "Patch " << patchNames[patchi]
|
||||
<< " is internal to the mesh "
|
||||
<< " and is not being added to the boundary."
|
||||
<< endl;
|
||||
@ -1524,9 +1524,9 @@ int main(int argc, char *argv[])
|
||||
// Change patch ids
|
||||
forAll(facePatchID, idI)
|
||||
{
|
||||
label faceI = idI + pShapeMesh.nInternalFaces();
|
||||
label facei = idI + pShapeMesh.nInternalFaces();
|
||||
|
||||
repatcher.changePatchID(faceI, facePatchID[idI]);
|
||||
repatcher.changePatchID(facei, facePatchID[idI]);
|
||||
}
|
||||
repatcher.repatch();
|
||||
|
||||
@ -1538,12 +1538,12 @@ int main(int argc, char *argv[])
|
||||
// Re-do face matching to write sets
|
||||
if (writeSets)
|
||||
{
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const faceList& bFaces = patches[patchI];
|
||||
const faceList& bFaces = patches[patchi];
|
||||
label sz = bFaces.size();
|
||||
|
||||
faceSet pFaceSet(pShapeMesh, patchNames[patchI], sz);
|
||||
faceSet pFaceSet(pShapeMesh, patchNames[patchi], sz);
|
||||
|
||||
forAll(bFaces, j)
|
||||
{
|
||||
@ -1551,7 +1551,7 @@ int main(int argc, char *argv[])
|
||||
label cMeshFace = findFace(pShapeMesh, f);
|
||||
pFaceSet.insert(cMeshFace);
|
||||
}
|
||||
Info<< "Writing patch " << patchNames[patchI]
|
||||
Info<< "Writing patch " << patchNames[patchi]
|
||||
<< " of size " << sz << " to faceSet" << endl;
|
||||
|
||||
pFaceSet.instance() = pShapeMesh.instance();
|
||||
@ -1629,15 +1629,15 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
DynamicList<label> zoneFaces(pShapeMesh.nFaces());
|
||||
forAll(pShapeMesh.faceNeighbour(), faceI)
|
||||
forAll(pShapeMesh.faceNeighbour(), facei)
|
||||
{
|
||||
label nei = pShapeMesh.faceNeighbour()[faceI];
|
||||
label own = pShapeMesh.faceOwner()[faceI];
|
||||
label nei = pShapeMesh.faceNeighbour()[facei];
|
||||
label own = pShapeMesh.faceOwner()[facei];
|
||||
if (nei != -1)
|
||||
{
|
||||
if (zoneCell[nei] && zoneCell[own])
|
||||
{
|
||||
zoneFaces.append(faceI);
|
||||
zoneFaces.append(facei);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -113,13 +113,13 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
|
||||
const pointField& p = points();
|
||||
|
||||
forAll(p, pointI)
|
||||
forAll(p, pointi)
|
||||
{
|
||||
fluentMeshFile
|
||||
<< " "
|
||||
<< p[pointI].x() << " "
|
||||
<< p[pointI].y()
|
||||
<< " " << p[pointI].z() << std::endl;
|
||||
<< p[pointi].x() << " "
|
||||
<< p[pointi].y()
|
||||
<< " " << p[pointi].z() << std::endl;
|
||||
}
|
||||
|
||||
fluentMeshFile
|
||||
@ -135,9 +135,9 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
<< "(13 (2 1 "
|
||||
<< own.size() << " 2 0)" << std::endl << "(" << std::endl;
|
||||
|
||||
forAll(own, faceI)
|
||||
forAll(own, facei)
|
||||
{
|
||||
const labelList& l = fcs[faceI];
|
||||
const labelList& l = fcs[facei];
|
||||
|
||||
fluentMeshFile << " ";
|
||||
|
||||
@ -148,8 +148,8 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
fluentMeshFile << l[lI] + 1 << " ";
|
||||
}
|
||||
|
||||
fluentMeshFile << nei[faceI] + 1 << " ";
|
||||
fluentMeshFile << own[faceI] + 1 << std::endl;
|
||||
fluentMeshFile << nei[facei] + 1 << " ";
|
||||
fluentMeshFile << own[facei] + 1 << std::endl;
|
||||
}
|
||||
|
||||
fluentMeshFile << "))" << std::endl;
|
||||
@ -157,31 +157,31 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
label nWrittenFaces = own.size();
|
||||
|
||||
// Writing boundary faces
|
||||
forAll(boundary(), patchI)
|
||||
forAll(boundary(), patchi)
|
||||
{
|
||||
const faceUList& patchFaces = boundaryMesh()[patchI];
|
||||
const faceUList& patchFaces = boundaryMesh()[patchi];
|
||||
|
||||
const labelList& patchFaceCells =
|
||||
boundaryMesh()[patchI].faceCells();
|
||||
boundaryMesh()[patchi].faceCells();
|
||||
|
||||
// The face group will be offset by 10 from the patch label
|
||||
|
||||
// Write header
|
||||
fluentMeshFile
|
||||
<< "(13 (" << patchI + 10 << " " << nWrittenFaces + 1
|
||||
<< "(13 (" << patchi + 10 << " " << nWrittenFaces + 1
|
||||
<< " " << nWrittenFaces + patchFaces.size() << " ";
|
||||
|
||||
nWrittenFaces += patchFaces.size();
|
||||
|
||||
// Write patch type
|
||||
if (isA<wallFvPatch>(boundary()[patchI]))
|
||||
if (isA<wallFvPatch>(boundary()[patchi]))
|
||||
{
|
||||
fluentMeshFile << 3;
|
||||
}
|
||||
else if
|
||||
(
|
||||
isA<symmetryPlaneFvPatch>(boundary()[patchI])
|
||||
|| isA<symmetryFvPatch>(boundary()[patchI])
|
||||
isA<symmetryPlaneFvPatch>(boundary()[patchi])
|
||||
|| isA<symmetryFvPatch>(boundary()[patchi])
|
||||
)
|
||||
{
|
||||
fluentMeshFile << 7;
|
||||
@ -194,9 +194,9 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
fluentMeshFile
|
||||
<<" 0)" << std::endl << "(" << std::endl;
|
||||
|
||||
forAll(patchFaces, faceI)
|
||||
forAll(patchFaces, facei)
|
||||
{
|
||||
const labelList& l = patchFaces[faceI];
|
||||
const labelList& l = patchFaces[facei];
|
||||
|
||||
fluentMeshFile << " ";
|
||||
|
||||
@ -210,7 +210,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
fluentMeshFile << l[lI] + 1 << " ";
|
||||
}
|
||||
|
||||
fluentMeshFile << patchFaceCells[faceI] + 1 << " 0" << std::endl;
|
||||
fluentMeshFile << patchFaceCells[facei] + 1 << " 0" << std::endl;
|
||||
}
|
||||
|
||||
fluentMeshFile << "))" << std::endl;
|
||||
@ -230,21 +230,21 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
|
||||
bool hasWarned = false;
|
||||
|
||||
forAll(cells, cellI)
|
||||
forAll(cells, celli)
|
||||
{
|
||||
if (cells[cellI].model() == tet)
|
||||
if (cells[celli].model() == tet)
|
||||
{
|
||||
fluentMeshFile << " " << 2;
|
||||
}
|
||||
else if (cells[cellI].model() == hex)
|
||||
else if (cells[celli].model() == hex)
|
||||
{
|
||||
fluentMeshFile << " " << 4;
|
||||
}
|
||||
else if (cells[cellI].model() == pyr)
|
||||
else if (cells[celli].model() == pyr)
|
||||
{
|
||||
fluentMeshFile << " " << 5;
|
||||
}
|
||||
else if (cells[cellI].model() == prism)
|
||||
else if (cells[celli].model() == prism)
|
||||
{
|
||||
fluentMeshFile << " " << 6;
|
||||
}
|
||||
@ -256,7 +256,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
|
||||
WarningInFunction
|
||||
<< "foamMeshToFluent: cell shape for cell "
|
||||
<< cellI << " only supported by Fluent polyhedral meshes."
|
||||
<< celli << " only supported by Fluent polyhedral meshes."
|
||||
<< nl
|
||||
<< " Suppressing any further messages for polyhedral"
|
||||
<< " cells." << endl;
|
||||
@ -275,20 +275,20 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
fluentMeshFile << "(39 (2 interior interior-1)())" << std::endl;
|
||||
|
||||
// Writing boundary patch types
|
||||
forAll(boundary(), patchI)
|
||||
forAll(boundary(), patchi)
|
||||
{
|
||||
fluentMeshFile
|
||||
<< "(39 (" << patchI + 10 << " ";
|
||||
<< "(39 (" << patchi + 10 << " ";
|
||||
|
||||
// Write patch type
|
||||
if (isA<wallFvPatch>(boundary()[patchI]))
|
||||
if (isA<wallFvPatch>(boundary()[patchi]))
|
||||
{
|
||||
fluentMeshFile << "wall ";
|
||||
}
|
||||
else if
|
||||
(
|
||||
isA<symmetryPlaneFvPatch>(boundary()[patchI])
|
||||
|| isA<symmetryFvPatch>(boundary()[patchI])
|
||||
isA<symmetryPlaneFvPatch>(boundary()[patchi])
|
||||
|| isA<symmetryFvPatch>(boundary()[patchi])
|
||||
)
|
||||
{
|
||||
fluentMeshFile << "symmetry ";
|
||||
@ -299,7 +299,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
}
|
||||
|
||||
fluentMeshFile
|
||||
<< boundary()[patchI].name() << ")())" << std::endl;
|
||||
<< boundary()[patchi].name() << ")())" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,15 +31,15 @@ Description
|
||||
Reads an OpenFOAM mesh and writes a pro-STAR (v4) bnd/cel/vrt format.
|
||||
|
||||
Usage
|
||||
- foamToStarMesh [OPTION] \n
|
||||
Reads an OpenFOAM mesh and writes a pro-STAR (v4) bnd/cel/vrt format.
|
||||
\b foamToStarMesh [OPTION]
|
||||
|
||||
\param -noBnd \n
|
||||
Suppress writing the \c .bnd file
|
||||
Options:
|
||||
- \par -noBnd
|
||||
Suppress writing the \c .bnd file
|
||||
|
||||
\param -scale \<factor\>\n
|
||||
Specify an alternative geometry scaling factor.
|
||||
The default is \b 1000 (scale \em [m] to \em [mm]).
|
||||
- \par -scale \<factor\>
|
||||
Specify an alternative geometry scaling factor.
|
||||
The default is \b 1000 (scale \em [m] to \em [mm]).
|
||||
|
||||
Note
|
||||
The cellTable information available in the files
|
||||
@ -47,7 +47,7 @@ Note
|
||||
will be used if available. Otherwise the cellZones are used when
|
||||
creating the cellTable information.
|
||||
|
||||
See Also
|
||||
See also
|
||||
Foam::cellTable, Foam::meshWriter and Foam::meshWriters::STARCD
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,15 +31,15 @@ Description
|
||||
Reads an OpenFOAM mesh and writes the boundaries in a surface format.
|
||||
|
||||
Usage
|
||||
- foamToSurface [OPTION] \n
|
||||
Reads an OpenFOAM mesh and writes the boundaries in a surface format.
|
||||
\b foamToSurface [OPTION]
|
||||
|
||||
\param -scale \<factor\>\n
|
||||
Specify an alternative geometry scaling factor.
|
||||
Eg, use \b 1000 to scale \em [m] to \em [mm].
|
||||
Options:
|
||||
- \par -scale \<factor\>
|
||||
Specify an alternative geometry scaling factor.
|
||||
E.g. use \b 1000 to scale \em [m] to \em [mm].
|
||||
|
||||
\param -tri \n
|
||||
Triangulate surface.
|
||||
- \par -tri
|
||||
Triangulate surface.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -331,14 +331,14 @@ mtype {space}"MTYPE:"{space}
|
||||
|
||||
IStringStream elementStream(YYText());
|
||||
|
||||
label cellI(readLabel(elementStream));
|
||||
label celli(readLabel(elementStream));
|
||||
label cellType(readLabel(elementStream));
|
||||
label nVertices(readLabel(elementStream));
|
||||
|
||||
// reset number of continuation lines
|
||||
nCellContinuationLines = 0;
|
||||
|
||||
cellMap[curNumberOfCells] = cellI;
|
||||
cellMap[curNumberOfCells] = celli;
|
||||
cellTypes[curNumberOfCells] = cellType;
|
||||
cellLabels.set(curNumberOfCells, new labelList(nVertices));
|
||||
|
||||
@ -666,38 +666,38 @@ int main(int argc, char *argv[])
|
||||
// make a point mapping array
|
||||
label maxPointIndex = 0;
|
||||
|
||||
forAll(pointMap, pointI)
|
||||
forAll(pointMap, pointi)
|
||||
{
|
||||
if (pointMap[pointI] > maxPointIndex)
|
||||
if (pointMap[pointi] > maxPointIndex)
|
||||
{
|
||||
maxPointIndex = pointMap[pointI];
|
||||
maxPointIndex = pointMap[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
labelList pointLookup(maxPointIndex + 1, -1);
|
||||
|
||||
forAll(pointMap, pointI)
|
||||
forAll(pointMap, pointi)
|
||||
{
|
||||
pointLookup[pointMap[pointI] ] = pointI;
|
||||
pointLookup[pointMap[pointi] ] = pointi;
|
||||
}
|
||||
|
||||
// make a cell mapping array
|
||||
label maxCellIndex = 0;
|
||||
|
||||
forAll(cellMap, cellI)
|
||||
forAll(cellMap, celli)
|
||||
{
|
||||
if (cellMap[cellI] > maxCellIndex)
|
||||
if (cellMap[celli] > maxCellIndex)
|
||||
{
|
||||
maxCellIndex = cellMap[cellI];
|
||||
maxCellIndex = cellMap[celli];
|
||||
}
|
||||
}
|
||||
|
||||
labelList cellLookup(maxCellIndex + 1);
|
||||
|
||||
forAll(cellMap, cellI)
|
||||
forAll(cellMap, celli)
|
||||
{
|
||||
cellLookup[cellMap[cellI] ] = cellI;
|
||||
cellLookup[cellMap[celli] ] = celli;
|
||||
}
|
||||
|
||||
const cellModel& hex = *(cellModeller::lookup("hex"));
|
||||
@ -712,23 +712,23 @@ int main(int argc, char *argv[])
|
||||
|
||||
cellShapeList cells(cellLabels.size());
|
||||
|
||||
forAll(cellTypes, cellI)
|
||||
forAll(cellTypes, celli)
|
||||
{
|
||||
const labelList& curCellLabels = cellLabels[cellI];
|
||||
const labelList& curCellLabels = cellLabels[celli];
|
||||
|
||||
// Tetrahedron
|
||||
if (cellTypes[cellI] == 6)
|
||||
if (cellTypes[celli] == 6)
|
||||
{
|
||||
labelsTet[0] = pointLookup[curCellLabels[0] ];
|
||||
labelsTet[1] = pointLookup[curCellLabels[2] ];
|
||||
labelsTet[2] = pointLookup[curCellLabels[3] ];
|
||||
labelsTet[3] = pointLookup[curCellLabels[1] ];
|
||||
|
||||
cells[cellI] = cellShape(tet, labelsTet);
|
||||
cells[celli] = cellShape(tet, labelsTet);
|
||||
}
|
||||
|
||||
// Square-based pyramid
|
||||
else if (cellTypes[cellI] == 7)
|
||||
else if (cellTypes[celli] == 7)
|
||||
{
|
||||
labelsPyramid[0] = pointLookup[curCellLabels[0] ];
|
||||
labelsPyramid[1] = pointLookup[curCellLabels[1] ];
|
||||
@ -736,11 +736,11 @@ int main(int argc, char *argv[])
|
||||
labelsPyramid[3] = pointLookup[curCellLabels[2] ];
|
||||
labelsPyramid[4] = pointLookup[curCellLabels[4] ];
|
||||
|
||||
cells[cellI] = cellShape(pyr, labelsPyramid);
|
||||
cells[celli] = cellShape(pyr, labelsPyramid);
|
||||
}
|
||||
|
||||
// Triangular prism
|
||||
else if (cellTypes[cellI] == 5)
|
||||
else if (cellTypes[celli] == 5)
|
||||
{
|
||||
labelsPrism[0] = pointLookup[curCellLabels[0] ];
|
||||
labelsPrism[1] = pointLookup[curCellLabels[1] ];
|
||||
@ -749,11 +749,11 @@ int main(int argc, char *argv[])
|
||||
labelsPrism[4] = pointLookup[curCellLabels[4] ];
|
||||
labelsPrism[5] = pointLookup[curCellLabels[5] ];
|
||||
|
||||
cells[cellI] = cellShape(prism, labelsPrism);
|
||||
cells[celli] = cellShape(prism, labelsPrism);
|
||||
}
|
||||
|
||||
// Hex
|
||||
else if (cellTypes[cellI] == 4)
|
||||
else if (cellTypes[celli] == 4)
|
||||
{
|
||||
labelsHex[0] = pointLookup[curCellLabels[0] ];
|
||||
labelsHex[1] = pointLookup[curCellLabels[1] ];
|
||||
@ -764,7 +764,7 @@ int main(int argc, char *argv[])
|
||||
labelsHex[6] = pointLookup[curCellLabels[7] ];
|
||||
labelsHex[7] = pointLookup[curCellLabels[6] ];
|
||||
|
||||
cells[cellI] = cellShape(hex, labelsHex);
|
||||
cells[celli] = cellShape(hex, labelsHex);
|
||||
}
|
||||
}
|
||||
|
||||
@ -783,26 +783,26 @@ int main(int argc, char *argv[])
|
||||
|
||||
faceListList boundary(patchCells.size());
|
||||
|
||||
forAll(patchCells, patchI)
|
||||
forAll(patchCells, patchi)
|
||||
{
|
||||
labelList& curCells = patchCells[patchI];
|
||||
labelList& curFaces = patchCellFaces[patchI];
|
||||
labelList& curCells = patchCells[patchi];
|
||||
labelList& curFaces = patchCellFaces[patchi];
|
||||
|
||||
faceList& patchFaces = boundary[patchI];
|
||||
faceList& patchFaces = boundary[patchi];
|
||||
patchFaces.setSize(curCells.size());
|
||||
|
||||
forAll(curCells, faceI)
|
||||
forAll(curCells, facei)
|
||||
{
|
||||
patchFaces[faceI] =
|
||||
cells[cellLookup[curCells[faceI] ] ].faces()
|
||||
patchFaces[facei] =
|
||||
cells[cellLookup[curCells[facei] ] ].faces()
|
||||
[
|
||||
faceIndex
|
||||
[
|
||||
// this picks a cell type
|
||||
cells[cellLookup[curCells[faceI] ] ]
|
||||
cells[cellLookup[curCells[facei] ] ]
|
||||
.model().index()
|
||||
]
|
||||
[curFaces[faceI] - 1] // this gives a fluent face - 1
|
||||
[curFaces[facei] - 1] // this gives a fluent face - 1
|
||||
];
|
||||
|
||||
}
|
||||
@ -834,14 +834,14 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Add information to dictionary
|
||||
forAll(patchNames, patchI)
|
||||
forAll(patchNames, patchi)
|
||||
{
|
||||
if (!patchDicts.set(patchI))
|
||||
if (!patchDicts.set(patchi))
|
||||
{
|
||||
patchDicts.set(patchI, new dictionary());
|
||||
patchDicts.set(patchi, new dictionary());
|
||||
}
|
||||
// Add but not overwrite
|
||||
patchDicts[patchI].add("type", polyPatch::typeName, false);
|
||||
patchDicts[patchi].add("type", polyPatch::typeName, false);
|
||||
}
|
||||
|
||||
polyMesh pShapeMesh
|
||||
|
||||
@ -123,9 +123,9 @@ label findFace(const primitivePatch& pp, const labelList& meshF)
|
||||
// meshF vertices (in any order ;-)
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
label facei = pFaces[i];
|
||||
|
||||
const face& f = pp[faceI];
|
||||
const face& f = pp[facei];
|
||||
|
||||
// Count uses of vertices of meshF for f
|
||||
label nMatched = 0;
|
||||
@ -140,7 +140,7 @@ label findFace(const primitivePatch& pp, const labelList& meshF)
|
||||
|
||||
if (nMatched == meshF.size())
|
||||
{
|
||||
return faceI;
|
||||
return facei;
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,9 +155,9 @@ label findInternalFace(const primitiveMesh& mesh, const labelList& meshF)
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
label facei = pFaces[i];
|
||||
|
||||
const face& f = mesh.faces()[faceI];
|
||||
const face& f = mesh.faces()[facei];
|
||||
|
||||
// Count uses of vertices of meshF for f
|
||||
label nMatched = 0;
|
||||
@ -172,7 +172,7 @@ label findInternalFace(const primitiveMesh& mesh, const labelList& meshF)
|
||||
|
||||
if (nMatched == meshF.size())
|
||||
{
|
||||
return faceI;
|
||||
return facei;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
@ -210,7 +210,7 @@ bool correctOrientation(const pointField& points, const cellShape& shape)
|
||||
void storeCellInZone
|
||||
(
|
||||
const label regPhys,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
Map<label>& physToZone,
|
||||
|
||||
labelList& zoneToPhys,
|
||||
@ -231,12 +231,12 @@ void storeCellInZone
|
||||
physToZone.insert(regPhys, zoneI);
|
||||
|
||||
zoneToPhys[zoneI] = regPhys;
|
||||
zoneCells[zoneI].append(cellI);
|
||||
zoneCells[zoneI].append(celli);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Existing zone for region
|
||||
zoneCells[zoneFnd()].append(cellI);
|
||||
zoneCells[zoneFnd()].append(celli);
|
||||
}
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ void readPoints(IFstream& inFile, pointField& points, Map<label>& mshToFoam)
|
||||
points.setSize(nVerts);
|
||||
mshToFoam.resize(2*nVerts);
|
||||
|
||||
for (label pointI = 0; pointI < nVerts; pointI++)
|
||||
for (label pointi = 0; pointi < nVerts; pointi++)
|
||||
{
|
||||
label mshLabel;
|
||||
scalar xVal, yVal, zVal;
|
||||
@ -309,13 +309,13 @@ void readPoints(IFstream& inFile, pointField& points, Map<label>& mshToFoam)
|
||||
|
||||
lineStr >> mshLabel >> xVal >> yVal >> zVal;
|
||||
|
||||
point& pt = points[pointI];
|
||||
point& pt = points[pointi];
|
||||
|
||||
pt.x() = xVal;
|
||||
pt.y() = yVal;
|
||||
pt.z() = zVal;
|
||||
|
||||
mshToFoam.insert(mshLabel, pointI);
|
||||
mshToFoam.insert(mshLabel, pointi);
|
||||
}
|
||||
|
||||
Info<< "Vertices read:" << mshToFoam.size() << endl;
|
||||
@ -452,7 +452,7 @@ void readCells
|
||||
// Storage for all cells. Too big. Shrink later
|
||||
cells.setSize(nElems);
|
||||
|
||||
label cellI = 0;
|
||||
label celli = 0;
|
||||
label nTet = 0;
|
||||
label nPyr = 0;
|
||||
label nPrism = 0;
|
||||
@ -508,28 +508,28 @@ void readCells
|
||||
|
||||
Map<label>::iterator regFnd = physToPatch.find(regPhys);
|
||||
|
||||
label patchI = -1;
|
||||
label patchi = -1;
|
||||
if (regFnd == physToPatch.end())
|
||||
{
|
||||
// New region. Allocate patch for it.
|
||||
patchI = patchFaces.size();
|
||||
patchi = patchFaces.size();
|
||||
|
||||
patchFaces.setSize(patchI + 1);
|
||||
patchToPhys.setSize(patchI + 1);
|
||||
patchFaces.setSize(patchi + 1);
|
||||
patchToPhys.setSize(patchi + 1);
|
||||
|
||||
Info<< "Mapping region " << regPhys << " to Foam patch "
|
||||
<< patchI << endl;
|
||||
physToPatch.insert(regPhys, patchI);
|
||||
patchToPhys[patchI] = regPhys;
|
||||
<< patchi << endl;
|
||||
physToPatch.insert(regPhys, patchi);
|
||||
patchToPhys[patchi] = regPhys;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Existing patch for region
|
||||
patchI = regFnd();
|
||||
patchi = regFnd();
|
||||
}
|
||||
|
||||
// Add triangle to correct patchFaces.
|
||||
patchFaces[patchI].append(triPoints);
|
||||
patchFaces[patchi].append(triPoints);
|
||||
}
|
||||
else if (elmType == MSHQUAD)
|
||||
{
|
||||
@ -541,35 +541,35 @@ void readCells
|
||||
|
||||
Map<label>::iterator regFnd = physToPatch.find(regPhys);
|
||||
|
||||
label patchI = -1;
|
||||
label patchi = -1;
|
||||
if (regFnd == physToPatch.end())
|
||||
{
|
||||
// New region. Allocate patch for it.
|
||||
patchI = patchFaces.size();
|
||||
patchi = patchFaces.size();
|
||||
|
||||
patchFaces.setSize(patchI + 1);
|
||||
patchToPhys.setSize(patchI + 1);
|
||||
patchFaces.setSize(patchi + 1);
|
||||
patchToPhys.setSize(patchi + 1);
|
||||
|
||||
Info<< "Mapping region " << regPhys << " to Foam patch "
|
||||
<< patchI << endl;
|
||||
physToPatch.insert(regPhys, patchI);
|
||||
patchToPhys[patchI] = regPhys;
|
||||
<< patchi << endl;
|
||||
physToPatch.insert(regPhys, patchi);
|
||||
patchToPhys[patchi] = regPhys;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Existing patch for region
|
||||
patchI = regFnd();
|
||||
patchi = regFnd();
|
||||
}
|
||||
|
||||
// Add quad to correct patchFaces.
|
||||
patchFaces[patchI].append(quadPoints);
|
||||
patchFaces[patchi].append(quadPoints);
|
||||
}
|
||||
else if (elmType == MSHTET)
|
||||
{
|
||||
storeCellInZone
|
||||
(
|
||||
regPhys,
|
||||
cellI,
|
||||
celli,
|
||||
physToZone,
|
||||
zoneToPhys,
|
||||
zoneCells
|
||||
@ -581,7 +581,7 @@ void readCells
|
||||
|
||||
renumber(mshToFoam, tetPoints);
|
||||
|
||||
cells[cellI++] = cellShape(tet, tetPoints);
|
||||
cells[celli++] = cellShape(tet, tetPoints);
|
||||
|
||||
nTet++;
|
||||
}
|
||||
@ -590,7 +590,7 @@ void readCells
|
||||
storeCellInZone
|
||||
(
|
||||
regPhys,
|
||||
cellI,
|
||||
celli,
|
||||
physToZone,
|
||||
zoneToPhys,
|
||||
zoneCells
|
||||
@ -602,7 +602,7 @@ void readCells
|
||||
|
||||
renumber(mshToFoam, pyrPoints);
|
||||
|
||||
cells[cellI++] = cellShape(pyr, pyrPoints);
|
||||
cells[celli++] = cellShape(pyr, pyrPoints);
|
||||
|
||||
nPyr++;
|
||||
}
|
||||
@ -611,7 +611,7 @@ void readCells
|
||||
storeCellInZone
|
||||
(
|
||||
regPhys,
|
||||
cellI,
|
||||
celli,
|
||||
physToZone,
|
||||
zoneToPhys,
|
||||
zoneCells
|
||||
@ -623,13 +623,13 @@ void readCells
|
||||
|
||||
renumber(mshToFoam, prismPoints);
|
||||
|
||||
cells[cellI] = cellShape(prism, prismPoints);
|
||||
cells[celli] = cellShape(prism, prismPoints);
|
||||
|
||||
const cellShape& cell = cells[cellI];
|
||||
const cellShape& cell = cells[celli];
|
||||
|
||||
if (!keepOrientation && !correctOrientation(points, cell))
|
||||
{
|
||||
Info<< "Inverting prism " << cellI << endl;
|
||||
Info<< "Inverting prism " << celli << endl;
|
||||
// Reorder prism.
|
||||
prismPoints[0] = cell[0];
|
||||
prismPoints[1] = cell[2];
|
||||
@ -638,10 +638,10 @@ void readCells
|
||||
prismPoints[4] = cell[4];
|
||||
prismPoints[5] = cell[5];
|
||||
|
||||
cells[cellI] = cellShape(prism, prismPoints);
|
||||
cells[celli] = cellShape(prism, prismPoints);
|
||||
}
|
||||
|
||||
cellI++;
|
||||
celli++;
|
||||
|
||||
nPrism++;
|
||||
}
|
||||
@ -650,7 +650,7 @@ void readCells
|
||||
storeCellInZone
|
||||
(
|
||||
regPhys,
|
||||
cellI,
|
||||
celli,
|
||||
physToZone,
|
||||
zoneToPhys,
|
||||
zoneCells
|
||||
@ -664,13 +664,13 @@ void readCells
|
||||
|
||||
renumber(mshToFoam, hexPoints);
|
||||
|
||||
cells[cellI] = cellShape(hex, hexPoints);
|
||||
cells[celli] = cellShape(hex, hexPoints);
|
||||
|
||||
const cellShape& cell = cells[cellI];
|
||||
const cellShape& cell = cells[celli];
|
||||
|
||||
if (!keepOrientation && !correctOrientation(points, cell))
|
||||
{
|
||||
Info<< "Inverting hex " << cellI << endl;
|
||||
Info<< "Inverting hex " << celli << endl;
|
||||
// Reorder hex.
|
||||
hexPoints[0] = cell[4];
|
||||
hexPoints[1] = cell[5];
|
||||
@ -681,10 +681,10 @@ void readCells
|
||||
hexPoints[6] = cell[2];
|
||||
hexPoints[7] = cell[3];
|
||||
|
||||
cells[cellI] = cellShape(hex, hexPoints);
|
||||
cells[celli] = cellShape(hex, hexPoints);
|
||||
}
|
||||
|
||||
cellI++;
|
||||
celli++;
|
||||
|
||||
nHex++;
|
||||
}
|
||||
@ -708,11 +708,11 @@ void readCells
|
||||
}
|
||||
|
||||
|
||||
cells.setSize(cellI);
|
||||
cells.setSize(celli);
|
||||
|
||||
forAll(patchFaces, patchI)
|
||||
forAll(patchFaces, patchi)
|
||||
{
|
||||
patchFaces[patchI].shrink();
|
||||
patchFaces[patchi].shrink();
|
||||
}
|
||||
|
||||
|
||||
@ -883,22 +883,22 @@ int main(int argc, char *argv[])
|
||||
|
||||
wordList boundaryPatchNames(boundaryFaces.size());
|
||||
|
||||
forAll(boundaryPatchNames, patchI)
|
||||
forAll(boundaryPatchNames, patchi)
|
||||
{
|
||||
label physReg = patchToPhys[patchI];
|
||||
label physReg = patchToPhys[patchi];
|
||||
|
||||
Map<word>::const_iterator iter = physicalNames.find(physReg);
|
||||
|
||||
if (iter != physicalNames.end())
|
||||
{
|
||||
boundaryPatchNames[patchI] = iter();
|
||||
boundaryPatchNames[patchi] = iter();
|
||||
}
|
||||
else
|
||||
{
|
||||
boundaryPatchNames[patchI] = word("patch") + name(patchI);
|
||||
boundaryPatchNames[patchi] = word("patch") + name(patchi);
|
||||
}
|
||||
Info<< "Patch " << patchI << " gets name "
|
||||
<< boundaryPatchNames[patchI] << endl;
|
||||
Info<< "Patch " << patchi << " gets name "
|
||||
<< boundaryPatchNames[patchi] << endl;
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
@ -941,34 +941,34 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Go through all the patchFaces and find corresponding face in pp.
|
||||
forAll(patchFaces, patchI)
|
||||
forAll(patchFaces, patchi)
|
||||
{
|
||||
const DynamicList<face>& pFaces = patchFaces[patchI];
|
||||
const DynamicList<face>& pFaces = patchFaces[patchi];
|
||||
|
||||
Info<< "Finding faces of patch " << patchI << endl;
|
||||
Info<< "Finding faces of patch " << patchi << endl;
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
const face& f = pFaces[i];
|
||||
|
||||
// Find face in pp using all vertices of f.
|
||||
label patchFaceI = findFace(pp, f);
|
||||
label patchFacei = findFace(pp, f);
|
||||
|
||||
if (patchFaceI != -1)
|
||||
if (patchFacei != -1)
|
||||
{
|
||||
label meshFaceI = pp.start() + patchFaceI;
|
||||
label meshFacei = pp.start() + patchFacei;
|
||||
|
||||
repatcher.changePatchID(meshFaceI, patchI);
|
||||
repatcher.changePatchID(meshFacei, patchi);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Maybe internal face? If so add to faceZone with same index
|
||||
// - might be useful.
|
||||
label meshFaceI = findInternalFace(mesh, f);
|
||||
label meshFacei = findInternalFace(mesh, f);
|
||||
|
||||
if (meshFaceI != -1)
|
||||
if (meshFacei != -1)
|
||||
{
|
||||
zoneFaces[patchI].append(meshFaceI);
|
||||
zoneFaces[patchi].append(meshFacei);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1106,22 +1106,22 @@ int main(int argc, char *argv[])
|
||||
if (mesh.boundaryMesh()[defaultPatchID].size() == 0)
|
||||
{
|
||||
List<polyPatch*> newPatchPtrList((mesh.boundaryMesh().size() - 1));
|
||||
label newPatchI = 0;
|
||||
forAll(mesh.boundaryMesh(), patchI)
|
||||
label newPatchi = 0;
|
||||
forAll(mesh.boundaryMesh(), patchi)
|
||||
{
|
||||
if (patchI != defaultPatchID)
|
||||
if (patchi != defaultPatchID)
|
||||
{
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||
|
||||
newPatchPtrList[newPatchI] = patch.clone
|
||||
newPatchPtrList[newPatchi] = patch.clone
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
newPatchI,
|
||||
newPatchi,
|
||||
patch.size(),
|
||||
patch.start()
|
||||
).ptr();
|
||||
|
||||
newPatchI++;
|
||||
newPatchi++;
|
||||
}
|
||||
}
|
||||
repatcher.changePatches(newPatchPtrList);
|
||||
|
||||
@ -215,20 +215,20 @@ void readPoints
|
||||
string line;
|
||||
is.getLine(line);
|
||||
|
||||
label pointI = readLabel(IStringStream(line.substr(0, 10))());
|
||||
label pointi = readLabel(IStringStream(line.substr(0, 10))());
|
||||
|
||||
if (pointI == -1)
|
||||
if (pointi == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (pointI != points.size()+1 && !hasWarned)
|
||||
else if (pointi != points.size()+1 && !hasWarned)
|
||||
{
|
||||
hasWarned = true;
|
||||
|
||||
IOWarningInFunction
|
||||
(
|
||||
is
|
||||
) << "Points not in order starting at point " << pointI
|
||||
) << "Points not in order starting at point " << pointi
|
||||
//<< " at line " << is.lineNumber()
|
||||
//<< abort(FatalError);
|
||||
<< endl;
|
||||
@ -240,7 +240,7 @@ void readPoints
|
||||
pt[1] = readUnvScalar(line.substr(25, 25));
|
||||
pt[2] = readUnvScalar(line.substr(50, 25));
|
||||
|
||||
unvPointID.append(pointI);
|
||||
unvPointID.append(pointi);
|
||||
points.append(pt);
|
||||
}
|
||||
|
||||
@ -253,15 +253,15 @@ void readPoints
|
||||
void addAndExtend
|
||||
(
|
||||
DynamicList<label>& indizes,
|
||||
label cellI,
|
||||
label celli,
|
||||
label val
|
||||
)
|
||||
{
|
||||
if (indizes.size() < (cellI+1))
|
||||
if (indizes.size() < (celli+1))
|
||||
{
|
||||
indizes.setSize(cellI+1,-1);
|
||||
indizes.setSize(celli+1,-1);
|
||||
}
|
||||
indizes[cellI] = val;
|
||||
indizes[celli] = val;
|
||||
}
|
||||
|
||||
// Reads cells section. Read region as well? Not handled yet but should just
|
||||
@ -282,9 +282,9 @@ void readCells
|
||||
|
||||
// Invert point numbering.
|
||||
label maxUnvPoint = 0;
|
||||
forAll(unvPointID, pointI)
|
||||
forAll(unvPointID, pointi)
|
||||
{
|
||||
maxUnvPoint = max(maxUnvPoint, unvPointID[pointI]);
|
||||
maxUnvPoint = max(maxUnvPoint, unvPointID[pointi]);
|
||||
}
|
||||
labelList unvToFoam(invert(maxUnvPoint+1, unvPointID));
|
||||
|
||||
@ -307,16 +307,16 @@ void readCells
|
||||
break;
|
||||
}
|
||||
|
||||
label cellI, feID, physProp, matProp, colour, nNodes;
|
||||
label celli, feID, physProp, matProp, colour, nNodes;
|
||||
|
||||
IStringStream lineStr(line);
|
||||
lineStr
|
||||
>> cellI >> feID >> physProp >> matProp >> colour >> nNodes;
|
||||
>> celli >> feID >> physProp >> matProp >> colour >> nNodes;
|
||||
|
||||
if (foundFeType.insert(feID))
|
||||
{
|
||||
Info<< "First occurrence of element type " << feID
|
||||
<< " for cell " << cellI << " at line "
|
||||
<< " for cell " << celli << " at line "
|
||||
<< is.lineNumber() << endl;
|
||||
}
|
||||
|
||||
@ -341,7 +341,7 @@ void readCells
|
||||
lineStr
|
||||
>> cVerts[0] >> cVerts[1] >> cVerts[2];
|
||||
boundaryFaces.append(cVerts);
|
||||
boundaryFaceIndices.append(cellI);
|
||||
boundaryFaceIndices.append(celli);
|
||||
}
|
||||
else if (feID == 44 || feID == 94)
|
||||
{
|
||||
@ -353,7 +353,7 @@ void readCells
|
||||
lineStr
|
||||
>> cVerts[0] >> cVerts[1] >> cVerts[2] >> cVerts[3];
|
||||
boundaryFaces.append(cVerts);
|
||||
boundaryFaceIndices.append(cellI);
|
||||
boundaryFaceIndices.append(celli);
|
||||
}
|
||||
else if (feID == 111)
|
||||
{
|
||||
@ -367,12 +367,12 @@ void readCells
|
||||
|
||||
cellVerts.append(cellShape(tet, cVerts, true));
|
||||
cellMaterial.append(physProp);
|
||||
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
|
||||
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
|
||||
|
||||
if (cellVerts.last().size() != cVerts.size())
|
||||
{
|
||||
Info<< "Line:" << is.lineNumber()
|
||||
<< " element:" << cellI
|
||||
<< " element:" << celli
|
||||
<< " type:" << feID
|
||||
<< " collapsed from " << cVerts << nl
|
||||
<< " to:" << cellVerts.last()
|
||||
@ -392,12 +392,12 @@ void readCells
|
||||
|
||||
cellVerts.append(cellShape(prism, cVerts, true));
|
||||
cellMaterial.append(physProp);
|
||||
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
|
||||
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
|
||||
|
||||
if (cellVerts.last().size() != cVerts.size())
|
||||
{
|
||||
Info<< "Line:" << is.lineNumber()
|
||||
<< " element:" << cellI
|
||||
<< " element:" << celli
|
||||
<< " type:" << feID
|
||||
<< " collapsed from " << cVerts << nl
|
||||
<< " to:" << cellVerts.last()
|
||||
@ -417,12 +417,12 @@ void readCells
|
||||
|
||||
cellVerts.append(cellShape(hex, cVerts, true));
|
||||
cellMaterial.append(physProp);
|
||||
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
|
||||
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
|
||||
|
||||
if (cellVerts.last().size() != cVerts.size())
|
||||
{
|
||||
Info<< "Line:" << is.lineNumber()
|
||||
<< " element:" << cellI
|
||||
<< " element:" << celli
|
||||
<< " type:" << feID
|
||||
<< " collapsed from " << cVerts << nl
|
||||
<< " to:" << cellVerts.last()
|
||||
@ -449,12 +449,12 @@ void readCells
|
||||
|
||||
cellVerts.append(cellShape(tet, cVerts, true));
|
||||
cellMaterial.append(physProp);
|
||||
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
|
||||
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
|
||||
|
||||
if (cellVerts.last().size() != cVerts.size())
|
||||
{
|
||||
Info<< "Line:" << is.lineNumber()
|
||||
<< " element:" << cellI
|
||||
<< " element:" << celli
|
||||
<< " type:" << feID
|
||||
<< " collapsed from " << cVerts << nl
|
||||
<< " to:" << cellVerts.last()
|
||||
@ -608,10 +608,10 @@ void readDOFS
|
||||
}
|
||||
|
||||
IStringStream lineStr(line);
|
||||
label pointI;
|
||||
lineStr >> pointI;
|
||||
label pointi;
|
||||
lineStr >> pointi;
|
||||
|
||||
vertices.append(pointI);
|
||||
vertices.append(pointi);
|
||||
}
|
||||
|
||||
Info<< "For DOF set " << group
|
||||
@ -628,16 +628,16 @@ void readDOFS
|
||||
// Returns -1 or group that all of the vertices of f are in,
|
||||
label findPatch(const List<labelHashSet>& dofGroups, const face& f)
|
||||
{
|
||||
forAll(dofGroups, patchI)
|
||||
forAll(dofGroups, patchi)
|
||||
{
|
||||
if (dofGroups[patchI].found(f[0]))
|
||||
if (dofGroups[patchi].found(f[0]))
|
||||
{
|
||||
bool allInGroup = true;
|
||||
|
||||
// Check rest of face
|
||||
for (label fp = 1; fp < f.size(); fp++)
|
||||
{
|
||||
if (!dofGroups[patchI].found(f[fp]))
|
||||
if (!dofGroups[patchi].found(f[fp]))
|
||||
{
|
||||
allInGroup = false;
|
||||
break;
|
||||
@ -646,7 +646,7 @@ label findPatch(const List<labelHashSet>& dofGroups, const face& f)
|
||||
|
||||
if (allInGroup)
|
||||
{
|
||||
return patchI;
|
||||
return patchi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -784,56 +784,56 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Invert point numbering.
|
||||
label maxUnvPoint = 0;
|
||||
forAll(unvPointID, pointI)
|
||||
forAll(unvPointID, pointi)
|
||||
{
|
||||
maxUnvPoint = max(maxUnvPoint, unvPointID[pointI]);
|
||||
maxUnvPoint = max(maxUnvPoint, unvPointID[pointi]);
|
||||
}
|
||||
labelList unvToFoam(invert(maxUnvPoint+1, unvPointID));
|
||||
|
||||
|
||||
// Renumber vertex numbers on cells
|
||||
|
||||
forAll(cellVerts, cellI)
|
||||
forAll(cellVerts, celli)
|
||||
{
|
||||
labelList foamVerts
|
||||
(
|
||||
renumber
|
||||
(
|
||||
unvToFoam,
|
||||
static_cast<labelList&>(cellVerts[cellI])
|
||||
static_cast<labelList&>(cellVerts[celli])
|
||||
)
|
||||
);
|
||||
|
||||
if (findIndex(foamVerts, -1) != -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cell " << cellI
|
||||
<< " unv vertices " << cellVerts[cellI]
|
||||
<< "Cell " << celli
|
||||
<< " unv vertices " << cellVerts[celli]
|
||||
<< " has some undefined vertices " << foamVerts
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Bit nasty: replace vertex list.
|
||||
cellVerts[cellI].transfer(foamVerts);
|
||||
cellVerts[celli].transfer(foamVerts);
|
||||
}
|
||||
|
||||
// Renumber vertex numbers on boundaryFaces
|
||||
|
||||
forAll(boundaryFaces, bFaceI)
|
||||
forAll(boundaryFaces, bFacei)
|
||||
{
|
||||
labelList foamVerts(renumber(unvToFoam, boundaryFaces[bFaceI]));
|
||||
labelList foamVerts(renumber(unvToFoam, boundaryFaces[bFacei]));
|
||||
|
||||
if (findIndex(foamVerts, -1) != -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Boundary face " << bFaceI
|
||||
<< " unv vertices " << boundaryFaces[bFaceI]
|
||||
<< "Boundary face " << bFacei
|
||||
<< " unv vertices " << boundaryFaces[bFacei]
|
||||
<< " has some undefined vertices " << foamVerts
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Bit nasty: replace vertex list.
|
||||
boundaryFaces[bFaceI].transfer(foamVerts);
|
||||
boundaryFaces[bFacei].transfer(foamVerts);
|
||||
}
|
||||
|
||||
|
||||
@ -853,15 +853,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
{
|
||||
HashTable<label, face, Hash<face>> faceToFaceID(boundaryFaces.size());
|
||||
forAll(boundaryFaces, faceI)
|
||||
forAll(boundaryFaces, facei)
|
||||
{
|
||||
SortableList<label> sortedVerts(boundaryFaces[faceI]);
|
||||
faceToFaceID.insert(face(sortedVerts), faceI);
|
||||
SortableList<label> sortedVerts(boundaryFaces[facei]);
|
||||
faceToFaceID.insert(face(sortedVerts), facei);
|
||||
}
|
||||
|
||||
forAll(cellVerts, cellI)
|
||||
forAll(cellVerts, celli)
|
||||
{
|
||||
faceList faces = cellVerts[cellI].faces();
|
||||
faceList faces = cellVerts[celli].faces();
|
||||
forAll(faces, i)
|
||||
{
|
||||
SortableList<label> sortedVerts(faces[i]);
|
||||
@ -870,31 +870,31 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (fnd != faceToFaceID.end())
|
||||
{
|
||||
label faceI = fnd();
|
||||
int stat = face::compare(faces[i], boundaryFaces[faceI]);
|
||||
label facei = fnd();
|
||||
int stat = face::compare(faces[i], boundaryFaces[facei]);
|
||||
|
||||
if (stat == 1)
|
||||
{
|
||||
// Same orientation. Cell is owner.
|
||||
own[faceI] = cellI;
|
||||
own[facei] = celli;
|
||||
}
|
||||
else if (stat == -1)
|
||||
{
|
||||
// Opposite orientation. Cell is neighbour.
|
||||
nei[faceI] = cellI;
|
||||
nei[facei] = celli;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
label nReverse = 0;
|
||||
forAll(own, faceI)
|
||||
forAll(own, facei)
|
||||
{
|
||||
if (own[faceI] == -1 && nei[faceI] != -1)
|
||||
if (own[facei] == -1 && nei[facei] != -1)
|
||||
{
|
||||
// Boundary face with incorrect orientation
|
||||
boundaryFaces[faceI] = boundaryFaces[faceI].reverseFace();
|
||||
Swap(own[faceI], nei[faceI]);
|
||||
boundaryFaces[facei] = boundaryFaces[facei].reverseFace();
|
||||
Swap(own[facei], nei[facei]);
|
||||
nReverse++;
|
||||
}
|
||||
}
|
||||
@ -906,12 +906,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
label cnt = 0;
|
||||
forAll(own, faceI)
|
||||
forAll(own, facei)
|
||||
{
|
||||
if (own[faceI] != -1 && nei[faceI] != -1)
|
||||
if (own[facei] != -1 && nei[facei] != -1)
|
||||
{
|
||||
faceToCell[1].insert(faceI, own[faceI]);
|
||||
faceToCell[0].insert(faceI, nei[faceI]);
|
||||
faceToCell[1].insert(facei, own[facei]);
|
||||
faceToCell[0].insert(facei, nei[facei]);
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
@ -940,40 +940,40 @@ int main(int argc, char *argv[])
|
||||
<< " DOF sets to detect boundary faces."<< endl;
|
||||
|
||||
// Renumber vertex numbers on contraints
|
||||
forAll(dofVertIndices, patchI)
|
||||
forAll(dofVertIndices, patchi)
|
||||
{
|
||||
inplaceRenumber(unvToFoam, dofVertIndices[patchI]);
|
||||
inplaceRenumber(unvToFoam, dofVertIndices[patchi]);
|
||||
}
|
||||
|
||||
|
||||
// Build labelHashSet of points per dofGroup/patch
|
||||
List<labelHashSet> dofGroups(dofVertIndices.size());
|
||||
|
||||
forAll(dofVertIndices, patchI)
|
||||
forAll(dofVertIndices, patchi)
|
||||
{
|
||||
const labelList& foamVerts = dofVertIndices[patchI];
|
||||
const labelList& foamVerts = dofVertIndices[patchi];
|
||||
|
||||
forAll(foamVerts, i)
|
||||
{
|
||||
dofGroups[patchI].insert(foamVerts[i]);
|
||||
dofGroups[patchi].insert(foamVerts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
List<DynamicList<face>> dynPatchFaces(dofVertIndices.size());
|
||||
|
||||
forAll(cellVerts, cellI)
|
||||
forAll(cellVerts, celli)
|
||||
{
|
||||
const cellShape& shape = cellVerts[cellI];
|
||||
const cellShape& shape = cellVerts[celli];
|
||||
|
||||
const faceList shapeFaces(shape.faces());
|
||||
|
||||
forAll(shapeFaces, i)
|
||||
{
|
||||
label patchI = findPatch(dofGroups, shapeFaces[i]);
|
||||
label patchi = findPatch(dofGroups, shapeFaces[i]);
|
||||
|
||||
if (patchI != -1)
|
||||
if (patchi != -1)
|
||||
{
|
||||
dynPatchFaces[patchI].append(shapeFaces[i]);
|
||||
dynPatchFaces[patchi].append(shapeFaces[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -981,9 +981,9 @@ int main(int argc, char *argv[])
|
||||
// Transfer
|
||||
patchFaceVerts.setSize(dynPatchFaces.size());
|
||||
|
||||
forAll(dynPatchFaces, patchI)
|
||||
forAll(dynPatchFaces, patchi)
|
||||
{
|
||||
patchFaceVerts[patchI].transfer(dynPatchFaces[patchI]);
|
||||
patchFaceVerts[patchi].transfer(dynPatchFaces[patchi]);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1008,12 +1008,12 @@ int main(int argc, char *argv[])
|
||||
boundaryFaceToIndex.insert(boundaryFaceIndices[i], i);
|
||||
}
|
||||
|
||||
forAll(patchFaceVerts, patchI)
|
||||
forAll(patchFaceVerts, patchi)
|
||||
{
|
||||
Info << patchI << ": " << patchNames[patchI] << " is " << flush;
|
||||
Info << patchi << ": " << patchNames[patchi] << " is " << flush;
|
||||
|
||||
faceList& patchFaces = patchFaceVerts[patchI];
|
||||
const labelList& faceIndices = patchFaceIndices[patchI];
|
||||
faceList& patchFaces = patchFaceVerts[patchi];
|
||||
const labelList& faceIndices = patchFaceIndices[patchi];
|
||||
|
||||
patchFaces.setSize(faceIndices.size());
|
||||
|
||||
@ -1024,13 +1024,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (boundaryFaceToIndex.found(faceIndices[i]))
|
||||
{
|
||||
label bFaceI = boundaryFaceToIndex[faceIndices[i]];
|
||||
label bFacei = boundaryFaceToIndex[faceIndices[i]];
|
||||
|
||||
if (own[bFaceI] != -1 && nei[bFaceI] == -1)
|
||||
if (own[bFacei] != -1 && nei[bFacei] == -1)
|
||||
{
|
||||
patchFaces[cnt] = boundaryFaces[bFaceI];
|
||||
patchFaces[cnt] = boundaryFaces[bFacei];
|
||||
cnt++;
|
||||
if (alreadyOnBoundary.found(bFaceI))
|
||||
if (alreadyOnBoundary.found(bFacei))
|
||||
{
|
||||
duplicateFaces = true;
|
||||
}
|
||||
@ -1040,14 +1040,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (cnt != patchFaces.size() || duplicateFaces)
|
||||
{
|
||||
isAPatch[patchI] = false;
|
||||
isAPatch[patchi] = false;
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
if (cnt != patchFaces.size())
|
||||
{
|
||||
WarningInFunction
|
||||
<< "For patch " << patchI << " there were "
|
||||
<< "For patch " << patchi << " there were "
|
||||
<< patchFaces.size()-cnt
|
||||
<< " faces not used because they seem"
|
||||
<< " to be internal. "
|
||||
@ -1058,7 +1058,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Patch "
|
||||
<< patchI << " has faces that are already "
|
||||
<< patchi << " has faces that are already "
|
||||
<< " in use on other boundary-patches,"
|
||||
<< " Assuming faceZoneset." << endl;
|
||||
}
|
||||
@ -1078,13 +1078,13 @@ int main(int argc, char *argv[])
|
||||
<< "The face index " << faceIndices[i]
|
||||
<< " was not found amongst the cells."
|
||||
<< " This kills the theory that "
|
||||
<< patchNames[patchI] << " is a cell zone"
|
||||
<< patchNames[patchi] << " is a cell zone"
|
||||
<< endl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
theCells[i] = cellCorrespondence[faceIndices[i]];
|
||||
}
|
||||
cellZones.insert(patchNames[patchI], theCells);
|
||||
cellZones.insert(patchNames[patchi], theCells);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1094,7 +1094,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
theFaces[i] = boundaryFaceToIndex[faceIndices[i]];
|
||||
}
|
||||
faceZones.insert(patchNames[patchI],theFaces);
|
||||
faceZones.insert(patchNames[patchi],theFaces);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1103,8 +1103,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(patchFaces, i)
|
||||
{
|
||||
label bFaceI = boundaryFaceToIndex[faceIndices[i]];
|
||||
alreadyOnBoundary.insert(bFaceI);
|
||||
label bFacei = boundaryFaceToIndex[faceIndices[i]];
|
||||
alreadyOnBoundary.insert(bFacei);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1143,14 +1143,14 @@ int main(int argc, char *argv[])
|
||||
DynamicList<word> usedPatchNames;
|
||||
DynamicList<faceList> usedPatchFaceVerts;
|
||||
|
||||
forAll(patchNames, patchI)
|
||||
forAll(patchNames, patchi)
|
||||
{
|
||||
if (isAPatch[patchI])
|
||||
if (isAPatch[patchi])
|
||||
{
|
||||
Info<< " " << patchNames[patchI] << '\t'
|
||||
<< patchFaceVerts[patchI].size() << nl;
|
||||
usedPatchNames.append(patchNames[patchI]);
|
||||
usedPatchFaceVerts.append(patchFaceVerts[patchI]);
|
||||
Info<< " " << patchNames[patchi] << '\t'
|
||||
<< patchFaceVerts[patchi].size() << nl;
|
||||
usedPatchNames.append(patchNames[patchi]);
|
||||
usedPatchFaceVerts.append(patchFaceVerts[patchi]);
|
||||
}
|
||||
}
|
||||
usedPatchNames.shrink();
|
||||
|
||||
@ -546,14 +546,14 @@ preservePatchTypes
|
||||
defaultFacesType
|
||||
);
|
||||
// Add information to dictionary
|
||||
forAll(patchNames, patchI)
|
||||
forAll(patchNames, patchi)
|
||||
{
|
||||
if (!patchDicts.set(patchI))
|
||||
if (!patchDicts.set(patchi))
|
||||
{
|
||||
patchDicts.set(patchI, new dictionary());
|
||||
patchDicts.set(patchi, new dictionary());
|
||||
}
|
||||
// Add but not overwrite
|
||||
patchDicts[patchI].add("type", patchTypes[patchI], false);
|
||||
patchDicts[patchi].add("type", patchTypes[patchi], false);
|
||||
}
|
||||
|
||||
// Build the mesh and write it out
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -95,24 +95,24 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (readHex)
|
||||
{
|
||||
for (label cellI = 0; cellI < nCells; cellI++)
|
||||
for (label celli = 0; celli < nCells; celli++)
|
||||
{
|
||||
for (label cp = 0; cp < 8; cp++)
|
||||
{
|
||||
mshStream >> hexPoints[cp];
|
||||
}
|
||||
cells[cellI] = cellShape(hex, hexPoints);
|
||||
cells[celli] = cellShape(hex, hexPoints);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (label cellI = 0; cellI < nCells; cellI++)
|
||||
for (label celli = 0; celli < nCells; celli++)
|
||||
{
|
||||
for (label cp = 0; cp < 4; cp++)
|
||||
{
|
||||
mshStream >> tetPoints[cp];
|
||||
}
|
||||
cells[cellI] = cellShape(tet, tetPoints);
|
||||
cells[celli] = cellShape(tet, tetPoints);
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,13 +126,13 @@ int main(int argc, char *argv[])
|
||||
pointField points(nPoints);
|
||||
|
||||
|
||||
for (label pointI = 0; pointI < nPoints; pointI++)
|
||||
for (label pointi = 0; pointi < nPoints; pointi++)
|
||||
{
|
||||
scalar x, y, z;
|
||||
|
||||
mshStream >> x >> y >> z;
|
||||
|
||||
points[pointI] = point(x, y, z);
|
||||
points[pointi] = point(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -108,13 +108,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
pointField points(nNodes);
|
||||
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
scalar x,y,z;
|
||||
|
||||
str >> x >> y >> z;
|
||||
|
||||
points[pointI] = point(x, y, z);
|
||||
points[pointi] = point(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
labelList tetPoints(4);
|
||||
|
||||
forAll(cells, cellI)
|
||||
forAll(cells, celli)
|
||||
{
|
||||
label domain(readLabel(str));
|
||||
|
||||
@ -147,7 +147,7 @@ int main(int argc, char *argv[])
|
||||
tetPoints[2] = readLabel(str) - 1;
|
||||
tetPoints[3] = readLabel(str) - 1;
|
||||
|
||||
cells[cellI] = cellShape(tet, tetPoints);
|
||||
cells[celli] = cellShape(tet, tetPoints);
|
||||
}
|
||||
|
||||
|
||||
@ -168,31 +168,31 @@ int main(int argc, char *argv[])
|
||||
// Boundary faces as three vertices
|
||||
HashTable<label, triFace, Hash<triFace>> vertsToBoundary(nFaces);
|
||||
|
||||
forAll(boundaryFaces, faceI)
|
||||
forAll(boundaryFaces, facei)
|
||||
{
|
||||
label patchI(readLabel(str));
|
||||
label patchi(readLabel(str));
|
||||
|
||||
if (patchI < 0)
|
||||
if (patchi < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Invalid boundary region number " << patchI
|
||||
<< "Invalid boundary region number " << patchi
|
||||
<< " on line " << str.lineNumber()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
maxPatch = max(maxPatch, patchI);
|
||||
maxPatch = max(maxPatch, patchi);
|
||||
|
||||
triFace tri(readLabel(str)-1, readLabel(str)-1, readLabel(str)-1);
|
||||
|
||||
// Store boundary face as is for now. Later on reverse it.
|
||||
boundaryFaces[faceI].setSize(3);
|
||||
boundaryFaces[faceI][0] = tri[0];
|
||||
boundaryFaces[faceI][1] = tri[1];
|
||||
boundaryFaces[faceI][2] = tri[2];
|
||||
boundaryPatch[faceI] = patchI;
|
||||
boundaryFaces[facei].setSize(3);
|
||||
boundaryFaces[facei][0] = tri[0];
|
||||
boundaryFaces[facei][1] = tri[1];
|
||||
boundaryFaces[facei][2] = tri[2];
|
||||
boundaryPatch[facei] = patchi;
|
||||
|
||||
vertsToBoundary.insert(tri, faceI);
|
||||
vertsToBoundary.insert(tri, facei);
|
||||
}
|
||||
|
||||
label nPatches = maxPatch + 1;
|
||||
@ -202,9 +202,9 @@ int main(int argc, char *argv[])
|
||||
// For storage reasons I store the triangles and loop over the cells instead
|
||||
// of the other way around (store cells and loop over triangles) though
|
||||
// that would be faster.
|
||||
forAll(cells, cellI)
|
||||
forAll(cells, celli)
|
||||
{
|
||||
const cellShape& cll = cells[cellI];
|
||||
const cellShape& cll = cells[celli];
|
||||
|
||||
// Get the four (outwards pointing) faces of the cell
|
||||
faceList tris(cll.faces());
|
||||
@ -220,7 +220,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (iter != vertsToBoundary.end())
|
||||
{
|
||||
label faceI = iter();
|
||||
label facei = iter();
|
||||
const triFace& tri = iter.key();
|
||||
|
||||
// Determine orientation of tri v.s. cell centre.
|
||||
@ -231,7 +231,7 @@ int main(int argc, char *argv[])
|
||||
if (((fc - cc) & fn) < 0)
|
||||
{
|
||||
// Boundary face points inwards. Flip.
|
||||
boundaryFaces[faceI].flip();
|
||||
boundaryFaces[facei].flip();
|
||||
}
|
||||
|
||||
// Done this face so erase from hash
|
||||
@ -257,9 +257,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
wordList patchNames(nPatches);
|
||||
|
||||
forAll(patchNames, patchI)
|
||||
forAll(patchNames, patchi)
|
||||
{
|
||||
patchNames[patchI] = word("patch") + name(patchI);
|
||||
patchNames[patchi] = word("patch") + name(patchi);
|
||||
}
|
||||
|
||||
wordList patchTypes(nPatches, polyPatch::typeName);
|
||||
@ -271,24 +271,24 @@ int main(int argc, char *argv[])
|
||||
// Sort boundaryFaces by patch.
|
||||
List<DynamicList<face>> allPatchFaces(nPatches);
|
||||
|
||||
forAll(boundaryPatch, faceI)
|
||||
forAll(boundaryPatch, facei)
|
||||
{
|
||||
label patchI = boundaryPatch[faceI];
|
||||
label patchi = boundaryPatch[facei];
|
||||
|
||||
allPatchFaces[patchI].append(boundaryFaces[faceI]);
|
||||
allPatchFaces[patchi].append(boundaryFaces[facei]);
|
||||
}
|
||||
|
||||
Info<< "Patches:" << nl
|
||||
<< "\tNeutral Boundary\tPatch name\tSize" << nl
|
||||
<< "\t----------------\t----------\t----" << endl;
|
||||
|
||||
forAll(allPatchFaces, patchI)
|
||||
forAll(allPatchFaces, patchi)
|
||||
{
|
||||
Info<< '\t' << patchI << "\t\t\t"
|
||||
<< patchNames[patchI] << "\t\t"
|
||||
<< allPatchFaces[patchI].size() << endl;
|
||||
Info<< '\t' << patchi << "\t\t\t"
|
||||
<< patchNames[patchi] << "\t\t"
|
||||
<< allPatchFaces[patchi].size() << endl;
|
||||
|
||||
patchFaces[patchI].transfer(allPatchFaces[patchI]);
|
||||
patchFaces[patchi].transfer(allPatchFaces[patchi]);
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -464,9 +464,9 @@ faceList hexBlock::patchFaces(const label direc, const labelList& range) const
|
||||
else if (blockHandedness_ == left)
|
||||
{
|
||||
// turn all faces inside out
|
||||
forAll(result, faceI)
|
||||
forAll(result, facei)
|
||||
{
|
||||
result[faceI].flip();
|
||||
result[facei].flip();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -210,16 +210,16 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
labelListList curBlockCells = blocks[blockI].blockCells();
|
||||
|
||||
forAll(curBlockCells, blockCellI)
|
||||
forAll(curBlockCells, blockCelli)
|
||||
{
|
||||
labelList cellPoints(curBlockCells[blockCellI].size());
|
||||
labelList cellPoints(curBlockCells[blockCelli].size());
|
||||
|
||||
forAll(cellPoints, pointI)
|
||||
forAll(cellPoints, pointi)
|
||||
{
|
||||
cellPoints[pointI] =
|
||||
cellPoints[pointi] =
|
||||
oldToNew
|
||||
[
|
||||
curBlockCells[blockCellI][pointI]
|
||||
curBlockCells[blockCelli][pointi]
|
||||
+ blockOffsets[blockI]
|
||||
];
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -69,9 +69,9 @@ void Foam::sammMesh::calcPointCells() const
|
||||
//
|
||||
|
||||
// For each cell
|
||||
forAll(cellShapes_, cellI)
|
||||
forAll(cellShapes_, celli)
|
||||
{
|
||||
const faceList& faces = cellFaces_[cellI];
|
||||
const faceList& faces = cellFaces_[celli];
|
||||
|
||||
forAll(faces, i)
|
||||
{
|
||||
@ -90,7 +90,7 @@ void Foam::sammMesh::calcPointCells() const
|
||||
|
||||
for (label f = 0; f < curCount; f++)
|
||||
{
|
||||
if (curPointCells[f] == cellI)
|
||||
if (curPointCells[f] == celli)
|
||||
{
|
||||
found = true;
|
||||
|
||||
@ -108,7 +108,7 @@ void Foam::sammMesh::calcPointCells() const
|
||||
}
|
||||
|
||||
// Enter the cell label in the point's cell list
|
||||
curPointCells[curCount] = cellI;
|
||||
curPointCells[curCount] = celli;
|
||||
|
||||
// Increment the cell count for the point addressed
|
||||
cellCount[curPoint]++;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -70,39 +70,39 @@ bool Foam::sammMesh::sammEqualFace
|
||||
|
||||
void Foam::sammMesh::createBoundaryFaces()
|
||||
{
|
||||
forAll(boundary_, patchI)
|
||||
forAll(boundary_, patchi)
|
||||
{
|
||||
faceList& patchFaces = boundary_[patchI];
|
||||
faceList& patchFaces = boundary_[patchi];
|
||||
|
||||
const labelListList& PointCells = pointCells();
|
||||
|
||||
forAll(patchFaces, faceI)
|
||||
forAll(patchFaces, facei)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
face& curFace = patchFaces[faceI];
|
||||
face& curFace = patchFaces[facei];
|
||||
const labelList& facePoints = curFace;
|
||||
|
||||
forAll(facePoints, pointI)
|
||||
forAll(facePoints, pointi)
|
||||
{
|
||||
const labelList& facePointCells =
|
||||
PointCells[facePoints[pointI]];
|
||||
PointCells[facePoints[pointi]];
|
||||
|
||||
forAll(facePointCells, cellI)
|
||||
forAll(facePointCells, celli)
|
||||
{
|
||||
const faceList& curCellFaces =
|
||||
cellFaces_[facePointCells[cellI]];
|
||||
cellFaces_[facePointCells[celli]];
|
||||
|
||||
forAll(curCellFaces, cellFaceI)
|
||||
forAll(curCellFaces, cellFacei)
|
||||
{
|
||||
if (sammEqualFace(curCellFaces[cellFaceI], curFace))
|
||||
if (sammEqualFace(curCellFaces[cellFacei], curFace))
|
||||
{
|
||||
// Found the cell face corresponding to this face
|
||||
found = true;
|
||||
|
||||
// Set boundary face to the corresponding cell face
|
||||
// which guarantees it is outward-pointing
|
||||
curFace = curCellFaces[cellFaceI];
|
||||
curFace = curCellFaces[cellFacei];
|
||||
}
|
||||
if (found) break;
|
||||
}
|
||||
@ -113,7 +113,7 @@ void Foam::sammMesh::createBoundaryFaces()
|
||||
if (!found)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Face " << faceI
|
||||
<< "Face " << facei
|
||||
<< " does not have neighbour cell." << endl
|
||||
<< " face : " << endl << curFace
|
||||
<< abort(FatalError);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -41,17 +41,17 @@ void Foam::sammMesh::createPolyBoundary()
|
||||
|
||||
const labelListList& PointCells = pointCells();
|
||||
|
||||
forAll(boundary_, patchI)
|
||||
forAll(boundary_, patchi)
|
||||
{
|
||||
const faceList& curShapePatch = boundary_[patchI];
|
||||
const faceList& curShapePatch = boundary_[patchi];
|
||||
|
||||
polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
|
||||
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
|
||||
|
||||
forAll(curShapePatch, faceI)
|
||||
forAll(curShapePatch, facei)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
const face& curFace = curShapePatch[faceI];
|
||||
const face& curFace = curShapePatch[facei];
|
||||
|
||||
meshFaces_[nCreatedFaces] = curFace;
|
||||
|
||||
@ -59,19 +59,19 @@ void Foam::sammMesh::createPolyBoundary()
|
||||
// mark it in the cellPolys_
|
||||
const labelList& facePoints = curFace;
|
||||
|
||||
forAll(facePoints, pointI)
|
||||
forAll(facePoints, pointi)
|
||||
{
|
||||
const labelList& facePointCells =
|
||||
PointCells[facePoints[pointI]];
|
||||
PointCells[facePoints[pointi]];
|
||||
|
||||
forAll(facePointCells, cellI)
|
||||
forAll(facePointCells, celli)
|
||||
{
|
||||
const faceList& curCellFaces =
|
||||
cellFaces_[facePointCells[cellI]];
|
||||
cellFaces_[facePointCells[celli]];
|
||||
|
||||
forAll(curCellFaces, cellFaceI)
|
||||
forAll(curCellFaces, cellFacei)
|
||||
{
|
||||
if (curCellFaces[cellFaceI] == curFace)
|
||||
if (curCellFaces[cellFacei] == curFace)
|
||||
{
|
||||
// Found the cell face corresponding to this face
|
||||
found = true;
|
||||
@ -79,7 +79,7 @@ void Foam::sammMesh::createPolyBoundary()
|
||||
// Debugging
|
||||
if
|
||||
(
|
||||
cellPolys_[facePointCells[cellI]][cellFaceI]
|
||||
cellPolys_[facePointCells[celli]][cellFacei]
|
||||
!= -1
|
||||
)
|
||||
{
|
||||
@ -89,7 +89,7 @@ void Foam::sammMesh::createPolyBoundary()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
cellPolys_[facePointCells[cellI]][cellFaceI] =
|
||||
cellPolys_[facePointCells[celli]][cellFacei] =
|
||||
nCreatedFaces;
|
||||
|
||||
nBoundaryFacesFound++;
|
||||
@ -120,21 +120,21 @@ Foam::List<Foam::polyPatch* > Foam::sammMesh::polyBoundaryPatches
|
||||
{
|
||||
List<polyPatch* > p(boundary_.size());
|
||||
|
||||
forAll(boundary_, patchI)
|
||||
forAll(boundary_, patchi)
|
||||
{
|
||||
const faceList& curShapePatch = boundary_[patchI];
|
||||
const faceList& curShapePatch = boundary_[patchi];
|
||||
|
||||
p[patchI] = polyPatch::New
|
||||
p[patchi] = polyPatch::New
|
||||
(
|
||||
patchTypes_[patchI],
|
||||
patchNames_[patchI],
|
||||
patchTypes_[patchi],
|
||||
patchNames_[patchi],
|
||||
curShapePatch.size(),
|
||||
polyBoundaryPatchStartIndices_[patchI],
|
||||
patchI,
|
||||
polyBoundaryPatchStartIndices_[patchi],
|
||||
patchi,
|
||||
pMesh.boundaryMesh()
|
||||
).ptr();
|
||||
|
||||
p[patchI]->physicalType() = patchPhysicalTypes_[patchI];
|
||||
p[patchi]->physicalType() = patchPhysicalTypes_[patchi];
|
||||
}
|
||||
|
||||
return p;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,18 +40,18 @@ void Foam::sammMesh::createPolyCells()
|
||||
|
||||
label maxFaces = 0;
|
||||
|
||||
forAll(cellPolys_, cellI)
|
||||
forAll(cellPolys_, celli)
|
||||
{
|
||||
cell& curCell = cellPolys_[cellI];
|
||||
cell& curCell = cellPolys_[celli];
|
||||
|
||||
curCell.setSize(cellFaces_[cellI].size());
|
||||
curCell.setSize(cellFaces_[celli].size());
|
||||
|
||||
forAll(curCell, fI)
|
||||
{
|
||||
curCell[fI] = -1;
|
||||
}
|
||||
|
||||
maxFaces += cellFaces_[cellI].size();
|
||||
maxFaces += cellFaces_[celli].size();
|
||||
}
|
||||
|
||||
Info<< "Maximum possible number of faces in mesh: " << maxFaces << endl;
|
||||
@ -65,7 +65,7 @@ void Foam::sammMesh::createPolyCells()
|
||||
|
||||
nInternalFaces_ = 0;
|
||||
|
||||
forAll(cellFaces_, cellI)
|
||||
forAll(cellFaces_, celli)
|
||||
{
|
||||
// Note:
|
||||
// Insertion cannot be done in one go as the faces need to be
|
||||
@ -73,7 +73,7 @@ void Foam::sammMesh::createPolyCells()
|
||||
// cells. Therefore, all neighbours will be detected first
|
||||
// and then added in the correct order.
|
||||
|
||||
const faceList& curFaces = cellFaces_[cellI];
|
||||
const faceList& curFaces = cellFaces_[celli];
|
||||
|
||||
// Record the neighbour cell
|
||||
labelList neiCells(curFaces.size(), -1);
|
||||
@ -84,23 +84,23 @@ void Foam::sammMesh::createPolyCells()
|
||||
label nNeighbours = 0;
|
||||
|
||||
// For all faces ...
|
||||
forAll(curFaces, faceI)
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
// Skip faces that have already been matched
|
||||
if (cellPolys_[cellI][faceI] >= 0) continue;
|
||||
if (cellPolys_[celli][facei] >= 0) continue;
|
||||
|
||||
found = false;
|
||||
|
||||
const face& curFace = curFaces[faceI];
|
||||
const face& curFace = curFaces[facei];
|
||||
|
||||
// get the list of labels
|
||||
const labelList& curPoints = curFace;
|
||||
|
||||
// For all points
|
||||
forAll(curPoints, pointI)
|
||||
forAll(curPoints, pointi)
|
||||
{
|
||||
// get the list of cells sharing this point
|
||||
const labelList& curNeighbours = PointCells[curPoints[pointI]];
|
||||
const labelList& curNeighbours = PointCells[curPoints[pointi]];
|
||||
|
||||
// For all neighbours
|
||||
forAll(curNeighbours, neiI)
|
||||
@ -109,21 +109,21 @@ void Foam::sammMesh::createPolyCells()
|
||||
|
||||
// reject neighbours with the lower label. This should
|
||||
// also reject current cell.
|
||||
if (curNei > cellI)
|
||||
if (curNei > celli)
|
||||
{
|
||||
// get the list of search faces
|
||||
const faceList& searchFaces = cellFaces_[curNei];
|
||||
|
||||
forAll(searchFaces, neiFaceI)
|
||||
forAll(searchFaces, neiFacei)
|
||||
{
|
||||
if (searchFaces[neiFaceI] == curFace)
|
||||
if (searchFaces[neiFacei] == curFace)
|
||||
{
|
||||
// match!!
|
||||
found = true;
|
||||
|
||||
// Record the neighbour cell and face
|
||||
neiCells[faceI] = curNei;
|
||||
faceOfNeiCell[faceI] = neiFaceI;
|
||||
neiCells[facei] = curNei;
|
||||
faceOfNeiCell[facei] = neiFacei;
|
||||
nNeighbours++;
|
||||
|
||||
break;
|
||||
@ -159,7 +159,7 @@ void Foam::sammMesh::createPolyCells()
|
||||
meshFaces_[nInternalFaces_] = curFaces[nextNei];
|
||||
|
||||
// Mark for owner
|
||||
cellPolys_[cellI][nextNei] = nInternalFaces_;
|
||||
cellPolys_[celli][nextNei] = nInternalFaces_;
|
||||
|
||||
// Mark for neighbour
|
||||
cellPolys_[neiCells[nextNei]][faceOfNeiCell[nextNei]] =
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,21 +34,21 @@ void Foam::sammMesh::fixCollapsedEdges()
|
||||
{
|
||||
cellFaces_.setSize(cellShapes_.size());
|
||||
|
||||
forAll(cellShapes_, cellI)
|
||||
forAll(cellShapes_, celli)
|
||||
{
|
||||
cellFaces_[cellI] = cellShapes_[cellI].faces();
|
||||
cellFaces_[celli] = cellShapes_[celli].faces();
|
||||
}
|
||||
|
||||
// go through the faces and find if there exist faces with duplicate
|
||||
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
|
||||
|
||||
forAll(cellFaces_, cellI)
|
||||
forAll(cellFaces_, celli)
|
||||
{
|
||||
faceList& curFaces = cellFaces_[cellI];
|
||||
faceList& curFaces = cellFaces_[celli];
|
||||
|
||||
forAll(curFaces, faceI)
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
face& vertexLabels = curFaces[faceI];
|
||||
face& vertexLabels = curFaces[facei];
|
||||
|
||||
bool duplicatesFound = false;
|
||||
|
||||
@ -129,7 +129,7 @@ void Foam::sammMesh::fixCollapsedEdges()
|
||||
if (nNewVertices < 3)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "face " << faceI << " of cell " << cellI
|
||||
<< "face " << facei << " of cell " << celli
|
||||
<< " is colapsed down to a point or edge, which is "
|
||||
<< "not permitted" << endl
|
||||
<< "original face: " << vertexLabels << endl
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,20 +32,20 @@ Description
|
||||
|
||||
void Foam::sammMesh::purgeCellShapes()
|
||||
{
|
||||
forAll(cellFaces_, cellI)
|
||||
forAll(cellFaces_, celli)
|
||||
{
|
||||
const faceList& curFaces = cellFaces_[cellI];
|
||||
const faceList& curFaces = cellFaces_[celli];
|
||||
|
||||
// Get model faces
|
||||
faceList shapeFaces = cellShapes_[cellI].faces();
|
||||
faceList shapeFaces = cellShapes_[celli].faces();
|
||||
|
||||
forAll(shapeFaces, faceI)
|
||||
forAll(shapeFaces, facei)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
forAll(curFaces, i)
|
||||
{
|
||||
if (shapeFaces[faceI] == curFaces[i])
|
||||
if (shapeFaces[facei] == curFaces[i])
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
@ -54,8 +54,8 @@ void Foam::sammMesh::purgeCellShapes()
|
||||
|
||||
if (!found)
|
||||
{
|
||||
Info<< "Purging cell shape " << cellI << endl;
|
||||
cellShapes_[cellI] = cellShape(*unknownPtr_, labelList(0));
|
||||
Info<< "Purging cell shape " << celli << endl;
|
||||
cellShapes_[celli] = cellShape(*unknownPtr_, labelList(0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -139,7 +139,7 @@ void Foam::sammMesh::readBoundary()
|
||||
|
||||
IFstream boundaryFile(boundaryFileName);
|
||||
|
||||
for (label faceI=0; faceI<nFaces; faceI++)
|
||||
for (label facei=0; facei<nFaces; facei++)
|
||||
{
|
||||
boundaryFile >> lineIndex;
|
||||
|
||||
@ -172,7 +172,7 @@ void Foam::sammMesh::readBoundary()
|
||||
)
|
||||
{
|
||||
//Info<< "Converting collapsed quad into triangle"
|
||||
// << " for face " << faceI
|
||||
// << " for face " << facei
|
||||
// << " in Samm boundary " << lineIndex << endl;
|
||||
|
||||
pointLabelsTri[0] = pointLabels[0];
|
||||
@ -243,13 +243,13 @@ void Foam::sammMesh::readBoundary()
|
||||
defaultFacesType_
|
||||
);
|
||||
|
||||
forAll(patchDicts, patchI)
|
||||
forAll(patchDicts, patchi)
|
||||
{
|
||||
if (patchDicts.set(patchI))
|
||||
if (patchDicts.set(patchi))
|
||||
{
|
||||
const dictionary& dict = patchDicts[patchI];
|
||||
dict.readIfPresent("type", patchTypes_[patchI]);
|
||||
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]);
|
||||
const dictionary& dict = patchDicts[patchi];
|
||||
dict.readIfPresent("type", patchTypes_[patchi]);
|
||||
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchi]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -230,7 +230,7 @@ void Foam::sammMesh::readCells()
|
||||
labelList labels(24, label(-1));
|
||||
label lineLabel, sammLabel, regionLabel, typeFlag;
|
||||
|
||||
for (label cellI = 0; cellI < nCells; cellI++)
|
||||
for (label celli = 0; celli < nCells; celli++)
|
||||
{
|
||||
label nLabels = 0;
|
||||
|
||||
@ -294,15 +294,15 @@ void Foam::sammMesh::readCells()
|
||||
|
||||
} while (typeFlag == -1 || addOnToCell);
|
||||
|
||||
starCellLabelLookup_[lineLabel] = cellI;
|
||||
starCellLabelLookup_[lineLabel] = celli;
|
||||
|
||||
if (nLabels == 8)
|
||||
{
|
||||
addRegularCell(labels, cellI);
|
||||
addRegularCell(labels, celli);
|
||||
}
|
||||
else
|
||||
{
|
||||
addSAMMcell(typeFlag, labels, cellI);
|
||||
addSAMMcell(typeFlag, labels, celli);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -127,15 +127,15 @@ void Foam::sammMesh::readCouples()
|
||||
}
|
||||
|
||||
// Once all couples are read, remove zero size faces from all cells
|
||||
forAll(cellFaces_, cellI)
|
||||
forAll(cellFaces_, celli)
|
||||
{
|
||||
faceList& curFaces = cellFaces_[cellI];
|
||||
faceList& curFaces = cellFaces_[celli];
|
||||
|
||||
label zeroSizeFound = 0;
|
||||
|
||||
forAll(curFaces, faceI)
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
if (curFaces[faceI].empty())
|
||||
if (curFaces[facei].empty())
|
||||
{
|
||||
zeroSizeFound++;
|
||||
}
|
||||
@ -150,11 +150,11 @@ void Foam::sammMesh::readCouples()
|
||||
|
||||
label nFaces = 0;
|
||||
|
||||
forAll(oldFaces, faceI)
|
||||
forAll(oldFaces, facei)
|
||||
{
|
||||
if (oldFaces[faceI].size())
|
||||
if (oldFaces[facei].size())
|
||||
{
|
||||
curFaces[nFaces] = oldFaces[faceI];
|
||||
curFaces[nFaces] = oldFaces[facei];
|
||||
|
||||
nFaces++;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -128,21 +128,21 @@ void Foam::sammMesh::createPolyMeshData()
|
||||
label nProblemCells = 0;
|
||||
|
||||
// check that there is no zeros in the cellPolys_
|
||||
forAll(cellPolys_, cellI)
|
||||
forAll(cellPolys_, celli)
|
||||
{
|
||||
const labelList& curFaceLabels = cellPolys_[cellI];
|
||||
const labelList& curFaceLabels = cellPolys_[celli];
|
||||
|
||||
forAll(curFaceLabels, faceI)
|
||||
forAll(curFaceLabels, facei)
|
||||
{
|
||||
if (curFaceLabels[faceI] == -1)
|
||||
if (curFaceLabels[facei] == -1)
|
||||
{
|
||||
Info<< "cell " << cellI
|
||||
Info<< "cell " << celli
|
||||
<< " has got an unmatched face. "
|
||||
<< "Index: " << cellShapes_[cellI].model().index() << endl
|
||||
// << "cell shape: " << cellShapes_[cellI] << endl
|
||||
// << "shape faces: " << cellShapes_[cellI].faces() << endl
|
||||
<< "cellPolys: " << cellPolys_[cellI] << endl
|
||||
// << "cell faces: " << cellFaces_[cellI]
|
||||
<< "Index: " << cellShapes_[celli].model().index() << endl
|
||||
// << "cell shape: " << cellShapes_[celli] << endl
|
||||
// << "shape faces: " << cellShapes_[celli].faces() << endl
|
||||
<< "cellPolys: " << cellPolys_[celli] << endl
|
||||
// << "cell faces: " << cellFaces_[celli]
|
||||
<< endl;
|
||||
|
||||
nProblemCells++;
|
||||
@ -185,7 +185,7 @@ Foam::sammMesh::sammMesh
|
||||
cellPolys_(0),
|
||||
nInternalFaces_(0),
|
||||
polyBoundaryPatchStartIndices_(0),
|
||||
pointCellsPtr_(NULL),
|
||||
pointCellsPtr_(nullptr),
|
||||
isShapeMesh_(true)
|
||||
{
|
||||
// Fill in the lookup tables
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -69,9 +69,9 @@ void Foam::starMesh::calcPointCells() const
|
||||
//
|
||||
|
||||
// For each cell
|
||||
forAll(cellShapes_, cellI)
|
||||
forAll(cellShapes_, celli)
|
||||
{
|
||||
const faceList& faces = cellFaces_[cellI];
|
||||
const faceList& faces = cellFaces_[celli];
|
||||
|
||||
forAll(faces, i)
|
||||
{
|
||||
@ -90,7 +90,7 @@ void Foam::starMesh::calcPointCells() const
|
||||
|
||||
for (label f = 0; f < curCount; f++)
|
||||
{
|
||||
if (curPointCells[f] == cellI)
|
||||
if (curPointCells[f] == celli)
|
||||
{
|
||||
found = true;
|
||||
|
||||
@ -108,7 +108,7 @@ void Foam::starMesh::calcPointCells() const
|
||||
}
|
||||
|
||||
// Enter the cell label in the point's cell list
|
||||
curPointCells[curCount] = cellI;
|
||||
curPointCells[curCount] = celli;
|
||||
|
||||
// Increment the cell count for the point addressed
|
||||
cellCount[curPoint]++;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,6 +42,13 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
class coupledFacePair;
|
||||
|
||||
Ostream& operator<<(Ostream&, const coupledFacePair&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class coupledFacePair Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -97,48 +97,48 @@ void Foam::starMesh::markBoundaryFaces()
|
||||
boundaryCellIDs_.setSize(boundary_.size());
|
||||
boundaryCellFaceIDs_.setSize(boundary_.size());
|
||||
|
||||
forAll(boundary_, patchI)
|
||||
forAll(boundary_, patchi)
|
||||
{
|
||||
const faceList& patchFaces = boundary_[patchI];
|
||||
const faceList& patchFaces = boundary_[patchi];
|
||||
|
||||
// set size of patch lists
|
||||
labelList& curBoundaryCellIDs = boundaryCellIDs_[patchI];
|
||||
labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchI];
|
||||
labelList& curBoundaryCellIDs = boundaryCellIDs_[patchi];
|
||||
labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchi];
|
||||
|
||||
curBoundaryCellIDs.setSize(patchFaces.size());
|
||||
curBoundaryCellFaceIDs.setSize(patchFaces.size());
|
||||
|
||||
const labelListList& PointCells = pointCells();
|
||||
|
||||
forAll(patchFaces, faceI)
|
||||
forAll(patchFaces, facei)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
const face& curFace = patchFaces[faceI];
|
||||
const face& curFace = patchFaces[facei];
|
||||
const labelList& facePoints = curFace;
|
||||
|
||||
forAll(facePoints, pointI)
|
||||
forAll(facePoints, pointi)
|
||||
{
|
||||
const labelList& facePointCells =
|
||||
PointCells[facePoints[pointI]];
|
||||
PointCells[facePoints[pointi]];
|
||||
|
||||
forAll(facePointCells, cellI)
|
||||
forAll(facePointCells, celli)
|
||||
{
|
||||
const label curCellIndex = facePointCells[cellI];
|
||||
const label curCellIndex = facePointCells[celli];
|
||||
|
||||
const faceList& curCellFaces =
|
||||
cellFaces_[curCellIndex];
|
||||
|
||||
forAll(curCellFaces, cellFaceI)
|
||||
forAll(curCellFaces, cellFacei)
|
||||
{
|
||||
if (starEqualFace(curFace, curCellFaces[cellFaceI]))
|
||||
if (starEqualFace(curFace, curCellFaces[cellFacei]))
|
||||
{
|
||||
// Found the cell face corresponding to this face
|
||||
found = true;
|
||||
|
||||
// Set boundary face to the corresponding cell face
|
||||
curBoundaryCellIDs[faceI] = curCellIndex;
|
||||
curBoundaryCellFaceIDs[faceI] = cellFaceI;
|
||||
curBoundaryCellIDs[facei] = curCellIndex;
|
||||
curBoundaryCellFaceIDs[facei] = cellFacei;
|
||||
}
|
||||
if (found) break;
|
||||
}
|
||||
@ -149,7 +149,7 @@ void Foam::starMesh::markBoundaryFaces()
|
||||
if (!found)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Face " << faceI
|
||||
<< "Face " << facei
|
||||
<< " does not have neighbour cell."
|
||||
<< " Face : " << endl << curFace << endl
|
||||
<< "PROSTAR Command: vset,news,vlis";
|
||||
@ -178,19 +178,19 @@ void Foam::starMesh::markBoundaryFaces()
|
||||
void Foam::starMesh::collectBoundaryFaces()
|
||||
{
|
||||
Info<< "Collecting boundary faces" << endl;
|
||||
forAll(boundary_, patchI)
|
||||
forAll(boundary_, patchi)
|
||||
{
|
||||
faceList& patchFaces = boundary_[patchI];
|
||||
faceList& patchFaces = boundary_[patchi];
|
||||
|
||||
// set size of patch lists
|
||||
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchI];
|
||||
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchI];
|
||||
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchi];
|
||||
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchi];
|
||||
|
||||
forAll(curBoundaryCellIDs, faceI)
|
||||
forAll(curBoundaryCellIDs, facei)
|
||||
{
|
||||
patchFaces[faceI] =
|
||||
cellFaces_[curBoundaryCellIDs[faceI]]
|
||||
[curBoundaryCellFaceIDs[faceI]];
|
||||
patchFaces[facei] =
|
||||
cellFaces_[curBoundaryCellIDs[facei]]
|
||||
[curBoundaryCellFaceIDs[facei]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1311,17 +1311,17 @@ void Foam::starMesh::createCoupleMatches()
|
||||
// onto the master face to ensure closedness
|
||||
vector pointProjectionNormal = -masterFace.normal(points_);
|
||||
|
||||
forAll(intersectedFace, intPointI)
|
||||
forAll(intersectedFace, intPointi)
|
||||
{
|
||||
#ifdef DEBUG_COUPLE_PROJECTION
|
||||
Info<< "Proj: old point: "
|
||||
<< points_[intersectedFace[intPointI]] << endl;
|
||||
<< points_[intersectedFace[intPointi]] << endl;
|
||||
#endif
|
||||
|
||||
pointHit projHit =
|
||||
masterFace.ray
|
||||
(
|
||||
points_[intersectedFace[intPointI]],
|
||||
points_[intersectedFace[intPointi]],
|
||||
pointProjectionNormal,
|
||||
points_,
|
||||
intersection::FULL_RAY
|
||||
@ -1329,12 +1329,12 @@ void Foam::starMesh::createCoupleMatches()
|
||||
|
||||
if (projHit.hit())
|
||||
{
|
||||
points_[intersectedFace[intPointI]] =
|
||||
points_[intersectedFace[intPointi]] =
|
||||
projHit.hitPoint();
|
||||
|
||||
#ifdef DEBUG_COUPLE_PROJECTION
|
||||
Info<< " new point: "
|
||||
<< points_[intersectedFace[intPointI]] << endl;
|
||||
<< points_[intersectedFace[intPointi]] << endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -1423,9 +1423,9 @@ void Foam::starMesh::createCoupleMatches()
|
||||
// Loop through all cells and reset faces for removal to zero size
|
||||
const labelList crfToc = cellRemovedFaces.toc();
|
||||
|
||||
forAll(crfToc, cellI)
|
||||
forAll(crfToc, celli)
|
||||
{
|
||||
const label curCell = crfToc[cellI];
|
||||
const label curCell = crfToc[celli];
|
||||
|
||||
const SLList<label>& curRemovedFaces = cellRemovedFaces[curCell];
|
||||
|
||||
@ -1450,9 +1450,9 @@ void Foam::starMesh::createCoupleMatches()
|
||||
const labelList cafToc = cellAddedFaces.toc();
|
||||
|
||||
// Insert the new faces into the list
|
||||
forAll(cafToc, cellI)
|
||||
forAll(cafToc, celli)
|
||||
{
|
||||
const label curCell = cafToc[cellI];
|
||||
const label curCell = cafToc[celli];
|
||||
|
||||
const SLList<face>& curAddedFaces = cellAddedFaces[curCell];
|
||||
|
||||
@ -1464,11 +1464,11 @@ void Foam::starMesh::createCoupleMatches()
|
||||
label nNewFaces = 0;
|
||||
|
||||
// copy original faces that have not been removed
|
||||
forAll(oldFaces, faceI)
|
||||
forAll(oldFaces, facei)
|
||||
{
|
||||
if (oldFaces[faceI].size())
|
||||
if (oldFaces[facei].size())
|
||||
{
|
||||
newFaces[nNewFaces] = oldFaces[faceI];
|
||||
newFaces[nNewFaces] = oldFaces[facei];
|
||||
nNewFaces++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,17 +41,17 @@ void Foam::starMesh::createPolyBoundary()
|
||||
|
||||
const labelListList& PointCells = pointCells();
|
||||
|
||||
forAll(boundary_, patchI)
|
||||
forAll(boundary_, patchi)
|
||||
{
|
||||
const faceList& curShapePatch = boundary_[patchI];
|
||||
const faceList& curShapePatch = boundary_[patchi];
|
||||
|
||||
polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
|
||||
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
|
||||
|
||||
forAll(curShapePatch, faceI)
|
||||
forAll(curShapePatch, facei)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
const face& curFace = curShapePatch[faceI];
|
||||
const face& curFace = curShapePatch[facei];
|
||||
|
||||
meshFaces_[nCreatedFaces] = curFace;
|
||||
|
||||
@ -59,19 +59,19 @@ void Foam::starMesh::createPolyBoundary()
|
||||
// mark it in the cellPolys_
|
||||
const labelList& facePoints = curFace;
|
||||
|
||||
forAll(facePoints, pointI)
|
||||
forAll(facePoints, pointi)
|
||||
{
|
||||
const labelList& facePointCells =
|
||||
PointCells[facePoints[pointI]];
|
||||
PointCells[facePoints[pointi]];
|
||||
|
||||
forAll(facePointCells, cellI)
|
||||
forAll(facePointCells, celli)
|
||||
{
|
||||
const faceList& curCellFaces =
|
||||
cellFaces_[facePointCells[cellI]];
|
||||
cellFaces_[facePointCells[celli]];
|
||||
|
||||
forAll(curCellFaces, cellFaceI)
|
||||
forAll(curCellFaces, cellFacei)
|
||||
{
|
||||
if (curCellFaces[cellFaceI] == curFace)
|
||||
if (curCellFaces[cellFacei] == curFace)
|
||||
{
|
||||
// Found the cell face corresponding to this face
|
||||
found = true;
|
||||
@ -79,13 +79,13 @@ void Foam::starMesh::createPolyBoundary()
|
||||
// Debugging
|
||||
if
|
||||
(
|
||||
cellPolys_[facePointCells[cellI]][cellFaceI]
|
||||
cellPolys_[facePointCells[celli]][cellFacei]
|
||||
!= -1
|
||||
)
|
||||
{
|
||||
if
|
||||
(
|
||||
cellPolys_[facePointCells[cellI]][cellFaceI]
|
||||
cellPolys_[facePointCells[celli]][cellFacei]
|
||||
> nInternalFaces_
|
||||
)
|
||||
{
|
||||
@ -94,24 +94,24 @@ void Foam::starMesh::createPolyBoundary()
|
||||
<< "\nProbably multiple definitions "
|
||||
<< "of a single boundary face. " << endl
|
||||
<< "Other boundary face: "
|
||||
<< curCellFaces[cellFaceI]
|
||||
<< curCellFaces[cellFacei]
|
||||
<< endl;
|
||||
|
||||
Info<< "PROSTAR Command: vset,news,vlis";
|
||||
forAll(curCellFaces[cellFaceI], spI)
|
||||
forAll(curCellFaces[cellFacei], spI)
|
||||
{
|
||||
// check if the point is given by STAR
|
||||
// or created locally
|
||||
if
|
||||
(
|
||||
curCellFaces[cellFaceI][spI] > -1
|
||||
&& curCellFaces[cellFaceI][spI]
|
||||
curCellFaces[cellFacei][spI] > -1
|
||||
&& curCellFaces[cellFacei][spI]
|
||||
< starPointID_.size()
|
||||
)
|
||||
{
|
||||
Info<< ","
|
||||
<< starPointID_
|
||||
[curCellFaces[cellFaceI][spI]];
|
||||
[curCellFaces[cellFacei][spI]];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -128,24 +128,24 @@ void Foam::starMesh::createPolyBoundary()
|
||||
<< "boundary face on a previously "
|
||||
<< "matched internal face. " << endl
|
||||
<< "Internal face: "
|
||||
<< curCellFaces[cellFaceI]
|
||||
<< curCellFaces[cellFacei]
|
||||
<< endl;
|
||||
|
||||
Info<< "PROSTAR Command: vset,news,vlis";
|
||||
forAll(curCellFaces[cellFaceI], spI)
|
||||
forAll(curCellFaces[cellFacei], spI)
|
||||
{
|
||||
// check if the point is given by STAR
|
||||
// or created locally
|
||||
if
|
||||
(
|
||||
curCellFaces[cellFaceI][spI] > -1
|
||||
&& curCellFaces[cellFaceI][spI]
|
||||
curCellFaces[cellFacei][spI] > -1
|
||||
&& curCellFaces[cellFacei][spI]
|
||||
< starPointID_.size()
|
||||
)
|
||||
{
|
||||
Info<< ","
|
||||
<< starPointID_
|
||||
[curCellFaces[cellFaceI][spI]];
|
||||
[curCellFaces[cellFacei][spI]];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -157,7 +157,7 @@ void Foam::starMesh::createPolyBoundary()
|
||||
}
|
||||
}
|
||||
|
||||
cellPolys_[facePointCells[cellI]][cellFaceI] =
|
||||
cellPolys_[facePointCells[celli]][cellFacei] =
|
||||
nCreatedFaces;
|
||||
|
||||
nBoundaryFacesFound++;
|
||||
@ -176,20 +176,20 @@ void Foam::starMesh::createPolyBoundary()
|
||||
// check all cellPolys_ to see if there are any missing faces
|
||||
label nMissingFaceFound = 0;
|
||||
|
||||
forAll(cellPolys_, cellI)
|
||||
forAll(cellPolys_, celli)
|
||||
{
|
||||
const labelList& curFaces = cellPolys_[cellI];
|
||||
const labelList& curFaces = cellPolys_[celli];
|
||||
|
||||
forAll(curFaces, faceI)
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
if (curFaces[faceI] < 0)
|
||||
if (curFaces[facei] < 0)
|
||||
{
|
||||
const face& missingFace = cellFaces_[cellI][faceI];
|
||||
const face& missingFace = cellFaces_[celli][facei];
|
||||
|
||||
InfoInFunction
|
||||
<< "Missing face found in cell " << cellI
|
||||
<< ".\nType: " << cellShapes_[cellI].model().name()
|
||||
<< ". STAR cell number: " << starCellID_[cellI]
|
||||
<< "Missing face found in cell " << celli
|
||||
<< ".\nType: " << cellShapes_[celli].model().name()
|
||||
<< ". STAR cell number: " << starCellID_[celli]
|
||||
<< ". Face: " << missingFace << endl;
|
||||
|
||||
nMissingFaceFound++;
|
||||
@ -228,13 +228,13 @@ void Foam::starMesh::createPolyBoundary()
|
||||
// (faces addressed once or more than twice)
|
||||
labelList markupFaces(meshFaces_.size(), 0);
|
||||
|
||||
forAll(cellPolys_, cellI)
|
||||
forAll(cellPolys_, celli)
|
||||
{
|
||||
const labelList& curFaces = cellPolys_[cellI];
|
||||
const labelList& curFaces = cellPolys_[celli];
|
||||
|
||||
forAll(curFaces, faceI)
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
markupFaces[curFaces[faceI]]++;
|
||||
markupFaces[curFaces[facei]]++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -245,15 +245,15 @@ void Foam::starMesh::createPolyBoundary()
|
||||
|
||||
label nProblemFacesFound = 0;
|
||||
|
||||
forAll(markupFaces, faceI)
|
||||
forAll(markupFaces, facei)
|
||||
{
|
||||
if (markupFaces[faceI] != 2)
|
||||
if (markupFaces[facei] != 2)
|
||||
{
|
||||
const face& problemFace = meshFaces_[faceI];
|
||||
const face& problemFace = meshFaces_[facei];
|
||||
|
||||
InfoInFunction
|
||||
<< "Problem with face " << faceI << ": addressed "
|
||||
<< markupFaces[faceI] << " times (should be 2!). Face: "
|
||||
<< "Problem with face " << facei << ": addressed "
|
||||
<< markupFaces[facei] << " times (should be 2!). Face: "
|
||||
<< problemFace << endl;
|
||||
|
||||
nProblemFacesFound++;
|
||||
@ -295,15 +295,15 @@ Foam::starMesh::polyBoundaryPatches(const polyMesh& pMesh)
|
||||
{
|
||||
List<polyPatch*> p(boundary_.size());
|
||||
|
||||
forAll(boundary_, patchI)
|
||||
forAll(boundary_, patchi)
|
||||
{
|
||||
p[patchI] = polyPatch::New
|
||||
p[patchi] = polyPatch::New
|
||||
(
|
||||
patchTypes_[patchI],
|
||||
patchNames_[patchI],
|
||||
boundary_[patchI].size(),
|
||||
polyBoundaryPatchStartIndices_[patchI],
|
||||
patchI,
|
||||
patchTypes_[patchi],
|
||||
patchNames_[patchi],
|
||||
boundary_[patchi].size(),
|
||||
polyBoundaryPatchStartIndices_[patchi],
|
||||
patchi,
|
||||
pMesh.boundaryMesh()
|
||||
).ptr();
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,18 +40,18 @@ void Foam::starMesh::createPolyCells()
|
||||
|
||||
label maxFaces = 0;
|
||||
|
||||
forAll(cellPolys_, cellI)
|
||||
forAll(cellPolys_, celli)
|
||||
{
|
||||
cell& curCell = cellPolys_[cellI];
|
||||
cell& curCell = cellPolys_[celli];
|
||||
|
||||
curCell.setSize(cellFaces_[cellI].size());
|
||||
curCell.setSize(cellFaces_[celli].size());
|
||||
|
||||
forAll(curCell, fI)
|
||||
{
|
||||
curCell[fI] = -1;
|
||||
}
|
||||
|
||||
maxFaces += cellFaces_[cellI].size();
|
||||
maxFaces += cellFaces_[celli].size();
|
||||
}
|
||||
|
||||
Info<< "Maximum possible number of faces in mesh: " << maxFaces << endl;
|
||||
@ -65,7 +65,7 @@ void Foam::starMesh::createPolyCells()
|
||||
|
||||
nInternalFaces_ = 0;
|
||||
|
||||
forAll(cellFaces_, cellI)
|
||||
forAll(cellFaces_, celli)
|
||||
{
|
||||
// Note:
|
||||
// Insertion cannot be done in one go as the faces need to be
|
||||
@ -73,7 +73,7 @@ void Foam::starMesh::createPolyCells()
|
||||
// cells. Therefore, all neighbours will be detected first
|
||||
// and then added in the correct order.
|
||||
|
||||
const faceList& curFaces = cellFaces_[cellI];
|
||||
const faceList& curFaces = cellFaces_[celli];
|
||||
|
||||
// Record the neighbour cell
|
||||
labelList neiCells(curFaces.size(), -1);
|
||||
@ -84,23 +84,23 @@ void Foam::starMesh::createPolyCells()
|
||||
label nNeighbours = 0;
|
||||
|
||||
// For all faces ...
|
||||
forAll(curFaces, faceI)
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
// Skip faces that have already been matched
|
||||
if (cellPolys_[cellI][faceI] >= 0) continue;
|
||||
if (cellPolys_[celli][facei] >= 0) continue;
|
||||
|
||||
found = false;
|
||||
|
||||
const face& curFace = curFaces[faceI];
|
||||
const face& curFace = curFaces[facei];
|
||||
|
||||
// get the list of labels
|
||||
const labelList& curPoints = curFace;
|
||||
|
||||
// For all points
|
||||
forAll(curPoints, pointI)
|
||||
forAll(curPoints, pointi)
|
||||
{
|
||||
// get the list of cells sharing this point
|
||||
const labelList& curNeighbours = PointCells[curPoints[pointI]];
|
||||
const labelList& curNeighbours = PointCells[curPoints[pointi]];
|
||||
|
||||
// For all neighbours
|
||||
forAll(curNeighbours, neiI)
|
||||
@ -109,21 +109,21 @@ void Foam::starMesh::createPolyCells()
|
||||
|
||||
// reject neighbours with the lower label. This should
|
||||
// also reject current cell.
|
||||
if (curNei > cellI)
|
||||
if (curNei > celli)
|
||||
{
|
||||
// get the list of search faces
|
||||
const faceList& searchFaces = cellFaces_[curNei];
|
||||
|
||||
forAll(searchFaces, neiFaceI)
|
||||
forAll(searchFaces, neiFacei)
|
||||
{
|
||||
if (searchFaces[neiFaceI] == curFace)
|
||||
if (searchFaces[neiFacei] == curFace)
|
||||
{
|
||||
// match!!
|
||||
found = true;
|
||||
|
||||
// Record the neighbour cell and face
|
||||
neiCells[faceI] = curNei;
|
||||
faceOfNeiCell[faceI] = neiFaceI;
|
||||
neiCells[facei] = curNei;
|
||||
faceOfNeiCell[facei] = neiFacei;
|
||||
nNeighbours++;
|
||||
|
||||
break;
|
||||
@ -159,7 +159,7 @@ void Foam::starMesh::createPolyCells()
|
||||
meshFaces_[nInternalFaces_] = curFaces[nextNei];
|
||||
|
||||
// Mark for owner
|
||||
cellPolys_[cellI][nextNei] = nInternalFaces_;
|
||||
cellPolys_[celli][nextNei] = nInternalFaces_;
|
||||
|
||||
// Mark for neighbour
|
||||
cellPolys_[neiCells[nextNei]][faceOfNeiCell[nextNei]] =
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,21 +34,21 @@ void Foam::starMesh::fixCollapsedEdges()
|
||||
{
|
||||
cellFaces_.setSize(cellShapes_.size());
|
||||
|
||||
forAll(cellShapes_, cellI)
|
||||
forAll(cellShapes_, celli)
|
||||
{
|
||||
cellFaces_[cellI] = cellShapes_[cellI].faces();
|
||||
cellFaces_[celli] = cellShapes_[celli].faces();
|
||||
}
|
||||
|
||||
// go through the faces and find if there exist faces with duplicate
|
||||
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
|
||||
|
||||
forAll(cellFaces_, cellI)
|
||||
forAll(cellFaces_, celli)
|
||||
{
|
||||
faceList& curFaces = cellFaces_[cellI];
|
||||
faceList& curFaces = cellFaces_[celli];
|
||||
|
||||
forAll(curFaces, faceI)
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
face& vertexLabels = curFaces[faceI];
|
||||
face& vertexLabels = curFaces[facei];
|
||||
|
||||
bool duplicatesFound = false;
|
||||
|
||||
@ -128,7 +128,7 @@ void Foam::starMesh::fixCollapsedEdges()
|
||||
if (nNewVertices < 3)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Face " << faceI << " of cell " << cellI
|
||||
<< "Face " << facei << " of cell " << celli
|
||||
<< " is colapsed down to a point or edge, which is "
|
||||
<< "not permitted" << endl
|
||||
<< "original face: " << vertexLabels << endl
|
||||
|
||||
@ -62,9 +62,9 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
||||
|
||||
label nMergeSets = 0;
|
||||
|
||||
forAll(cellFaces_, cellI)
|
||||
forAll(cellFaces_, celli)
|
||||
{
|
||||
const faceList& curFaces = cellFaces_[cellI];
|
||||
const faceList& curFaces = cellFaces_[celli];
|
||||
|
||||
// create a list of all points for the cell with duplicates
|
||||
// and find the shortest edge length
|
||||
@ -73,11 +73,11 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
||||
|
||||
scalar pointMergeTol = GREAT;
|
||||
|
||||
forAll(curFaces, faceI)
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
nPointsInCell += curFaces[faceI].size();
|
||||
nPointsInCell += curFaces[facei].size();
|
||||
|
||||
edgeList curEdges = curFaces[faceI].edges();
|
||||
edgeList curEdges = curFaces[facei].edges();
|
||||
|
||||
forAll(curEdges, edgeI)
|
||||
{
|
||||
@ -97,9 +97,9 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
||||
labelList cellPoints(nPointsInCell);
|
||||
label nAddedPoints = 0;
|
||||
|
||||
forAll(curFaces, faceI)
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
const face& f = curFaces[faceI];
|
||||
const face& f = curFaces[facei];
|
||||
|
||||
forAll(f, fI)
|
||||
{
|
||||
@ -234,16 +234,16 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
||||
|
||||
// Insert the primary point renumbering into the list
|
||||
// Take care of possibly unused points in the list
|
||||
forAll(renumberPoints, pointI)
|
||||
forAll(renumberPoints, pointi)
|
||||
{
|
||||
if (renumberPoints[pointI] < 0)
|
||||
if (renumberPoints[pointi] < 0)
|
||||
{
|
||||
// point not merged
|
||||
renumberPoints[pointI] = pointI;
|
||||
renumberPoints[pointi] = pointi;
|
||||
}
|
||||
else
|
||||
{
|
||||
renumberPoints[pointI] = mergeSetID[renumberPoints[pointI]];
|
||||
renumberPoints[pointi] = mergeSetID[renumberPoints[pointi]];
|
||||
}
|
||||
}
|
||||
|
||||
@ -252,19 +252,19 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
||||
// renumbering of all faces. This will only be used to see which
|
||||
// points are still used!
|
||||
|
||||
forAll(cellFaces_, cellI)
|
||||
forAll(cellFaces_, celli)
|
||||
{
|
||||
faceList& prelimFaces = cellFaces_[cellI];
|
||||
faceList& prelimFaces = cellFaces_[celli];
|
||||
|
||||
forAll(prelimFaces, faceI)
|
||||
forAll(prelimFaces, facei)
|
||||
{
|
||||
face oldFacePoints = prelimFaces[faceI];
|
||||
face oldFacePoints = prelimFaces[facei];
|
||||
|
||||
face& prelimFacePoints = prelimFaces[faceI];
|
||||
face& prelimFacePoints = prelimFaces[facei];
|
||||
|
||||
forAll(prelimFacePoints, pointI)
|
||||
forAll(prelimFacePoints, pointi)
|
||||
{
|
||||
if (renumberPoints[oldFacePoints[pointI]] < 0)
|
||||
if (renumberPoints[oldFacePoints[pointi]] < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Error in point renumbering. Old face: "
|
||||
@ -273,8 +273,8 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
prelimFacePoints[pointI] =
|
||||
renumberPoints[oldFacePoints[pointI]];
|
||||
prelimFacePoints[pointi] =
|
||||
renumberPoints[oldFacePoints[pointi]];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -283,35 +283,35 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
||||
// re-create the point list and renumber the whole lot
|
||||
renumberPoints = 0;
|
||||
|
||||
forAll(cellFaces_, cellI)
|
||||
forAll(cellFaces_, celli)
|
||||
{
|
||||
const faceList& curFaces = cellFaces_[cellI];
|
||||
const faceList& curFaces = cellFaces_[celli];
|
||||
|
||||
forAll(curFaces, faceI)
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
const face& curFacePoints = curFaces[faceI];
|
||||
const face& curFacePoints = curFaces[facei];
|
||||
|
||||
forAll(curFacePoints, pointI)
|
||||
forAll(curFacePoints, pointi)
|
||||
{
|
||||
renumberPoints[curFacePoints[pointI]]++;
|
||||
renumberPoints[curFacePoints[pointi]]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
forAll(cellShapes_, cellI)
|
||||
forAll(cellShapes_, celli)
|
||||
{
|
||||
const labelList& curLabels = cellShapes_[cellI];
|
||||
const labelList& curLabels = cellShapes_[celli];
|
||||
|
||||
forAll(curLabels, pointI)
|
||||
forAll(curLabels, pointi)
|
||||
{
|
||||
if (renumberPoints[curLabels[pointI]] == 0)
|
||||
if (renumberPoints[curLabels[pointi]] == 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Error in point merging for cell "
|
||||
<< cellI << ". STAR index: " << starCellID_[cellI]
|
||||
<< celli << ". STAR index: " << starCellID_[celli]
|
||||
<< ". " << endl
|
||||
<< "Point index: " << curLabels[pointI] << " STAR index "
|
||||
<< starPointID_[curLabels[pointI]] << endl
|
||||
<< "Point index: " << curLabels[pointi] << " STAR index "
|
||||
<< starPointID_[curLabels[pointi]] << endl
|
||||
<< "Please check the geometry for the cell." << endl;
|
||||
}
|
||||
}
|
||||
@ -319,22 +319,22 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
||||
|
||||
label nUsedPoints = 0;
|
||||
|
||||
forAll(renumberPoints, pointI)
|
||||
forAll(renumberPoints, pointi)
|
||||
{
|
||||
if (renumberPoints[pointI] > 0)
|
||||
if (renumberPoints[pointi] > 0)
|
||||
{
|
||||
// This should be OK as the compressed points list will always
|
||||
// have less points that the original lists. Even if there is
|
||||
// no points removed, this will copy the list back onto itself
|
||||
//
|
||||
renumberPoints[pointI] = nUsedPoints;
|
||||
points_[nUsedPoints] = points_[pointI];
|
||||
renumberPoints[pointi] = nUsedPoints;
|
||||
points_[nUsedPoints] = points_[pointi];
|
||||
|
||||
nUsedPoints++;
|
||||
}
|
||||
else
|
||||
{
|
||||
renumberPoints[pointI] = -1;
|
||||
renumberPoints[pointi] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -346,58 +346,58 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
||||
|
||||
Info<< "Renumbering all faces" << endl;
|
||||
|
||||
forAll(cellFaces_, cellI)
|
||||
forAll(cellFaces_, celli)
|
||||
{
|
||||
faceList& newFaces = cellFaces_[cellI];
|
||||
faceList& newFaces = cellFaces_[celli];
|
||||
|
||||
forAll(newFaces, faceI)
|
||||
forAll(newFaces, facei)
|
||||
{
|
||||
face oldFacePoints = newFaces[faceI];
|
||||
face oldFacePoints = newFaces[facei];
|
||||
|
||||
face& newFacePoints = newFaces[faceI];
|
||||
face& newFacePoints = newFaces[facei];
|
||||
|
||||
forAll(newFacePoints, pointI)
|
||||
forAll(newFacePoints, pointi)
|
||||
{
|
||||
if (renumberPoints[oldFacePoints[pointI]] < 0)
|
||||
if (renumberPoints[oldFacePoints[pointi]] < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Error in point renumbering for point "
|
||||
<< oldFacePoints[pointI]
|
||||
<< oldFacePoints[pointi]
|
||||
<< ". Renumbering index is -1." << endl
|
||||
<< "Old face: " << oldFacePoints << endl
|
||||
<< "New face: " << newFacePoints << abort(FatalError);
|
||||
}
|
||||
|
||||
newFacePoints[pointI] = renumberPoints[oldFacePoints[pointI]];
|
||||
newFacePoints[pointi] = renumberPoints[oldFacePoints[pointi]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "Renumbering all cell shapes" << endl;
|
||||
|
||||
forAll(cellShapes_, cellI)
|
||||
forAll(cellShapes_, celli)
|
||||
{
|
||||
labelList oldLabels = cellShapes_[cellI];
|
||||
labelList oldLabels = cellShapes_[celli];
|
||||
|
||||
labelList& curLabels = cellShapes_[cellI];
|
||||
labelList& curLabels = cellShapes_[celli];
|
||||
|
||||
forAll(curLabels, pointI)
|
||||
forAll(curLabels, pointi)
|
||||
{
|
||||
if (renumberPoints[curLabels[pointI]] < 0)
|
||||
if (renumberPoints[curLabels[pointi]] < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Error in point renumbering for cell "
|
||||
<< cellI << ". STAR index: " << starCellID_[cellI]
|
||||
<< celli << ". STAR index: " << starCellID_[celli]
|
||||
<< ". " << endl
|
||||
<< "Point index: " << curLabels[pointI] << " STAR index "
|
||||
<< starPointID_[curLabels[pointI]] << " returns invalid "
|
||||
<< "Point index: " << curLabels[pointi] << " STAR index "
|
||||
<< starPointID_[curLabels[pointi]] << " returns invalid "
|
||||
<< "renumbering index: "
|
||||
<< renumberPoints[curLabels[pointI]] << "." << endl
|
||||
<< renumberPoints[curLabels[pointi]] << "." << endl
|
||||
<< "Old cellShape: " << oldLabels << endl
|
||||
<< "New cell shape: " << curLabels << abort(FatalError);
|
||||
}
|
||||
|
||||
curLabels[pointI] = renumberPoints[oldLabels[pointI]];
|
||||
curLabels[pointi] = renumberPoints[oldLabels[pointi]];
|
||||
}
|
||||
}
|
||||
|
||||
@ -407,11 +407,11 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
||||
|
||||
starPointID_ = -1;
|
||||
|
||||
forAll(starPointID_, pointI)
|
||||
forAll(starPointID_, pointi)
|
||||
{
|
||||
if (renumberPoints[pointI] > -1)
|
||||
if (renumberPoints[pointi] > -1)
|
||||
{
|
||||
starPointID_[renumberPoints[pointI]] = oldStarPointID[pointI];
|
||||
starPointID_[renumberPoints[pointi]] = oldStarPointID[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,20 +32,20 @@ Description
|
||||
|
||||
void Foam::starMesh::purgeCellShapes()
|
||||
{
|
||||
forAll(cellFaces_, cellI)
|
||||
forAll(cellFaces_, celli)
|
||||
{
|
||||
const faceList& curFaces = cellFaces_[cellI];
|
||||
const faceList& curFaces = cellFaces_[celli];
|
||||
|
||||
// Get model faces
|
||||
faceList shapeFaces = cellShapes_[cellI].faces();
|
||||
faceList shapeFaces = cellShapes_[celli].faces();
|
||||
|
||||
forAll(shapeFaces, faceI)
|
||||
forAll(shapeFaces, facei)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
forAll(curFaces, i)
|
||||
{
|
||||
if (shapeFaces[faceI] == curFaces[i])
|
||||
if (shapeFaces[facei] == curFaces[i])
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
@ -54,8 +54,8 @@ void Foam::starMesh::purgeCellShapes()
|
||||
|
||||
if (!found)
|
||||
{
|
||||
Info<< "Purging cell shape " << cellI << endl;
|
||||
cellShapes_[cellI] = cellShape(*unknownPtr_, labelList(0));
|
||||
Info<< "Purging cell shape " << celli << endl;
|
||||
cellShapes_[celli] = cellShape(*unknownPtr_, labelList(0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -137,7 +137,7 @@ void Foam::starMesh::readBoundary()
|
||||
|
||||
IFstream boundaryFile(boundaryFileName);
|
||||
|
||||
for (label faceI=0; faceI<nFaces; faceI++)
|
||||
for (label facei=0; facei<nFaces; facei++)
|
||||
{
|
||||
boundaryFile >> lineIndex;
|
||||
|
||||
@ -170,7 +170,7 @@ void Foam::starMesh::readBoundary()
|
||||
)
|
||||
{
|
||||
//Info<< "Converting collapsed quad into triangle"
|
||||
// << " for face " << faceI
|
||||
// << " for face " << facei
|
||||
// << " in Star boundary " << lineIndex << endl;
|
||||
|
||||
pointLabelsTri[0] = pointLabels[0];
|
||||
@ -241,13 +241,13 @@ void Foam::starMesh::readBoundary()
|
||||
defaultFacesType_
|
||||
);
|
||||
|
||||
forAll(patchDicts, patchI)
|
||||
forAll(patchDicts, patchi)
|
||||
{
|
||||
if (patchDicts.set(patchI))
|
||||
if (patchDicts.set(patchi))
|
||||
{
|
||||
const dictionary& dict = patchDicts[patchI];
|
||||
dict.readIfPresent("type", patchTypes_[patchI]);
|
||||
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]);
|
||||
const dictionary& dict = patchDicts[patchi];
|
||||
dict.readIfPresent("type", patchTypes_[patchi]);
|
||||
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchi]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -275,7 +275,7 @@ void Foam::starMesh::readCells()
|
||||
labelList labels(24, label(-1));
|
||||
label lineLabel, starLabel, regionLabel, typeFlag;
|
||||
|
||||
for (label cellI = 0; cellI < nCells; cellI++)
|
||||
for (label celli = 0; celli < nCells; celli++)
|
||||
{
|
||||
label nLabels = 0;
|
||||
|
||||
@ -346,29 +346,29 @@ void Foam::starMesh::readCells()
|
||||
} while (addOnToCell >= 0);
|
||||
|
||||
// Record STAR cell number (used for debugging)
|
||||
starCellID_[cellI] = lineLabel;
|
||||
starCellID_[celli] = lineLabel;
|
||||
|
||||
// insert STAR lookup addressing
|
||||
starCellLabelLookup_[lineLabel] = cellI;
|
||||
starCellLabelLookup_[lineLabel] = celli;
|
||||
|
||||
if (nLabels == 8)
|
||||
{
|
||||
addRegularCell(labels, cellI);
|
||||
addRegularCell(labels, celli);
|
||||
}
|
||||
else
|
||||
{
|
||||
addSAMMcell(labels, cellI);
|
||||
addSAMMcell(labels, celli);
|
||||
}
|
||||
|
||||
// check cell labels
|
||||
const labelList& curShapeLabels = cellShapes_[cellI];
|
||||
const labelList& curShapeLabels = cellShapes_[celli];
|
||||
|
||||
forAll(curShapeLabels, i)
|
||||
{
|
||||
if (curShapeLabels[i] < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Invalid vertex found in cell " << cellI
|
||||
<< "Invalid vertex found in cell " << celli
|
||||
<< ". STAR cell no: " << lineLabel
|
||||
<< " labels: " << curShapeLabels
|
||||
<< abort(FatalError);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -255,7 +255,7 @@ Foam::starMesh::starMesh
|
||||
cellPolys_(0),
|
||||
nInternalFaces_(0),
|
||||
polyBoundaryPatchStartIndices_(0),
|
||||
pointCellsPtr_(NULL),
|
||||
pointCellsPtr_(nullptr),
|
||||
couples_(0),
|
||||
isShapeMesh_(true)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,22 +31,22 @@ Description
|
||||
Converts a Star-CD (v4) pro-STAR mesh into OpenFOAM format.
|
||||
|
||||
Usage
|
||||
- star4ToFoam [OPTION] ccmMesh\n
|
||||
convert pro-STAR mesh to OpenFOAM
|
||||
\b star4ToFoam [OPTION] ccmMesh
|
||||
|
||||
\param -ascii \n
|
||||
Write in ASCII format instead of binary
|
||||
Options:
|
||||
- \par -ascii
|
||||
Write in ASCII format instead of binary
|
||||
|
||||
\param -scale \<factor\>\n
|
||||
Specify an alternative geometry scaling factor.
|
||||
The default is \b 0.001 (scale \em [mm] to \em [m]).
|
||||
- \par -scale \<factor\>
|
||||
Specify an alternative geometry scaling factor.
|
||||
The default is \b 0.001 (scale \em [mm] to \em [m]).
|
||||
|
||||
\param -solids \n
|
||||
Treat any solid cells present just like fluid cells.
|
||||
The default is to discard them.
|
||||
- \par -solids
|
||||
Treat any solid cells present just like fluid cells.
|
||||
The default is to discard them.
|
||||
|
||||
Note
|
||||
- baffles are written as interfaces for later use
|
||||
Baffles are written as interfaces for later use
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -83,11 +83,11 @@ label findFace(const primitiveMesh& mesh, const face& f)
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
label facei = pFaces[i];
|
||||
|
||||
if (mesh.faces()[faceI] == f)
|
||||
if (mesh.faces()[facei] == f)
|
||||
{
|
||||
return faceI;
|
||||
return facei;
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
labelList pointIndex(nNodes);
|
||||
|
||||
label pointI = 0;
|
||||
label pointi = 0;
|
||||
|
||||
while (nodeStream.good())
|
||||
{
|
||||
@ -221,15 +221,15 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Store point and node number.
|
||||
points[pointI] = point(x, y, z);
|
||||
nodeToPoint.insert(nodeI, pointI);
|
||||
pointI++;
|
||||
points[pointi] = point(x, y, z);
|
||||
nodeToPoint.insert(nodeI, pointi);
|
||||
pointi++;
|
||||
}
|
||||
}
|
||||
if (pointI != nNodes)
|
||||
if (pointi != nNodes)
|
||||
{
|
||||
FatalIOErrorInFunction(nodeStream)
|
||||
<< "Only " << pointI << " nodes present instead of " << nNodes
|
||||
<< "Only " << pointi << " nodes present instead of " << nNodes
|
||||
<< " from header." << exit(FatalIOError);
|
||||
}
|
||||
}
|
||||
@ -282,7 +282,7 @@ int main(int argc, char *argv[])
|
||||
labelList tetPoints(4);
|
||||
|
||||
cellShapeList cells(nTets);
|
||||
label cellI = 0;
|
||||
label celli = 0;
|
||||
|
||||
while (eleStream.good())
|
||||
{
|
||||
@ -302,7 +302,7 @@ int main(int argc, char *argv[])
|
||||
tetPoints[i] = nodeToPoint[nodeI];
|
||||
}
|
||||
|
||||
cells[cellI++] = cellShape(tet, tetPoints);
|
||||
cells[celli++] = cellShape(tet, tetPoints);
|
||||
|
||||
// Skip attributes
|
||||
for (label i = 0; i < nElemAttr; i++)
|
||||
@ -394,7 +394,7 @@ int main(int argc, char *argv[])
|
||||
boundaryPatch.setSize(nFaces);
|
||||
boundaryPatch = -1;
|
||||
|
||||
label faceI = 0;
|
||||
label facei = 0;
|
||||
|
||||
// Region to patch conversion
|
||||
Map<label> regionToPatch;
|
||||
@ -409,9 +409,9 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
IStringStream faceLine(line);
|
||||
|
||||
label tetGenFaceI, dummy, region;
|
||||
label tetGenFacei, dummy, region;
|
||||
|
||||
faceLine >> tetGenFaceI;
|
||||
faceLine >> tetGenFacei;
|
||||
|
||||
// Read face and reverse orientation (Foam needs outwards
|
||||
// pointing)
|
||||
@ -425,7 +425,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (findFace(mesh, f) >= mesh.nInternalFaces())
|
||||
{
|
||||
boundaryFaces[faceI] = f;
|
||||
boundaryFaces[facei] = f;
|
||||
|
||||
if (nFaceAttr > 0)
|
||||
{
|
||||
@ -434,27 +434,27 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Get Foam patchID and update region->patch table.
|
||||
label patchI = 0;
|
||||
label patchi = 0;
|
||||
|
||||
Map<label>::iterator patchFind =
|
||||
regionToPatch.find(region);
|
||||
|
||||
if (patchFind == regionToPatch.end())
|
||||
{
|
||||
patchI = nPatches;
|
||||
patchi = nPatches;
|
||||
|
||||
Info<< "Mapping tetgen region " << region
|
||||
<< " to Foam patch "
|
||||
<< patchI << endl;
|
||||
<< patchi << endl;
|
||||
|
||||
regionToPatch.insert(region, nPatches++);
|
||||
}
|
||||
else
|
||||
{
|
||||
patchI = patchFind();
|
||||
patchi = patchFind();
|
||||
}
|
||||
|
||||
boundaryPatch[faceI] = patchI;
|
||||
boundaryPatch[facei] = patchi;
|
||||
|
||||
// Skip remaining attributes
|
||||
for (label i = 1; i < nFaceAttr; i++)
|
||||
@ -463,15 +463,15 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
faceI++;
|
||||
facei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Trim
|
||||
boundaryFaces.setSize(faceI);
|
||||
boundaryPatch.setSize(faceI);
|
||||
boundaryFaces.setSize(facei);
|
||||
boundaryPatch.setSize(facei);
|
||||
|
||||
|
||||
// Print region to patch mapping
|
||||
@ -489,9 +489,9 @@ int main(int argc, char *argv[])
|
||||
faceListList patchFaces(nPatches);
|
||||
wordList patchNames(nPatches);
|
||||
|
||||
forAll(patchNames, patchI)
|
||||
forAll(patchNames, patchi)
|
||||
{
|
||||
patchNames[patchI] = word("patch") + name(patchI);
|
||||
patchNames[patchi] = word("patch") + name(patchi);
|
||||
}
|
||||
|
||||
wordList patchTypes(nPatches, polyPatch::typeName);
|
||||
@ -503,21 +503,21 @@ int main(int argc, char *argv[])
|
||||
// Sort boundaryFaces by patch using boundaryPatch.
|
||||
List<DynamicList<face>> allPatchFaces(nPatches);
|
||||
|
||||
forAll(boundaryPatch, faceI)
|
||||
forAll(boundaryPatch, facei)
|
||||
{
|
||||
label patchI = boundaryPatch[faceI];
|
||||
label patchi = boundaryPatch[facei];
|
||||
|
||||
allPatchFaces[patchI].append(boundaryFaces[faceI]);
|
||||
allPatchFaces[patchi].append(boundaryFaces[facei]);
|
||||
}
|
||||
|
||||
Info<< "Patch sizes:" << endl;
|
||||
|
||||
forAll(allPatchFaces, patchI)
|
||||
forAll(allPatchFaces, patchi)
|
||||
{
|
||||
Info<< " " << patchNames[patchI] << " : "
|
||||
<< allPatchFaces[patchI].size() << endl;
|
||||
Info<< " " << patchNames[patchi] << " : "
|
||||
<< allPatchFaces[patchi].size() << endl;
|
||||
|
||||
patchFaces[patchI].transfer(allPatchFaces[patchI]);
|
||||
patchFaces[patchi].transfer(allPatchFaces[patchi]);
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -72,9 +72,9 @@ void writePoints(const polyMesh& mesh, const fileName& timeName)
|
||||
|
||||
OFstream pointStream(pointFile);
|
||||
|
||||
forAll(mesh.points(), pointI)
|
||||
forAll(mesh.points(), pointi)
|
||||
{
|
||||
writeOBJ(mesh.points()[pointI], pointStream);
|
||||
writeOBJ(mesh.points()[pointi], pointStream);
|
||||
vertI++;
|
||||
}
|
||||
|
||||
@ -109,9 +109,9 @@ void writePoints
|
||||
|
||||
forAll(cellLabels, i)
|
||||
{
|
||||
label cellI = cellLabels[i];
|
||||
label celli = cellLabels[i];
|
||||
|
||||
const labelList& cEdges = mesh.cellEdges()[cellI];
|
||||
const labelList& cEdges = mesh.cellEdges()[celli];
|
||||
|
||||
forAll(cEdges, cEdgeI)
|
||||
{
|
||||
@ -158,21 +158,21 @@ void writePoints
|
||||
void writePoints
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const fileName& timeName
|
||||
)
|
||||
{
|
||||
fileName fName
|
||||
(
|
||||
mesh.time().path()
|
||||
/ "meshPoints_" + timeName + '_' + name(cellI) + ".obj"
|
||||
/ "meshPoints_" + timeName + '_' + name(celli) + ".obj"
|
||||
);
|
||||
|
||||
Info<< "Writing mesh points and edges to " << fName << endl;
|
||||
|
||||
OFstream pointStream(fName);
|
||||
|
||||
const cell& cFaces = mesh.cells()[cellI];
|
||||
const cell& cFaces = mesh.cells()[celli];
|
||||
|
||||
meshTools::writeOBJ(pointStream, mesh.faces(), mesh.points(), cFaces);
|
||||
}
|
||||
@ -192,9 +192,9 @@ void writeFaceCentres(const polyMesh& mesh,const fileName& timeName)
|
||||
|
||||
OFstream faceStream(faceFile);
|
||||
|
||||
forAll(mesh.faceCentres(), faceI)
|
||||
forAll(mesh.faceCentres(), facei)
|
||||
{
|
||||
writeOBJ(mesh.faceCentres()[faceI], faceStream);
|
||||
writeOBJ(mesh.faceCentres()[facei], faceStream);
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,9 +210,9 @@ void writeCellCentres(const polyMesh& mesh, const fileName& timeName)
|
||||
|
||||
OFstream cellStream(cellFile);
|
||||
|
||||
forAll(mesh.cellCentres(), cellI)
|
||||
forAll(mesh.cellCentres(), celli)
|
||||
{
|
||||
writeOBJ(mesh.cellCentres()[cellI], cellStream);
|
||||
writeOBJ(mesh.cellCentres()[celli], cellStream);
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,9 +225,9 @@ void writePatchCentres
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
fileName faceFile
|
||||
(
|
||||
@ -238,9 +238,9 @@ void writePatchCentres
|
||||
|
||||
OFstream patchFaceStream(faceFile);
|
||||
|
||||
forAll(pp.faceCentres(), faceI)
|
||||
forAll(pp.faceCentres(), facei)
|
||||
{
|
||||
writeOBJ(pp.faceCentres()[faceI], patchFaceStream);
|
||||
writeOBJ(pp.faceCentres()[facei], patchFaceStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -254,9 +254,9 @@ void writePatchFaces
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
fileName faceFile
|
||||
(
|
||||
@ -268,14 +268,14 @@ void writePatchFaces
|
||||
|
||||
OFstream patchFaceStream(faceFile);
|
||||
|
||||
forAll(pp.localPoints(), pointI)
|
||||
forAll(pp.localPoints(), pointi)
|
||||
{
|
||||
writeOBJ(pp.localPoints()[pointI], patchFaceStream);
|
||||
writeOBJ(pp.localPoints()[pointi], patchFaceStream);
|
||||
}
|
||||
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
|
||||
patchFaceStream<< 'f';
|
||||
|
||||
@ -297,9 +297,9 @@ void writePatchBoundaryEdges
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
fileName edgeFile
|
||||
(
|
||||
@ -311,9 +311,9 @@ void writePatchBoundaryEdges
|
||||
|
||||
OFstream patchEdgeStream(edgeFile);
|
||||
|
||||
forAll(pp.localPoints(), pointI)
|
||||
forAll(pp.localPoints(), pointi)
|
||||
{
|
||||
writeOBJ(pp.localPoints()[pointI], patchEdgeStream);
|
||||
writeOBJ(pp.localPoints()[pointi], patchEdgeStream);
|
||||
}
|
||||
|
||||
for (label edgeI = pp.nInternalEdges(); edgeI < pp.nEdges(); edgeI++)
|
||||
@ -332,11 +332,11 @@ void writePatchBoundaryEdges
|
||||
void writePointCells
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const fileName& timeName
|
||||
)
|
||||
{
|
||||
const labelList& pCells = mesh.pointCells()[pointI];
|
||||
const labelList& pCells = mesh.pointCells()[pointi];
|
||||
|
||||
labelHashSet allEdges(6*pCells.size());
|
||||
|
||||
@ -354,7 +354,7 @@ void writePointCells
|
||||
fileName pFile
|
||||
(
|
||||
mesh.time().path()
|
||||
/ "pointEdges_" + timeName + '_' + name(pointI) + ".obj"
|
||||
/ "pointEdges_" + timeName + '_' + name(pointi) + ".obj"
|
||||
);
|
||||
|
||||
Info<< "Writing pointEdges to " << pFile << endl;
|
||||
@ -467,19 +467,19 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
if (doCell)
|
||||
{
|
||||
label cellI = args.optionRead<label>("cell");
|
||||
label celli = args.optionRead<label>("cell");
|
||||
|
||||
writePoints(mesh, cellI, runTime.timeName());
|
||||
writePoints(mesh, celli, runTime.timeName());
|
||||
}
|
||||
if (doPoint)
|
||||
{
|
||||
label pointI = args.optionRead<label>("point");
|
||||
label pointi = args.optionRead<label>("point");
|
||||
|
||||
writePointCells(mesh, pointI, runTime.timeName());
|
||||
writePointCells(mesh, pointi, runTime.timeName());
|
||||
}
|
||||
if (doFace)
|
||||
{
|
||||
label faceI = args.optionRead<label>("face");
|
||||
label facei = args.optionRead<label>("face");
|
||||
|
||||
fileName fName
|
||||
(
|
||||
@ -487,7 +487,7 @@ int main(int argc, char *argv[])
|
||||
/ "meshPoints_"
|
||||
+ runTime.timeName()
|
||||
+ '_'
|
||||
+ name(faceI)
|
||||
+ name(facei)
|
||||
+ ".obj"
|
||||
);
|
||||
|
||||
@ -495,7 +495,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
OFstream str(fName);
|
||||
|
||||
const face& f = mesh.faces()[faceI];
|
||||
const face& f = mesh.faces()[facei];
|
||||
|
||||
meshTools::writeOBJ(str, faceList(1, f), mesh.points());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user