Go to the documentation of this file.
35 template<
typename Type>
36 Type Foam::zoneDistribute::getLocalValue
38 const GeometricField<Type, fvPatchField, volMesh>&
phi,
48 return faceValue(
phi,localIdx);
54 template<
typename Type>
55 Type Foam::zoneDistribute::faceValue
57 const GeometricField<Type, fvPatchField, volMesh>&
phi,
61 const label faceI = localIdx + mesh_.nInternalFaces() - mesh_.nCells();
63 const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
66 const label patchI = pbm.whichPatch(faceI);
68 if (patchI < 0 || patchI >= pbm.size())
71 <<
"Cannot find patch for face " << faceI
75 const polyPatch& pp = pbm[patchI];
77 const label patchFaceI = pp.whichFace(faceI);
83 template<
typename Type>
91 if (globalNumbering().isLocal(gblIdx))
93 const label idx = globalNumbering().toLocal(gblIdx);
94 return getLocalValue(
phi,idx);
98 return valuesFromOtherProc[gblIdx];
103 template<
typename Type>
113 <<
"size of zone: " <<
zone.size()
114 <<
"size of phi:" <<
phi.size()
115 <<
"do not match. Did the mesh change?"
135 for (
const label gblIdx : stencil_[celli])
137 tmpField.
append(getValue(
phi,neiValues,gblIdx));
140 stencilWithValues.insert(celli,tmpField);
144 return stencilWithValues;
148 template<
typename Type>
158 <<
"size of zone: " <<
zone.size()
159 <<
"size of phi:" <<
phi.size()
160 <<
"do not match. Did the mesh change?"
175 for (
const label sendIdx : send_[domaini])
177 sendValues[domaini].insert
180 getLocalValue(
phi,globalNumbering().toLocal(sendIdx))
195 toDomain << sendValues[domain];
211 fromDomain >> tmpValue;
213 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).
static bool & parRun()
Test if this a parallel run, or allow modify access.
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
Number of mesh cells.
void finishedSends(const bool block=true)
Mark all sends as having been done. This will start receives.
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)
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.