GIT: Initial state after latest Foundation merge

This commit is contained in:
Andrew Heather
2016-09-20 14:49:08 +01:00
4571 changed files with 115696 additions and 74609 deletions

View File

@ -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

View File

@ -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];
}
}

View File

@ -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];
}
}

View File

@ -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);
}
}
}