mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: decomposePar: decompose hexRef8 data (snappyHexMesh)
This commit is contained in:
@ -99,6 +99,40 @@ Usage
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
const labelIOList& procAddressing
|
||||
(
|
||||
const PtrList<fvMesh>& procMeshList,
|
||||
const label procI,
|
||||
const word& name,
|
||||
PtrList<labelIOList>& procAddressingList
|
||||
)
|
||||
{
|
||||
const fvMesh& procMesh = procMeshList[procI];
|
||||
|
||||
if (!procAddressingList.set(procI))
|
||||
{
|
||||
procAddressingList.set
|
||||
(
|
||||
procI,
|
||||
new labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
name,
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
return procAddressingList[procI];
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addNote
|
||||
@ -805,74 +839,29 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
const fvMesh& procMesh = procMeshList[procI];
|
||||
|
||||
|
||||
if (!faceProcAddressingList.set(procI))
|
||||
{
|
||||
faceProcAddressingList.set
|
||||
const labelIOList& faceProcAddressing = procAddressing
|
||||
(
|
||||
procMeshList,
|
||||
procI,
|
||||
new labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"faceProcAddressing",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
faceProcAddressingList
|
||||
);
|
||||
}
|
||||
const labelIOList& faceProcAddressing =
|
||||
faceProcAddressingList[procI];
|
||||
|
||||
|
||||
if (!cellProcAddressingList.set(procI))
|
||||
{
|
||||
cellProcAddressingList.set
|
||||
const labelIOList& cellProcAddressing = procAddressing
|
||||
(
|
||||
procMeshList,
|
||||
procI,
|
||||
new labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"cellProcAddressing",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
cellProcAddressingList
|
||||
);
|
||||
}
|
||||
const labelIOList& cellProcAddressing =
|
||||
cellProcAddressingList[procI];
|
||||
|
||||
|
||||
if (!boundaryProcAddressingList.set(procI))
|
||||
{
|
||||
boundaryProcAddressingList.set
|
||||
const labelIOList& boundaryProcAddressing = procAddressing
|
||||
(
|
||||
procMeshList,
|
||||
procI,
|
||||
new labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"boundaryProcAddressing",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
boundaryProcAddressingList
|
||||
);
|
||||
}
|
||||
const labelIOList& boundaryProcAddressing =
|
||||
boundaryProcAddressingList[procI];
|
||||
|
||||
|
||||
// FV fields
|
||||
@ -959,27 +948,13 @@ int main(int argc, char *argv[])
|
||||
|| pointTensorFields.size()
|
||||
)
|
||||
{
|
||||
if (!pointProcAddressingList.set(procI))
|
||||
{
|
||||
pointProcAddressingList.set
|
||||
const labelIOList& pointProcAddressing = procAddressing
|
||||
(
|
||||
procMeshList,
|
||||
procI,
|
||||
new labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pointProcAddressing",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
pointProcAddressingList
|
||||
);
|
||||
}
|
||||
const labelIOList& pointProcAddressing =
|
||||
pointProcAddressingList[procI];
|
||||
|
||||
const pointMesh& procPMesh = pointMesh::New(procMesh);
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@ License
|
||||
#include "cellSet.H"
|
||||
#include "faceSet.H"
|
||||
#include "pointSet.H"
|
||||
#include "uniformDimensionedFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -195,6 +196,60 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
}
|
||||
|
||||
|
||||
autoPtr<labelIOList> cellLevelPtr;
|
||||
{
|
||||
IOobject io
|
||||
(
|
||||
"cellLevel",
|
||||
facesInstance(),
|
||||
polyMesh::meshSubDir,
|
||||
*this,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
if (io.headerOk())
|
||||
{
|
||||
Info<< "Reading hexRef8 data : " << io.name() << endl;
|
||||
cellLevelPtr.reset(new labelIOList(io));
|
||||
}
|
||||
}
|
||||
autoPtr<labelIOList> pointLevelPtr;
|
||||
{
|
||||
IOobject io
|
||||
(
|
||||
"pointLevel",
|
||||
facesInstance(),
|
||||
polyMesh::meshSubDir,
|
||||
*this,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
if (io.headerOk())
|
||||
{
|
||||
Info<< "Reading hexRef8 data : " << io.name() << endl;
|
||||
pointLevelPtr.reset(new labelIOList(io));
|
||||
}
|
||||
}
|
||||
autoPtr<uniformDimensionedScalarField> level0EdgePtr;
|
||||
{
|
||||
IOobject io
|
||||
(
|
||||
"level0Edge",
|
||||
facesInstance(),
|
||||
polyMesh::meshSubDir,
|
||||
*this,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
if (io.headerOk())
|
||||
{
|
||||
Info<< "Reading hexRef8 data : " << io.name() << endl;
|
||||
level0EdgePtr.reset(new uniformDimensionedScalarField(io));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
label maxProcCells = 0;
|
||||
label totProcFaces = 0;
|
||||
label maxProcPatches = 0;
|
||||
@ -767,8 +822,28 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
procMesh.write();
|
||||
|
||||
// Write points if pointsInstance differing from facesInstance
|
||||
if (facesInstancePointsPtr_.valid())
|
||||
{
|
||||
pointIOField pointsInstancePoints
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
pointsInstance(),
|
||||
polyMesh::meshSubDir,
|
||||
procMesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
xferMove(procPoints)
|
||||
);
|
||||
pointsInstancePoints.write();
|
||||
}
|
||||
|
||||
|
||||
// Decompose any sets
|
||||
if (decomposeSets)
|
||||
{
|
||||
forAll(cellSets, i)
|
||||
@ -813,25 +888,67 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
}
|
||||
|
||||
|
||||
// Write points if pointsInstance differing from facesInstance
|
||||
if (facesInstancePointsPtr_.valid())
|
||||
// hexRef8 data
|
||||
if (cellLevelPtr.valid())
|
||||
{
|
||||
pointIOField pointsInstancePoints
|
||||
labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
pointsInstance(),
|
||||
cellLevelPtr().name(),
|
||||
facesInstance(),
|
||||
polyMesh::meshSubDir,
|
||||
procMesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
xferMove(procPoints)
|
||||
);
|
||||
pointsInstancePoints.write();
|
||||
UIndirectList<label>
|
||||
(
|
||||
cellLevelPtr(),
|
||||
procCellAddressing_[procI]
|
||||
)()
|
||||
).write();
|
||||
}
|
||||
if (pointLevelPtr.valid())
|
||||
{
|
||||
labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
pointLevelPtr().name(),
|
||||
facesInstance(),
|
||||
polyMesh::meshSubDir,
|
||||
procMesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
UIndirectList<label>
|
||||
(
|
||||
pointLevelPtr(),
|
||||
procPointAddressing_[procI]
|
||||
)()
|
||||
).write();
|
||||
}
|
||||
if (level0EdgePtr.valid())
|
||||
{
|
||||
uniformDimensionedScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
level0EdgePtr().name(),
|
||||
facesInstance(),
|
||||
polyMesh::meshSubDir,
|
||||
procMesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
level0EdgePtr()
|
||||
).write();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Statistics
|
||||
|
||||
Info<< endl
|
||||
<< "Processor " << procI << nl
|
||||
|
||||
Reference in New Issue
Block a user