mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into sixDofPatch
This commit is contained in:
@ -55,7 +55,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
|
|
||||||
while (runTime.run())
|
while (runTime.loop())
|
||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
@ -81,8 +81,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "convergenceCheck.H"
|
#include "convergenceCheck.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
runTime++;
|
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
|||||||
@ -46,9 +46,6 @@ Usage
|
|||||||
@param -fields \n
|
@param -fields \n
|
||||||
Use existing geometry decomposition and convert fields only.
|
Use existing geometry decomposition and convert fields only.
|
||||||
|
|
||||||
@param -filterPatches \n
|
|
||||||
Remove empty patches when decomposing the geometry.
|
|
||||||
|
|
||||||
@param -force \n
|
@param -force \n
|
||||||
Remove any existing @a processor subdirectories before decomposing the
|
Remove any existing @a processor subdirectories before decomposing the
|
||||||
geometry.
|
geometry.
|
||||||
@ -99,11 +96,6 @@ int main(int argc, char *argv[])
|
|||||||
"use existing geometry decomposition and convert fields only"
|
"use existing geometry decomposition and convert fields only"
|
||||||
);
|
);
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
|
||||||
"filterPatches",
|
|
||||||
"remove empty patches when decomposing the geometry"
|
|
||||||
);
|
|
||||||
argList::addBoolOption
|
|
||||||
(
|
(
|
||||||
"force",
|
"force",
|
||||||
"remove existing processor*/ subdirs before decomposing the geometry"
|
"remove existing processor*/ subdirs before decomposing the geometry"
|
||||||
@ -128,7 +120,6 @@ int main(int argc, char *argv[])
|
|||||||
bool writeCellDist = args.optionFound("cellDist");
|
bool writeCellDist = args.optionFound("cellDist");
|
||||||
bool copyUniform = args.optionFound("copyUniform");
|
bool copyUniform = args.optionFound("copyUniform");
|
||||||
bool decomposeFieldsOnly = args.optionFound("fields");
|
bool decomposeFieldsOnly = args.optionFound("fields");
|
||||||
bool filterPatches = args.optionFound("filterPatches");
|
|
||||||
bool forceOverwrite = args.optionFound("force");
|
bool forceOverwrite = args.optionFound("force");
|
||||||
bool ifRequiredDecomposition = args.optionFound("ifRequired");
|
bool ifRequiredDecomposition = args.optionFound("ifRequired");
|
||||||
|
|
||||||
@ -249,7 +240,7 @@ int main(int argc, char *argv[])
|
|||||||
// Decompose the mesh
|
// Decompose the mesh
|
||||||
if (!decomposeFieldsOnly)
|
if (!decomposeFieldsOnly)
|
||||||
{
|
{
|
||||||
mesh.decomposeMesh(filterPatches);
|
mesh.decomposeMesh();
|
||||||
|
|
||||||
mesh.writeDecomposition();
|
mesh.writeDecomposition();
|
||||||
|
|
||||||
|
|||||||
@ -69,6 +69,24 @@ void Foam::domainDecomposition::mark
|
|||||||
Foam::domainDecomposition::domainDecomposition(const IOobject& io)
|
Foam::domainDecomposition::domainDecomposition(const IOobject& io)
|
||||||
:
|
:
|
||||||
fvMesh(io),
|
fvMesh(io),
|
||||||
|
facesInstancePointsPtr_
|
||||||
|
(
|
||||||
|
pointsInstance() != facesInstance()
|
||||||
|
? new pointIOField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"points",
|
||||||
|
facesInstance(),
|
||||||
|
polyMesh::meshSubDir,
|
||||||
|
*this,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
: NULL
|
||||||
|
),
|
||||||
decompositionDict_
|
decompositionDict_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -86,7 +104,6 @@ Foam::domainDecomposition::domainDecomposition(const IOobject& io)
|
|||||||
procPointAddressing_(nProcs_),
|
procPointAddressing_(nProcs_),
|
||||||
procFaceAddressing_(nProcs_),
|
procFaceAddressing_(nProcs_),
|
||||||
procCellAddressing_(nProcs_),
|
procCellAddressing_(nProcs_),
|
||||||
procBoundaryAddressing_(nProcs_),
|
|
||||||
procPatchSize_(nProcs_),
|
procPatchSize_(nProcs_),
|
||||||
procPatchStartIndex_(nProcs_),
|
procPatchStartIndex_(nProcs_),
|
||||||
procNeighbourProcessors_(nProcs_),
|
procNeighbourProcessors_(nProcs_),
|
||||||
@ -263,24 +280,67 @@ bool Foam::domainDecomposition::writeDecomposition()
|
|||||||
"system",
|
"system",
|
||||||
"constant"
|
"constant"
|
||||||
);
|
);
|
||||||
|
processorDb.setTime(time());
|
||||||
|
|
||||||
// create the mesh
|
// create the mesh. Two situations:
|
||||||
polyMesh procMesh
|
// - points and faces come from the same time ('instance'). The mesh
|
||||||
|
// will get constructed in the same instance.
|
||||||
|
// - points come from a different time (moving mesh cases).
|
||||||
|
// It will read the points belonging to the faces instance and
|
||||||
|
// construct the procMesh with it which then gets handled as above.
|
||||||
|
// (so with 'old' geometry).
|
||||||
|
// Only at writing time will it additionally write the current
|
||||||
|
// points.
|
||||||
|
|
||||||
|
autoPtr<polyMesh> procMeshPtr;
|
||||||
|
|
||||||
|
if (facesInstancePointsPtr_.valid())
|
||||||
|
{
|
||||||
|
// Construct mesh from facesInstance.
|
||||||
|
pointField facesInstancePoints
|
||||||
|
(
|
||||||
|
facesInstancePointsPtr_(),
|
||||||
|
curPointLabels
|
||||||
|
);
|
||||||
|
|
||||||
|
procMeshPtr.reset
|
||||||
|
(
|
||||||
|
new polyMesh
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
this->polyMesh::name(), // region name of undecomposed mesh
|
this->polyMesh::name(), // region of undecomposed mesh
|
||||||
pointsInstance(),
|
facesInstance(),
|
||||||
|
processorDb
|
||||||
|
),
|
||||||
|
xferMove(facesInstancePoints),
|
||||||
|
xferMove(procFaces),
|
||||||
|
xferMove(procCells)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
procMeshPtr.reset
|
||||||
|
(
|
||||||
|
new polyMesh
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
this->polyMesh::name(), // region of undecomposed mesh
|
||||||
|
facesInstance(),
|
||||||
processorDb
|
processorDb
|
||||||
),
|
),
|
||||||
xferMove(procPoints),
|
xferMove(procPoints),
|
||||||
xferMove(procFaces),
|
xferMove(procFaces),
|
||||||
xferMove(procCells)
|
xferMove(procCells)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
polyMesh& procMesh = procMeshPtr();
|
||||||
|
|
||||||
|
|
||||||
// Create processor boundary patches
|
// Create processor boundary patches
|
||||||
const labelList& curBoundaryAddressing = procBoundaryAddressing_[procI];
|
|
||||||
|
|
||||||
const labelList& curPatchSizes = procPatchSize_[procI];
|
const labelList& curPatchSizes = procPatchSize_[procI];
|
||||||
|
|
||||||
const labelList& curPatchStarts = procPatchStartIndex_[procI];
|
const labelList& curPatchStarts = procPatchStartIndex_[procI];
|
||||||
@ -309,8 +369,7 @@ bool Foam::domainDecomposition::writeDecomposition()
|
|||||||
{
|
{
|
||||||
// Get the face labels consistent with the field mapping
|
// Get the face labels consistent with the field mapping
|
||||||
// (reuse the patch field mappers)
|
// (reuse the patch field mappers)
|
||||||
const polyPatch& meshPatch =
|
const polyPatch& meshPatch = meshPatches[patchi];
|
||||||
meshPatches[curBoundaryAddressing[patchi]];
|
|
||||||
|
|
||||||
fvFieldDecomposer::patchFieldDecomposer patchMapper
|
fvFieldDecomposer::patchFieldDecomposer patchMapper
|
||||||
(
|
(
|
||||||
@ -324,8 +383,7 @@ bool Foam::domainDecomposition::writeDecomposition()
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Map existing patches
|
// Map existing patches
|
||||||
procPatches[nPatches] =
|
procPatches[nPatches] = meshPatch.clone
|
||||||
meshPatches[curBoundaryAddressing[patchi]].clone
|
|
||||||
(
|
(
|
||||||
procMesh.boundaryMesh(),
|
procMesh.boundaryMesh(),
|
||||||
nPatches,
|
nPatches,
|
||||||
@ -589,6 +647,26 @@ bool Foam::domainDecomposition::writeDecomposition()
|
|||||||
|
|
||||||
procMesh.write();
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
Info<< endl
|
Info<< endl
|
||||||
<< "Processor " << procI << nl
|
<< "Processor " << procI << nl
|
||||||
<< " Number of cells = " << procMesh.nCells()
|
<< " Number of cells = " << procMesh.nCells()
|
||||||
@ -678,6 +756,16 @@ bool Foam::domainDecomposition::writeDecomposition()
|
|||||||
);
|
);
|
||||||
cellProcAddressing.write();
|
cellProcAddressing.write();
|
||||||
|
|
||||||
|
// Write patch map for backwards compatibility.
|
||||||
|
// (= identity map for original patches, -1 for processor patches)
|
||||||
|
label nMeshPatches = curPatchSizes.size();
|
||||||
|
labelList procBoundaryAddressing(identity(nMeshPatches));
|
||||||
|
procBoundaryAddressing.setSize
|
||||||
|
(
|
||||||
|
nMeshPatches+curProcessorPatchSizes.size(),
|
||||||
|
-1
|
||||||
|
);
|
||||||
|
|
||||||
labelIOList boundaryProcAddressing
|
labelIOList boundaryProcAddressing
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -689,7 +777,7 @@ bool Foam::domainDecomposition::writeDecomposition()
|
|||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
procBoundaryAddressing_[procI]
|
procBoundaryAddressing
|
||||||
);
|
);
|
||||||
boundaryProcAddressing.write();
|
boundaryProcAddressing.write();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,6 +55,9 @@ class domainDecomposition
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
//- Optional: points at the facesInstance
|
||||||
|
autoPtr<pointIOField> facesInstancePointsPtr_;
|
||||||
|
|
||||||
//- Mesh decomposition control dictionary
|
//- Mesh decomposition control dictionary
|
||||||
IOdictionary decompositionDict_;
|
IOdictionary decompositionDict_;
|
||||||
|
|
||||||
@ -83,9 +86,6 @@ class domainDecomposition
|
|||||||
//- Labels of cells for each processor
|
//- Labels of cells for each processor
|
||||||
labelListList procCellAddressing_;
|
labelListList procCellAddressing_;
|
||||||
|
|
||||||
//- Original patch index for every processor patch
|
|
||||||
labelListList procBoundaryAddressing_;
|
|
||||||
|
|
||||||
//- Sizes for processor mesh patches
|
//- Sizes for processor mesh patches
|
||||||
// Excludes inter-processor boundaries
|
// Excludes inter-processor boundaries
|
||||||
labelListList procPatchSize_;
|
labelListList procPatchSize_;
|
||||||
@ -149,8 +149,8 @@ public:
|
|||||||
return distributed_;
|
return distributed_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Decompose mesh. Optionally remove zero-sized patches.
|
//- Decompose mesh.
|
||||||
void decomposeMesh(const bool filterEmptyPatches);
|
void decomposeMesh();
|
||||||
|
|
||||||
//- Write decomposition
|
//- Write decomposition
|
||||||
bool writeDecomposition();
|
bool writeDecomposition();
|
||||||
|
|||||||
@ -40,7 +40,7 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
void Foam::domainDecomposition::decomposeMesh()
|
||||||
{
|
{
|
||||||
// Decide which cell goes to which processor
|
// Decide which cell goes to which processor
|
||||||
distributeCells();
|
distributeCells();
|
||||||
@ -598,64 +598,6 @@ void Foam::domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "\nCalculating processor boundary addressing" << endl;
|
|
||||||
// For every patch of processor boundary, find the index of the original
|
|
||||||
// patch. Mis-alignment is caused by the fact that patches with zero size
|
|
||||||
// are omitted. For processor patches, set index to -1.
|
|
||||||
// At the same time, filter the procPatchSize_ and procPatchStartIndex_
|
|
||||||
// lists to exclude zero-size patches
|
|
||||||
forAll(procPatchSize_, procI)
|
|
||||||
{
|
|
||||||
// Make a local copy of old lists
|
|
||||||
const labelList oldPatchSizes = procPatchSize_[procI];
|
|
||||||
|
|
||||||
const labelList oldPatchStarts = procPatchStartIndex_[procI];
|
|
||||||
|
|
||||||
labelList& curPatchSizes = procPatchSize_[procI];
|
|
||||||
|
|
||||||
labelList& curPatchStarts = procPatchStartIndex_[procI];
|
|
||||||
|
|
||||||
const labelList& curProcessorPatchSizes =
|
|
||||||
procProcessorPatchSize_[procI];
|
|
||||||
|
|
||||||
labelList& curBoundaryAddressing = procBoundaryAddressing_[procI];
|
|
||||||
|
|
||||||
curBoundaryAddressing.setSize
|
|
||||||
(
|
|
||||||
oldPatchSizes.size()
|
|
||||||
+ curProcessorPatchSizes.size()
|
|
||||||
);
|
|
||||||
|
|
||||||
label nPatches = 0;
|
|
||||||
|
|
||||||
forAll(oldPatchSizes, patchi)
|
|
||||||
{
|
|
||||||
if (!filterEmptyPatches || oldPatchSizes[patchi] > 0)
|
|
||||||
{
|
|
||||||
curBoundaryAddressing[nPatches] = patchi;
|
|
||||||
|
|
||||||
curPatchSizes[nPatches] = oldPatchSizes[patchi];
|
|
||||||
|
|
||||||
curPatchStarts[nPatches] = oldPatchStarts[patchi];
|
|
||||||
|
|
||||||
nPatches++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// reset to the size of live patches
|
|
||||||
curPatchSizes.setSize(nPatches);
|
|
||||||
curPatchStarts.setSize(nPatches);
|
|
||||||
|
|
||||||
forAll(curProcessorPatchSizes, procPatchI)
|
|
||||||
{
|
|
||||||
curBoundaryAddressing[nPatches] = -1;
|
|
||||||
|
|
||||||
nPatches++;
|
|
||||||
}
|
|
||||||
|
|
||||||
curBoundaryAddressing.setSize(nPatches);
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "\nDistributing points to processors" << endl;
|
Info<< "\nDistributing points to processors" << endl;
|
||||||
// For every processor, loop through the list of faces for the processor.
|
// For every processor, loop through the list of faces for the processor.
|
||||||
// For every face, loop through the list of points and mark the point as
|
// For every face, loop through the list of points and mark the point as
|
||||||
|
|||||||
@ -35,6 +35,10 @@ License
|
|||||||
#include "IOmanip.H"
|
#include "IOmanip.H"
|
||||||
#include "itoa.H"
|
#include "itoa.H"
|
||||||
#include "ensightWriteBinary.H"
|
#include "ensightWriteBinary.H"
|
||||||
|
#include "globalIndex.H"
|
||||||
|
#include "PackedBoolList.H"
|
||||||
|
#include "mapDistribute.H"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Functions * * * * * * * * * * * * * * //
|
||||||
@ -106,7 +110,8 @@ Foam::ensightMesh::ensightMesh
|
|||||||
{
|
{
|
||||||
allPatchNames_ = wordList::subList
|
allPatchNames_ = wordList::subList
|
||||||
(
|
(
|
||||||
mesh_.boundaryMesh().names(), mesh_.boundary().size()
|
mesh_.boundaryMesh().names(),
|
||||||
|
mesh_.boundary().size()
|
||||||
- mesh_.globalData().processorPatches().size()
|
- mesh_.globalData().processorPatches().size()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -295,6 +300,114 @@ Foam::ensightMesh::~ensightMesh()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::globalIndex Foam::ensightMesh::mergeMeshPoints
|
||||||
|
(
|
||||||
|
labelList& pointToGlobal,
|
||||||
|
pointField& uniquePoints
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const globalMeshData& globalData = mesh_.globalData();
|
||||||
|
const indirectPrimitivePatch& coupledPatch = globalData.coupledPatch();
|
||||||
|
const labelListList& globalPointSlaves =
|
||||||
|
globalData.globalPointSlaves();
|
||||||
|
const mapDistribute& globalPointSlavesMap =
|
||||||
|
globalData.globalPointSlavesMap();
|
||||||
|
|
||||||
|
|
||||||
|
// 1. Count number of masters on my processor.
|
||||||
|
label nCoupledMaster = 0;
|
||||||
|
PackedBoolList isMaster(mesh_.nPoints(), 1);
|
||||||
|
forAll(globalPointSlaves, pointI)
|
||||||
|
{
|
||||||
|
const labelList& slavePoints = globalPointSlaves[pointI];
|
||||||
|
|
||||||
|
if (slavePoints.size() > 0)
|
||||||
|
{
|
||||||
|
nCoupledMaster++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isMaster[coupledPatch.meshPoints()[pointI]] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
label myUniquePoints =
|
||||||
|
mesh_.nPoints()
|
||||||
|
- coupledPatch.nPoints()
|
||||||
|
+ nCoupledMaster;
|
||||||
|
|
||||||
|
//Pout<< "Points :" << nl
|
||||||
|
// << " mesh : " << mesh_.nPoints() << nl
|
||||||
|
// << " of which coupled : " << coupledPatch.nPoints() << nl
|
||||||
|
// << " of which master : " << nCoupledMaster << nl
|
||||||
|
// << endl;
|
||||||
|
|
||||||
|
|
||||||
|
// 2. Create global indexing for unique points.
|
||||||
|
globalIndex globalPoints(myUniquePoints);
|
||||||
|
|
||||||
|
|
||||||
|
// 3. Assign global point numbers. Keep slaves unset.
|
||||||
|
pointToGlobal.setSize(mesh_.nPoints());
|
||||||
|
pointToGlobal = -1;
|
||||||
|
uniquePoints.setSize(myUniquePoints);
|
||||||
|
label nMaster = 0;
|
||||||
|
|
||||||
|
forAll(isMaster, meshPointI)
|
||||||
|
{
|
||||||
|
if (isMaster[meshPointI])
|
||||||
|
{
|
||||||
|
pointToGlobal[meshPointI] = globalPoints.toGlobal(nMaster);
|
||||||
|
uniquePoints[nMaster] = mesh_.points()[meshPointI];
|
||||||
|
nMaster++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 4. Push global index for coupled points to slaves.
|
||||||
|
{
|
||||||
|
labelList masterToGlobal(globalPointSlavesMap.constructSize(), -1);
|
||||||
|
|
||||||
|
forAll(globalPointSlaves, pointI)
|
||||||
|
{
|
||||||
|
const labelList& slaves = globalPointSlaves[pointI];
|
||||||
|
|
||||||
|
if (slaves.size() > 0)
|
||||||
|
{
|
||||||
|
// Duplicate master globalpoint into slave slots
|
||||||
|
label meshPointI = coupledPatch.meshPoints()[pointI];
|
||||||
|
masterToGlobal[pointI] = pointToGlobal[meshPointI];
|
||||||
|
forAll(slaves, i)
|
||||||
|
{
|
||||||
|
masterToGlobal[slaves[i]] = masterToGlobal[pointI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send back
|
||||||
|
globalPointSlavesMap.reverseDistribute
|
||||||
|
(
|
||||||
|
coupledPatch.nPoints(),
|
||||||
|
masterToGlobal
|
||||||
|
);
|
||||||
|
|
||||||
|
// On slave copy master index into overall map.
|
||||||
|
forAll(globalPointSlaves, pointI)
|
||||||
|
{
|
||||||
|
const labelList& slaves = globalPointSlaves[pointI];
|
||||||
|
|
||||||
|
if (slaves.size() == 0)
|
||||||
|
{
|
||||||
|
label meshPointI = coupledPatch.meshPoints()[pointI];
|
||||||
|
pointToGlobal[meshPointI] = masterToGlobal[pointI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return globalPoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::ensightMesh::writePoints
|
void Foam::ensightMesh::writePoints
|
||||||
(
|
(
|
||||||
const scalarField& pointsComponent,
|
const scalarField& pointsComponent,
|
||||||
@ -311,7 +424,8 @@ void Foam::ensightMesh::writePoints
|
|||||||
Foam::cellShapeList Foam::ensightMesh::map
|
Foam::cellShapeList Foam::ensightMesh::map
|
||||||
(
|
(
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const labelList& prims
|
const labelList& prims,
|
||||||
|
const labelList& pointToGlobal
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
cellShapeList mcsl(prims.size());
|
cellShapeList mcsl(prims.size());
|
||||||
@ -319,6 +433,7 @@ Foam::cellShapeList Foam::ensightMesh::map
|
|||||||
forAll(prims, i)
|
forAll(prims, i)
|
||||||
{
|
{
|
||||||
mcsl[i] = cellShapes[prims[i]];
|
mcsl[i] = cellShapes[prims[i]];
|
||||||
|
inplaceRenumber(pointToGlobal, mcsl[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return mcsl;
|
return mcsl;
|
||||||
@ -329,7 +444,8 @@ Foam::cellShapeList Foam::ensightMesh::map
|
|||||||
(
|
(
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const labelList& hexes,
|
const labelList& hexes,
|
||||||
const labelList& wedges
|
const labelList& wedges,
|
||||||
|
const labelList& pointToGlobal
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
cellShapeList mcsl(hexes.size() + wedges.size());
|
cellShapeList mcsl(hexes.size() + wedges.size());
|
||||||
@ -337,6 +453,7 @@ Foam::cellShapeList Foam::ensightMesh::map
|
|||||||
forAll(hexes, i)
|
forAll(hexes, i)
|
||||||
{
|
{
|
||||||
mcsl[i] = cellShapes[hexes[i]];
|
mcsl[i] = cellShapes[hexes[i]];
|
||||||
|
inplaceRenumber(pointToGlobal, mcsl[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
label offset = hexes.size();
|
label offset = hexes.size();
|
||||||
@ -358,6 +475,7 @@ Foam::cellShapeList Foam::ensightMesh::map
|
|||||||
hexLabels[7] = cellPoints[5];
|
hexLabels[7] = cellPoints[5];
|
||||||
|
|
||||||
mcsl[i + offset] = cellShape(hex, hexLabels);
|
mcsl[i + offset] = cellShape(hex, hexLabels);
|
||||||
|
inplaceRenumber(pointToGlobal, mcsl[i + offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return mcsl;
|
return mcsl;
|
||||||
@ -367,19 +485,18 @@ Foam::cellShapeList Foam::ensightMesh::map
|
|||||||
void Foam::ensightMesh::writePrims
|
void Foam::ensightMesh::writePrims
|
||||||
(
|
(
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const label pointOffset,
|
|
||||||
OFstream& ensightGeometryFile
|
OFstream& ensightGeometryFile
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label po = pointOffset + 1;
|
|
||||||
|
|
||||||
forAll(cellShapes, i)
|
forAll(cellShapes, i)
|
||||||
{
|
{
|
||||||
const cellShape& cellPoints = cellShapes[i];
|
const cellShape& cellPoints = cellShapes[i];
|
||||||
|
|
||||||
forAll(cellPoints, pointI)
|
forAll(cellPoints, pointI)
|
||||||
{
|
{
|
||||||
ensightGeometryFile<< setw(10) << cellPoints[pointI] + po;
|
ensightGeometryFile
|
||||||
|
<< setw(10)
|
||||||
|
<< cellPoints[pointI] + 1;
|
||||||
}
|
}
|
||||||
ensightGeometryFile << nl;
|
ensightGeometryFile << nl;
|
||||||
}
|
}
|
||||||
@ -389,12 +506,9 @@ void Foam::ensightMesh::writePrims
|
|||||||
void Foam::ensightMesh::writePrimsBinary
|
void Foam::ensightMesh::writePrimsBinary
|
||||||
(
|
(
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const label pointOffset,
|
|
||||||
std::ofstream& ensightGeometryFile
|
std::ofstream& ensightGeometryFile
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label po = pointOffset + 1;
|
|
||||||
|
|
||||||
// Create a temp int array
|
// Create a temp int array
|
||||||
int numElem;
|
int numElem;
|
||||||
|
|
||||||
@ -414,7 +528,7 @@ void Foam::ensightMesh::writePrimsBinary
|
|||||||
|
|
||||||
forAll(cellPoints, pointI)
|
forAll(cellPoints, pointI)
|
||||||
{
|
{
|
||||||
temp[n] = cellPoints[pointI] + po;
|
temp[n] = cellPoints[pointI] + 1;
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -469,12 +583,9 @@ void Foam::ensightMesh::writePolysPoints
|
|||||||
const labelList& polys,
|
const labelList& polys,
|
||||||
const cellList& cellFaces,
|
const cellList& cellFaces,
|
||||||
const faceList& faces,
|
const faceList& faces,
|
||||||
const label pointOffset,
|
|
||||||
OFstream& ensightGeometryFile
|
OFstream& ensightGeometryFile
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label po = pointOffset + 1;
|
|
||||||
|
|
||||||
forAll(polys, i)
|
forAll(polys, i)
|
||||||
{
|
{
|
||||||
const labelList& cf = cellFaces[polys[i]];
|
const labelList& cf = cellFaces[polys[i]];
|
||||||
@ -485,7 +596,7 @@ void Foam::ensightMesh::writePolysPoints
|
|||||||
|
|
||||||
forAll(f, pointI)
|
forAll(f, pointI)
|
||||||
{
|
{
|
||||||
ensightGeometryFile << setw(10) << f[pointI] + po;
|
ensightGeometryFile << setw(10) << f[pointI] + 1;
|
||||||
}
|
}
|
||||||
ensightGeometryFile << nl;
|
ensightGeometryFile << nl;
|
||||||
}
|
}
|
||||||
@ -495,14 +606,19 @@ void Foam::ensightMesh::writePolysPoints
|
|||||||
|
|
||||||
void Foam::ensightMesh::writeAllPolys
|
void Foam::ensightMesh::writeAllPolys
|
||||||
(
|
(
|
||||||
const labelList& pointOffsets,
|
const labelList& pointToGlobal,
|
||||||
OFstream& ensightGeometryFile
|
OFstream& ensightGeometryFile
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (meshCellSets_.nPolys)
|
if (meshCellSets_.nPolys)
|
||||||
{
|
{
|
||||||
const cellList& cellFaces = mesh_.cells();
|
const cellList& cellFaces = mesh_.cells();
|
||||||
const faceList& faces = mesh_.faces();
|
// Renumber faces to use global point numbers
|
||||||
|
faceList faces(mesh_.faces());
|
||||||
|
forAll(faces, i)
|
||||||
|
{
|
||||||
|
inplaceRenumber(pointToGlobal, faces[i]);
|
||||||
|
}
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
@ -541,6 +657,7 @@ void Foam::ensightMesh::writeAllPolys
|
|||||||
toMaster<< meshCellSets_.polys << cellFaces;
|
toMaster<< meshCellSets_.polys << cellFaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Number of points for each face of the above list
|
// Number of points for each face of the above list
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
@ -584,7 +701,6 @@ void Foam::ensightMesh::writeAllPolys
|
|||||||
meshCellSets_.polys,
|
meshCellSets_.polys,
|
||||||
cellFaces,
|
cellFaces,
|
||||||
faces,
|
faces,
|
||||||
0,
|
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
// Slaves
|
// Slaves
|
||||||
@ -600,7 +716,6 @@ void Foam::ensightMesh::writeAllPolys
|
|||||||
polys,
|
polys,
|
||||||
cellFaces,
|
cellFaces,
|
||||||
faces,
|
faces,
|
||||||
pointOffsets[slave-1],
|
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -661,12 +776,9 @@ void Foam::ensightMesh::writePolysPointsBinary
|
|||||||
const labelList& polys,
|
const labelList& polys,
|
||||||
const cellList& cellFaces,
|
const cellList& cellFaces,
|
||||||
const faceList& faces,
|
const faceList& faces,
|
||||||
const label pointOffset,
|
|
||||||
std::ofstream& ensightGeometryFile
|
std::ofstream& ensightGeometryFile
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label po = pointOffset + 1;
|
|
||||||
|
|
||||||
forAll(polys, i)
|
forAll(polys, i)
|
||||||
{
|
{
|
||||||
const labelList& cf = cellFaces[polys[i]];
|
const labelList& cf = cellFaces[polys[i]];
|
||||||
@ -677,7 +789,7 @@ void Foam::ensightMesh::writePolysPointsBinary
|
|||||||
|
|
||||||
forAll(f, pointI)
|
forAll(f, pointI)
|
||||||
{
|
{
|
||||||
writeEnsDataBinary(f[pointI] + po,ensightGeometryFile);
|
writeEnsDataBinary(f[pointI] + 1,ensightGeometryFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -686,14 +798,19 @@ void Foam::ensightMesh::writePolysPointsBinary
|
|||||||
|
|
||||||
void Foam::ensightMesh::writeAllPolysBinary
|
void Foam::ensightMesh::writeAllPolysBinary
|
||||||
(
|
(
|
||||||
const labelList& pointOffsets,
|
const labelList& pointToGlobal,
|
||||||
std::ofstream& ensightGeometryFile
|
std::ofstream& ensightGeometryFile
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (meshCellSets_.nPolys)
|
if (meshCellSets_.nPolys)
|
||||||
{
|
{
|
||||||
const cellList& cellFaces = mesh_.cells();
|
const cellList& cellFaces = mesh_.cells();
|
||||||
const faceList& faces = mesh_.faces();
|
// Renumber faces to use global point numbers
|
||||||
|
faceList faces(mesh_.faces());
|
||||||
|
forAll(faces, i)
|
||||||
|
{
|
||||||
|
inplaceRenumber(pointToGlobal, faces[i]);
|
||||||
|
}
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
@ -775,7 +892,6 @@ void Foam::ensightMesh::writeAllPolysBinary
|
|||||||
meshCellSets_.polys,
|
meshCellSets_.polys,
|
||||||
cellFaces,
|
cellFaces,
|
||||||
faces,
|
faces,
|
||||||
0,
|
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
// Slaves
|
// Slaves
|
||||||
@ -791,7 +907,6 @@ void Foam::ensightMesh::writeAllPolysBinary
|
|||||||
polys,
|
polys,
|
||||||
cellFaces,
|
cellFaces,
|
||||||
faces,
|
faces,
|
||||||
pointOffsets[slave-1],
|
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -810,7 +925,6 @@ void Foam::ensightMesh::writeAllPrims
|
|||||||
const char* key,
|
const char* key,
|
||||||
const label nPrims,
|
const label nPrims,
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const labelList& pointOffsets,
|
|
||||||
OFstream& ensightGeometryFile
|
OFstream& ensightGeometryFile
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -820,19 +934,14 @@ void Foam::ensightMesh::writeAllPrims
|
|||||||
{
|
{
|
||||||
ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
|
ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
|
||||||
|
|
||||||
writePrims(cellShapes, 0, ensightGeometryFile);
|
writePrims(cellShapes, ensightGeometryFile);
|
||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
IPstream fromSlave(Pstream::scheduled, slave);
|
||||||
cellShapeList cellShapes(fromSlave);
|
cellShapeList cellShapes(fromSlave);
|
||||||
|
|
||||||
writePrims
|
writePrims(cellShapes, ensightGeometryFile);
|
||||||
(
|
|
||||||
cellShapes,
|
|
||||||
pointOffsets[slave-1],
|
|
||||||
ensightGeometryFile
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -849,7 +958,6 @@ void Foam::ensightMesh::writeAllPrimsBinary
|
|||||||
const char* key,
|
const char* key,
|
||||||
const label nPrims,
|
const label nPrims,
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const labelList& pointOffsets,
|
|
||||||
std::ofstream& ensightGeometryFile
|
std::ofstream& ensightGeometryFile
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -860,19 +968,14 @@ void Foam::ensightMesh::writeAllPrimsBinary
|
|||||||
writeEnsDataBinary(key,ensightGeometryFile);
|
writeEnsDataBinary(key,ensightGeometryFile);
|
||||||
writeEnsDataBinary(nPrims,ensightGeometryFile);
|
writeEnsDataBinary(nPrims,ensightGeometryFile);
|
||||||
|
|
||||||
writePrimsBinary(cellShapes, 0, ensightGeometryFile);
|
writePrimsBinary(cellShapes, ensightGeometryFile);
|
||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
IPstream fromSlave(Pstream::scheduled, slave);
|
||||||
cellShapeList cellShapes(fromSlave);
|
cellShapeList cellShapes(fromSlave);
|
||||||
|
|
||||||
writePrimsBinary
|
writePrimsBinary(cellShapes, ensightGeometryFile);
|
||||||
(
|
|
||||||
cellShapes,
|
|
||||||
pointOffsets[slave-1],
|
|
||||||
ensightGeometryFile
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -926,34 +1029,13 @@ void Foam::ensightMesh::writeFacePrimsBinary
|
|||||||
|
|
||||||
forAll(patchFace, pointI)
|
forAll(patchFace, pointI)
|
||||||
{
|
{
|
||||||
writeEnsDataBinary
|
writeEnsDataBinary(patchFace[pointI] + po, ensightGeometryFile);
|
||||||
(
|
|
||||||
patchFace[pointI] + po,
|
|
||||||
ensightGeometryFile
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::faceList Foam::ensightMesh::map
|
|
||||||
(
|
|
||||||
const faceList& patchFaces,
|
|
||||||
const labelList& prims
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
faceList ppf(prims.size());
|
|
||||||
|
|
||||||
forAll(prims, i)
|
|
||||||
{
|
|
||||||
ppf[i] = patchFaces[prims[i]];
|
|
||||||
}
|
|
||||||
|
|
||||||
return ppf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::ensightMesh::writeAllFacePrims
|
void Foam::ensightMesh::writeAllFacePrims
|
||||||
(
|
(
|
||||||
const char* key,
|
const char* key,
|
||||||
@ -975,7 +1057,7 @@ void Foam::ensightMesh::writeAllFacePrims
|
|||||||
{
|
{
|
||||||
writeFacePrims
|
writeFacePrims
|
||||||
(
|
(
|
||||||
map(patchFaces, prims),
|
UIndirectList<face>(patchFaces, prims)(),
|
||||||
0,
|
0,
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
@ -1001,7 +1083,7 @@ void Foam::ensightMesh::writeAllFacePrims
|
|||||||
else if (&prims != NULL)
|
else if (&prims != NULL)
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster<< map(patchFaces, prims);
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1015,8 +1097,7 @@ void Foam::ensightMesh::writeNSidedNPointsPerFace
|
|||||||
{
|
{
|
||||||
forAll(patchFaces, i)
|
forAll(patchFaces, i)
|
||||||
{
|
{
|
||||||
ensightGeometryFile
|
ensightGeometryFile << setw(10) << patchFaces[i].size() << nl;
|
||||||
<< setw(10) << patchFaces[i].size() << nl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1028,12 +1109,7 @@ void Foam::ensightMesh::writeNSidedPoints
|
|||||||
OFstream& ensightGeometryFile
|
OFstream& ensightGeometryFile
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
writeFacePrims
|
writeFacePrims(patchFaces, pointOffset, ensightGeometryFile);
|
||||||
(
|
|
||||||
patchFaces,
|
|
||||||
pointOffset,
|
|
||||||
ensightGeometryFile
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1062,7 +1138,7 @@ void Foam::ensightMesh::writeAllNSided
|
|||||||
{
|
{
|
||||||
writeNSidedNPointsPerFace
|
writeNSidedNPointsPerFace
|
||||||
(
|
(
|
||||||
map(patchFaces, prims),
|
UIndirectList<face>(patchFaces, prims)(),
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1086,7 +1162,7 @@ void Foam::ensightMesh::writeAllNSided
|
|||||||
else if (&prims != NULL)
|
else if (&prims != NULL)
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster<< map(patchFaces, prims);
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of points id for each face
|
// List of points id for each face
|
||||||
@ -1096,7 +1172,7 @@ void Foam::ensightMesh::writeAllNSided
|
|||||||
{
|
{
|
||||||
writeNSidedPoints
|
writeNSidedPoints
|
||||||
(
|
(
|
||||||
map(patchFaces, prims),
|
UIndirectList<face>(patchFaces, prims)(),
|
||||||
0,
|
0,
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
@ -1122,7 +1198,7 @@ void Foam::ensightMesh::writeAllNSided
|
|||||||
else if (&prims != NULL)
|
else if (&prims != NULL)
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster<< map(patchFaces, prims);
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1186,7 +1262,7 @@ void Foam::ensightMesh::writeAllNSidedBinary
|
|||||||
{
|
{
|
||||||
writeNSidedNPointsPerFaceBinary
|
writeNSidedNPointsPerFaceBinary
|
||||||
(
|
(
|
||||||
map(patchFaces, prims),
|
UIndirectList<face>(patchFaces, prims)(),
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1210,7 +1286,7 @@ void Foam::ensightMesh::writeAllNSidedBinary
|
|||||||
else if (&prims != NULL)
|
else if (&prims != NULL)
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster<< map(patchFaces, prims);
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of points id for each face
|
// List of points id for each face
|
||||||
@ -1220,7 +1296,7 @@ void Foam::ensightMesh::writeAllNSidedBinary
|
|||||||
{
|
{
|
||||||
writeNSidedPointsBinary
|
writeNSidedPointsBinary
|
||||||
(
|
(
|
||||||
map(patchFaces, prims),
|
UIndirectList<face>(patchFaces, prims)(),
|
||||||
0,
|
0,
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
@ -1246,7 +1322,7 @@ void Foam::ensightMesh::writeAllNSidedBinary
|
|||||||
else if (&prims != NULL)
|
else if (&prims != NULL)
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster<< map(patchFaces, prims);
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1274,7 +1350,7 @@ void Foam::ensightMesh::writeAllFacePrimsBinary
|
|||||||
{
|
{
|
||||||
writeFacePrimsBinary
|
writeFacePrimsBinary
|
||||||
(
|
(
|
||||||
map(patchFaces, prims),
|
UIndirectList<face>(patchFaces, prims)(),
|
||||||
0,
|
0,
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
@ -1300,7 +1376,7 @@ void Foam::ensightMesh::writeAllFacePrimsBinary
|
|||||||
else if (&prims != NULL)
|
else if (&prims != NULL)
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster<< map(patchFaces, prims);
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1334,9 +1410,22 @@ void Foam::ensightMesh::writeAscii
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const Time& runTime = mesh_.time();
|
const Time& runTime = mesh_.time();
|
||||||
const pointField& points = mesh_.points();
|
//const pointField& points = mesh_.points();
|
||||||
const cellShapeList& cellShapes = mesh_.cellShapes();
|
const cellShapeList& cellShapes = mesh_.cellShapes();
|
||||||
|
|
||||||
|
// Find global point numbering
|
||||||
|
labelList pointToGlobal;
|
||||||
|
pointField uniquePoints;
|
||||||
|
globalIndex globalPoints
|
||||||
|
(
|
||||||
|
mergeMeshPoints
|
||||||
|
(
|
||||||
|
pointToGlobal,
|
||||||
|
uniquePoints
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
word timeFile = prepend;
|
word timeFile = prepend;
|
||||||
|
|
||||||
if (timeIndex == 0)
|
if (timeIndex == 0)
|
||||||
@ -1382,12 +1471,9 @@ void Foam::ensightMesh::writeAscii
|
|||||||
<< "element id assign" << nl;
|
<< "element id assign" << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList pointOffsets(Pstream::nProcs(), 0);
|
|
||||||
|
|
||||||
if (patchNames_.empty())
|
if (patchNames_.empty())
|
||||||
{
|
{
|
||||||
label nPoints = points.size();
|
label nPoints = globalPoints.size();
|
||||||
Pstream::gather(nPoints, sumOp<label>());
|
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
@ -1401,17 +1487,13 @@ void Foam::ensightMesh::writeAscii
|
|||||||
|
|
||||||
for (direction d=0; d<vector::nComponents; d++)
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
{
|
{
|
||||||
writePoints(points.component(d), ensightGeometryFile);
|
writePoints(uniquePoints.component(d), ensightGeometryFile);
|
||||||
pointOffsets[0] = points.size();
|
|
||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
IPstream fromSlave(Pstream::scheduled, slave);
|
||||||
scalarField pointsComponent(fromSlave);
|
scalarField pointsComponent(fromSlave);
|
||||||
writePoints(pointsComponent, ensightGeometryFile);
|
writePoints(pointsComponent, ensightGeometryFile);
|
||||||
pointOffsets[slave] =
|
|
||||||
pointOffsets[slave-1]
|
|
||||||
+ pointsComponent.size();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1420,16 +1502,22 @@ void Foam::ensightMesh::writeAscii
|
|||||||
for (direction d=0; d<vector::nComponents; d++)
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster<< points.component(d);
|
toMaster<< uniquePoints.component(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
writeAllPrims
|
writeAllPrims
|
||||||
(
|
(
|
||||||
"hexa8",
|
"hexa8",
|
||||||
meshCellSets_.nHexesWedges,
|
meshCellSets_.nHexesWedges,
|
||||||
map(cellShapes, meshCellSets_.hexes, meshCellSets_.wedges),
|
map // Rewrite cellShapes to global numbering
|
||||||
pointOffsets,
|
(
|
||||||
|
cellShapes,
|
||||||
|
meshCellSets_.hexes,
|
||||||
|
meshCellSets_.wedges,
|
||||||
|
pointToGlobal
|
||||||
|
),
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1437,8 +1525,7 @@ void Foam::ensightMesh::writeAscii
|
|||||||
(
|
(
|
||||||
"penta6",
|
"penta6",
|
||||||
meshCellSets_.nPrisms,
|
meshCellSets_.nPrisms,
|
||||||
map(cellShapes, meshCellSets_.prisms),
|
map(cellShapes, meshCellSets_.prisms, pointToGlobal),
|
||||||
pointOffsets,
|
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1446,8 +1533,7 @@ void Foam::ensightMesh::writeAscii
|
|||||||
(
|
(
|
||||||
"pyramid5",
|
"pyramid5",
|
||||||
meshCellSets_.nPyrs,
|
meshCellSets_.nPyrs,
|
||||||
map(cellShapes, meshCellSets_.pyrs),
|
map(cellShapes, meshCellSets_.pyrs, pointToGlobal),
|
||||||
pointOffsets,
|
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1455,14 +1541,13 @@ void Foam::ensightMesh::writeAscii
|
|||||||
(
|
(
|
||||||
"tetra4",
|
"tetra4",
|
||||||
meshCellSets_.nTets,
|
meshCellSets_.nTets,
|
||||||
map(cellShapes, meshCellSets_.tets),
|
map(cellShapes, meshCellSets_.tets, pointToGlobal),
|
||||||
pointOffsets,
|
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
|
|
||||||
writeAllPolys
|
writeAllPolys
|
||||||
(
|
(
|
||||||
pointOffsets,
|
pointToGlobal,
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1498,14 +1583,14 @@ void Foam::ensightMesh::writeAscii
|
|||||||
patchFacesPtr = &(p.localFaces());
|
patchFacesPtr = &(p.localFaces());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nfp.nTris || nfp.nQuads || nfp.nPolys)
|
||||||
|
{
|
||||||
const labelList& tris = *trisPtr;
|
const labelList& tris = *trisPtr;
|
||||||
const labelList& quads = *quadsPtr;
|
const labelList& quads = *quadsPtr;
|
||||||
const labelList& polys = *polysPtr;
|
const labelList& polys = *polysPtr;
|
||||||
const pointField& patchPoints = *patchPointsPtr;
|
const pointField& patchPoints = *patchPointsPtr;
|
||||||
const faceList& patchFaces = *patchFacesPtr;
|
const faceList& patchFaces = *patchFacesPtr;
|
||||||
|
|
||||||
if (nfp.nTris || nfp.nQuads || nfp.nPolys)
|
|
||||||
{
|
|
||||||
labelList patchPointOffsets(Pstream::nProcs(), 0);
|
labelList patchPointOffsets(Pstream::nProcs(), 0);
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
@ -1627,10 +1712,21 @@ void Foam::ensightMesh::writeBinary
|
|||||||
Ostream& ensightCaseFile
|
Ostream& ensightCaseFile
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
//const Time& runTime = mesh.time();
|
|
||||||
const pointField& points = mesh_.points();
|
|
||||||
const cellShapeList& cellShapes = mesh_.cellShapes();
|
const cellShapeList& cellShapes = mesh_.cellShapes();
|
||||||
|
|
||||||
|
// Find global point numbering
|
||||||
|
labelList pointToGlobal;
|
||||||
|
pointField uniquePoints;
|
||||||
|
globalIndex globalPoints
|
||||||
|
(
|
||||||
|
mergeMeshPoints
|
||||||
|
(
|
||||||
|
pointToGlobal,
|
||||||
|
uniquePoints
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
word timeFile = prepend;
|
word timeFile = prepend;
|
||||||
|
|
||||||
if (timeIndex == 0)
|
if (timeIndex == 0)
|
||||||
@ -1668,12 +1764,10 @@ void Foam::ensightMesh::writeBinary
|
|||||||
writeEnsDataBinary("element id assign", ensightGeometryFile);
|
writeEnsDataBinary("element id assign", ensightGeometryFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList pointOffsets(Pstream::nProcs(), 0);
|
|
||||||
|
|
||||||
if (patchNames_.empty())
|
if (patchNames_.empty())
|
||||||
{
|
{
|
||||||
label nPoints = points.size();
|
label nPoints = globalPoints.size();
|
||||||
Pstream::gather(nPoints, sumOp<label>());
|
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
@ -1685,19 +1779,17 @@ void Foam::ensightMesh::writeBinary
|
|||||||
|
|
||||||
for (direction d=0; d<vector::nComponents; d++)
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
{
|
{
|
||||||
//writePointsBinary(points.component(d), ensightGeometryFile);
|
writeEnsDataBinary
|
||||||
writeEnsDataBinary(points.component(d), ensightGeometryFile);
|
(
|
||||||
pointOffsets[0] = points.size();
|
uniquePoints.component(d),
|
||||||
|
ensightGeometryFile
|
||||||
|
);
|
||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
IPstream fromSlave(Pstream::scheduled, slave);
|
||||||
scalarField pointsComponent(fromSlave);
|
scalarField pointsComponent(fromSlave);
|
||||||
//writePointsBinary(pointsComponent, ensightGeometryFile);
|
|
||||||
writeEnsDataBinary(pointsComponent, ensightGeometryFile);
|
writeEnsDataBinary(pointsComponent, ensightGeometryFile);
|
||||||
pointOffsets[slave] =
|
|
||||||
pointOffsets[slave-1]
|
|
||||||
+ pointsComponent.size();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1706,7 +1798,7 @@ void Foam::ensightMesh::writeBinary
|
|||||||
for (direction d=0; d<vector::nComponents; d++)
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster<< points.component(d);
|
toMaster<< uniquePoints.component(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1714,8 +1806,13 @@ void Foam::ensightMesh::writeBinary
|
|||||||
(
|
(
|
||||||
"hexa8",
|
"hexa8",
|
||||||
meshCellSets_.nHexesWedges,
|
meshCellSets_.nHexesWedges,
|
||||||
map(cellShapes, meshCellSets_.hexes, meshCellSets_.wedges),
|
map // Rewrite cellShapes to global numbering
|
||||||
pointOffsets,
|
(
|
||||||
|
cellShapes,
|
||||||
|
meshCellSets_.hexes,
|
||||||
|
meshCellSets_.wedges,
|
||||||
|
pointToGlobal
|
||||||
|
),
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1723,8 +1820,7 @@ void Foam::ensightMesh::writeBinary
|
|||||||
(
|
(
|
||||||
"penta6",
|
"penta6",
|
||||||
meshCellSets_.nPrisms,
|
meshCellSets_.nPrisms,
|
||||||
map(cellShapes, meshCellSets_.prisms),
|
map(cellShapes, meshCellSets_.prisms, pointToGlobal),
|
||||||
pointOffsets,
|
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1732,8 +1828,7 @@ void Foam::ensightMesh::writeBinary
|
|||||||
(
|
(
|
||||||
"pyramid5",
|
"pyramid5",
|
||||||
meshCellSets_.nPyrs,
|
meshCellSets_.nPyrs,
|
||||||
map(cellShapes, meshCellSets_.pyrs),
|
map(cellShapes, meshCellSets_.pyrs, pointToGlobal),
|
||||||
pointOffsets,
|
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1741,17 +1836,15 @@ void Foam::ensightMesh::writeBinary
|
|||||||
(
|
(
|
||||||
"tetra4",
|
"tetra4",
|
||||||
meshCellSets_.nTets,
|
meshCellSets_.nTets,
|
||||||
map(cellShapes, meshCellSets_.tets),
|
map(cellShapes, meshCellSets_.tets, pointToGlobal),
|
||||||
pointOffsets,
|
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
|
|
||||||
writeAllPolysBinary
|
writeAllPolysBinary
|
||||||
(
|
(
|
||||||
pointOffsets,
|
pointToGlobal,
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
label ensightPatchI = patchPartOffset_;
|
label ensightPatchI = patchPartOffset_;
|
||||||
@ -1786,14 +1879,14 @@ void Foam::ensightMesh::writeBinary
|
|||||||
patchFacesPtr = &(p.localFaces());
|
patchFacesPtr = &(p.localFaces());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nfp.nTris || nfp.nQuads || nfp.nPolys)
|
||||||
|
{
|
||||||
const labelList& tris = *trisPtr;
|
const labelList& tris = *trisPtr;
|
||||||
const labelList& quads = *quadsPtr;
|
const labelList& quads = *quadsPtr;
|
||||||
const labelList& polys = *polysPtr;
|
const labelList& polys = *polysPtr;
|
||||||
const pointField& patchPoints = *patchPointsPtr;
|
const pointField& patchPoints = *patchPointsPtr;
|
||||||
const faceList& patchFaces = *patchFacesPtr;
|
const faceList& patchFaces = *patchFacesPtr;
|
||||||
|
|
||||||
if (nfp.nTris || nfp.nQuads || nfp.nPolys)
|
|
||||||
{
|
|
||||||
labelList patchPointOffsets(Pstream::nProcs(), 0);
|
labelList patchPointOffsets(Pstream::nProcs(), 0);
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
|
|||||||
@ -42,6 +42,7 @@ SourceFiles
|
|||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include "globalIndex.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -110,6 +111,16 @@ private:
|
|||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const ensightMesh&);
|
void operator=(const ensightMesh&);
|
||||||
|
|
||||||
|
|
||||||
|
//- Construct map from mesh points to merged points.
|
||||||
|
// pointToGlobal : from mesh point to global point
|
||||||
|
// uniquePoints : my set of unique points
|
||||||
|
globalIndex mergeMeshPoints
|
||||||
|
(
|
||||||
|
labelList& pointToGlobal,
|
||||||
|
pointField& uniquePoints
|
||||||
|
) const;
|
||||||
|
|
||||||
void writePoints
|
void writePoints
|
||||||
(
|
(
|
||||||
const scalarField& pointsComponent,
|
const scalarField& pointsComponent,
|
||||||
@ -119,20 +130,21 @@ private:
|
|||||||
cellShapeList map
|
cellShapeList map
|
||||||
(
|
(
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const labelList& prims
|
const labelList& prims,
|
||||||
|
const labelList& pointToGlobal
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
cellShapeList map
|
cellShapeList map
|
||||||
(
|
(
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const labelList& hexes,
|
const labelList& hexes,
|
||||||
const labelList& wedges
|
const labelList& wedges,
|
||||||
|
const labelList& pointToGlobal
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
void writePrims
|
void writePrims
|
||||||
(
|
(
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const label pointOffset,
|
|
||||||
OFstream& ensightGeometryFile
|
OFstream& ensightGeometryFile
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -156,13 +168,12 @@ private:
|
|||||||
const labelList& polys,
|
const labelList& polys,
|
||||||
const cellList& cellFaces,
|
const cellList& cellFaces,
|
||||||
const faceList& faces,
|
const faceList& faces,
|
||||||
const label pointOffset,
|
|
||||||
OFstream& ensightGeometryFile
|
OFstream& ensightGeometryFile
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
void writeAllPolys
|
void writeAllPolys
|
||||||
(
|
(
|
||||||
const labelList& pointOffsets,
|
const labelList& pointToGlobal,
|
||||||
OFstream& ensightGeometryFile
|
OFstream& ensightGeometryFile
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -171,7 +182,6 @@ private:
|
|||||||
const char* key,
|
const char* key,
|
||||||
const label nPrims,
|
const label nPrims,
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const labelList& pointOffsets,
|
|
||||||
OFstream& ensightGeometryFile
|
OFstream& ensightGeometryFile
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -182,12 +192,6 @@ private:
|
|||||||
OFstream& ensightGeometryFile
|
OFstream& ensightGeometryFile
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
faceList map
|
|
||||||
(
|
|
||||||
const faceList& patchFaces,
|
|
||||||
const labelList& prims
|
|
||||||
) const;
|
|
||||||
|
|
||||||
void writeAllFacePrims
|
void writeAllFacePrims
|
||||||
(
|
(
|
||||||
const char* key,
|
const char* key,
|
||||||
@ -241,7 +245,6 @@ private:
|
|||||||
void writePrimsBinary
|
void writePrimsBinary
|
||||||
(
|
(
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const label pointOffset,
|
|
||||||
std::ofstream& ensightGeometryFile
|
std::ofstream& ensightGeometryFile
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -250,7 +253,6 @@ private:
|
|||||||
const char* key,
|
const char* key,
|
||||||
const label nPrims,
|
const label nPrims,
|
||||||
const cellShapeList& cellShapes,
|
const cellShapeList& cellShapes,
|
||||||
const labelList& pointOffsets,
|
|
||||||
std::ofstream& ensightGeometryFile
|
std::ofstream& ensightGeometryFile
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -274,13 +276,12 @@ private:
|
|||||||
const labelList& polys,
|
const labelList& polys,
|
||||||
const cellList& cellFaces,
|
const cellList& cellFaces,
|
||||||
const faceList& faces,
|
const faceList& faces,
|
||||||
const label pointOffset,
|
|
||||||
std::ofstream& ensightGeometryFile
|
std::ofstream& ensightGeometryFile
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
void writeAllPolysBinary
|
void writeAllPolysBinary
|
||||||
(
|
(
|
||||||
const labelList& pointOffsets,
|
const labelList& pointToGlobal,
|
||||||
std::ofstream& ensightGeometryFile
|
std::ofstream& ensightGeometryFile
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|||||||
@ -676,6 +676,10 @@ Foam::Time& Foam::Time::operator++()
|
|||||||
|
|
||||||
deltaT0_ = deltaTSave_;
|
deltaT0_ = deltaTSave_;
|
||||||
deltaTSave_ = deltaT_;
|
deltaTSave_ = deltaT_;
|
||||||
|
|
||||||
|
// Save old time name
|
||||||
|
const word oldTimeName = dimensionedScalar::name();
|
||||||
|
|
||||||
setTime(value() + deltaT_, timeIndex_ + 1);
|
setTime(value() + deltaT_, timeIndex_ + 1);
|
||||||
|
|
||||||
if (!subCycling_)
|
if (!subCycling_)
|
||||||
@ -685,7 +689,30 @@ Foam::Time& Foam::Time::operator++()
|
|||||||
{
|
{
|
||||||
setTime(0.0, timeIndex_);
|
setTime(0.0, timeIndex_);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Check that new time representation differs from old one
|
||||||
|
if (dimensionedScalar::name() == oldTimeName)
|
||||||
|
{
|
||||||
|
int oldPrecision = precision_;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
precision_++;
|
||||||
|
setTime(value(), timeIndex());
|
||||||
|
}
|
||||||
|
while (precision_ < 100 && dimensionedScalar::name() == oldTimeName);
|
||||||
|
|
||||||
|
WarningIn("Time::operator++()")
|
||||||
|
<< "Increased the timePrecision from " << oldPrecision
|
||||||
|
<< " to " << precision_
|
||||||
|
<< " to distinguish between timeNames at time " << value()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!subCycling_)
|
||||||
|
{
|
||||||
switch (writeControl_)
|
switch (writeControl_)
|
||||||
{
|
{
|
||||||
case wcTimeStep:
|
case wcTimeStep:
|
||||||
|
|||||||
@ -410,33 +410,30 @@ Foam::label Foam::globalMeshData::countCoincidentFaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::globalMeshData::calcGlobalPointSlaves() const
|
void Foam::globalMeshData::calcGlobalPointSlaves
|
||||||
|
(
|
||||||
|
const globalPoints& globalData,
|
||||||
|
autoPtr<globalIndex>& globalIndicesPtr,
|
||||||
|
autoPtr<labelListList>& globalPointSlavesPtr,
|
||||||
|
autoPtr<mapDistribute>& globalPointSlavesMapPtr
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Pout<< "globalMeshData::calcGlobalPointSlaves() :"
|
|
||||||
<< " calculating coupled master to slave point addressing."
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate connected points for master points
|
|
||||||
globalPoints globalData(mesh_, coupledPatch(), true);
|
|
||||||
|
|
||||||
const Map<label>& meshToProcPoint = globalData.meshToProcPoint();
|
|
||||||
|
|
||||||
// Create global numbering for coupled points
|
// Create global numbering for coupled points
|
||||||
globalPointNumberingPtr_.reset
|
globalIndicesPtr.reset
|
||||||
(
|
(
|
||||||
new globalIndex(globalData.globalIndices())
|
new globalIndex(globalData.globalIndices())
|
||||||
);
|
);
|
||||||
const globalIndex& globalIndices = globalPointNumberingPtr_();
|
const globalIndex& globalIndices = globalIndicesPtr();
|
||||||
|
|
||||||
// Create master to slave addressing. Empty for slave points.
|
// Create master to slave addressing. Empty for slave points.
|
||||||
globalPointSlavesPtr_.reset
|
globalPointSlavesPtr.reset
|
||||||
(
|
(
|
||||||
new labelListList(coupledPatch().nPoints())
|
new labelListList(coupledPatch().nPoints())
|
||||||
);
|
);
|
||||||
labelListList& globalPointSlaves = globalPointSlavesPtr_();
|
labelListList& globalPointSlaves = globalPointSlavesPtr();
|
||||||
|
|
||||||
|
|
||||||
|
const Map<label>& meshToProcPoint = globalData.meshToProcPoint();
|
||||||
|
|
||||||
forAllConstIter(Map<label>, meshToProcPoint, iter)
|
forAllConstIter(Map<label>, meshToProcPoint, iter)
|
||||||
{
|
{
|
||||||
@ -465,7 +462,7 @@ void Foam::globalMeshData::calcGlobalPointSlaves() const
|
|||||||
// Changes globalPointSlaves to be indices into compact data
|
// Changes globalPointSlaves to be indices into compact data
|
||||||
|
|
||||||
List<Map<label> > compactMap(Pstream::nProcs());
|
List<Map<label> > compactMap(Pstream::nProcs());
|
||||||
globalPointSlavesMapPtr_.reset
|
globalPointSlavesMapPtr.reset
|
||||||
(
|
(
|
||||||
new mapDistribute
|
new mapDistribute
|
||||||
(
|
(
|
||||||
@ -477,41 +474,50 @@ void Foam::globalMeshData::calcGlobalPointSlaves() const
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "globalMeshData::calcGlobalPointSlaves() :"
|
Pout<< "globalMeshData::calcGlobalPointSlaves(..) :"
|
||||||
<< " coupled points:" << coupledPatch().nPoints()
|
<< " coupled points:" << coupledPatch().nPoints()
|
||||||
<< " additional remote points:"
|
<< " additional remote points:"
|
||||||
<< globalPointSlavesMapPtr_().constructSize()
|
<< globalPointSlavesMapPtr().constructSize()
|
||||||
- coupledPatch().nPoints()
|
- coupledPatch().nPoints()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
void Foam::globalMeshData::calcGlobalPointSlaves() const
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "globalMeshData::calcGlobalEdgeSlaves() :"
|
Pout<< "globalMeshData::calcGlobalPointSlaves() :"
|
||||||
<< " calculating coupled master to slave edge addressing."
|
<< " calculating coupled master to collocated"
|
||||||
|
<< " slave point addressing."
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const labelListList& globalPointSlaves = this->globalPointSlaves();
|
// Calculate collocated connected points for master points.
|
||||||
const mapDistribute& globalPointSlavesMap = this->globalPointSlavesMap();
|
globalPoints collocatedGlobalData(mesh_, coupledPatch(), true, false);
|
||||||
|
|
||||||
// - Send across connected edges (in global edge addressing)
|
calcGlobalPointSlaves
|
||||||
// - Check on receiving side whether edge has same slave edge
|
|
||||||
// on both endpoints.
|
|
||||||
|
|
||||||
// Create global numbering for coupled edges
|
|
||||||
globalEdgeNumberingPtr_.reset
|
|
||||||
(
|
(
|
||||||
new globalIndex(coupledPatch().nEdges())
|
collocatedGlobalData,
|
||||||
|
globalPointNumberingPtr_,
|
||||||
|
globalPointSlavesPtr_,
|
||||||
|
globalPointSlavesMapPtr_
|
||||||
);
|
);
|
||||||
const globalIndex& globalIndices = globalEdgeNumberingPtr_();
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::globalMeshData::calcGlobalEdgeSlaves
|
||||||
|
(
|
||||||
|
const labelListList& pointSlaves,
|
||||||
|
const mapDistribute& pointSlavesMap,
|
||||||
|
const globalIndex& globalEdgeIndices,
|
||||||
|
autoPtr<labelListList>& globalEdgeSlavesPtr,
|
||||||
|
autoPtr<mapDistribute>& globalEdgeSlavesMapPtr
|
||||||
|
) const
|
||||||
|
{
|
||||||
// Coupled point to global coupled edges.
|
// Coupled point to global coupled edges.
|
||||||
labelListList globalPointEdges(globalPointSlavesMap.constructSize());
|
labelListList globalPointEdges(pointSlavesMap.constructSize());
|
||||||
|
|
||||||
// Create local version
|
// Create local version
|
||||||
const labelListList& pointEdges = coupledPatch().pointEdges();
|
const labelListList& pointEdges = coupledPatch().pointEdges();
|
||||||
@ -522,12 +528,12 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
globalPEdges.setSize(pEdges.size());
|
globalPEdges.setSize(pEdges.size());
|
||||||
forAll(pEdges, i)
|
forAll(pEdges, i)
|
||||||
{
|
{
|
||||||
globalPEdges[i] = globalIndices.toGlobal(pEdges[i]);
|
globalPEdges[i] = globalEdgeIndices.toGlobal(pEdges[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pull slave data to master
|
// Pull slave data to master
|
||||||
globalPointSlavesMap.distribute(globalPointEdges);
|
pointSlavesMap.distribute(globalPointEdges);
|
||||||
|
|
||||||
// Now check on master if any of my edges are also on slave.
|
// Now check on master if any of my edges are also on slave.
|
||||||
// This assumes that if slaves have a coupled edge it is also on
|
// This assumes that if slaves have a coupled edge it is also on
|
||||||
@ -538,14 +544,14 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
const edgeList& edges = coupledPatch().edges();
|
const edgeList& edges = coupledPatch().edges();
|
||||||
|
|
||||||
// Create master to slave addressing. Empty for slave edges.
|
// Create master to slave addressing. Empty for slave edges.
|
||||||
globalEdgeSlavesPtr_.reset(new labelListList(edges.size()));
|
globalEdgeSlavesPtr.reset(new labelListList(edges.size()));
|
||||||
labelListList& globalEdgeSlaves = globalEdgeSlavesPtr_();
|
labelListList& globalEdgeSlaves = globalEdgeSlavesPtr();
|
||||||
|
|
||||||
forAll(edges, edgeI)
|
forAll(edges, edgeI)
|
||||||
{
|
{
|
||||||
const edge& e = edges[edgeI];
|
const edge& e = edges[edgeI];
|
||||||
const labelList& slaves0 = globalPointSlaves[e[0]];
|
const labelList& slaves0 = pointSlaves[e[0]];
|
||||||
const labelList& slaves1 = globalPointSlaves[e[1]];
|
const labelList& slaves1 = pointSlaves[e[1]];
|
||||||
|
|
||||||
// Check for edges that are in both slaves0 and slaves1.
|
// Check for edges that are in both slaves0 and slaves1.
|
||||||
pointEdgeSet.clear();
|
pointEdgeSet.clear();
|
||||||
@ -576,11 +582,11 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
|
|
||||||
// Construct map
|
// Construct map
|
||||||
List<Map<label> > compactMap(Pstream::nProcs());
|
List<Map<label> > compactMap(Pstream::nProcs());
|
||||||
globalEdgeSlavesMapPtr_.reset
|
globalEdgeSlavesMapPtr.reset
|
||||||
(
|
(
|
||||||
new mapDistribute
|
new mapDistribute
|
||||||
(
|
(
|
||||||
globalIndices,
|
globalEdgeIndices,
|
||||||
globalEdgeSlaves,
|
globalEdgeSlaves,
|
||||||
compactMap
|
compactMap
|
||||||
)
|
)
|
||||||
@ -591,12 +597,39 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
Pout<< "globalMeshData::calcGlobalEdgeSlaves() :"
|
Pout<< "globalMeshData::calcGlobalEdgeSlaves() :"
|
||||||
<< " coupled edge:" << edges.size()
|
<< " coupled edge:" << edges.size()
|
||||||
<< " additional remote edges:"
|
<< " additional remote edges:"
|
||||||
<< globalEdgeSlavesMapPtr_().constructSize() - edges.size()
|
<< globalEdgeSlavesMapPtr().constructSize() - edges.size()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "globalMeshData::calcGlobalEdgeSlaves() :"
|
||||||
|
<< " calculating coupled master to collocated slave"
|
||||||
|
<< " edge addressing." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - Send across connected edges (in global edge addressing)
|
||||||
|
// - Check on receiving side whether edge has same slave edge
|
||||||
|
// on both endpoints.
|
||||||
|
|
||||||
|
// Create global numbering for coupled edges
|
||||||
|
const globalIndex& globalIndices = globalEdgeNumbering();
|
||||||
|
|
||||||
|
calcGlobalEdgeSlaves
|
||||||
|
(
|
||||||
|
globalPointSlaves(),
|
||||||
|
globalPointSlavesMap(),
|
||||||
|
globalIndices,
|
||||||
|
globalEdgeSlavesPtr_,
|
||||||
|
globalEdgeSlavesMapPtr_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Calculate uncoupled boundary faces (without calculating
|
// Calculate uncoupled boundary faces (without calculating
|
||||||
// primitiveMesh::pointFaces())
|
// primitiveMesh::pointFaces())
|
||||||
void Foam::globalMeshData::calcPointBoundaryFaces
|
void Foam::globalMeshData::calcPointBoundaryFaces
|
||||||
@ -961,6 +994,55 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::globalMeshData::calcGlobalPointAllSlaves() const
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "globalMeshData::calcGlobalPointAllSlaves() :"
|
||||||
|
<< " calculating coupled master to slave point addressing."
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate collocated&non-collocated connected points for master points.
|
||||||
|
globalPoints allGlobalData(mesh_, coupledPatch(), true, true);
|
||||||
|
|
||||||
|
calcGlobalPointSlaves
|
||||||
|
(
|
||||||
|
allGlobalData,
|
||||||
|
globalPointAllNumberingPtr_,
|
||||||
|
globalPointAllSlavesPtr_,
|
||||||
|
globalPointAllSlavesMapPtr_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::globalMeshData::calcGlobalEdgeAllSlaves() const
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "globalMeshData::calcGlobalEdgeAllSlaves() :"
|
||||||
|
<< " calculating coupled master to slave edge addressing."
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - Send across connected edges (in global edge addressing)
|
||||||
|
// - Check on receiving side whether edge has same slave edge
|
||||||
|
// on both endpoints.
|
||||||
|
|
||||||
|
// Create global numbering for coupled edges
|
||||||
|
const globalIndex& globalIndices = globalEdgeNumbering();
|
||||||
|
|
||||||
|
calcGlobalEdgeSlaves
|
||||||
|
(
|
||||||
|
globalPointAllSlaves(),
|
||||||
|
globalPointAllSlavesMap(),
|
||||||
|
globalIndices,
|
||||||
|
globalEdgeAllSlavesPtr_,
|
||||||
|
globalEdgeAllSlavesMapPtr_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from polyMesh
|
// Construct from polyMesh
|
||||||
@ -1057,6 +1139,17 @@ void Foam::globalMeshData::clearOut()
|
|||||||
globalBoundaryCellNumberingPtr_.clear();
|
globalBoundaryCellNumberingPtr_.clear();
|
||||||
globalPointBoundaryCellsPtr_.clear();
|
globalPointBoundaryCellsPtr_.clear();
|
||||||
globalPointBoundaryCellsMapPtr_.clear();
|
globalPointBoundaryCellsMapPtr_.clear();
|
||||||
|
|
||||||
|
//- Non-collocated
|
||||||
|
|
||||||
|
// Point
|
||||||
|
globalPointAllNumberingPtr_.clear();
|
||||||
|
globalPointAllSlavesPtr_.clear();
|
||||||
|
globalPointAllSlavesMapPtr_.clear();
|
||||||
|
// Edge
|
||||||
|
globalEdgeAllSlavesPtr_.clear();
|
||||||
|
globalEdgeAllSlavesMapPtr_.clear();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1212,7 +1305,7 @@ Foam::pointField Foam::globalMeshData::geometricSharedPoints() const
|
|||||||
labelList pMap;
|
labelList pMap;
|
||||||
pointField mergedPoints;
|
pointField mergedPoints;
|
||||||
|
|
||||||
mergePoints
|
Foam::mergePoints
|
||||||
(
|
(
|
||||||
sharedPoints, // coordinates to merge
|
sharedPoints, // coordinates to merge
|
||||||
tolDim, // tolerance
|
tolDim, // tolerance
|
||||||
@ -1350,7 +1443,10 @@ const Foam::globalIndex& Foam::globalMeshData::globalEdgeNumbering() const
|
|||||||
{
|
{
|
||||||
if (!globalEdgeNumberingPtr_.valid())
|
if (!globalEdgeNumberingPtr_.valid())
|
||||||
{
|
{
|
||||||
calcGlobalEdgeSlaves();
|
globalEdgeNumberingPtr_.reset
|
||||||
|
(
|
||||||
|
new globalIndex(coupledPatch().nEdges())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return globalEdgeNumberingPtr_();
|
return globalEdgeNumberingPtr_();
|
||||||
}
|
}
|
||||||
@ -1452,6 +1548,293 @@ const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Non-collocated coupled point/edge addressing
|
||||||
|
|
||||||
|
const Foam::globalIndex& Foam::globalMeshData::globalPointAllNumbering() const
|
||||||
|
{
|
||||||
|
if (!globalPointAllNumberingPtr_.valid())
|
||||||
|
{
|
||||||
|
calcGlobalPointAllSlaves();
|
||||||
|
}
|
||||||
|
return globalPointAllNumberingPtr_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::labelListList& Foam::globalMeshData::globalPointAllSlaves() const
|
||||||
|
{
|
||||||
|
if (!globalPointAllSlavesPtr_.valid())
|
||||||
|
{
|
||||||
|
calcGlobalPointAllSlaves();
|
||||||
|
}
|
||||||
|
return globalPointAllSlavesPtr_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::mapDistribute& Foam::globalMeshData::globalPointAllSlavesMap() const
|
||||||
|
{
|
||||||
|
if (!globalPointAllSlavesMapPtr_.valid())
|
||||||
|
{
|
||||||
|
calcGlobalPointAllSlaves();
|
||||||
|
}
|
||||||
|
return globalPointAllSlavesMapPtr_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::labelListList& Foam::globalMeshData::globalEdgeAllSlaves() const
|
||||||
|
{
|
||||||
|
if (!globalEdgeAllSlavesPtr_.valid())
|
||||||
|
{
|
||||||
|
calcGlobalEdgeAllSlaves();
|
||||||
|
}
|
||||||
|
return globalEdgeAllSlavesPtr_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::mapDistribute& Foam::globalMeshData::globalEdgeAllSlavesMap() const
|
||||||
|
{
|
||||||
|
if (!globalEdgeAllSlavesMapPtr_.valid())
|
||||||
|
{
|
||||||
|
calcGlobalEdgeAllSlaves();
|
||||||
|
}
|
||||||
|
return globalEdgeAllSlavesMapPtr_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||||
|
(
|
||||||
|
labelList& pointToGlobal,
|
||||||
|
labelList& uniquePoints
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const indirectPrimitivePatch& cpp = coupledPatch();
|
||||||
|
const labelListList& pointSlaves = globalPointSlaves();
|
||||||
|
const mapDistribute& pointSlavesMap = globalPointSlavesMap();
|
||||||
|
|
||||||
|
|
||||||
|
// 1. Count number of masters on my processor.
|
||||||
|
label nCoupledMaster = 0;
|
||||||
|
PackedBoolList isMaster(mesh_.nPoints(), 1);
|
||||||
|
forAll(pointSlaves, pointI)
|
||||||
|
{
|
||||||
|
const labelList& slavePoints = pointSlaves[pointI];
|
||||||
|
|
||||||
|
if (slavePoints.size() > 0)
|
||||||
|
{
|
||||||
|
nCoupledMaster++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isMaster[cpp.meshPoints()[pointI]] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
label myUniquePoints = mesh_.nPoints() - cpp.nPoints() + nCoupledMaster;
|
||||||
|
|
||||||
|
//Pout<< "Points :" << nl
|
||||||
|
// << " mesh : " << mesh_.nPoints() << nl
|
||||||
|
// << " of which coupled : " << cpp.nPoints() << nl
|
||||||
|
// << " of which master : " << nCoupledMaster << nl
|
||||||
|
// << endl;
|
||||||
|
|
||||||
|
|
||||||
|
// 2. Create global indexing for unique points.
|
||||||
|
autoPtr<globalIndex> globalPointsPtr(new globalIndex(myUniquePoints));
|
||||||
|
|
||||||
|
|
||||||
|
// 3. Assign global point numbers. Keep slaves unset.
|
||||||
|
pointToGlobal.setSize(mesh_.nPoints());
|
||||||
|
pointToGlobal = -1;
|
||||||
|
uniquePoints.setSize(myUniquePoints);
|
||||||
|
label nMaster = 0;
|
||||||
|
|
||||||
|
forAll(isMaster, meshPointI)
|
||||||
|
{
|
||||||
|
if (isMaster[meshPointI])
|
||||||
|
{
|
||||||
|
pointToGlobal[meshPointI] = globalPointsPtr().toGlobal(nMaster);
|
||||||
|
uniquePoints[nMaster] = meshPointI;
|
||||||
|
nMaster++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 4. Push global index for coupled points to slaves.
|
||||||
|
{
|
||||||
|
labelList masterToGlobal(pointSlavesMap.constructSize(), -1);
|
||||||
|
|
||||||
|
forAll(pointSlaves, pointI)
|
||||||
|
{
|
||||||
|
const labelList& slaves = pointSlaves[pointI];
|
||||||
|
|
||||||
|
if (slaves.size() > 0)
|
||||||
|
{
|
||||||
|
// Duplicate master globalpoint into slave slots
|
||||||
|
label meshPointI = cpp.meshPoints()[pointI];
|
||||||
|
masterToGlobal[pointI] = pointToGlobal[meshPointI];
|
||||||
|
forAll(slaves, i)
|
||||||
|
{
|
||||||
|
masterToGlobal[slaves[i]] = masterToGlobal[pointI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send back
|
||||||
|
pointSlavesMap.reverseDistribute(cpp.nPoints(), masterToGlobal);
|
||||||
|
|
||||||
|
// On slave copy master index into overal map.
|
||||||
|
forAll(pointSlaves, pointI)
|
||||||
|
{
|
||||||
|
const labelList& slaves = pointSlaves[pointI];
|
||||||
|
|
||||||
|
if (slaves.size() == 0)
|
||||||
|
{
|
||||||
|
label meshPointI = cpp.meshPoints()[pointI];
|
||||||
|
pointToGlobal[meshPointI] = masterToGlobal[pointI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return globalPointsPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||||
|
(
|
||||||
|
const labelList& meshPoints,
|
||||||
|
const Map<label>& meshPointMap,
|
||||||
|
labelList& pointToGlobal,
|
||||||
|
labelList& uniquePoints
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const indirectPrimitivePatch& cpp = coupledPatch();
|
||||||
|
const labelListList& pointSlaves = globalPointSlaves();
|
||||||
|
const mapDistribute& pointSlavesMap = globalPointSlavesMap();
|
||||||
|
|
||||||
|
|
||||||
|
// 1. Count number of masters on my processor.
|
||||||
|
label nCoupledMaster = 0;
|
||||||
|
label nCoupledSlave = 0;
|
||||||
|
PackedBoolList isMaster(meshPoints.size(), 1);
|
||||||
|
|
||||||
|
forAll(meshPoints, localPointI)
|
||||||
|
{
|
||||||
|
label meshPointI = meshPoints[localPointI];
|
||||||
|
|
||||||
|
Map<label>::const_iterator iter = cpp.meshPointMap().find(meshPointI);
|
||||||
|
|
||||||
|
if (iter != cpp.meshPointMap().end())
|
||||||
|
{
|
||||||
|
// My localPointI is a coupled point.
|
||||||
|
|
||||||
|
label coupledPointI = iter();
|
||||||
|
|
||||||
|
if (pointSlaves[coupledPointI].size() > 0)
|
||||||
|
{
|
||||||
|
nCoupledMaster++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isMaster[localPointI] = 0;
|
||||||
|
nCoupledSlave++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
label myUniquePoints = meshPoints.size() + nCoupledMaster - nCoupledSlave;
|
||||||
|
|
||||||
|
Pout<< "Points :" << nl
|
||||||
|
<< " patch : " << meshPoints.size() << nl
|
||||||
|
<< " of which coupled : " << nCoupledMaster+nCoupledSlave << nl
|
||||||
|
<< " of which master : " << nCoupledMaster << nl
|
||||||
|
<< " of which slave : " << nCoupledSlave << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
|
||||||
|
// 2. Create global indexing for unique points.
|
||||||
|
autoPtr<globalIndex> globalPointsPtr(new globalIndex(myUniquePoints));
|
||||||
|
|
||||||
|
|
||||||
|
// 3. Assign global point numbers. Keep slaves unset.
|
||||||
|
pointToGlobal.setSize(meshPoints.size());
|
||||||
|
pointToGlobal = -1;
|
||||||
|
uniquePoints.setSize(myUniquePoints);
|
||||||
|
label nMaster = 0;
|
||||||
|
|
||||||
|
forAll(isMaster, localPointI)
|
||||||
|
{
|
||||||
|
if (isMaster[localPointI])
|
||||||
|
{
|
||||||
|
pointToGlobal[localPointI] = globalPointsPtr().toGlobal(nMaster);
|
||||||
|
uniquePoints[nMaster] = localPointI;
|
||||||
|
nMaster++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 4. Push global index for coupled points to slaves.
|
||||||
|
{
|
||||||
|
labelList masterToGlobal(pointSlavesMap.constructSize(), -1);
|
||||||
|
|
||||||
|
forAll(meshPoints, localPointI)
|
||||||
|
{
|
||||||
|
label meshPointI = meshPoints[localPointI];
|
||||||
|
|
||||||
|
Map<label>::const_iterator iter = cpp.meshPointMap().find
|
||||||
|
(
|
||||||
|
meshPointI
|
||||||
|
);
|
||||||
|
|
||||||
|
if (iter != cpp.meshPointMap().end())
|
||||||
|
{
|
||||||
|
// My localPointI is a coupled point.
|
||||||
|
label coupledPointI = iter();
|
||||||
|
|
||||||
|
const labelList& slaves = pointSlaves[coupledPointI];
|
||||||
|
|
||||||
|
if (slaves.size() > 0)
|
||||||
|
{
|
||||||
|
// Duplicate master globalpoint into slave slots
|
||||||
|
masterToGlobal[coupledPointI] = pointToGlobal[meshPointI];
|
||||||
|
forAll(slaves, i)
|
||||||
|
{
|
||||||
|
masterToGlobal[slaves[i]] = pointToGlobal[meshPointI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send back
|
||||||
|
pointSlavesMap.reverseDistribute(cpp.nPoints(), masterToGlobal);
|
||||||
|
|
||||||
|
// On slave copy master index into overal map.
|
||||||
|
forAll(meshPoints, localPointI)
|
||||||
|
{
|
||||||
|
label meshPointI = meshPoints[localPointI];
|
||||||
|
|
||||||
|
Map<label>::const_iterator iter = cpp.meshPointMap().find
|
||||||
|
(
|
||||||
|
meshPointI
|
||||||
|
);
|
||||||
|
|
||||||
|
if (iter != cpp.meshPointMap().end())
|
||||||
|
{
|
||||||
|
// My localPointI is a coupled point.
|
||||||
|
label coupledPointI = iter();
|
||||||
|
const labelList& slaves = pointSlaves[coupledPointI];
|
||||||
|
|
||||||
|
if (slaves.size() == 0)
|
||||||
|
{
|
||||||
|
pointToGlobal[meshPointI] = masterToGlobal[coupledPointI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return globalPointsPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::globalMeshData::movePoints(const pointField& newPoints)
|
void Foam::globalMeshData::movePoints(const pointField& newPoints)
|
||||||
{
|
{
|
||||||
// Topology does not change and we don't store any geometry so nothing
|
// Topology does not change and we don't store any geometry so nothing
|
||||||
@ -1482,8 +1865,9 @@ void Foam::globalMeshData::updateMesh()
|
|||||||
|
|
||||||
// Option 1. Topological
|
// Option 1. Topological
|
||||||
{
|
{
|
||||||
// Calculate all shared points. This does all the hard work.
|
// Calculate all shared points (excluded points that are only
|
||||||
globalPoints parallelPoints(mesh_, false);
|
// on two coupled patches). This does all the hard work.
|
||||||
|
globalPoints parallelPoints(mesh_, false, true);
|
||||||
|
|
||||||
// Copy data out.
|
// Copy data out.
|
||||||
nGlobalPoints_ = parallelPoints.nGlobalPoints();
|
nGlobalPoints_ = parallelPoints.nGlobalPoints();
|
||||||
@ -1505,6 +1889,16 @@ void Foam::globalMeshData::updateMesh()
|
|||||||
// sharedEdgeAddr_ = parallelPoints.sharedEdgeAddr();
|
// sharedEdgeAddr_ = parallelPoints.sharedEdgeAddr();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "globalMeshData : nGlobalPoints_:" << nGlobalPoints_ << nl
|
||||||
|
<< "globalMeshData : sharedPointLabels_:"
|
||||||
|
<< sharedPointLabels_.size() << nl
|
||||||
|
<< "globalMeshData : sharedPointAddr_:"
|
||||||
|
<< sharedPointAddr_.size() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Total number of faces. Start off from all faces. Remove coincident
|
// Total number of faces. Start off from all faces. Remove coincident
|
||||||
// processor faces (on highest numbered processor) before summing.
|
// processor faces (on highest numbered processor) before summing.
|
||||||
nTotalFaces_ = mesh_.nFaces();
|
nTotalFaces_ = mesh_.nFaces();
|
||||||
|
|||||||
@ -31,7 +31,7 @@ Description
|
|||||||
|
|
||||||
Requires:
|
Requires:
|
||||||
- all processor patches to have correct ordering.
|
- all processor patches to have correct ordering.
|
||||||
- all processorPatches to have their transforms set ('makeTransforms')
|
- all processorPatches to have their transforms set.
|
||||||
|
|
||||||
The shared point addressing is quite interesting. It gives on each processor
|
The shared point addressing is quite interesting. It gives on each processor
|
||||||
the vertices that cannot be set using a normal swap on processor patches.
|
the vertices that cannot be set using a normal swap on processor patches.
|
||||||
@ -67,14 +67,12 @@ Description
|
|||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
globalMeshData.C
|
globalMeshData.C
|
||||||
globalMeshDataMorph.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef globalMeshData_H
|
#ifndef globalMeshData_H
|
||||||
#define globalMeshData_H
|
#define globalMeshData_H
|
||||||
|
|
||||||
//#include "polyMesh.H"
|
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
#include "processorTopology.H"
|
#include "processorTopology.H"
|
||||||
#include "labelPair.H"
|
#include "labelPair.H"
|
||||||
@ -95,6 +93,7 @@ class globalIndex;
|
|||||||
class polyMesh;
|
class polyMesh;
|
||||||
class mapDistribute;
|
class mapDistribute;
|
||||||
template<class T> class EdgeMap;
|
template<class T> class EdgeMap;
|
||||||
|
class globalPoints;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class globalMeshData Declaration
|
Class globalMeshData Declaration
|
||||||
@ -201,31 +200,36 @@ class globalMeshData
|
|||||||
|
|
||||||
|
|
||||||
// Coupled point addressing
|
// Coupled point addressing
|
||||||
// This is addressing from coupled point to coupled points,faces,cells
|
// This is addressing from coupled point to coupled points/faces/cells.
|
||||||
|
// Two variants:
|
||||||
|
// - collocated (so not physically separated)
|
||||||
|
// - also separated
|
||||||
// This is a full schedule so includes points only used by two
|
// This is a full schedule so includes points only used by two
|
||||||
// coupled patches.
|
// coupled patches.
|
||||||
|
|
||||||
mutable autoPtr<indirectPrimitivePatch> coupledPatchPtr_;
|
mutable autoPtr<indirectPrimitivePatch> coupledPatchPtr_;
|
||||||
|
|
||||||
// Coupled point to coupled points
|
// Collocated
|
||||||
|
|
||||||
|
// Coupled point to collocated coupled points
|
||||||
|
|
||||||
mutable autoPtr<globalIndex> globalPointNumberingPtr_;
|
mutable autoPtr<globalIndex> globalPointNumberingPtr_;
|
||||||
mutable autoPtr<labelListList> globalPointSlavesPtr_;
|
mutable autoPtr<labelListList> globalPointSlavesPtr_;
|
||||||
mutable autoPtr<mapDistribute> globalPointSlavesMapPtr_;
|
mutable autoPtr<mapDistribute> globalPointSlavesMapPtr_;
|
||||||
|
|
||||||
// Coupled edge to coupled edges
|
// Coupled edge to collocated coupled edges
|
||||||
|
|
||||||
mutable autoPtr<globalIndex> globalEdgeNumberingPtr_;
|
mutable autoPtr<globalIndex> globalEdgeNumberingPtr_;
|
||||||
mutable autoPtr<labelListList> globalEdgeSlavesPtr_;
|
mutable autoPtr<labelListList> globalEdgeSlavesPtr_;
|
||||||
mutable autoPtr<mapDistribute> globalEdgeSlavesMapPtr_;
|
mutable autoPtr<mapDistribute> globalEdgeSlavesMapPtr_;
|
||||||
|
|
||||||
// Coupled point to boundary faces
|
// Coupled point to collocated boundary faces
|
||||||
|
|
||||||
mutable autoPtr<globalIndex> globalBoundaryFaceNumberingPtr_;
|
mutable autoPtr<globalIndex> globalBoundaryFaceNumberingPtr_;
|
||||||
mutable autoPtr<labelListList> globalPointBoundaryFacesPtr_;
|
mutable autoPtr<labelListList> globalPointBoundaryFacesPtr_;
|
||||||
mutable autoPtr<mapDistribute> globalPointBoundaryFacesMapPtr_;
|
mutable autoPtr<mapDistribute> globalPointBoundaryFacesMapPtr_;
|
||||||
|
|
||||||
// Coupled point to boundary cells
|
// Coupled point to collocated boundary cells
|
||||||
|
|
||||||
mutable autoPtr<labelList> boundaryCellsPtr_;
|
mutable autoPtr<labelList> boundaryCellsPtr_;
|
||||||
mutable autoPtr<globalIndex> globalBoundaryCellNumberingPtr_;
|
mutable autoPtr<globalIndex> globalBoundaryCellNumberingPtr_;
|
||||||
@ -233,6 +237,21 @@ class globalMeshData
|
|||||||
mutable autoPtr<mapDistribute> globalPointBoundaryCellsMapPtr_;
|
mutable autoPtr<mapDistribute> globalPointBoundaryCellsMapPtr_;
|
||||||
|
|
||||||
|
|
||||||
|
// Non-collocated as well
|
||||||
|
|
||||||
|
// Coupled point to all coupled points
|
||||||
|
|
||||||
|
mutable autoPtr<globalIndex> globalPointAllNumberingPtr_;
|
||||||
|
mutable autoPtr<labelListList> globalPointAllSlavesPtr_;
|
||||||
|
mutable autoPtr<mapDistribute> globalPointAllSlavesMapPtr_;
|
||||||
|
|
||||||
|
// Coupled edge to all coupled edges (same numbering as
|
||||||
|
// collocated coupled edges)
|
||||||
|
|
||||||
|
mutable autoPtr<labelListList> globalEdgeAllSlavesPtr_;
|
||||||
|
mutable autoPtr<mapDistribute> globalEdgeAllSlavesMapPtr_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Set up processor patch addressing
|
//- Set up processor patch addressing
|
||||||
@ -256,9 +275,28 @@ class globalMeshData
|
|||||||
const vectorField& separationDist
|
const vectorField& separationDist
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Calculate global point addressing.
|
||||||
|
void calcGlobalPointSlaves
|
||||||
|
(
|
||||||
|
const globalPoints&,
|
||||||
|
autoPtr<globalIndex>&,
|
||||||
|
autoPtr<labelListList>&,
|
||||||
|
autoPtr<mapDistribute>&
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Calculate global point addressing.
|
//- Calculate global point addressing.
|
||||||
void calcGlobalPointSlaves() const;
|
void calcGlobalPointSlaves() const;
|
||||||
|
|
||||||
|
//- Calculate global edge addressing.
|
||||||
|
void calcGlobalEdgeSlaves
|
||||||
|
(
|
||||||
|
const labelListList&,
|
||||||
|
const mapDistribute&,
|
||||||
|
const globalIndex&,
|
||||||
|
autoPtr<labelListList>&,
|
||||||
|
autoPtr<mapDistribute>&
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Calculate global edge addressing.
|
//- Calculate global edge addressing.
|
||||||
void calcGlobalEdgeSlaves() const;
|
void calcGlobalEdgeSlaves() const;
|
||||||
|
|
||||||
@ -272,6 +310,15 @@ class globalMeshData
|
|||||||
void calcGlobalPointBoundaryCells() const;
|
void calcGlobalPointBoundaryCells() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Non-collocated
|
||||||
|
|
||||||
|
//- Calculate global point addressing.
|
||||||
|
void calcGlobalPointAllSlaves() const;
|
||||||
|
|
||||||
|
//- Calculate global edge addressing.
|
||||||
|
void calcGlobalEdgeAllSlaves() const;
|
||||||
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
globalMeshData(const globalMeshData&);
|
globalMeshData(const globalMeshData&);
|
||||||
|
|
||||||
@ -449,8 +496,8 @@ public:
|
|||||||
//- Return patch of all coupled faces
|
//- Return patch of all coupled faces
|
||||||
const indirectPrimitivePatch& coupledPatch() const;
|
const indirectPrimitivePatch& coupledPatch() const;
|
||||||
|
|
||||||
// Coupled point to coupled points. Coupled points are points on
|
// Coupled point to collocated coupled points. Coupled points are
|
||||||
// any coupled patch.
|
// points on any coupled patch.
|
||||||
|
|
||||||
//- Numbering of coupled points is according to coupledPatch.
|
//- Numbering of coupled points is according to coupledPatch.
|
||||||
const globalIndex& globalPointNumbering() const;
|
const globalIndex& globalPointNumbering() const;
|
||||||
@ -484,6 +531,45 @@ public:
|
|||||||
const mapDistribute& globalPointBoundaryCellsMap() const;
|
const mapDistribute& globalPointBoundaryCellsMap() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Collocated & non-collocated
|
||||||
|
|
||||||
|
// Coupled point to all coupled points (collocated and
|
||||||
|
// non-collocated).
|
||||||
|
|
||||||
|
const globalIndex& globalPointAllNumbering()const;
|
||||||
|
const labelListList& globalPointAllSlaves() const;
|
||||||
|
const mapDistribute& globalPointAllSlavesMap() const;
|
||||||
|
|
||||||
|
// Coupled edge to all coupled edges (same numbering as
|
||||||
|
// collocated)
|
||||||
|
|
||||||
|
const labelListList& globalEdgeAllSlaves() const;
|
||||||
|
const mapDistribute& globalEdgeAllSlavesMap() const;
|
||||||
|
|
||||||
|
// Other
|
||||||
|
|
||||||
|
//- Helper for merging mesh point data. Determines
|
||||||
|
// - my unique indices
|
||||||
|
// - global numbering over all unique indices
|
||||||
|
// - the global number for all local points (so this will
|
||||||
|
// be local for my unique points)
|
||||||
|
autoPtr<globalIndex> mergePoints
|
||||||
|
(
|
||||||
|
labelList& pointToGlobal,
|
||||||
|
labelList& uniquePoints
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Helper for merging patch point data. Takes maps from
|
||||||
|
// local points to/from mesh
|
||||||
|
autoPtr<globalIndex> mergePoints
|
||||||
|
(
|
||||||
|
const labelList& meshPoints,
|
||||||
|
const Map<label>& meshPointMap,
|
||||||
|
labelList& pointToGlobal,
|
||||||
|
labelList& uniquePoints
|
||||||
|
) const;
|
||||||
|
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
|
|
||||||
//- Update for moving points.
|
//- Update for moving points.
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -67,8 +67,8 @@ Description
|
|||||||
At this point one will have complete point-point connectivity for all
|
At this point one will have complete point-point connectivity for all
|
||||||
points on processor patches. Now
|
points on processor patches. Now
|
||||||
|
|
||||||
- remove point equivalences of size 2. These are just normal points
|
- (optional)remove point equivalences of size 2. These are
|
||||||
shared between two neighbouring procPatches.
|
just normal points shared between two neighbouring procPatches.
|
||||||
- collect on each processor points for which it is the master
|
- collect on each processor points for which it is the master
|
||||||
- request number of sharedPointLabels from the Pstream::master.
|
- request number of sharedPointLabels from the Pstream::master.
|
||||||
|
|
||||||
@ -98,10 +98,10 @@ SourceFiles
|
|||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
#include "primitivePatch.H"
|
#include "primitivePatch.H"
|
||||||
#include "className.H"
|
|
||||||
#include "edgeList.H"
|
#include "edgeList.H"
|
||||||
#include "globalIndex.H"
|
#include "globalIndex.H"
|
||||||
#include "indirectPrimitivePatch.H"
|
#include "indirectPrimitivePatch.H"
|
||||||
|
#include "PackedBoolList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -112,6 +112,8 @@ namespace Foam
|
|||||||
class polyMesh;
|
class polyMesh;
|
||||||
class polyBoundaryMesh;
|
class polyBoundaryMesh;
|
||||||
class cyclicPolyPatch;
|
class cyclicPolyPatch;
|
||||||
|
class polyPatch;
|
||||||
|
class coupledPolyPatch;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class globalPoints Declaration
|
Class globalPoints Declaration
|
||||||
@ -119,7 +121,15 @@ class cyclicPolyPatch;
|
|||||||
|
|
||||||
class globalPoints
|
class globalPoints
|
||||||
{
|
{
|
||||||
// Private classes
|
// Static data members
|
||||||
|
|
||||||
|
//- Offset to add to points (in globalIndices) originating from
|
||||||
|
// collocated coupled points.
|
||||||
|
static const label fromCollocated;
|
||||||
|
|
||||||
|
//- Distance to check whether points/faces are collocated.
|
||||||
|
static const scalar mergeDist;
|
||||||
|
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -152,13 +162,53 @@ class globalPoints
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Is identity transform?
|
||||||
|
static bool noTransform(const tensor&, const scalar mergeDist);
|
||||||
|
|
||||||
|
//- Return per face collocated status
|
||||||
|
static PackedBoolList collocatedFaces
|
||||||
|
(
|
||||||
|
const coupledPolyPatch&,
|
||||||
|
const scalar mergeDist
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Return per point collocated status
|
||||||
|
static PackedBoolList collocatedPoints
|
||||||
|
(
|
||||||
|
const coupledPolyPatch&,
|
||||||
|
const scalar mergeDist
|
||||||
|
);
|
||||||
|
|
||||||
|
// Wrappers around global point numbering to add collocated bit
|
||||||
|
|
||||||
|
//- Convert into globalIndices and add collocated bit
|
||||||
|
label toGlobal(const label, const bool isCollocated) const;
|
||||||
|
|
||||||
|
//- Is collocated bit set
|
||||||
|
bool isCollocated(const label globalI) const;
|
||||||
|
|
||||||
|
//- Remove collocated bit
|
||||||
|
label removeCollocated(const label globalI) const;
|
||||||
|
|
||||||
|
//- (remove collocated bit and) check if originates from local proc
|
||||||
|
bool isLocal(const label globalI) const;
|
||||||
|
|
||||||
|
//- (remove collocated bit and) get originating processor
|
||||||
|
label whichProcID(const label globalI) const;
|
||||||
|
|
||||||
|
//- (remove collocated bit and) convert to local number on processor
|
||||||
|
label toLocal(const label procI, const label globalI) const;
|
||||||
|
|
||||||
|
//- (remove collocated bit and) convert to local number on
|
||||||
|
// Pstream::myProcNo
|
||||||
|
label toLocal(const label globalI) const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//- Count all points on processorPatches. Is all points for which
|
//- Count all points on processorPatches. Is all points for which
|
||||||
// information is collected.
|
// information is collected.
|
||||||
static label countPatchPoints(const polyBoundaryMesh&);
|
static label countPatchPoints(const polyBoundaryMesh&);
|
||||||
|
|
||||||
////- Get all faces on coupled patches
|
|
||||||
//static labelListl coupledFaces(const polyBoundaryMesh&);
|
|
||||||
|
|
||||||
//- Add information about patchPointI in relative indices to send
|
//- Add information about patchPointI in relative indices to send
|
||||||
// buffers (patchFaces, indexInFace etc.)
|
// buffers (patchFaces, indexInFace etc.)
|
||||||
static void addToSend
|
static void addToSend
|
||||||
@ -197,9 +247,17 @@ class globalPoints
|
|||||||
bool storeInfo
|
bool storeInfo
|
||||||
(
|
(
|
||||||
const labelList& nbrInfo,
|
const labelList& nbrInfo,
|
||||||
const label localPointI
|
const label localPointI,
|
||||||
|
const bool isCollocated
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void printProcPoints
|
||||||
|
(
|
||||||
|
const labelList& patchToMeshPoint,
|
||||||
|
const labelList& pointInfo,
|
||||||
|
Ostream& os
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Initialize procPoints_ to my patch points. allPoints = true:
|
//- Initialize procPoints_ to my patch points. allPoints = true:
|
||||||
// seed with all patch points, = false: only boundaryPoints().
|
// seed with all patch points, = false: only boundaryPoints().
|
||||||
void initOwnPoints
|
void initOwnPoints
|
||||||
@ -212,6 +270,7 @@ class globalPoints
|
|||||||
//- Send subset of procPoints to neighbours
|
//- Send subset of procPoints to neighbours
|
||||||
void sendPatchPoints
|
void sendPatchPoints
|
||||||
(
|
(
|
||||||
|
const bool mergeSeparated,
|
||||||
const Map<label>&,
|
const Map<label>&,
|
||||||
PstreamBuffers&,
|
PstreamBuffers&,
|
||||||
const labelHashSet&
|
const labelHashSet&
|
||||||
@ -220,6 +279,7 @@ class globalPoints
|
|||||||
//- Receive neighbour points and merge into my procPoints.
|
//- Receive neighbour points and merge into my procPoints.
|
||||||
void receivePatchPoints
|
void receivePatchPoints
|
||||||
(
|
(
|
||||||
|
const bool mergeSeparated,
|
||||||
const Map<label>&,
|
const Map<label>&,
|
||||||
PstreamBuffers&,
|
PstreamBuffers&,
|
||||||
labelHashSet&
|
labelHashSet&
|
||||||
@ -230,20 +290,31 @@ class globalPoints
|
|||||||
void remove(const labelList& patchToMeshPoint, const Map<label>&);
|
void remove(const labelList& patchToMeshPoint, const Map<label>&);
|
||||||
|
|
||||||
//- Compact out unused elements of procPoints.
|
//- Compact out unused elements of procPoints.
|
||||||
void compact();
|
void compact(const labelList& patchToMeshPoint);
|
||||||
|
|
||||||
//- Get indices of point for which I am master (lowest numbered proc)
|
//- Get indices of point for which I am master (lowest numbered proc)
|
||||||
labelList getMasterPoints(const labelList& patchToMeshPoint) const;
|
labelList getMasterPoints(const labelList& patchToMeshPoint) const;
|
||||||
|
|
||||||
|
|
||||||
//- Send subset of shared points to neighbours
|
//- Send subset of shared points to neighbours
|
||||||
void sendSharedPoints(PstreamBuffers&, const labelList&) const;
|
void sendSharedPoints
|
||||||
|
(
|
||||||
|
const bool mergeSeparated,
|
||||||
|
PstreamBuffers&,
|
||||||
|
const DynamicList<label>&
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Take over any local shared points
|
||||||
|
void extendSharedPoints(const Map<label>&, DynamicList<label>&);
|
||||||
|
|
||||||
//- Receive shared points and update subset.
|
//- Receive shared points and update subset.
|
||||||
void receiveSharedPoints
|
void receiveSharedPoints
|
||||||
(
|
(
|
||||||
const Map<label>&,
|
const bool mergeSeparated,
|
||||||
|
const Map<label>& meshToPatchPoint,
|
||||||
|
const Map<label>& meshToShared,
|
||||||
PstreamBuffers&,
|
PstreamBuffers&,
|
||||||
labelList&
|
DynamicList<label>&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Should move into cyclicPolyPatch ordering problem
|
//- Should move into cyclicPolyPatch ordering problem
|
||||||
@ -255,7 +326,8 @@ class globalPoints
|
|||||||
(
|
(
|
||||||
const Map<label>&,
|
const Map<label>&,
|
||||||
const labelList&,
|
const labelList&,
|
||||||
const bool keepAllPoints
|
const bool keepAllPoints,
|
||||||
|
const bool mergeSeparated
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
@ -276,7 +348,15 @@ public:
|
|||||||
//- Construct from mesh.
|
//- Construct from mesh.
|
||||||
// keepAllPoints = false : filter out points that are on two
|
// keepAllPoints = false : filter out points that are on two
|
||||||
// neighbouring coupled patches (so can be swapped)
|
// neighbouring coupled patches (so can be swapped)
|
||||||
globalPoints(const polyMesh& mesh, const bool keepAllPoints);
|
// mergeSeparated:
|
||||||
|
// true : merge coupled points across separated patches.
|
||||||
|
// false : do not merge across coupled separated patches.
|
||||||
|
globalPoints
|
||||||
|
(
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const bool keepAllPoints,
|
||||||
|
const bool mergeSeparated
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct from mesh and patch of coupled faces. Difference with
|
//- Construct from mesh and patch of coupled faces. Difference with
|
||||||
// construct from mesh only is that this stores the meshToProcPoint,
|
// construct from mesh only is that this stores the meshToProcPoint,
|
||||||
@ -286,7 +366,8 @@ public:
|
|||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const indirectPrimitivePatch& coupledPatch,
|
const indirectPrimitivePatch& coupledPatch,
|
||||||
const bool keepAllPoints
|
const bool keepAllPoints,
|
||||||
|
const bool mergeSeparated
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -206,6 +206,15 @@ void Foam::processorPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
|||||||
}
|
}
|
||||||
else if (mag(magSf - nbrMagSf)/avSf > coupledPolyPatch::matchTol)
|
else if (mag(magSf - nbrMagSf)/avSf > coupledPolyPatch::matchTol)
|
||||||
{
|
{
|
||||||
|
fileName nm
|
||||||
|
(
|
||||||
|
boundaryMesh().mesh().time().path()
|
||||||
|
/name()+"_faces.obj"
|
||||||
|
);
|
||||||
|
Pout<< "processorPolyPatch::order : Writing my " << size()
|
||||||
|
<< " faces to OBJ file " << nm << endl;
|
||||||
|
writeOBJ(nm, *this, points());
|
||||||
|
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"processorPolyPatch::calcGeometry()"
|
"processorPolyPatch::calcGeometry()"
|
||||||
|
|||||||
@ -61,7 +61,33 @@ Foam::displacementFvMotionSolver::displacementFvMotionSolver
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{}
|
{
|
||||||
|
if (points0_.size() != mesh.nPoints())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"displacementFvMotionSolver::displacementFvMotionSolver\n"
|
||||||
|
"(\n"
|
||||||
|
" const polyMesh&,\n"
|
||||||
|
" Istream&\n"
|
||||||
|
")"
|
||||||
|
) << "Number of points in mesh " << mesh.nPoints()
|
||||||
|
<< " differs from number of points " << points0_.size()
|
||||||
|
<< " read from file "
|
||||||
|
<<
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"points",
|
||||||
|
mesh.time().constant(),
|
||||||
|
polyMesh::meshSubDir,
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
).filePath()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
Reference in New Issue
Block a user