Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2013-07-11 17:28:28 +01:00
7 changed files with 456 additions and 9759 deletions

View File

@ -793,7 +793,6 @@ private:
faceList& faces,
labelList& owner,
labelList& neighbour,
wordList& patchTypes,
wordList& patchNames,
PtrList<dictionary>& patchDicts,
pointField& cellCentres,
@ -810,7 +809,6 @@ private:
faceList& faces,
labelList& owner,
labelList& neighbour,
wordList& patchTypes,
wordList& patchNames,
PtrList<dictionary>& patchDicts
);
@ -894,7 +892,6 @@ private:
label createPatchInfo
(
wordList& patchNames,
wordList& patchTypes,
PtrList<dictionary>& patchDicts
) const;
@ -909,7 +906,6 @@ private:
faceList& faces,
labelList& owner,
labelList& neighbour,
wordList& patchTypes,
wordList& patchNames,
PtrList<dictionary>& patchDicts,
labelListList& patchPointPairSlaves,
@ -976,7 +972,6 @@ private:
autoPtr<fvMesh> createDummyMesh
(
const IOobject& io,
const wordList& patchTypes,
const wordList& patchNames,
const PtrList<dictionary>& patchDicts
) const;
@ -986,7 +981,6 @@ private:
void checkProcessorPatchesMatch
(
const wordList& patchTypes,
const PtrList<dictionary>& patchDicts
) const;
@ -1005,7 +999,6 @@ private:
const fileName& instance,
const pointField& points,
faceList& faces,
const wordList& patchTypes,
const wordList& patchNames,
const PtrList<dictionary>& patchDicts
) const;
@ -1176,7 +1169,6 @@ public:
faceList& faces,
labelList& owner,
labelList& neighbour,
const wordList& patchTypes,
const wordList& patchNames,
const PtrList<dictionary>& patchDicts,
const pointField& cellCentres,

View File

@ -514,7 +514,6 @@ void Foam::conformalVoronoiMesh::calcDualMesh
faceList& faces,
labelList& owner,
labelList& neighbour,
wordList& patchTypes,
wordList& patchNames,
PtrList<dictionary>& patchDicts,
pointField& cellCentres,
@ -595,7 +594,6 @@ void Foam::conformalVoronoiMesh::calcDualMesh
faces,
owner,
neighbour,
patchTypes,
patchNames,
patchDicts,
patchToDelaunayVertex, // from patch face to Delaunay vertex (slavePp)
@ -624,7 +622,6 @@ void Foam::conformalVoronoiMesh::calcTetMesh
faceList& faces,
labelList& owner,
labelList& neighbour,
wordList& patchTypes,
wordList& patchNames,
PtrList<dictionary>& patchDicts
)
@ -679,7 +676,6 @@ void Foam::conformalVoronoiMesh::calcTetMesh
patchNames.setSize(patchNames.size() + 1);
patchNames[patchNames.size() - 1] = "foamyHexMesh_defaultPatch";
patchTypes.setSize(patchNames.size(), wallPolyPatch::typeName);
label nPatches = patchNames.size();
@ -1212,7 +1208,6 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
faceList faces;
labelList owner;
labelList neighbour;
wordList patchTypes;
wordList patchNames;
PtrList<dictionary> patchDicts;
pointField cellCentres;
@ -1229,7 +1224,6 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
faces,
owner,
neighbour,
patchTypes,
patchNames,
patchDicts,
patchToDelaunayVertex,
@ -1272,7 +1266,11 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
{
label totalPatchSize = readLabel(patchDicts[p].lookup("nFaces"));
if (patchTypes[p] == processorPolyPatch::typeName)
if
(
patchDicts.set(p)
&& word(patchDicts[p].lookup("type")) == processorPolyPatch::typeName
)
{
// Do not create empty processor patches
if (totalPatchSize > 0)
@ -1285,7 +1283,7 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
patchDicts[p],
nValidPatches,
pMesh.boundaryMesh(),
patchTypes[p]
processorPolyPatch::typeName
);
nValidPatches++;
@ -1300,7 +1298,6 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
{
patches[nValidPatches] = polyPatch::New
(
patchTypes[p],
patchNames[p],
patchDicts[p],
nValidPatches,
@ -2026,13 +2023,11 @@ void Foam::conformalVoronoiMesh::reindexDualVertices
Foam::label Foam::conformalVoronoiMesh::createPatchInfo
(
wordList& patchNames,
wordList& patchTypes,
PtrList<dictionary>& patchDicts
) const
{
patchNames = geometryToConformTo_.patchNames();
patchTypes.setSize(patchNames.size() + 1, wallPolyPatch::typeName);
patchDicts.setSize(patchNames.size() + 1);
const PtrList<dictionary>& patchInfo = geometryToConformTo_.patchInfo();
@ -2041,18 +2036,16 @@ Foam::label Foam::conformalVoronoiMesh::createPatchInfo
{
if (patchInfo.set(patchI))
{
patchTypes[patchI] =
patchInfo[patchI].lookupOrDefault<word>
(
"type",
wallPolyPatch::typeName
);
patchDicts.set(patchI, new dictionary(patchInfo[patchI]));
}
else
{
patchDicts.set(patchI, new dictionary());
patchDicts[patchI].set
(
"type",
wallPolyPatch::typeName
);
}
}
@ -2060,6 +2053,11 @@ Foam::label Foam::conformalVoronoiMesh::createPatchInfo
label defaultPatchIndex = patchNames.size() - 1;
patchNames[defaultPatchIndex] = "foamyHexMesh_defaultPatch";
patchDicts.set(defaultPatchIndex, new dictionary());
patchDicts[defaultPatchIndex].set
(
"type",
wallPolyPatch::typeName
);
label nProcPatches = 0;
@ -2117,7 +2115,6 @@ Foam::label Foam::conformalVoronoiMesh::createPatchInfo
label nTotalPatches = nNonProcPatches + nProcPatches;
patchNames.setSize(nTotalPatches);
patchTypes.setSize(nTotalPatches);
patchDicts.setSize(nTotalPatches);
for (label pI = nNonProcPatches; pI < nTotalPatches; ++pI)
{
@ -2130,20 +2127,24 @@ Foam::label Foam::conformalVoronoiMesh::createPatchInfo
{
if (procUsed[pUI])
{
patchTypes[nNonProcPatches + procAddI] =
processorPolyPatch::typeName;
patchNames[nNonProcPatches + procAddI] =
"procBoundary"
+ name(Pstream::myProcNo())
+ "to"
+ name(pUI);
patchDicts[nNonProcPatches + procAddI].set
(
"type",
processorPolyPatch::typeName
);
patchDicts[nNonProcPatches + procAddI].set
(
"myProcNo",
Pstream::myProcNo()
);
patchDicts[nNonProcPatches + procAddI].set("neighbProcNo", pUI);
procAddI++;
@ -2221,7 +2222,6 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
faceList& faces,
labelList& owner,
labelList& neighbour,
wordList& patchTypes,
wordList& patchNames,
PtrList<dictionary>& patchDicts,
labelListList& patchPointPairSlaves,
@ -2232,7 +2232,6 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
const label defaultPatchIndex = createPatchInfo
(
patchNames,
patchTypes,
patchDicts
);

View File

@ -371,7 +371,6 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
faceList faces;
labelList owner;
labelList neighbour;
wordList patchTypes;
wordList patchNames;
PtrList<dictionary> patchDicts;
pointField cellCentres;
@ -385,7 +384,6 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
faces,
owner,
neighbour,
patchTypes,
patchNames,
patchDicts,
cellCentres,
@ -405,7 +403,6 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
faces,
owner,
neighbour,
patchTypes,
patchNames,
patchDicts,
cellCentres,
@ -669,7 +666,6 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
(
const IOobject& io,
const wordList& patchTypes,
const wordList& patchNames,
const PtrList<dictionary>& patchDicts
) const
@ -690,7 +686,14 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
forAll(patches, patchI)
{
if (patchTypes[patchI] == processorPolyPatch::typeName)
if
(
patchDicts.set(patchI)
&& (
word(patchDicts[patchI].lookup("type"))
== processorPolyPatch::typeName
)
)
{
patches[patchI] = new processorPolyPatch
(
@ -708,7 +711,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
{
patches[patchI] = polyPatch::New
(
patchTypes[patchI],
patchDicts[patchI].lookup("type"),
patchNames[patchI],
0, //patchSizes[p],
0, //patchStarts[p],
@ -726,7 +729,6 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
(
const wordList& patchTypes,
const PtrList<dictionary>& patchDicts
) const
{
@ -737,9 +739,16 @@ void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
labelList(Pstream::nProcs(), -1)
);
forAll(patchTypes, patchI)
forAll(patchDicts, patchI)
{
if (patchTypes[patchI] == processorPolyPatch::typeName)
if
(
patchDicts.set(patchI)
&& (
word(patchDicts[patchI].lookup("type"))
== processorPolyPatch::typeName
)
)
{
const label procNeighb =
readLabel(patchDicts[patchI].lookup("neighbProcNo"));
@ -848,7 +857,6 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
const fileName& instance,
const pointField& points,
faceList& faces,
const wordList& patchTypes,
const wordList& patchNames,
const PtrList<dictionary>& patchDicts
) const
@ -856,7 +864,7 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
Info<< incrIndent << indent << "Reordering processor patches" << endl;
Info<< incrIndent;
checkProcessorPatchesMatch(patchTypes, patchDicts);
checkProcessorPatchesMatch(patchDicts);
// Create dummy mesh with correct proc boundaries to do sorting
autoPtr<fvMesh> sortMeshPtr
@ -872,7 +880,6 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
IOobject::NO_WRITE,
false
),
patchTypes,
patchNames,
patchDicts
)
@ -1034,7 +1041,6 @@ void Foam::conformalVoronoiMesh::writeMesh
faceList& faces,
labelList& owner,
labelList& neighbour,
const wordList& patchTypes,
const wordList& patchNames,
const PtrList<dictionary>& patchDicts,
const pointField& cellCentres,
@ -1058,7 +1064,6 @@ void Foam::conformalVoronoiMesh::writeMesh
instance,
points,
faces,
patchTypes,
patchNames,
patchDicts
);
@ -1094,7 +1099,14 @@ void Foam::conformalVoronoiMesh::writeMesh
{
label totalPatchSize = readLabel(patchDicts[p].lookup("nFaces"));
if (patchTypes[p] == processorPolyPatch::typeName)
if
(
patchDicts.set(p)
&& (
word(patchDicts[p].lookup("type"))
== processorPolyPatch::typeName
)
)
{
const_cast<dictionary&>(patchDicts[p]).set
(
@ -1112,7 +1124,7 @@ void Foam::conformalVoronoiMesh::writeMesh
patchDicts[p],
nValidPatches,
mesh.boundaryMesh(),
patchTypes[p]
processorPolyPatch::typeName
);
nValidPatches++;
@ -1127,7 +1139,6 @@ void Foam::conformalVoronoiMesh::writeMesh
{
patches[nValidPatches] = polyPatch::New
(
patchTypes[p],
patchNames[p],
patchDicts[p],
nValidPatches,