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" 845 singlePatchProc_ = calcDistribution(srcPatch, tgtPatch);
847 Info<<
indent <<
"AMI: Patch source faces: " << srcTotalSize <<
nl 848 <<
indent <<
"AMI: Patch target faces: " << tgtTotalSize <<
nl;
856 <<
"AMI: patch proc:" << singlePatchProc_
871 const label singlePatchProc
876 srcAddress_.transfer(srcAddress);
877 srcWeights_.transfer(srcWeights);
878 tgtAddress_.transfer(tgtAddress);
879 tgtWeights_.transfer(tgtWeights);
882 srcWeightsSum_.resize_nocopy(srcWeights_.size());
883 forAll(srcWeights_, facei)
885 srcWeightsSum_[facei] =
sum(srcWeights_[facei]);
888 tgtWeightsSum_.resize_nocopy(tgtWeights_.size());
889 forAll(tgtWeights_, facei)
891 tgtWeightsSum_[facei] =
sum(tgtWeights_[facei]);
894 srcMapPtr_ = std::move(srcToTgtMap);
895 tgtMapPtr_ = std::move(tgtToSrcMap);
897 singlePatchProc_ = singlePatchProc;
912 auto newPtr = clone();
913 newPtr->calculate(srcPatch, tgtPatch);
925 labelListList& newSrcConstructMap = newPtr->srcMapPtr_->constructMap();
928 labelListList& newTgtConstructMap = newPtr->tgtMapPtr_->constructMap();
935 srcMapPtr_->constructMapTotalSize(),
936 tgtMapPtr_->constructMapTotalSize()
943 newPtr->srcMapPtr_->constructMapTotalSize(),
944 newPtr->tgtMapPtr_->constructMapTotalSize()
951 auto iter1 = oldMapMap.
begin();
952 auto iter2 = newMapMap.
begin();
956 const label len1 = srcConstructMap[proci].
size();
957 const label len2 = newSrcConstructMap[proci].
size();
959 std::iota(iter1, (iter1 + len1), total);
963 std::iota(iter2, (iter2 + len2), total);
973 for (label& value : list)
975 value = oldMapMap[value];
979 for (
labelList& list : newSrcConstructMap)
981 for (label& value : list)
983 value = newMapMap[value];
989 for (label& value : list)
991 value = oldMapMap[value];
995 for (
labelList& list : newPtr->tgtAddress_)
997 for (label& value : list)
999 value = newMapMap[value];
1008 auto iter1 = oldMapMap.
begin();
1009 auto iter2 = newMapMap.
begin();
1013 const label len1 = tgtConstructMap[proci].
size();
1014 const label len2 = newTgtConstructMap[proci].
size();
1016 std::iota(iter1, (iter1 + len1), total);
1020 std::iota(iter2, (iter2 + len2), total);
1030 for (label& value : list)
1032 value = oldMapMap[value];
1036 for (
labelList& list : newTgtConstructMap)
1038 for (label& value : list)
1040 value = newMapMap[value];
1046 for (label& value : list)
1048 value = oldMapMap[value];
1052 for (
labelList& list : newPtr->srcAddress_)
1054 for (label& value : list)
1056 value = newMapMap[value];
1062 srcMapPtr_->constructSize() += newPtr->srcMapPtr_->constructSize();
1063 tgtMapPtr_->constructSize() += newPtr->tgtMapPtr_->constructSize();
1068 srcSubMap[proci].
push_back(newSrcSubMap[proci]);
1069 srcConstructMap[proci].
push_back(newSrcConstructMap[proci]);
1071 tgtSubMap[proci].
push_back(newTgtSubMap[proci]);
1072 tgtConstructMap[proci].
push_back(newTgtConstructMap[proci]);
1077 forAll(srcMagSf_, srcFacei)
1079 srcAddress_[srcFacei].push_back(newPtr->srcAddress()[srcFacei]);
1080 srcWeights_[srcFacei].push_back(newPtr->srcWeights()[srcFacei]);
1081 srcWeightsSum_[srcFacei] += newPtr->srcWeightsSum()[srcFacei];
1085 forAll(tgtMagSf_, tgtFacei)
1087 tgtAddress_[tgtFacei].push_back(newPtr->tgtAddress()[tgtFacei]);
1088 tgtWeights_[tgtFacei].push_back(newPtr->tgtWeights()[tgtFacei]);
1089 tgtWeightsSum_[tgtFacei] += newPtr->tgtWeightsSum()[tgtFacei];
1096 const bool conformal,
1109 lowWeightCorrection_,
1122 lowWeightCorrection_,
1133 const label tgtFacei,
1141 const labelList& addr = tgtAddress_[tgtFacei];
1145 label nearestFacei = -1;
1147 for (
const label srcFacei : addr)
1149 const face&
f = srcPatch[srcFacei];
1152 f.ray(tgtPoint,
n, srcPoints, intersection::algorithm::VISIBLE);
1156 tgtPoint = ray.
point();
1163 nearestFacei = srcFacei;
1169 tgtPoint = nearest.
point();
1170 return nearestFacei;
1182 const label srcFacei,
1187 const pointField& tgtPoints = tgtPatch.points();
1191 label nearestFacei = -1;
1194 const labelList& addr = srcAddress_[srcFacei];
1196 for (
const label tgtFacei : addr)
1198 const face&
f = tgtPatch[tgtFacei];
1201 f.ray(srcPoint,
n, tgtPoints, intersection::algorithm::VISIBLE);
1205 srcPoint = ray.point();
1208 const pointHit near =
f.nearestPoint(srcPoint, tgtPoints);
1210 if (near.distance() < nearest.distance())
1213 nearestFacei = tgtFacei;
1216 if (nearest.hit() || nearest.eligibleMiss())
1218 srcPoint = nearest.point();
1219 return nearestFacei;
1230 Log <<
"Checks only valid for serial running (currently)" <<
endl;
1235 bool symmetricSrc =
true;
1237 Log <<
" Checking for missing src face in tgt lists" <<
nl;
1239 forAll(srcAddress_, srcFacei)
1241 const labelList& tgtIds = srcAddress_[srcFacei];
1242 for (
const label tgtFacei : tgtIds)
1244 if (!tgtAddress_[tgtFacei].
found(srcFacei))
1246 symmetricSrc =
false;
1248 Log <<
" srcFacei:" << srcFacei
1249 <<
" not found in tgtToSrc list for tgtFacei:" 1257 Log <<
" - symmetric" <<
endl;
1260 bool symmetricTgt =
true;
1262 Log <<
" Checking for missing tgt face in src lists" <<
nl;
1264 forAll(tgtAddress_, tgtFacei)
1266 const labelList& srcIds = tgtAddress_[tgtFacei];
1267 for (
const label srcFacei : srcIds)
1269 if (!srcAddress_[srcFacei].
found(tgtFacei))
1271 symmetricTgt =
false;
1273 Log <<
" tgtFacei:" << tgtFacei
1274 <<
" not found in srcToTgt list for srcFacei:" 1282 Log <<
" - symmetric" <<
endl;
1285 return symmetricSrc && symmetricTgt;
1304 const point& srcPt = srcPatch.faceCentres()[i];
1306 for (
const label tgtPti : addr)
1308 const point& tgtPt = tgtPatch.faceCentres()[tgtPti];
1313 os <<
"l " << pti <<
" " << pti + 1 <<
endl;
1335 if (lowWeightCorrection_ > 0)
1337 os.
writeEntry(
"lowWeightCorrection", lowWeightCorrection_);
1344 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.
#define addProfiling(Name,...)
Define profiling trigger with specified name and description string. The description is generated by ...
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. ...
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.