mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -793,7 +793,6 @@ private:
|
|||||||
faceList& faces,
|
faceList& faces,
|
||||||
labelList& owner,
|
labelList& owner,
|
||||||
labelList& neighbour,
|
labelList& neighbour,
|
||||||
wordList& patchTypes,
|
|
||||||
wordList& patchNames,
|
wordList& patchNames,
|
||||||
PtrList<dictionary>& patchDicts,
|
PtrList<dictionary>& patchDicts,
|
||||||
pointField& cellCentres,
|
pointField& cellCentres,
|
||||||
@ -810,7 +809,6 @@ private:
|
|||||||
faceList& faces,
|
faceList& faces,
|
||||||
labelList& owner,
|
labelList& owner,
|
||||||
labelList& neighbour,
|
labelList& neighbour,
|
||||||
wordList& patchTypes,
|
|
||||||
wordList& patchNames,
|
wordList& patchNames,
|
||||||
PtrList<dictionary>& patchDicts
|
PtrList<dictionary>& patchDicts
|
||||||
);
|
);
|
||||||
@ -894,7 +892,6 @@ private:
|
|||||||
label createPatchInfo
|
label createPatchInfo
|
||||||
(
|
(
|
||||||
wordList& patchNames,
|
wordList& patchNames,
|
||||||
wordList& patchTypes,
|
|
||||||
PtrList<dictionary>& patchDicts
|
PtrList<dictionary>& patchDicts
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -909,7 +906,6 @@ private:
|
|||||||
faceList& faces,
|
faceList& faces,
|
||||||
labelList& owner,
|
labelList& owner,
|
||||||
labelList& neighbour,
|
labelList& neighbour,
|
||||||
wordList& patchTypes,
|
|
||||||
wordList& patchNames,
|
wordList& patchNames,
|
||||||
PtrList<dictionary>& patchDicts,
|
PtrList<dictionary>& patchDicts,
|
||||||
labelListList& patchPointPairSlaves,
|
labelListList& patchPointPairSlaves,
|
||||||
@ -976,7 +972,6 @@ private:
|
|||||||
autoPtr<fvMesh> createDummyMesh
|
autoPtr<fvMesh> createDummyMesh
|
||||||
(
|
(
|
||||||
const IOobject& io,
|
const IOobject& io,
|
||||||
const wordList& patchTypes,
|
|
||||||
const wordList& patchNames,
|
const wordList& patchNames,
|
||||||
const PtrList<dictionary>& patchDicts
|
const PtrList<dictionary>& patchDicts
|
||||||
) const;
|
) const;
|
||||||
@ -986,7 +981,6 @@ private:
|
|||||||
|
|
||||||
void checkProcessorPatchesMatch
|
void checkProcessorPatchesMatch
|
||||||
(
|
(
|
||||||
const wordList& patchTypes,
|
|
||||||
const PtrList<dictionary>& patchDicts
|
const PtrList<dictionary>& patchDicts
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -1005,7 +999,6 @@ private:
|
|||||||
const fileName& instance,
|
const fileName& instance,
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
faceList& faces,
|
faceList& faces,
|
||||||
const wordList& patchTypes,
|
|
||||||
const wordList& patchNames,
|
const wordList& patchNames,
|
||||||
const PtrList<dictionary>& patchDicts
|
const PtrList<dictionary>& patchDicts
|
||||||
) const;
|
) const;
|
||||||
@ -1176,7 +1169,6 @@ public:
|
|||||||
faceList& faces,
|
faceList& faces,
|
||||||
labelList& owner,
|
labelList& owner,
|
||||||
labelList& neighbour,
|
labelList& neighbour,
|
||||||
const wordList& patchTypes,
|
|
||||||
const wordList& patchNames,
|
const wordList& patchNames,
|
||||||
const PtrList<dictionary>& patchDicts,
|
const PtrList<dictionary>& patchDicts,
|
||||||
const pointField& cellCentres,
|
const pointField& cellCentres,
|
||||||
|
|||||||
@ -514,7 +514,6 @@ void Foam::conformalVoronoiMesh::calcDualMesh
|
|||||||
faceList& faces,
|
faceList& faces,
|
||||||
labelList& owner,
|
labelList& owner,
|
||||||
labelList& neighbour,
|
labelList& neighbour,
|
||||||
wordList& patchTypes,
|
|
||||||
wordList& patchNames,
|
wordList& patchNames,
|
||||||
PtrList<dictionary>& patchDicts,
|
PtrList<dictionary>& patchDicts,
|
||||||
pointField& cellCentres,
|
pointField& cellCentres,
|
||||||
@ -595,7 +594,6 @@ void Foam::conformalVoronoiMesh::calcDualMesh
|
|||||||
faces,
|
faces,
|
||||||
owner,
|
owner,
|
||||||
neighbour,
|
neighbour,
|
||||||
patchTypes,
|
|
||||||
patchNames,
|
patchNames,
|
||||||
patchDicts,
|
patchDicts,
|
||||||
patchToDelaunayVertex, // from patch face to Delaunay vertex (slavePp)
|
patchToDelaunayVertex, // from patch face to Delaunay vertex (slavePp)
|
||||||
@ -624,7 +622,6 @@ void Foam::conformalVoronoiMesh::calcTetMesh
|
|||||||
faceList& faces,
|
faceList& faces,
|
||||||
labelList& owner,
|
labelList& owner,
|
||||||
labelList& neighbour,
|
labelList& neighbour,
|
||||||
wordList& patchTypes,
|
|
||||||
wordList& patchNames,
|
wordList& patchNames,
|
||||||
PtrList<dictionary>& patchDicts
|
PtrList<dictionary>& patchDicts
|
||||||
)
|
)
|
||||||
@ -679,7 +676,6 @@ void Foam::conformalVoronoiMesh::calcTetMesh
|
|||||||
patchNames.setSize(patchNames.size() + 1);
|
patchNames.setSize(patchNames.size() + 1);
|
||||||
|
|
||||||
patchNames[patchNames.size() - 1] = "foamyHexMesh_defaultPatch";
|
patchNames[patchNames.size() - 1] = "foamyHexMesh_defaultPatch";
|
||||||
patchTypes.setSize(patchNames.size(), wallPolyPatch::typeName);
|
|
||||||
|
|
||||||
label nPatches = patchNames.size();
|
label nPatches = patchNames.size();
|
||||||
|
|
||||||
@ -1212,7 +1208,6 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
|
|||||||
faceList faces;
|
faceList faces;
|
||||||
labelList owner;
|
labelList owner;
|
||||||
labelList neighbour;
|
labelList neighbour;
|
||||||
wordList patchTypes;
|
|
||||||
wordList patchNames;
|
wordList patchNames;
|
||||||
PtrList<dictionary> patchDicts;
|
PtrList<dictionary> patchDicts;
|
||||||
pointField cellCentres;
|
pointField cellCentres;
|
||||||
@ -1229,7 +1224,6 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
|
|||||||
faces,
|
faces,
|
||||||
owner,
|
owner,
|
||||||
neighbour,
|
neighbour,
|
||||||
patchTypes,
|
|
||||||
patchNames,
|
patchNames,
|
||||||
patchDicts,
|
patchDicts,
|
||||||
patchToDelaunayVertex,
|
patchToDelaunayVertex,
|
||||||
@ -1272,7 +1266,11 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
|
|||||||
{
|
{
|
||||||
label totalPatchSize = readLabel(patchDicts[p].lookup("nFaces"));
|
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
|
// Do not create empty processor patches
|
||||||
if (totalPatchSize > 0)
|
if (totalPatchSize > 0)
|
||||||
@ -1285,7 +1283,7 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
|
|||||||
patchDicts[p],
|
patchDicts[p],
|
||||||
nValidPatches,
|
nValidPatches,
|
||||||
pMesh.boundaryMesh(),
|
pMesh.boundaryMesh(),
|
||||||
patchTypes[p]
|
processorPolyPatch::typeName
|
||||||
);
|
);
|
||||||
|
|
||||||
nValidPatches++;
|
nValidPatches++;
|
||||||
@ -1300,7 +1298,6 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
|
|||||||
{
|
{
|
||||||
patches[nValidPatches] = polyPatch::New
|
patches[nValidPatches] = polyPatch::New
|
||||||
(
|
(
|
||||||
patchTypes[p],
|
|
||||||
patchNames[p],
|
patchNames[p],
|
||||||
patchDicts[p],
|
patchDicts[p],
|
||||||
nValidPatches,
|
nValidPatches,
|
||||||
@ -2026,13 +2023,11 @@ void Foam::conformalVoronoiMesh::reindexDualVertices
|
|||||||
Foam::label Foam::conformalVoronoiMesh::createPatchInfo
|
Foam::label Foam::conformalVoronoiMesh::createPatchInfo
|
||||||
(
|
(
|
||||||
wordList& patchNames,
|
wordList& patchNames,
|
||||||
wordList& patchTypes,
|
|
||||||
PtrList<dictionary>& patchDicts
|
PtrList<dictionary>& patchDicts
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
patchNames = geometryToConformTo_.patchNames();
|
patchNames = geometryToConformTo_.patchNames();
|
||||||
|
|
||||||
patchTypes.setSize(patchNames.size() + 1, wallPolyPatch::typeName);
|
|
||||||
patchDicts.setSize(patchNames.size() + 1);
|
patchDicts.setSize(patchNames.size() + 1);
|
||||||
|
|
||||||
const PtrList<dictionary>& patchInfo = geometryToConformTo_.patchInfo();
|
const PtrList<dictionary>& patchInfo = geometryToConformTo_.patchInfo();
|
||||||
@ -2041,18 +2036,16 @@ Foam::label Foam::conformalVoronoiMesh::createPatchInfo
|
|||||||
{
|
{
|
||||||
if (patchInfo.set(patchI))
|
if (patchInfo.set(patchI))
|
||||||
{
|
{
|
||||||
patchTypes[patchI] =
|
|
||||||
patchInfo[patchI].lookupOrDefault<word>
|
|
||||||
(
|
|
||||||
"type",
|
|
||||||
wallPolyPatch::typeName
|
|
||||||
);
|
|
||||||
|
|
||||||
patchDicts.set(patchI, new dictionary(patchInfo[patchI]));
|
patchDicts.set(patchI, new dictionary(patchInfo[patchI]));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
patchDicts.set(patchI, new dictionary());
|
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;
|
label defaultPatchIndex = patchNames.size() - 1;
|
||||||
patchNames[defaultPatchIndex] = "foamyHexMesh_defaultPatch";
|
patchNames[defaultPatchIndex] = "foamyHexMesh_defaultPatch";
|
||||||
patchDicts.set(defaultPatchIndex, new dictionary());
|
patchDicts.set(defaultPatchIndex, new dictionary());
|
||||||
|
patchDicts[defaultPatchIndex].set
|
||||||
|
(
|
||||||
|
"type",
|
||||||
|
wallPolyPatch::typeName
|
||||||
|
);
|
||||||
|
|
||||||
label nProcPatches = 0;
|
label nProcPatches = 0;
|
||||||
|
|
||||||
@ -2117,7 +2115,6 @@ Foam::label Foam::conformalVoronoiMesh::createPatchInfo
|
|||||||
label nTotalPatches = nNonProcPatches + nProcPatches;
|
label nTotalPatches = nNonProcPatches + nProcPatches;
|
||||||
|
|
||||||
patchNames.setSize(nTotalPatches);
|
patchNames.setSize(nTotalPatches);
|
||||||
patchTypes.setSize(nTotalPatches);
|
|
||||||
patchDicts.setSize(nTotalPatches);
|
patchDicts.setSize(nTotalPatches);
|
||||||
for (label pI = nNonProcPatches; pI < nTotalPatches; ++pI)
|
for (label pI = nNonProcPatches; pI < nTotalPatches; ++pI)
|
||||||
{
|
{
|
||||||
@ -2130,20 +2127,24 @@ Foam::label Foam::conformalVoronoiMesh::createPatchInfo
|
|||||||
{
|
{
|
||||||
if (procUsed[pUI])
|
if (procUsed[pUI])
|
||||||
{
|
{
|
||||||
patchTypes[nNonProcPatches + procAddI] =
|
|
||||||
processorPolyPatch::typeName;
|
|
||||||
|
|
||||||
patchNames[nNonProcPatches + procAddI] =
|
patchNames[nNonProcPatches + procAddI] =
|
||||||
"procBoundary"
|
"procBoundary"
|
||||||
+ name(Pstream::myProcNo())
|
+ name(Pstream::myProcNo())
|
||||||
+ "to"
|
+ "to"
|
||||||
+ name(pUI);
|
+ name(pUI);
|
||||||
|
|
||||||
|
patchDicts[nNonProcPatches + procAddI].set
|
||||||
|
(
|
||||||
|
"type",
|
||||||
|
processorPolyPatch::typeName
|
||||||
|
);
|
||||||
|
|
||||||
patchDicts[nNonProcPatches + procAddI].set
|
patchDicts[nNonProcPatches + procAddI].set
|
||||||
(
|
(
|
||||||
"myProcNo",
|
"myProcNo",
|
||||||
Pstream::myProcNo()
|
Pstream::myProcNo()
|
||||||
);
|
);
|
||||||
|
|
||||||
patchDicts[nNonProcPatches + procAddI].set("neighbProcNo", pUI);
|
patchDicts[nNonProcPatches + procAddI].set("neighbProcNo", pUI);
|
||||||
|
|
||||||
procAddI++;
|
procAddI++;
|
||||||
@ -2221,7 +2222,6 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
|||||||
faceList& faces,
|
faceList& faces,
|
||||||
labelList& owner,
|
labelList& owner,
|
||||||
labelList& neighbour,
|
labelList& neighbour,
|
||||||
wordList& patchTypes,
|
|
||||||
wordList& patchNames,
|
wordList& patchNames,
|
||||||
PtrList<dictionary>& patchDicts,
|
PtrList<dictionary>& patchDicts,
|
||||||
labelListList& patchPointPairSlaves,
|
labelListList& patchPointPairSlaves,
|
||||||
@ -2232,7 +2232,6 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
|||||||
const label defaultPatchIndex = createPatchInfo
|
const label defaultPatchIndex = createPatchInfo
|
||||||
(
|
(
|
||||||
patchNames,
|
patchNames,
|
||||||
patchTypes,
|
|
||||||
patchDicts
|
patchDicts
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -371,7 +371,6 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
faceList faces;
|
faceList faces;
|
||||||
labelList owner;
|
labelList owner;
|
||||||
labelList neighbour;
|
labelList neighbour;
|
||||||
wordList patchTypes;
|
|
||||||
wordList patchNames;
|
wordList patchNames;
|
||||||
PtrList<dictionary> patchDicts;
|
PtrList<dictionary> patchDicts;
|
||||||
pointField cellCentres;
|
pointField cellCentres;
|
||||||
@ -385,7 +384,6 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
faces,
|
faces,
|
||||||
owner,
|
owner,
|
||||||
neighbour,
|
neighbour,
|
||||||
patchTypes,
|
|
||||||
patchNames,
|
patchNames,
|
||||||
patchDicts,
|
patchDicts,
|
||||||
cellCentres,
|
cellCentres,
|
||||||
@ -405,7 +403,6 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
faces,
|
faces,
|
||||||
owner,
|
owner,
|
||||||
neighbour,
|
neighbour,
|
||||||
patchTypes,
|
|
||||||
patchNames,
|
patchNames,
|
||||||
patchDicts,
|
patchDicts,
|
||||||
cellCentres,
|
cellCentres,
|
||||||
@ -669,7 +666,6 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
|
Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
|
||||||
(
|
(
|
||||||
const IOobject& io,
|
const IOobject& io,
|
||||||
const wordList& patchTypes,
|
|
||||||
const wordList& patchNames,
|
const wordList& patchNames,
|
||||||
const PtrList<dictionary>& patchDicts
|
const PtrList<dictionary>& patchDicts
|
||||||
) const
|
) const
|
||||||
@ -690,7 +686,14 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
|
|||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
if (patchTypes[patchI] == processorPolyPatch::typeName)
|
if
|
||||||
|
(
|
||||||
|
patchDicts.set(patchI)
|
||||||
|
&& (
|
||||||
|
word(patchDicts[patchI].lookup("type"))
|
||||||
|
== processorPolyPatch::typeName
|
||||||
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
patches[patchI] = new processorPolyPatch
|
patches[patchI] = new processorPolyPatch
|
||||||
(
|
(
|
||||||
@ -708,7 +711,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
|
|||||||
{
|
{
|
||||||
patches[patchI] = polyPatch::New
|
patches[patchI] = polyPatch::New
|
||||||
(
|
(
|
||||||
patchTypes[patchI],
|
patchDicts[patchI].lookup("type"),
|
||||||
patchNames[patchI],
|
patchNames[patchI],
|
||||||
0, //patchSizes[p],
|
0, //patchSizes[p],
|
||||||
0, //patchStarts[p],
|
0, //patchStarts[p],
|
||||||
@ -726,7 +729,6 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
|
|||||||
|
|
||||||
void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
|
void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
|
||||||
(
|
(
|
||||||
const wordList& patchTypes,
|
|
||||||
const PtrList<dictionary>& patchDicts
|
const PtrList<dictionary>& patchDicts
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -737,9 +739,16 @@ void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
|
|||||||
labelList(Pstream::nProcs(), -1)
|
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 =
|
const label procNeighb =
|
||||||
readLabel(patchDicts[patchI].lookup("neighbProcNo"));
|
readLabel(patchDicts[patchI].lookup("neighbProcNo"));
|
||||||
@ -848,7 +857,6 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
|||||||
const fileName& instance,
|
const fileName& instance,
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
faceList& faces,
|
faceList& faces,
|
||||||
const wordList& patchTypes,
|
|
||||||
const wordList& patchNames,
|
const wordList& patchNames,
|
||||||
const PtrList<dictionary>& patchDicts
|
const PtrList<dictionary>& patchDicts
|
||||||
) const
|
) const
|
||||||
@ -856,7 +864,7 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
|||||||
Info<< incrIndent << indent << "Reordering processor patches" << endl;
|
Info<< incrIndent << indent << "Reordering processor patches" << endl;
|
||||||
|
|
||||||
Info<< incrIndent;
|
Info<< incrIndent;
|
||||||
checkProcessorPatchesMatch(patchTypes, patchDicts);
|
checkProcessorPatchesMatch(patchDicts);
|
||||||
|
|
||||||
// Create dummy mesh with correct proc boundaries to do sorting
|
// Create dummy mesh with correct proc boundaries to do sorting
|
||||||
autoPtr<fvMesh> sortMeshPtr
|
autoPtr<fvMesh> sortMeshPtr
|
||||||
@ -872,7 +880,6 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
|||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
),
|
),
|
||||||
patchTypes,
|
|
||||||
patchNames,
|
patchNames,
|
||||||
patchDicts
|
patchDicts
|
||||||
)
|
)
|
||||||
@ -1034,7 +1041,6 @@ void Foam::conformalVoronoiMesh::writeMesh
|
|||||||
faceList& faces,
|
faceList& faces,
|
||||||
labelList& owner,
|
labelList& owner,
|
||||||
labelList& neighbour,
|
labelList& neighbour,
|
||||||
const wordList& patchTypes,
|
|
||||||
const wordList& patchNames,
|
const wordList& patchNames,
|
||||||
const PtrList<dictionary>& patchDicts,
|
const PtrList<dictionary>& patchDicts,
|
||||||
const pointField& cellCentres,
|
const pointField& cellCentres,
|
||||||
@ -1058,7 +1064,6 @@ void Foam::conformalVoronoiMesh::writeMesh
|
|||||||
instance,
|
instance,
|
||||||
points,
|
points,
|
||||||
faces,
|
faces,
|
||||||
patchTypes,
|
|
||||||
patchNames,
|
patchNames,
|
||||||
patchDicts
|
patchDicts
|
||||||
);
|
);
|
||||||
@ -1094,7 +1099,14 @@ void Foam::conformalVoronoiMesh::writeMesh
|
|||||||
{
|
{
|
||||||
label totalPatchSize = readLabel(patchDicts[p].lookup("nFaces"));
|
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
|
const_cast<dictionary&>(patchDicts[p]).set
|
||||||
(
|
(
|
||||||
@ -1112,7 +1124,7 @@ void Foam::conformalVoronoiMesh::writeMesh
|
|||||||
patchDicts[p],
|
patchDicts[p],
|
||||||
nValidPatches,
|
nValidPatches,
|
||||||
mesh.boundaryMesh(),
|
mesh.boundaryMesh(),
|
||||||
patchTypes[p]
|
processorPolyPatch::typeName
|
||||||
);
|
);
|
||||||
|
|
||||||
nValidPatches++;
|
nValidPatches++;
|
||||||
@ -1127,7 +1139,6 @@ void Foam::conformalVoronoiMesh::writeMesh
|
|||||||
{
|
{
|
||||||
patches[nValidPatches] = polyPatch::New
|
patches[nValidPatches] = polyPatch::New
|
||||||
(
|
(
|
||||||
patchTypes[p],
|
|
||||||
patchNames[p],
|
patchNames[p],
|
||||||
patchDicts[p],
|
patchDicts[p],
|
||||||
nValidPatches,
|
nValidPatches,
|
||||||
|
|||||||
141
src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.C
Normal file
141
src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.C
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "polyMeshFilterSettings.H"
|
||||||
|
#include "unitConversion.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::polyMeshFilterSettings::polyMeshFilterSettings(const dictionary& dict)
|
||||||
|
:
|
||||||
|
dict_(dict),
|
||||||
|
controlMeshQuality_
|
||||||
|
(
|
||||||
|
dict_.lookupOrDefault<Switch>("controlMeshQuality", false)
|
||||||
|
),
|
||||||
|
collapseEdgesCoeffDict_(dict_.subDict("collapseEdgesCoeffs")),
|
||||||
|
collapseFacesCoeffDict_(dict_.subOrEmptyDict("collapseFacesCoeffs")),
|
||||||
|
meshQualityCoeffDict_(dict_.subOrEmptyDict("controlMeshQualityCoeffs")),
|
||||||
|
minLen_(readScalar(collapseEdgesCoeffDict_.lookup("minimumEdgeLength"))),
|
||||||
|
maxCos_
|
||||||
|
(
|
||||||
|
::cos
|
||||||
|
(
|
||||||
|
degToRad
|
||||||
|
(
|
||||||
|
readScalar(collapseEdgesCoeffDict_.lookup("maximumMergeAngle"))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
edgeReductionFactor_
|
||||||
|
(
|
||||||
|
meshQualityCoeffDict_.lookupOrDefault<scalar>("edgeReductionFactor", -1)
|
||||||
|
),
|
||||||
|
maxIterations_
|
||||||
|
(
|
||||||
|
meshQualityCoeffDict_.lookupOrAddDefault<label>("maximumIterations", 1)
|
||||||
|
),
|
||||||
|
maxSmoothIters_
|
||||||
|
(
|
||||||
|
meshQualityCoeffDict_.lookupOrAddDefault<label>
|
||||||
|
(
|
||||||
|
"maximumSmoothingIterations",
|
||||||
|
0
|
||||||
|
)
|
||||||
|
),
|
||||||
|
initialFaceLengthFactor_
|
||||||
|
(
|
||||||
|
collapseFacesCoeffDict_.lookupOrAddDefault<scalar>
|
||||||
|
(
|
||||||
|
"initialFaceLengthFactor",
|
||||||
|
-1
|
||||||
|
)
|
||||||
|
),
|
||||||
|
faceReductionFactor_
|
||||||
|
(
|
||||||
|
meshQualityCoeffDict_.lookupOrAddDefault<scalar>
|
||||||
|
(
|
||||||
|
"faceReductionFactor",
|
||||||
|
-1
|
||||||
|
)
|
||||||
|
),
|
||||||
|
maxPointErrorCount_
|
||||||
|
(
|
||||||
|
meshQualityCoeffDict_.lookupOrAddDefault<label>("maxPointErrorCount", 0)
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::polyMeshFilterSettings::writeSettings(Ostream& os) const
|
||||||
|
{
|
||||||
|
os << "Merging:" << nl
|
||||||
|
<< " edges with length less than " << minLen() << " metres" << nl
|
||||||
|
<< " edges split by a point with edges in line to within "
|
||||||
|
<< radToDeg(::acos(maxCos())) << " degrees" << nl
|
||||||
|
<< " Minimum edge length reduction factor = "
|
||||||
|
<< edgeReductionFactor() << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
if (collapseFacesCoeffDict().empty())
|
||||||
|
{
|
||||||
|
os << "Face collapsing is off" << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
os << "Face collapsing is on" << endl;
|
||||||
|
os << " Initial face length factor = "<< initialFaceLengthFactor()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
os << "Control mesh quality = " << controlMeshQuality().asText() << endl;
|
||||||
|
|
||||||
|
if (controlMeshQuality())
|
||||||
|
{
|
||||||
|
os << " Minimum edge length reduction factor = "
|
||||||
|
<< edgeReductionFactor() << nl
|
||||||
|
<< " Minimum face area reduction factor = "
|
||||||
|
<< faceReductionFactor() << endl;
|
||||||
|
|
||||||
|
os << " Maximum number of collapse iterations = " << maxIterations()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
os << " Maximum number of edge/face reduction factor smoothing "
|
||||||
|
<< "iterations = " << maxSmoothIters() << endl;
|
||||||
|
|
||||||
|
os << " Maximum number of times a point can contribute to bad "
|
||||||
|
<< "faces across " << nl
|
||||||
|
<< " collapse iterations = " << maxPointErrorCount()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
os << "Selectively disabling wanted collapses until resulting quality"
|
||||||
|
<< " satisfies constraints in system/meshQualityDict" << nl
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
166
src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.H
Normal file
166
src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.H
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::polyMeshFilterSettings
|
||||||
|
|
||||||
|
Description
|
||||||
|
Class to store the settings for the polyMeshFilter class.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
polyMeshFilterSettings.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef polyMeshFilterSettings_H
|
||||||
|
#define polyMeshFilterSettings_H
|
||||||
|
|
||||||
|
#include "dictionary.H"
|
||||||
|
#include "Switch.H"
|
||||||
|
#include "scalar.H"
|
||||||
|
#include "label.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class polyMeshFilterSettings Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class polyMeshFilterSettings
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Dictionary containing the coefficient sub-dictionaries
|
||||||
|
const dictionary dict_;
|
||||||
|
|
||||||
|
//- After collapsing, check the mesh quality and redo the collapsing
|
||||||
|
// iteration if there are too many bad faces in the mesh
|
||||||
|
Switch controlMeshQuality_;
|
||||||
|
|
||||||
|
//- Coefficients for collapsing edges
|
||||||
|
const dictionary& collapseEdgesCoeffDict_;
|
||||||
|
|
||||||
|
//- Coefficients for collapsing faces
|
||||||
|
dictionary collapseFacesCoeffDict_;
|
||||||
|
|
||||||
|
//- Coefficients for controlling the mesh quality
|
||||||
|
dictionary meshQualityCoeffDict_;
|
||||||
|
|
||||||
|
//- Remove edges shorter than this length
|
||||||
|
const scalar minLen_;
|
||||||
|
|
||||||
|
//- Merge points that are only attached to two edges and have an angle
|
||||||
|
// between the edge greater than this value
|
||||||
|
const scalar maxCos_;
|
||||||
|
|
||||||
|
//- The amount that the local minimum edge length will be reduced by if
|
||||||
|
// the edge is part of a collapse string that generates poor quality
|
||||||
|
// faces
|
||||||
|
const scalar edgeReductionFactor_;
|
||||||
|
|
||||||
|
//- Maximum number of outer iterations
|
||||||
|
const label maxIterations_;
|
||||||
|
|
||||||
|
//- Maximum number of smoothing iterations of minEdgeLen_ and
|
||||||
|
// faceFilterFactor_
|
||||||
|
const label maxSmoothIters_;
|
||||||
|
|
||||||
|
//- Initialisation value of faceFilterFactor_
|
||||||
|
const scalar initialFaceLengthFactor_;
|
||||||
|
|
||||||
|
//- The amount that the local face size factor will be reduced by if
|
||||||
|
// the face is part of a collapse string that generates poor quality
|
||||||
|
// faces
|
||||||
|
const scalar faceReductionFactor_;
|
||||||
|
|
||||||
|
//- Maximum number of times a deleted point can be associated with the
|
||||||
|
// creation of a bad face it is forced to be kept.
|
||||||
|
const label maxPointErrorCount_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
explicit polyMeshFilterSettings(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
~polyMeshFilterSettings(){};
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
inline const dictionary& collapseEdgesCoeffDict() const;
|
||||||
|
|
||||||
|
inline const dictionary& collapseFacesCoeffDict() const;
|
||||||
|
|
||||||
|
inline const dictionary& meshQualityCoeffDict() const;
|
||||||
|
|
||||||
|
|
||||||
|
inline const Switch& controlMeshQuality() const;
|
||||||
|
|
||||||
|
|
||||||
|
inline const scalar& minLen() const;
|
||||||
|
|
||||||
|
inline const scalar& maxCos() const;
|
||||||
|
|
||||||
|
inline const scalar& edgeReductionFactor() const;
|
||||||
|
|
||||||
|
inline const label& maxIterations() const;
|
||||||
|
|
||||||
|
inline const label& maxSmoothIters() const;
|
||||||
|
|
||||||
|
inline const scalar& initialFaceLengthFactor() const;
|
||||||
|
|
||||||
|
inline const scalar& faceReductionFactor() const;
|
||||||
|
|
||||||
|
inline const label& maxPointErrorCount() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Write
|
||||||
|
|
||||||
|
//- Write the settings to a stream
|
||||||
|
void writeSettings(Ostream& os) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "polyMeshFilterSettingsI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
98
src/dynamicMesh/polyMeshFilter/polyMeshFilterSettingsI.H
Normal file
98
src/dynamicMesh/polyMeshFilter/polyMeshFilterSettingsI.H
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline const Foam::dictionary&
|
||||||
|
Foam::polyMeshFilterSettings::collapseEdgesCoeffDict() const
|
||||||
|
{
|
||||||
|
return collapseEdgesCoeffDict_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const Foam::dictionary&
|
||||||
|
Foam::polyMeshFilterSettings::collapseFacesCoeffDict() const
|
||||||
|
{
|
||||||
|
return collapseFacesCoeffDict_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const Foam::dictionary&
|
||||||
|
Foam::polyMeshFilterSettings::meshQualityCoeffDict() const
|
||||||
|
{
|
||||||
|
return meshQualityCoeffDict_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::Switch&
|
||||||
|
Foam::polyMeshFilterSettings::controlMeshQuality() const
|
||||||
|
{
|
||||||
|
return controlMeshQuality_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const Foam::scalar& Foam::polyMeshFilterSettings::minLen() const
|
||||||
|
{
|
||||||
|
return minLen_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const Foam::scalar& Foam::polyMeshFilterSettings::maxCos() const
|
||||||
|
{
|
||||||
|
return maxCos_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const Foam::scalar&
|
||||||
|
Foam::polyMeshFilterSettings::edgeReductionFactor() const
|
||||||
|
{
|
||||||
|
return edgeReductionFactor_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const Foam::label& Foam::polyMeshFilterSettings::maxIterations() const
|
||||||
|
{
|
||||||
|
return maxIterations_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const Foam::label& Foam::polyMeshFilterSettings::maxSmoothIters() const
|
||||||
|
{
|
||||||
|
return maxSmoothIters_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const Foam::scalar&
|
||||||
|
Foam::polyMeshFilterSettings::initialFaceLengthFactor() const
|
||||||
|
{
|
||||||
|
return initialFaceLengthFactor_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const Foam::scalar&
|
||||||
|
Foam::polyMeshFilterSettings::faceReductionFactor() const
|
||||||
|
{
|
||||||
|
return faceReductionFactor_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const Foam::label&
|
||||||
|
Foam::polyMeshFilterSettings::maxPointErrorCount() const
|
||||||
|
{
|
||||||
|
return maxPointErrorCount_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user