Holds a reference to the original mesh (the baseMesh) and optionally to a subset of that mesh (the subMesh) with mapping lists for points, faces, and cells. More...
Public Member Functions | |
faMeshDistributor (const faMesh &srcMesh, const faMesh &tgtMesh, const mapDistributePolyMesh &faDistMap, const bool isWriteProc=false) | |
Construct from components. More... | |
bool | isWriteProc () const noexcept |
Get status of write enabled (on this proc) More... | |
bool | isWriteProc (const bool on) noexcept |
Change status of write enabled (on this proc) More... | |
label | distributeAllFields (const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const |
template<class Type > | |
tmp< GeometricField< Type, faPatchField, areaMesh > > | distributeField (const GeometricField< Type, faPatchField, areaMesh > &fld) const |
Distribute area field. More... | |
template<class Type > | |
tmp< GeometricField< Type, faePatchField, edgeMesh > > | distributeField (const GeometricField< Type, faePatchField, edgeMesh > &fld) const |
Distribute edge field. More... | |
template<class Type > | |
tmp< GeometricField< Type, faPatchField, areaMesh > > | distributeAreaField (const IOobject &fieldObject) const |
Read and distribute area field. More... | |
template<class Type > | |
tmp< GeometricField< Type, faePatchField, edgeMesh > > | distributeEdgeField (const IOobject &fieldObject) const |
Read and distribute edge field. More... | |
template<class Type > | |
label | distributeAreaFields (const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const |
Read, distribute and write all/selected area fields. More... | |
template<class Type > | |
label | distributeEdgeFields (const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const |
Read, distribute and write all/selected area fields. More... | |
template<class Type > | |
Foam::tmp< Foam::GeometricField< Type, Foam::faPatchField, Foam::areaMesh > > | distributeField (const GeometricField< Type, faPatchField, areaMesh > &fld) const |
template<class Type > | |
Foam::tmp< Foam::GeometricField< Type, Foam::faePatchField, Foam::edgeMesh > > | distributeField (const GeometricField< Type, faePatchField, edgeMesh > &fld) const |
template<class Type > | |
Foam::tmp< Foam::GeometricField< Type, Foam::faPatchField, Foam::areaMesh > > | distributeAreaField (const IOobject &fieldObject) const |
template<class Type > | |
Foam::tmp< Foam::GeometricField< Type, Foam::faePatchField, Foam::edgeMesh > > | distributeEdgeField (const IOobject &fieldObject) const |
template<class Type > | |
Foam::label | distributeAreaFields (const IOobjectList &objects, const wordRes &selectedFields) const |
template<class Type > | |
Foam::label | distributeEdgeFields (const IOobjectList &objects, const wordRes &selectedFields) const |
Static Public Member Functions | |
static mapDistributePolyMesh | distribute (const faMesh &oldMesh, const mapDistributePolyMesh &distMap, const polyMesh &tgtPolyMesh, autoPtr< faMesh > &newMeshPtr) |
Distribute mesh according to the given (volume) mesh distribution. More... | |
static mapDistributePolyMesh | distribute (const faMesh &oldMesh, const mapDistributePolyMesh &distMap, autoPtr< faMesh > &newMeshPtr) |
Distribute mesh according to the given (volume) mesh distribution. More... | |
Static Public Attributes | |
static int | verbose_ = 0 |
Output verbosity when writing. More... | |
Holds a reference to the original mesh (the baseMesh) and optionally to a subset of that mesh (the subMesh) with mapping lists for points, faces, and cells.
Definition at line 60 of file faMeshDistributor.H.
faMeshDistributor | ( | const faMesh & | srcMesh, |
const faMesh & | tgtMesh, | ||
const mapDistributePolyMesh & | faDistMap, | ||
const bool | isWriteProc = false |
||
) |
Construct from components.
Definition at line 101 of file faMeshDistributor.C.
References faMesh::areaCentres(), Foam::diff(), mapDistributePolyMesh::distributeCellData(), mapDistributePolyMesh::distributeFaceData(), faMesh::edgeCentres(), Foam::endl(), faMesh::faceLabels(), faMeshTools::flattenEdgeField(), forAll, Foam::Info, faMesh::nEdges(), Foam::nl, Foam::Pout, and UList< T >::size().
|
static |
Distribute mesh according to the given (volume) mesh distribution.
Uses 'tgtPolyMesh' for the new mesh
{ // Transcribe from patchMapInfo gathered earlier. // - transform Map of labelHashSet to labelListList
labelListList sendToRemote(Pstream::nProcs(faPatchMap.comm()));
forAllConstIters(patchMapInfo, iter) { const label proci = iter.key(); sendToRemote[proci] = iter.val().sortedToc(); }
auto& patchSubMap = faPatchMap.subMap(); auto& patchCnstrMap = faPatchMap.constructMap();
patchSubMap = sendToRemote; patchCnstrMap.resize(patchSubMap.size());
// Change sendToRemote into recv-from-remote by using // all-to-all exchange
Pstream::exchange<labelList, label> ( sendToRemote, patchCnstrMap, UPstream::msgType(), faPatchMap.comm() ); }
tgtPolyMesh | From polyMesh |
Definition at line 39 of file faMeshDistributorNew.C.
References Foam::abort(), add(), faMesh::boundary(), Pstream::broadcast(), PtrList< T >::clone(), mapDistributeBase::comm(), mapDistributeBase::compactLocalData(), mapDistributeBase::constructHasFlip(), mapDistributeBase::constructMap(), mapDistributeBase::constructSize(), faMeshDistributor::distribute(), faPatch::edgeLabels(), Foam::endl(), Foam::exit(), PrimitivePatch< FaceList, PointField >::faceEdges(), faMesh::faceLabels(), mapDistributePolyMesh::faceMap(), Foam::FatalError, FatalErrorInFunction, Foam::ListOps::findIndices(), FixedList< T, N >::first(), forAll, faMesh::hasInternalEdgeLabels(), Foam::identity(), HashTable< T, Key, Hash >::insert(), io(), UList< T >::last(), HashTable< T, Key, Hash >::lookup(), Foam::mag(), PrimitivePatch< FaceList, PointField >::meshPoints(), UPstream::msgType(), processorFaPatch::myProcNo(), PrimitivePatch< FaceList, PointField >::nEdges(), nEdges(), PrimitivePatch< FaceList, PointField >::nFaces(), PrimitivePatch< FaceList, PointField >::nInternalEdges(), nNonProcessor, mapDistributePolyMesh::nOldFaces(), mapDistributePolyMesh::nOldPoints(), UPstream::nonBlocking, nPatches, PrimitivePatch< FaceList, PointField >::nPoints(), nProcEdges(), PstreamBuffers::nProcs(), UPstream::nRequests(), UPstream::parRun(), faMesh::patch(), faBoundaryMesh::patchStarts(), mapDistributePolyMesh::pointMap(), IOobject::READ_IF_PRESENT, IOobject::readOpt(), mapDistributeBase::renumberMap(), autoPtr< T >::reset(), List< T >::resize(), PtrList< T >::resize(), mapDistributeBase::reverseDistribute(), Pair< T >::second(), HashTable< T, Key, Hash >::set(), PtrList< T >::set(), UList< T >::size(), Foam::sortedOrder(), mapDistributeBase::subHasFlip(), mapDistributeBase::subMap(), globalIndex::toGlobal(), UPstream::waitRequests(), x, y, and Foam::Zero.
Referenced by faMeshDistributor::distribute().
|
static |
Distribute mesh according to the given (volume) mesh distribution.
Re-uses polyMesh from oldMesh for the new mesh
newMeshPtr | From polyMesh |
Definition at line 899 of file faMeshDistributorNew.C.
References faMeshDistributor::distribute(), and faMesh::mesh().
|
inlinenoexcept |
Get status of write enabled (on this proc)
Definition at line 151 of file faMeshDistributor.H.
Change status of write enabled (on this proc)
Definition at line 157 of file faMeshDistributor.H.
Foam::label distributeAllFields | ( | const IOobjectList & | objects, |
const wordRes & | selectedFields = wordRes() |
||
) | const |
Read, distribute and write all/selected point field types (scalar, vector, ... types)
Definition at line 207 of file faMeshDistributor.C.
tmp< GeometricField< Type, faPatchField, areaMesh > > distributeField | ( | const GeometricField< Type, faPatchField, areaMesh > & | fld | ) | const |
Distribute area field.
tmp< GeometricField< Type, faePatchField, edgeMesh > > distributeField | ( | const GeometricField< Type, faePatchField, edgeMesh > & | fld | ) | const |
Distribute edge field.
tmp< GeometricField< Type, faPatchField, areaMesh > > distributeAreaField | ( | const IOobject & | fieldObject | ) | const |
Read and distribute area field.
tmp< GeometricField< Type, faePatchField, edgeMesh > > distributeEdgeField | ( | const IOobject & | fieldObject | ) | const |
Read and distribute edge field.
label distributeAreaFields | ( | const IOobjectList & | objects, |
const wordRes & | selectedFields = wordRes() |
||
) | const |
Read, distribute and write all/selected area fields.
label distributeEdgeFields | ( | const IOobjectList & | objects, |
const wordRes & | selectedFields = wordRes() |
||
) | const |
Read, distribute and write all/selected area fields.
Foam::tmp< Foam::GeometricField< Type, Foam::faPatchField, Foam::areaMesh > > distributeField | ( | const GeometricField< Type, faPatchField, areaMesh > & | fld | ) | const |
Definition at line 47 of file faMeshDistributorTemplates.C.
References faMesh::boundary(), mapDistributePolyMesh::cellMap(), fld(), forAll, Foam::New(), IOobject::NO_READ, IOobject::NO_WRITE, DimensionedField< Type, GeoMesh >::oriented(), PtrList< T >::set(), UPtrList< T >::size(), faMesh::thisDb(), faMesh::time(), and Time::timeName().
Foam::tmp< Foam::GeometricField< Type, Foam::faePatchField, Foam::edgeMesh > > distributeField | ( | const GeometricField< Type, faePatchField, edgeMesh > & | fld | ) | const |
Definition at line 156 of file faMeshDistributorTemplates.C.
References fld(), forAll, Foam::New(), IOobject::NO_READ, IOobject::NO_WRITE, DimensionedField< Type, GeoMesh >::oriented(), and PtrList< T >::set().
Foam::tmp< Foam::GeometricField< Type, Foam::faPatchField, Foam::areaMesh > > distributeAreaField | ( | const IOobject & | fieldObject | ) | const |
Definition at line 261 of file faMeshDistributorTemplates.C.
References fld().
Foam::tmp< Foam::GeometricField< Type, Foam::faePatchField, Foam::edgeMesh > > distributeEdgeField | ( | const IOobject & | fieldObject | ) | const |
Definition at line 280 of file faMeshDistributorTemplates.C.
References fld().
Foam::label distributeAreaFields | ( | const IOobjectList & | objects, |
const wordRes & | selectedFields | ||
) | const |
Definition at line 298 of file faMeshDistributorTemplates.C.
References UList< T >::empty(), Foam::endl(), Foam::Info, io(), IOobject::name(), Foam::nl, and IOobjectList::sorted().
Foam::label distributeEdgeFields | ( | const IOobjectList & | objects, |
const wordRes & | selectedFields | ||
) | const |
Definition at line 342 of file faMeshDistributorTemplates.C.
References UList< T >::empty(), Foam::endl(), Foam::Info, io(), IOobject::name(), Foam::nl, and IOobjectList::sorted().
|
static |
Output verbosity when writing.
Definition at line 111 of file faMeshDistributor.H.