Loading...
Searching...
No Matches
fvMeshDistribute Class Reference

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

#include <fvMeshDistribute.H>

Public Member Functions

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

Static Public Member Functions

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

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 66 of file fvMeshDistribute.H.

Constructor & Destructor Documentation

◆ fvMeshDistribute()

fvMeshDistribute ( fvMesh & mesh)
explicit

Construct from mesh.

Definition at line 1841 of file fvMeshDistribute.C.

References mesh.

Member Function Documentation

◆ ClassName()

ClassName ( "fvMeshDistribute" )

References mesh.

◆ countCells()

Foam::labelList countCells ( const labelList & distribution)
static

Helper function: count cells per processor in wanted distribution.

Definition at line 1849 of file fvMeshDistribute.C.

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

Referenced by meshRefinement::balance(), and distribute().

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

◆ distribute()

◆ 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 262 of file fvMeshDistribute.C.

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

Here is the call graph for this function:

◆ printIntFieldInfo()

template<class GeoField>
void printIntFieldInfo ( const fvMesh & mesh)
static

Print some field info.

Definition at line 83 of file fvMeshDistributeTemplates.C.

References Foam::endl(), field(), Foam::isA(), mesh, and Foam::Pout.

Referenced by distribute().

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

◆ printFieldInfo()

template<class GeoField>
void printFieldInfo ( const fvMesh & mesh)
static

Print some field info.

Definition at line 105 of file fvMeshDistributeTemplates.C.

References Foam::endl(), field(), mesh, Foam::nl, and Foam::Pout.

Referenced by distribute().

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

◆ printMeshInfo()

void printMeshInfo ( const polyMesh & mesh)
static

Print some info on mesh.

Definition at line 220 of file fvMeshDistribute.C.

References Foam::endl(), mesh, Foam::nl, Foam::Pout, and pp().

Referenced by distribute().

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

◆ generateTestField()

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

Generate a test field on faces.

Definition at line 382 of file fvMeshDistribute.C.

References Foam::dimless, fld(), forAll, mesh, n, IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, Foam::normalised(), VectorSpace< Form, Cmpt, Ncmpts >::one, tmp< T >::ref(), UList< T >::size(), 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 433 of file fvMeshDistribute.C.

References Foam::cos(), e, Foam::endl(), fld(), forAll, Foam::mag(), mesh, n, fvPatch::name(), Foam::normalised(), VectorSpace< Form, Cmpt, Ncmpts >::one, fvsPatchFieldBase::patch(), fvPatch::start(), and WarningInFunction.

Here is the call graph for this function:

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