Go to the documentation of this file.
34 template<
typename Type>
35 Type Foam::zoneDistribute::getLocalValue
37 const GeometricField<Type, fvPatchField, volMesh>&
phi,
47 return faceValue(
phi,localIdx);
53 template<
typename Type>
54 Type Foam::zoneDistribute::faceValue
56 const GeometricField<Type, fvPatchField, volMesh>&
phi,
60 const label faceI = localIdx + mesh_.nInternalFaces() - mesh_.nCells();
62 const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
65 const label patchI = pbm.whichPatch(faceI);
67 if (patchI < 0 || patchI >= pbm.size())
70 <<
"Cannot find patch for face " << faceI
74 const polyPatch& pp = pbm[patchI];
76 const label patchFaceI = pp.whichFace(faceI);
82 template<
typename Type>
90 if (globalNumbering().isLocal(gblIdx))
92 const label idx = globalNumbering().toLocal(gblIdx);
93 return getLocalValue(
phi,idx);
97 return valuesFromOtherProc[gblIdx];
102 template<
typename Type>
112 <<
"size of zone: " <<
zone.size()
113 <<
"size of phi:" <<
phi.size()
114 <<
"do not match. Did the mesh change?"
134 for (
const label gblIdx : stencil_[celli])
136 tmpField.
append(getValue(
phi,neiValues,gblIdx));
139 stencilWithValues.insert(celli,tmpField);
143 return stencilWithValues;
147 template<
typename Type>
157 <<
"size of zone: " <<
zone.size()
158 <<
"size of phi:" <<
phi.size()
159 <<
"do not match. Did the mesh change?"
174 for (
const label sendIdx : send_[domaini])
176 sendValues[domaini].insert
179 getLocalValue(
phi,globalNumbering().toLocal(sendIdx))
194 toDomain << sendValues[domain];
210 fromDomain >> tmpValue;
212 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.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
static bool & parRun()
Is this a parallel run?
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)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
const Boundary & boundaryField() const
Return const-reference to the boundary field.