fvMeshDistribute Class Reference

Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing. More...

Public Member Functions

 ClassName ("fvMeshDistribute")
 
 fvMeshDistribute (fvMesh &mesh)
 Construct from mesh. More...
 
autoPtr< mapDistributePolyMeshdistribute (const labelList &dist)
 Send cells to neighbours according to distribution. More...
 

Static Public Member Functions

static labelList countCells (const labelList &)
 Helper function: count cells per processor in wanted distribution. More...
 
static void printCoupleInfo (const primitiveMesh &, const labelList &, const labelList &, const labelList &, const labelList &)
 Print some info on coupling data. More...
 
template<class GeoField >
static void printIntFieldInfo (const fvMesh &)
 Print some field info. More...
 
template<class GeoField >
static void printFieldInfo (const fvMesh &)
 Print some field info. More...
 
static void printMeshInfo (const fvMesh &)
 Print some info on mesh. More...
 
static tmp< surfaceScalarFieldgenerateTestField (const fvMesh &)
 Generate a test field on faces. More...
 
static void testField (const surfaceScalarField &)
 Check whether field consistent with face orientation. More...
 

Detailed Description

Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.

Input is per local cell the processor it should move to. Moves meshes and volFields/surfaceFields and returns map which can be used to distribute other.

Notes:

  • does not handle cyclics. Will probably handle separated proc patches.
  • if all cells move off processor also all its processor patches will get deleted so comms might be screwed up (since e.g. globalMeshData expects procPatches on all)
  • initial mesh has to have procPatches last and all normal patches common to all processors and in the same order. This is checked.
Source files

Definition at line 70 of file fvMeshDistribute.H.

Constructor & Destructor Documentation

◆ fvMeshDistribute()

fvMeshDistribute ( fvMesh mesh)
explicit

Construct from mesh.

Definition at line 1842 of file fvMeshDistribute.C.

Member Function Documentation

◆ ClassName()

ClassName ( "fvMeshDistribute"  )

◆ countCells()

Foam::labelList countCells ( const labelList distribution)
static

Helper function: count cells per processor in wanted distribution.

Definition at line 1852 of file fvMeshDistribute.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, UPstream::nProcs(), and Foam::Zero.

Referenced by meshRefinement::balance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ distribute()

Foam::autoPtr< Foam::mapDistributePolyMesh > distribute ( const labelList dist)

Send cells to neighbours according to distribution.

(for every cell the new proc)

Combine sourceProc, sourcePatch, sourceFace

Definition at line 1876 of file fvMeshDistribute.C.

References Foam::abort(), fvMeshAdder::add(), UPstream::allToAll(), fvMeshSubset::cellMap(), polyBoundaryMesh::checkParallelSync(), PstreamBuffers::clear(), Foam::expressions::patchExpr::debug, Foam::endl(), fvMeshSubset::faceFlipMap(), Foam::faceMap(), fvMeshSubset::faceMap(), Foam::FatalError, FatalErrorInFunction, PstreamBuffers::finishedSends(), Foam::flatOutput(), forAll, Foam::identity(), Foam::inplaceReorder(), meshes(), UPstream::myProcNo(), autoPtr< T >::New(), Foam::nl, UPstream::nonBlocking, UPstream::nProcs(), UPstream::parRun(), patches, fvMeshSubset::patchMap(), fvMeshSubset::pointMap(), Foam::Pout, autoPtr< T >::ptr(), Foam::renumber(), PtrList< T >::set(), HashTable< T, Key, Hash >::set(), List< T >::setSize(), polyBoundaryMesh::start(), fvMeshSubset::subMesh(), List< T >::transfer(), and Foam::Zero.

Referenced by meshRefinement::balance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printCoupleInfo()

void printCoupleInfo ( const primitiveMesh mesh,
const labelList sourceFace,
const labelList sourceProc,
const labelList sourcePatch,
const labelList sourceNewNbrProc 
)
static

Print some info on coupling data.

Definition at line 285 of file fvMeshDistribute.C.

References Foam::endl(), primitiveMesh::faceCentres(), forAll, mesh, primitiveMesh::nInternalFaces(), Foam::nl, and Foam::Pout.

Here is the call graph for this function:

◆ printIntFieldInfo()

void printIntFieldInfo ( const fvMesh mesh)
static

Print some field info.

Definition at line 81 of file fvMeshDistributeTemplates.C.

References Foam::endl(), fld, forAllConstIters(), mesh, and Foam::Pout.

Here is the call graph for this function:

◆ printFieldInfo()

void printFieldInfo ( const fvMesh mesh)
static

Print some field info.

Definition at line 109 of file fvMeshDistributeTemplates.C.

References Foam::endl(), fld, forAllConstIters(), mesh, OSstream::name(), Foam::nl, Foam::Pout, and fileName::type().

Here is the call graph for this function:

◆ printMeshInfo()

void printMeshInfo ( const fvMesh mesh)
static

Print some info on mesh.

Definition at line 225 of file fvMeshDistribute.C.

References fvMesh::boundary(), polyMesh::cellZones(), Foam::endl(), polyMesh::faceZones(), forAll, mesh, zoneIdentifier::name(), patchIdentifier::name(), primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, primitiveMesh::nPoints(), patches, polyMesh::points(), polyMesh::pointZones(), Foam::Pout, and polyPatch::start().

Here is the call graph for this function:

◆ generateTestField()

Foam::tmp< Foam::surfaceScalarField > generateTestField ( const fvMesh mesh)
static

Generate a test field on faces.

Definition at line 405 of file fvMeshDistribute.C.

References Foam::dimless, fld, forAll, fvMesh::magSf(), mesh, n, IOobject::NO_READ, IOobject::NO_WRITE, Foam::normalised(), VectorSpace< Vector< scalar >, scalar, 3 >::one, tmp< T >::ref(), fvMesh::Sf(), fvMesh::time(), Time::timeName(), and Foam::Zero.

Here is the call graph for this function:

◆ testField()

void testField ( const surfaceScalarField fld)
static

Check whether field consistent with face orientation.

Definition at line 455 of file fvMeshDistribute.C.

References Foam::cos(), Foam::constant::electromagnetic::e, Foam::endl(), primitiveMesh::faceCentres(), fld, forAll, Foam::mag(), fvMesh::magSf(), mesh, n, fvPatch::name(), Foam::normalised(), VectorSpace< Vector< scalar >, scalar, 3 >::one, fvsPatchField< Type >::patch(), fvMesh::Sf(), fvPatch::start(), and WarningInFunction.

Here is the call graph for this function:

The documentation for this class was generated from the following files: