Go to the documentation of this file.
35 template<
typename Type>
36 Type Foam::zoneDistribute::getLocalValue
38 const GeometricField<Type, fvPatchField, volMesh>&
phi,
47 return faceValue(
phi,localIdx);
51 template<
typename Type>
52 Type Foam::zoneDistribute::faceValue
54 const GeometricField<Type, fvPatchField, volMesh>&
phi,
58 const label faceI = localIdx + mesh_.nInternalFaces() - mesh_.nCells();
60 const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
63 const label patchI = pbm.whichPatch(faceI);
65 if (patchI < 0 || patchI >= pbm.size())
68 <<
"Cannot find patch for face " << faceI
72 const polyPatch& pp = pbm[patchI];
74 const label patchFaceI = pp.whichFace(faceI);
80 template<
typename Type>
88 if (gblIdx_.isLocal(gblIdx))
90 const label idx = gblIdx_.toLocal(gblIdx);
91 return getLocalValue(
phi,idx);
95 return valuesFromOtherProc[gblIdx];
100 template<
typename Type>
110 <<
"size of zone: " <<
zone.size()
111 <<
"size of phi:" <<
phi.size()
112 <<
"do not match. Did the mesh change?"
131 for (
const label gblIdx : stencil_[celli])
133 tmpField.
append(getValue(
phi,neiValues,gblIdx));
136 stencilWithValues.insert(celli,tmpField);
140 return stencilWithValues;
144 template<
typename Type>
154 <<
"size of zone: " <<
zone.size()
155 <<
"size of phi:" <<
phi.size()
156 <<
"do not match. Did the mesh change?"
170 for (
const label sendIdx : send_[domaini])
172 sendValues[domaini].insert
175 getLocalValue(
phi,gblIdx_.toLocal(sendIdx))
190 toDomain << sendValues[domain];
206 fromDomain >> tmpValue;
208 neiValues += tmpValue;
Type getValue(const GeometricField< Type, fvPatchField, volMesh > &phi, const Map< Type > &valuesFromOtherProc, const label gblIdx) const
Map< Type > getDatafromOtherProc(const boolList &zone, const GeometricField< Type, fvPatchField, volMesh > &phi)
Returns stencil and provides a Map with globalNumbering.
void clearStorage()
Clear the list and delete storage.
Output inter-processor communications stream operating on external buffer.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Base class for mesh zones.
A HashTable to objects of type <T> with a label key.
#define forAll(list, i)
Loop across all elements in list.
label nCells() const noexcept
Number of mesh cells.
void finishedSends(const bool block=true)
Mark all sends as having been done.
errorManip< error > abort(error &err)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static rangeType allProcs(const label communicator=worldComm)
Range of process indices for all processes.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
static bool & parRun() noexcept
Test if this a parallel run.
Map< Field< Type > > getFields(const boolList &zone, const GeometricField< Type, fvPatchField, volMesh > &phi)
Returns stencil and provides a Map with globalNumbering.
Input inter-processor communications stream operating on external buffer.
DynamicField< T, SizeMin > & append(const T &val)
Append an element at the end of the list.
static label nProcs(const label communicator=worldComm)
Number of processes in parallel run, and 1 for serial run.
const Boundary & boundaryField() const
Return const-reference to the boundary field.