Load balancing support, polyMesh

This commit is contained in:
Hrvoje Jasak 2018-04-24 11:04:03 +01:00
parent f523ecfb3c
commit 3f8721dfec
4 changed files with 45 additions and 10 deletions

View file

@ -719,6 +719,9 @@ void Foam::polyMesh::resetPrimitives
// Clear addressing. Keep geometric props for mapping.
clearAddressing();
// Clear everything
clearOut();
// Take over new primitive data.
// Optimized to avoid overwriting data at all
if (!pts().empty())
@ -748,19 +751,16 @@ void Foam::polyMesh::resetPrimitives
// Reset patch sizes and starts
Pout<< "Resetting patches: starts: " << patchStarts << endl;
forAll (boundary_, patchI)
{
boundary_[patchI] = polyPatch
boundary_[patchI].resetPatch
(
boundary_[patchI].name(),
patchSizes[patchI],
patchStarts[patchI],
patchI,
boundary_
patchStarts[patchI]
);
}
// Flags the mesh files as being changed
setInstance(time().timeName());
@ -804,12 +804,10 @@ void Foam::polyMesh::resetPrimitives
}
}
// Set the primitive mesh from the owner_, neighbour_.
// Works out from patch end where the active faces stop.
initMesh();
if (validBoundary)
{
// Note that we assume that all the patches stay the same and are

View file

@ -539,8 +539,8 @@ public:
void removeZones();
//- Reset mesh primitive data. Assumes all patch info correct
// (so does e.g. parallel communication). If not use
// validBoundary=false
// (so does e.g. parallel communication). If not, use
// validBoundary = false
// (still assumes patchStarts[0] = nInternalFaces and last
// patch ends at nActiveFaces) and change patches with addPatches.
void resetPrimitives

View file

@ -579,6 +579,36 @@ void Foam::polyPatch::syncOrder() const
{}
void Foam::polyPatch::resetPatch
(
const label newSize,
const label newStart
)
{
// Clear all data
clearAddressing();
// Reset start and primitive patch
start_ = newStart;
primitivePatch::operator=
(
primitivePatch
(
faceSubList
(
boundaryMesh_.mesh().allFaces(),
newSize,
newStart
),
boundaryMesh_.mesh().allPoints()
)
);
Pout<< "Patch reset: faceCells: " << faceCells() << endl;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::polyPatch::operator=(const polyPatch& p)

View file

@ -464,6 +464,13 @@ public:
// but is happening on other processors
virtual void syncOrder() const;
//- Reset patch
virtual void resetPatch
(
const label newSize,
const label newStart
);
// Member operators