90 UPstream::listGatherValues<bool>
92 (srcPatch.size() > 0 || tgtPatch.size() > 0),
97 const auto nHaveFaces = hasFaces.
count();
101 proci = hasFaces.find_first();
103 <<
"AMI local to processor" << proci <<
endl;
105 else if (nHaveFaces > 1)
109 <<
"AMI split across multiple processors" <<
endl;
121 const searchableSurface& surf,
125 addProfiling(ami,
"AMIInterpolation::projectPointsToSurface");
129 List<pointIndexHit> nearInfo;
152 <<
"Error projecting points to surface: " 153 << nMiss <<
" faces could not be determined" 162 const word& patchName,
166 const bool conformal,
168 const scalar lowWeightTol,
172 addProfiling(ami,
"AMIInterpolation::normaliseWeights");
175 wghtSum.resize_nocopy(wght.size());
176 label nLowWeight = 0;
184 scalar denom = patchAreas[facei];
199 if (t < lowWeightTol)
220 <<
"AMI: Patch " << patchName
222 <<
" min:" <<
gMin(wghtSum)
223 <<
" max:" <<
gMax(wghtSum)
226 const label nLow =
returnReduce(nLowWeight, sumOp<label>());
231 <<
"AMI: Patch " << patchName
232 <<
" identified " << nLow
233 <<
" faces with weights less than " << lowWeightTol
245 const autoPtr<mapDistribute>& targetMapPtr,
250 const labelList& sourceRestrictAddressing,
251 const labelList& targetRestrictAddressing,
257 autoPtr<mapDistribute>& tgtMap,
263 label sourceCoarseSize =
265 sourceRestrictAddressing.size()
266 ?
max(sourceRestrictAddressing)+1
270 label targetCoarseSize =
272 targetRestrictAddressing.size()
273 ?
max(targetRestrictAddressing)+1
280 srcMagSf.setSize(sourceCoarseSize, 0.0);
282 forAll(sourceRestrictAddressing, facei)
284 label coarseFacei = sourceRestrictAddressing[facei];
285 srcMagSf[coarseFacei] += fineSrcMagSf[facei];
292 const mapDistribute& map = *targetMapPtr;
295 labelList allRestrict(targetRestrictAddressing);
296 map.distribute(allRestrict);
331 forAll(map.subMap(), proci)
343 const labelList& elems = map.subMap()[proci];
349 labelList oldToNew(targetCoarseSize, -1);
352 for (
const label elemi : elems)
354 label fineElem = elemsMap[elemi];
355 label coarseElem = allRestrict[fineElem];
356 if (oldToNew[coarseElem] == -1)
358 oldToNew[coarseElem] = newi;
359 newSubMap[newi] = coarseElem;
363 newSubMap.resize(newi);
379 labelList tgtCompactMap(map.constructSize());
390 for (
const label fineElem : elemsMap)
392 label coarseElem = allRestrict[fineElem];
393 tgtCompactMap[fineElem] = coarseElem;
397 label compacti = targetCoarseSize;
400 forAll(map.constructMap(), proci)
407 const labelList& elems = map.constructMap()[proci];
409 labelList& newConstructMap = tgtConstructMap[proci];
416 label remoteTargetCoarseSize =
labelMin;
417 for (
const label elemi : elems)
419 remoteTargetCoarseSize =
max 421 remoteTargetCoarseSize,
425 remoteTargetCoarseSize += 1;
428 labelList oldToNew(remoteTargetCoarseSize, -1);
431 for (
const label fineElem : elems)
434 label coarseElem = allRestrict[fineElem];
435 if (oldToNew[coarseElem] == -1)
437 oldToNew[coarseElem] = newi;
438 tgtCompactMap[fineElem] = compacti;
439 newConstructMap[newi] = compacti++;
445 label compacti = oldToNew[coarseElem];
446 tgtCompactMap[fineElem] = newConstructMap[compacti];
449 newConstructMap.resize(newi);
454 srcAddress.setSize(sourceCoarseSize);
455 srcWeights.setSize(sourceCoarseSize);
457 forAll(fineSrcAddress, facei)
461 const labelList& elems = fineSrcAddress[facei];
462 const scalarList& weights = fineSrcWeights[facei];
463 const scalar fineArea = fineSrcMagSf[facei];
465 label coarseFacei = sourceRestrictAddressing[facei];
467 labelList& newElems = srcAddress[coarseFacei];
468 scalarList& newWeights = srcWeights[coarseFacei];
472 label elemi = elems[i];
473 label coarseElemi = tgtCompactMap[elemi];
475 label index = newElems.find(coarseElemi);
478 newElems.append(coarseElemi);
479 newWeights.append(fineArea*weights[i]);
483 newWeights[index] += fineArea*weights[i];
493 std::move(tgtSubMap),
494 std::move(tgtConstructMap),
503 srcAddress.setSize(sourceCoarseSize);
504 srcWeights.setSize(sourceCoarseSize);
506 forAll(fineSrcAddress, facei)
510 const labelList& elems = fineSrcAddress[facei];
511 const scalarList& weights = fineSrcWeights[facei];
512 const scalar fineArea = fineSrcMagSf[facei];
514 label coarseFacei = sourceRestrictAddressing[facei];
516 labelList& newElems = srcAddress[coarseFacei];
517 scalarList& newWeights = srcWeights[coarseFacei];
521 const label elemi = elems[i];
522 const label coarseElemi = targetRestrictAddressing[elemi];
524 const label index = newElems.find(coarseElemi);
527 newElems.append(coarseElemi);
528 newWeights.append(fineArea*weights[i]);
532 newWeights[index] += fineArea*weights[i];
559 const bool reverseTarget
562 requireMatch_(
dict.getOrDefault(
"requireMatch", true)),
563 reverseTarget_(
dict.getOrDefault(
"reverseTarget", reverseTarget)),
564 lowWeightCorrection_(
dict.getOrDefault<scalar>(
"lowWeightCorrection", -1)),
565 singlePatchProc_(-999),
585 const bool requireMatch,
586 const bool reverseTarget,
587 const scalar lowWeightCorrection
590 requireMatch_(requireMatch),
591 reverseTarget_(reverseTarget),
592 lowWeightCorrection_(lowWeightCorrection),
593 singlePatchProc_(-999),
616 const labelList& sourceRestrictAddressing,
617 const labelList& targetRestrictAddressing
620 requireMatch_(fineAMI.requireMatch_),
621 reverseTarget_(fineAMI.reverseTarget_),
622 lowWeightCorrection_(-1.0),
623 singlePatchProc_(fineAMI.singlePatchProc_),
624 comm_(fineAMI.comm_),
639 label sourceCoarseSize =
641 sourceRestrictAddressing.
size()
642 ?
max(sourceRestrictAddressing)+1
646 label neighbourCoarseSize =
648 targetRestrictAddressing.
size()
649 ?
max(targetRestrictAddressing)+1
655 Pout<<
"AMI: Creating addressing and weights as agglomeration of AMI :" 658 <<
" fineComm:" << fineAMI.
comm()
659 <<
" coarse source size:" << sourceCoarseSize
660 <<
" neighbour source size:" << neighbourCoarseSize
671 <<
"Size mismatch." <<
nl 673 <<
"Source agglomeration size:" 674 << sourceRestrictAddressing.
size() <<
nl 676 <<
"Target agglomeration size:" 677 << targetRestrictAddressing.
size()
691 sourceRestrictAddressing,
692 targetRestrictAddressing,
709 targetRestrictAddressing,
710 sourceRestrictAddressing,
724 requireMatch_(ami.requireMatch_),
725 reverseTarget_(ami.reverseTarget_),
726 lowWeightCorrection_(ami.lowWeightCorrection_),
727 singlePatchProc_(ami.singlePatchProc_),
729 srcMagSf_(ami.srcMagSf_),
730 srcAddress_(ami.srcAddress_),
731 srcWeights_(ami.srcWeights_),
732 srcWeightsSum_(ami.srcWeightsSum_),
733 srcCentroids_(ami.srcCentroids_),
735 tgtMagSf_(ami.tgtMagSf_),
736 tgtAddress_(ami.tgtAddress_),
737 tgtWeights_(ami.tgtWeights_),
738 tgtWeightsSum_(ami.tgtWeightsSum_),
739 tgtCentroids_(ami.tgtCentroids_),
749 lowWeightCorrection_(readScalar(is)),
785 const autoPtr<searchableSurface>& surfPtr
797 srcPatchPts_ = srcPatch.points();
798 projectPointsToSurface(surfPtr(), srcPatchPts_);
801 SubList<face>(srcPatch),
805 tgtPatchPts_ = tgtPatch.points();
806 projectPointsToSurface(surfPtr(), tgtPatchPts_);
809 SubList<face>(tgtPatch),
815 tsrcPatch0_.cref(srcPatch);
816 ttgtPatch0_.cref(tgtPatch);
834 if (srcTotalSize == 0)
837 <<
"AMI: no source faces present - no addressing constructed" 843 singlePatchProc_ = calcDistribution(srcPatch, tgtPatch);
845 Info<<
indent <<
"AMI: Patch source faces: " << srcTotalSize <<
nl 846 <<
indent <<
"AMI: Patch target faces: " << tgtTotalSize <<
nl;
854 <<
"AMI: patch proc:" << singlePatchProc_
869 const label singlePatchProc
874 srcAddress_.transfer(srcAddress);
875 srcWeights_.transfer(srcWeights);
876 tgtAddress_.transfer(tgtAddress);
877 tgtWeights_.transfer(tgtWeights);
880 srcWeightsSum_.resize_nocopy(srcWeights_.size());
881 forAll(srcWeights_, facei)
883 srcWeightsSum_[facei] =
sum(srcWeights_[facei]);
886 tgtWeightsSum_.resize_nocopy(tgtWeights_.size());
887 forAll(tgtWeights_, facei)
889 tgtWeightsSum_[facei] =
sum(tgtWeights_[facei]);
892 srcMapPtr_ = std::move(srcToTgtMap);
893 tgtMapPtr_ = std::move(tgtToSrcMap);
895 singlePatchProc_ = singlePatchProc;
910 auto newPtr = clone();
911 newPtr->calculate(srcPatch, tgtPatch);
923 labelListList& newSrcConstructMap = newPtr->srcMapPtr_->constructMap();
926 labelListList& newTgtConstructMap = newPtr->tgtMapPtr_->constructMap();
933 srcMapPtr_->constructMapTotalSize(),
934 tgtMapPtr_->constructMapTotalSize()
941 newPtr->srcMapPtr_->constructMapTotalSize(),
942 newPtr->tgtMapPtr_->constructMapTotalSize()
949 auto iter1 = oldMapMap.
begin();
950 auto iter2 = newMapMap.
begin();
954 const label len1 = srcConstructMap[proci].
size();
955 const label len2 = newSrcConstructMap[proci].
size();
957 std::iota(iter1, (iter1 + len1), total);
961 std::iota(iter2, (iter2 + len2), total);
971 for (label& value : list)
973 value = oldMapMap[value];
977 for (
labelList& list : newSrcConstructMap)
979 for (label& value : list)
981 value = newMapMap[value];
987 for (label& value : list)
989 value = oldMapMap[value];
993 for (
labelList& list : newPtr->tgtAddress_)
995 for (label& value : list)
997 value = newMapMap[value];
1006 auto iter1 = oldMapMap.
begin();
1007 auto iter2 = newMapMap.
begin();
1011 const label len1 = tgtConstructMap[proci].
size();
1012 const label len2 = newTgtConstructMap[proci].
size();
1014 std::iota(iter1, (iter1 + len1), total);
1018 std::iota(iter2, (iter2 + len2), total);
1028 for (label& value : list)
1030 value = oldMapMap[value];
1034 for (
labelList& list : newTgtConstructMap)
1036 for (label& value : list)
1038 value = newMapMap[value];
1044 for (label& value : list)
1046 value = oldMapMap[value];
1050 for (
labelList& list : newPtr->srcAddress_)
1052 for (label& value : list)
1054 value = newMapMap[value];
1060 srcMapPtr_->constructSize() += newPtr->srcMapPtr_->constructSize();
1061 tgtMapPtr_->constructSize() += newPtr->tgtMapPtr_->constructSize();
1066 srcSubMap[proci].
push_back(newSrcSubMap[proci]);
1067 srcConstructMap[proci].
push_back(newSrcConstructMap[proci]);
1069 tgtSubMap[proci].
push_back(newTgtSubMap[proci]);
1070 tgtConstructMap[proci].
push_back(newTgtConstructMap[proci]);
1075 forAll(srcMagSf_, srcFacei)
1077 srcAddress_[srcFacei].push_back(newPtr->srcAddress()[srcFacei]);
1078 srcWeights_[srcFacei].push_back(newPtr->srcWeights()[srcFacei]);
1079 srcWeightsSum_[srcFacei] += newPtr->srcWeightsSum()[srcFacei];
1083 forAll(tgtMagSf_, tgtFacei)
1085 tgtAddress_[tgtFacei].push_back(newPtr->tgtAddress()[tgtFacei]);
1086 tgtWeights_[tgtFacei].push_back(newPtr->tgtWeights()[tgtFacei]);
1087 tgtWeightsSum_[tgtFacei] += newPtr->tgtWeightsSum()[tgtFacei];
1094 const bool conformal,
1107 lowWeightCorrection_,
1120 lowWeightCorrection_,
1131 const label tgtFacei,
1139 const labelList& addr = tgtAddress_[tgtFacei];
1143 label nearestFacei = -1;
1145 for (
const label srcFacei : addr)
1147 const face&
f = srcPatch[srcFacei];
1150 f.ray(tgtPoint,
n, srcPoints, intersection::algorithm::VISIBLE);
1154 tgtPoint = ray.
point();
1161 nearestFacei = srcFacei;
1167 tgtPoint = nearest.
point();
1168 return nearestFacei;
1180 const label srcFacei,
1185 const pointField& tgtPoints = tgtPatch.points();
1189 label nearestFacei = -1;
1192 const labelList& addr = srcAddress_[srcFacei];
1194 for (
const label tgtFacei : addr)
1196 const face&
f = tgtPatch[tgtFacei];
1199 f.ray(srcPoint,
n, tgtPoints, intersection::algorithm::VISIBLE);
1203 srcPoint = ray.point();
1206 const pointHit near =
f.nearestPoint(srcPoint, tgtPoints);
1208 if (near.distance() < nearest.distance())
1211 nearestFacei = tgtFacei;
1214 if (nearest.hit() || nearest.eligibleMiss())
1216 srcPoint = nearest.point();
1217 return nearestFacei;
1228 Log <<
"Checks only valid for serial running (currently)" <<
endl;
1233 bool symmetricSrc =
true;
1235 Log <<
" Checking for missing src face in tgt lists" <<
nl;
1237 forAll(srcAddress_, srcFacei)
1239 const labelList& tgtIds = srcAddress_[srcFacei];
1240 for (
const label tgtFacei : tgtIds)
1242 if (!tgtAddress_[tgtFacei].
found(srcFacei))
1244 symmetricSrc =
false;
1246 Log <<
" srcFacei:" << srcFacei
1247 <<
" not found in tgtToSrc list for tgtFacei:" 1255 Log <<
" - symmetric" <<
endl;
1258 bool symmetricTgt =
true;
1260 Log <<
" Checking for missing tgt face in src lists" <<
nl;
1262 forAll(tgtAddress_, tgtFacei)
1264 const labelList& srcIds = tgtAddress_[tgtFacei];
1265 for (
const label srcFacei : srcIds)
1267 if (!srcAddress_[srcFacei].
found(tgtFacei))
1269 symmetricTgt =
false;
1271 Log <<
" tgtFacei:" << tgtFacei
1272 <<
" not found in srcToTgt list for srcFacei:" 1280 Log <<
" - symmetric" <<
endl;
1283 return symmetricSrc && symmetricTgt;
1302 const point& srcPt = srcPatch.faceCentres()[i];
1304 for (
const label tgtPti : addr)
1306 const point& tgtPt = tgtPatch.faceCentres()[tgtPti];
1311 os <<
"l " << pti <<
" " << pti + 1 <<
endl;
1333 if (lowWeightCorrection_ > 0)
1335 os.
writeEntry(
"lowWeightCorrection", lowWeightCorrection_);
1342 os << requireMatch()
List< scalar > scalarList
List of scalar.
label singlePatchProc_
Index of processor that holds all of both sides. The value is -1 for distributed cases.
void append(const primitivePatch &srcPatch, const primitivePatch &tgtPatch)
Append additional addressing and weights.
void size(const label n)
Older name for setAddressableSize.
unsigned int count(const bool on=true) const
Count number of bits set.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
Ostream & indent(Ostream &os)
Indent stream.
labelListList tgtAddress_
Addresses of source faces per target face.
dimensionedScalar log(const dimensionedScalar &ds)
label tgtPointFace(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const vector &n, const label srcFacei, point &srcPoint) const
Return target patch face index of point on source patch face.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A face is a list of labels corresponding to mesh vertices.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const scalarListList & tgtWeights() const
Return const access to target patch weights.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
autoPtr< mapDistribute > tgtMapPtr_
Target map pointer - parallel running only.
void inflate(const scalar factor)
Expand box by factor*mag(span) in all dimensions.
void writeFaceConnectivity(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const labelListList &srcAddress) const
Write face connectivity as OBJ file.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static refPtr< T > New(Args &&... args)
Construct refPtr with forwarding arguments.
label srcPointFace(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const vector &n, const label tgtFacei, point &tgtPoint) const
Return source patch face index of point on target patch face.
void projectPointsToSurface(const searchableSurface &surf, pointField &pts) const
Project points to surface.
autoPtr< indexedOctree< treeType > > createTree(const primitivePatch &patch) const
Reset the octree for the patch face search.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
virtual bool writeData(Ostream &os) const
Write AMI raw.
const labelListList & tgtAddress() const
Return const access to target patch addressing.
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
static bool & parRun() noexcept
Test if this a parallel run.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
static int & msgType() noexcept
Message tag of standard messages.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
void push_back(const T &val)
Append an element at the end of the list.
static bool cacheIntersections_
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
List< labelList > labelListList
List of labelList.
autoPtr< mapDistribute > srcMapPtr_
Source map pointer - parallel running only.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-paral...
label comm_
Communicator to use for parallel operations.
#define forAll(list, i)
Loop across all elements in list.
AMIInterpolation(const dictionary &dict, const bool reverseTarget=false)
Construct from dictionary.
bool hit() const noexcept
Is there a hit.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
A list of faces which address into the list of points.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
#define addProfiling(Name, Descr)
Define profiling trigger with specified name and description string.
vectorField pointField
pointField is a vectorField.
virtual bool calculate(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const autoPtr< searchableSurface > &surfPtr=nullptr)
Update addressing, weights and (optional) centroids.
const List< scalar > & tgtMagSf() const
Return const access to target patch face areas.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
static void agglomerate(const autoPtr< mapDistribute > &targetMap, const scalarList &fineSrcMagSf, const labelListList &fineSrcAddress, const scalarListList &fineSrcWeights, const labelList &sourceRestrictAddressing, const labelList &targetRestrictAddressing, scalarList &srcMagSf, labelListList &srcAddress, scalarListList &srcWeights, scalarField &srcWeightsSum, autoPtr< mapDistribute > &tgtMap, const label comm)
List< scalarList > scalarListList
List of scalarList.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
#define DebugInFunction
Report an information message using Foam::Info.
Encapsulation of data needed to search on PrimitivePatches.
void setDistance(const scalar d) noexcept
Set the distance.
constexpr scalar pi(M_PI)
Describes the interaction of a object and a (templated) point. It carries the info of a successful hi...
const Field< point_type > & points() const noexcept
Return reference to global points.
bool checkSymmetricWeights(const bool log) const
Check if src addresses are present in tgt addresses and viceversa.
errorManip< error > abort(error &err)
scalarListList srcWeights_
Weights of target faces per source face.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
#define DebugInfo
Report an information message using Foam::Info.
scalarField srcWeightsSum_
Sum of weights of target faces per source face.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const scalarListList & srcWeights() const
Return const access to source patch weights.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
A PrimitivePatch with a SubList addressing for the faces, const reference for the point field...
const List< scalar > & srcMagSf() const
Return const access to source patch face areas.
scalarList tgtMagSf_
Target face areas.
scalarField tgtWeightsSum_
Sum of weights of source faces per target face.
labelListList srcAddress_
Addresses of target faces per source face.
static void normaliseWeights(const scalarList &patchAreas, const word &patchName, const labelListList &addr, scalarListList &wght, scalarField &wghtSum, const bool conformal, const bool output, const scalar lowWeightTol, const label comm)
Normalise the (area) weights - suppresses numerical error in weights calculation. ...
Class containing processor-to-processor mapping information.
vector point
Point is a vector.
Non-pointer based hierarchical recursive searching.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Type gAverage(const FieldField< Field, Type > &f)
scalarListList tgtWeights_
Weights of source faces per target face.
bool good() const noexcept
True if next operation might succeed.
scalar distance() const noexcept
Return distance to hit.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
const std::string patch
OpenFOAM patch number as a std::string.
const point_type & point() const noexcept
Return the point, no checks.
Standard boundBox with extra functionality for use in octree.
messageStream Info
Information stream (stdout output on master, null elsewhere)
static Ostream & output(Ostream &os, const IntRange< T > &range)
label calcDistribution(const primitivePatch &srcPatch, const primitivePatch &tgtPatch) const
Calculate if patches are on multiple processors.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
static autoPtr< AMIInterpolation > New(const word &modelName, const dictionary &dict, const bool reverseTarget=false)
Selector for dictionary.
bool eligibleMiss() const noexcept
Is this an eligible miss.
List< label > labelList
A List of labels.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
const labelListList & srcAddress() const
Return const access to source patch addressing.
scalarList srcMagSf_
Source face areas.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Inter-processor communications stream.
void reset(autoPtr< mapDistribute > &&srcToTgtMap, autoPtr< mapDistribute > &&tgtToSrcMap, labelListList &&srcAddress, scalarListList &&srcWeights, labelListList &&tgtAddress, scalarListList &&tgtWeights, const label singlePatchProc)
Set the maps, addresses and weights from an external source.
bool readBool(Istream &is)
Read bool from stream using Foam::Switch(Istream&)
PointHit< point > pointHit
A PointHit with a 3D point.
label comm() const
Communicator to use for parallel operations.
virtual void write(Ostream &os) const
Write AMI as a dictionary.