103 bool inCommGroup = (srcPatch.size() > 0 || tgtPatch.size() > 0);
108 UPstream::allGatherValues<bool>(inCommGroup, comm)
122 label whichProci(-1);
130 DynamicList<label> subProcs(hasFaces.size());
133 if (hasFaces.test(i))
137 subProcs.push_back(i);
160 else if (nCommProcs == 1)
168 <<
"AMI local to processor" << proci <<
endl;
174 const label currComm = (geomComm.
good() ? geomComm().comm() : -1);
176 if (useLocalComm_ == 0)
181 else if (nCommProcs == subProcs.size())
186 else if (inCommGroup)
197 Pout<<
"Retained geomComm:" << currComm
198 <<
" with " << subProcs.size()
205 geomComm.
reset(
new UPstream::communicator(comm, subProcs));
208 Pout<<
"Allocated geomComm:" << geomComm().comm()
209 <<
" from " << subProcs.size()
218 geomComm.
reset(
new UPstream::communicator());
221 Pout<<
"Allocated dummy geomComm:" << geomComm().comm()
222 <<
" src-size:" << srcPatch.size()
223 <<
" tgt-size:" << tgtPatch.size() <<
endl;
229 <<
"AMI split across multiple processors " 239 const searchableSurface& surf,
243 addProfiling(ami,
"AMIInterpolation::projectPointsToSurface");
247 List<pointIndexHit> nearInfo;
270 <<
"Error projecting points to surface: " 271 << nMiss <<
" faces could not be determined" 280 const word& patchName,
284 const bool conformal,
286 const scalar lowWeightTol,
290 addProfiling(ami,
"AMIInterpolation::normaliseWeights");
293 wghtSum.resize_nocopy(wght.size());
294 label nLowWeight = 0;
302 scalar denom = patchAreas[facei];
317 if (t < lowWeightTol)
338 <<
"AMI: Patch " << patchName
340 <<
" min:" <<
limits.min()
341 <<
" max:" <<
limits.max()
342 <<
" average:" << avg <<
nl;
348 <<
"AMI: Patch " << patchName
349 <<
" identified " << nLow
350 <<
" faces with weights less than " << lowWeightTol
359 const autoPtr<mapDistribute>& targetMapPtr,
364 const labelList& sourceRestrictAddressing,
365 const labelList& targetRestrictAddressing,
371 autoPtr<mapDistribute>& tgtMap,
377 const label sourceCoarseSize =
379 sourceRestrictAddressing.size()
380 ?
max(sourceRestrictAddressing)+1
384 const label targetCoarseSize =
386 targetRestrictAddressing.size()
387 ?
max(targetRestrictAddressing)+1
394 srcMagSf.setSize(sourceCoarseSize, 0.0);
396 forAll(sourceRestrictAddressing, facei)
398 label coarseFacei = sourceRestrictAddressing[facei];
399 srcMagSf[coarseFacei] += fineSrcMagSf[facei];
408 const mapDistribute& map = *targetMapPtr;
410 if (map.constructMap().empty())
415 if (map.subMap().empty())
423 labelList allRestrict(targetRestrictAddressing);
424 map.distribute(allRestrict);
459 forAll(map.subMap(), proci)
471 const labelList& elems = map.subMap()[proci];
477 labelList oldToNew(targetCoarseSize, -1);
480 for (
const label elemi : elems)
482 label fineElem = elemsMap[elemi];
483 label coarseElem = allRestrict[fineElem];
484 if (oldToNew[coarseElem] == -1)
486 oldToNew[coarseElem] = newi;
487 newSubMap[newi] = coarseElem;
491 newSubMap.resize(newi);
507 labelList tgtCompactMap(map.constructSize());
518 for (
const label fineElem : elemsMap)
520 label coarseElem = allRestrict[fineElem];
521 tgtCompactMap[fineElem] = coarseElem;
525 label compacti = targetCoarseSize;
528 forAll(map.constructMap(), proci)
535 const labelList& elems = map.constructMap()[proci];
537 labelList& newConstructMap = tgtConstructMap[proci];
544 label remoteTargetCoarseSize =
labelMin;
545 for (
const label elemi : elems)
547 remoteTargetCoarseSize =
max 549 remoteTargetCoarseSize,
553 remoteTargetCoarseSize += 1;
556 labelList oldToNew(remoteTargetCoarseSize, -1);
559 for (
const label fineElem : elems)
562 label coarseElem = allRestrict[fineElem];
563 if (oldToNew[coarseElem] == -1)
565 oldToNew[coarseElem] = newi;
566 tgtCompactMap[fineElem] = compacti;
567 newConstructMap[newi] = compacti++;
573 label compacti = oldToNew[coarseElem];
574 tgtCompactMap[fineElem] = newConstructMap[compacti];
577 newConstructMap.resize(newi);
582 srcAddress.setSize(sourceCoarseSize);
583 srcWeights.setSize(sourceCoarseSize);
585 forAll(fineSrcAddress, facei)
589 const labelList& elems = fineSrcAddress[facei];
590 const scalarList& weights = fineSrcWeights[facei];
591 const scalar fineArea = fineSrcMagSf[facei];
593 label coarseFacei = sourceRestrictAddressing[facei];
595 labelList& newElems = srcAddress[coarseFacei];
596 scalarList& newWeights = srcWeights[coarseFacei];
600 label elemi = elems[i];
601 label coarseElemi = tgtCompactMap[elemi];
603 label index = newElems.find(coarseElemi);
606 newElems.append(coarseElemi);
607 newWeights.append(fineArea*weights[i]);
611 newWeights[index] += fineArea*weights[i];
621 std::move(tgtSubMap),
622 std::move(tgtConstructMap),
631 srcAddress.setSize(sourceCoarseSize);
632 srcWeights.setSize(sourceCoarseSize);
634 forAll(fineSrcAddress, facei)
638 const labelList& elems = fineSrcAddress[facei];
639 const scalarList& weights = fineSrcWeights[facei];
640 const scalar fineArea = fineSrcMagSf[facei];
642 label coarseFacei = sourceRestrictAddressing[facei];
644 labelList& newElems = srcAddress[coarseFacei];
645 scalarList& newWeights = srcWeights[coarseFacei];
649 const label elemi = elems[i];
650 const label coarseElemi = targetRestrictAddressing[elemi];
652 const label index = newElems.find(coarseElemi);
655 newElems.append(coarseElemi);
656 newWeights.append(fineArea*weights[i]);
660 newWeights[index] += fineArea*weights[i];
687 const bool reverseTarget
690 requireMatch_(
dict.getOrDefault(
"requireMatch", true)),
691 reverseTarget_(
dict.getOrDefault(
"reverseTarget", reverseTarget)),
692 lowWeightCorrection_(
dict.getOrDefault<scalar>(
"lowWeightCorrection", -1)),
693 singlePatchProc_(-999),
713 const bool requireMatch,
714 const bool reverseTarget,
715 const scalar lowWeightCorrection
718 requireMatch_(requireMatch),
719 reverseTarget_(reverseTarget),
720 lowWeightCorrection_(lowWeightCorrection),
721 singlePatchProc_(-999),
744 const labelList& sourceRestrictAddressing,
745 const labelList& targetRestrictAddressing
748 requireMatch_(fineAMI.requireMatch_),
749 reverseTarget_(fineAMI.reverseTarget_),
750 lowWeightCorrection_(-1.0),
751 singlePatchProc_(fineAMI.singlePatchProc_),
752 comm_(fineAMI.comm()),
768 label sourceCoarseSize =
770 sourceRestrictAddressing.
size()
771 ?
max(sourceRestrictAddressing)+1
775 label neighbourCoarseSize =
777 targetRestrictAddressing.
size()
778 ?
max(targetRestrictAddressing)+1
784 Pout<<
"AMI: Creating addressing and weights as agglomeration of AMI :" 787 <<
" fineComm:" << fineAMI.
comm()
788 <<
" coarse source size:" << sourceCoarseSize
789 <<
" neighbour source size:" << neighbourCoarseSize
800 <<
"Size mismatch." <<
nl 802 <<
"Source agglomeration size:" 803 << sourceRestrictAddressing.
size() <<
nl 805 <<
"Target agglomeration size:" 806 << targetRestrictAddressing.
size()
840 sourceRestrictAddressing,
841 targetRestrictAddressing,
875 targetRestrictAddressing,
876 sourceRestrictAddressing,
891 requireMatch_(ami.requireMatch_),
892 reverseTarget_(ami.reverseTarget_),
893 lowWeightCorrection_(ami.lowWeightCorrection_),
894 singlePatchProc_(ami.singlePatchProc_),
896 geomComm_(ami.geomComm_),
897 srcMagSf_(ami.srcMagSf_),
898 srcAddress_(ami.srcAddress_),
899 srcWeights_(ami.srcWeights_),
900 srcWeightsSum_(ami.srcWeightsSum_),
901 srcCentroids_(ami.srcCentroids_),
903 tgtMagSf_(ami.tgtMagSf_),
904 tgtAddress_(ami.tgtAddress_),
905 tgtWeights_(ami.tgtWeights_),
906 tgtWeightsSum_(ami.tgtWeightsSum_),
907 tgtCentroids_(ami.tgtCentroids_),
917 lowWeightCorrection_(readScalar(is)),
956 const autoPtr<searchableSurface>& surfPtr
969 if (srcMagSf_.size())
971 srcMagSf_.resize_nocopy(srcPatch.size());
973 srcAddress_.resize_nocopy(srcPatch.size());
974 srcWeights_.resize_nocopy(srcPatch.size());
975 srcWeightsSum_.resize_nocopy(srcPatch.size());
976 if (srcCentroids_.size())
978 srcCentroids_.resize_nocopy(srcPatch.size());
981 if (tgtMagSf_.size())
983 tgtMagSf_.resize_nocopy(tgtPatch.size());
985 tgtAddress_.resize_nocopy(tgtPatch.size());
986 tgtWeights_.resize_nocopy(tgtPatch.size());
987 tgtWeightsSum_.resize_nocopy(tgtPatch.size());
989 if (tgtCentroids_.size())
991 tgtCentroids_.resize_nocopy(tgtPatch.size());
998 srcPatchPts_ = srcPatch.points();
999 projectPointsToSurface(surfPtr(), srcPatchPts_);
1002 SubList<face>(srcPatch),
1006 tgtPatchPts_ = tgtPatch.points();
1007 projectPointsToSurface(surfPtr(), tgtPatchPts_);
1010 SubList<face>(tgtPatch),
1016 tsrcPatch0_.cref(srcPatch);
1017 ttgtPatch0_.cref(tgtPatch);
1029 if (srcTotalSize == 0)
1032 <<
"AMI: no source faces present - no addressing constructed" 1052 singlePatchProc_ = calcDistribution(srcPatch, tgtPatch, comm_, geomComm_);
1054 Info<<
indent <<
"AMI: Patch source faces: " << srcTotalSize <<
nl 1055 <<
indent <<
"AMI: Patch target faces: " << tgtTotalSize <<
nl;
1063 <<
"AMI: patch proc:" << singlePatchProc_
1078 const label singlePatchProc
1083 srcAddress_.transfer(srcAddress);
1084 srcWeights_.transfer(srcWeights);
1085 tgtAddress_.transfer(tgtAddress);
1086 tgtWeights_.transfer(tgtWeights);
1089 srcWeightsSum_.resize_nocopy(srcWeights_.size());
1090 forAll(srcWeights_, facei)
1092 srcWeightsSum_[facei] =
sum(srcWeights_[facei]);
1095 tgtWeightsSum_.resize_nocopy(tgtWeights_.size());
1096 forAll(tgtWeights_, facei)
1098 tgtWeightsSum_[facei] =
sum(tgtWeights_[facei]);
1101 srcMapPtr_ = std::move(srcToTgtMap);
1102 tgtMapPtr_ = std::move(tgtToSrcMap);
1104 singlePatchProc_ = singlePatchProc;
1119 auto newPtr = clone();
1120 newPtr->calculate(srcPatch, tgtPatch);
1123 if (distributed() && comm() != -1)
1126 labelListList& srcConstructMap = srcMapPtr_->constructMap();
1129 labelListList& tgtConstructMap = tgtMapPtr_->constructMap();
1132 labelListList& newSrcConstructMap = newPtr->srcMapPtr_->constructMap();
1135 labelListList& newTgtConstructMap = newPtr->tgtMapPtr_->constructMap();
1142 srcMapPtr_->constructMapTotalSize(),
1143 tgtMapPtr_->constructMapTotalSize()
1150 newPtr->srcMapPtr_->constructMapTotalSize(),
1151 newPtr->tgtMapPtr_->constructMapTotalSize()
1158 auto iter1 = oldMapMap.
begin();
1159 auto iter2 = newMapMap.
begin();
1163 const label len1 = srcConstructMap[proci].
size();
1164 const label len2 = newSrcConstructMap[proci].
size();
1166 std::iota(iter1, (iter1 + len1), total);
1170 std::iota(iter2, (iter2 + len2), total);
1180 for (label& value : list)
1182 value = oldMapMap[value];
1186 for (
labelList& list : newSrcConstructMap)
1188 for (label& value : list)
1190 value = newMapMap[value];
1196 for (label& value : list)
1198 value = oldMapMap[value];
1202 for (
labelList& list : newPtr->tgtAddress_)
1204 for (label& value : list)
1206 value = newMapMap[value];
1215 auto iter1 = oldMapMap.
begin();
1216 auto iter2 = newMapMap.
begin();
1220 const label len1 = tgtConstructMap[proci].
size();
1221 const label len2 = newTgtConstructMap[proci].
size();
1223 std::iota(iter1, (iter1 + len1), total);
1227 std::iota(iter2, (iter2 + len2), total);
1237 for (label& value : list)
1239 value = oldMapMap[value];
1243 for (
labelList& list : newTgtConstructMap)
1245 for (label& value : list)
1247 value = newMapMap[value];
1253 for (label& value : list)
1255 value = oldMapMap[value];
1259 for (
labelList& list : newPtr->srcAddress_)
1261 for (label& value : list)
1263 value = newMapMap[value];
1269 srcMapPtr_->constructSize() += newPtr->srcMapPtr_->constructSize();
1270 tgtMapPtr_->constructSize() += newPtr->tgtMapPtr_->constructSize();
1275 srcSubMap[proci].
push_back(newSrcSubMap[proci]);
1276 srcConstructMap[proci].
push_back(newSrcConstructMap[proci]);
1278 tgtSubMap[proci].
push_back(newTgtSubMap[proci]);
1279 tgtConstructMap[proci].
push_back(newTgtConstructMap[proci]);
1284 forAll(srcMagSf_, srcFacei)
1286 srcAddress_[srcFacei].push_back(newPtr->srcAddress()[srcFacei]);
1287 srcWeights_[srcFacei].push_back(newPtr->srcWeights()[srcFacei]);
1288 srcWeightsSum_[srcFacei] += newPtr->srcWeightsSum()[srcFacei];
1292 forAll(tgtMagSf_, tgtFacei)
1294 tgtAddress_[tgtFacei].push_back(newPtr->tgtAddress()[tgtFacei]);
1295 tgtWeights_[tgtFacei].push_back(newPtr->tgtWeights()[tgtFacei]);
1296 tgtWeightsSum_[tgtFacei] += newPtr->tgtWeightsSum()[tgtFacei];
1303 const bool conformal,
1316 lowWeightCorrection_,
1329 lowWeightCorrection_,
1340 const label tgtFacei,
1348 const labelList& addr = tgtAddress_[tgtFacei];
1352 label nearestFacei = -1;
1354 for (
const label srcFacei : addr)
1356 const face&
f = srcPatch[srcFacei];
1359 f.ray(tgtPoint,
n, srcPoints, intersection::algorithm::VISIBLE);
1363 tgtPoint = ray.
point();
1370 nearestFacei = srcFacei;
1376 tgtPoint = nearest.
point();
1377 return nearestFacei;
1389 const label srcFacei,
1394 const pointField& tgtPoints = tgtPatch.points();
1398 label nearestFacei = -1;
1401 const labelList& addr = srcAddress_[srcFacei];
1403 for (
const label tgtFacei : addr)
1405 const face&
f = tgtPatch[tgtFacei];
1408 f.ray(srcPoint,
n, tgtPoints, intersection::algorithm::VISIBLE);
1412 srcPoint = ray.point();
1415 const pointHit near =
f.nearestPoint(srcPoint, tgtPoints);
1417 if (near.distance() < nearest.distance())
1420 nearestFacei = tgtFacei;
1423 if (nearest.hit() || nearest.eligibleMiss())
1425 srcPoint = nearest.point();
1426 return nearestFacei;
1437 Log <<
"Checks only valid for serial running (currently)" <<
endl;
1442 bool symmetricSrc =
true;
1444 Log <<
" Checking for missing src face in tgt lists" <<
nl;
1446 forAll(srcAddress_, srcFacei)
1448 const labelList& tgtIds = srcAddress_[srcFacei];
1449 for (
const label tgtFacei : tgtIds)
1451 if (!tgtAddress_[tgtFacei].
found(srcFacei))
1453 symmetricSrc =
false;
1455 Log <<
" srcFacei:" << srcFacei
1456 <<
" not found in tgtToSrc list for tgtFacei:" 1464 Log <<
" - symmetric" <<
endl;
1467 bool symmetricTgt =
true;
1469 Log <<
" Checking for missing tgt face in src lists" <<
nl;
1471 forAll(tgtAddress_, tgtFacei)
1473 const labelList& srcIds = tgtAddress_[tgtFacei];
1474 for (
const label srcFacei : srcIds)
1476 if (!srcAddress_[srcFacei].
found(tgtFacei))
1478 symmetricTgt =
false;
1480 Log <<
" tgtFacei:" << tgtFacei
1481 <<
" not found in srcToTgt list for srcFacei:" 1489 Log <<
" - symmetric" <<
endl;
1492 return symmetricSrc && symmetricTgt;
1511 const point& srcPt = srcPatch.faceCentres()[i];
1513 for (
const label tgtPti : addr)
1515 const point& tgtPt = tgtPatch.faceCentres()[tgtPti];
1520 os <<
"l " << pti <<
" " << pti + 1 <<
endl;
1542 if (lowWeightCorrection_ > 0)
1544 os.
writeEntry(
"lowWeightCorrection", lowWeightCorrection_);
1551 os << requireMatch()
1571 if (distributed() && comm() != -1)
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.
label comm() const noexcept
Communicator (local or otherwise) for parallel operations.
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.
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.
registerOptSwitch("localAMIComm", int, Foam::AMIInterpolation::useLocalComm_)
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
void push_back(const T &val)
Append an element at the end of the list.
static bool cacheIntersections_
List< labelList > labelListList
List of labelList.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
autoPtr< mapDistribute > srcMapPtr_
Source map pointer - parallel running only.
label comm_
Communicator to use for parallel operations.
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
AMIInterpolation(const dictionary &dict, const bool reverseTarget=false)
Construct from dictionary.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
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.
bool good() const noexcept
True if the managed pointer is non-null.
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.
static int useLocalComm_
Control use of local communicator for AMI communication.
static constexpr int masterNo() noexcept
Relative rank for the master process - is always 0.
Encapsulation of data needed to search on PrimitivePatches.
label calcDistribution(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const label comm, autoPtr< UPstream::communicator > &geomComm) const
Calculate if patches are on multiple processors. Allocates local communicator and returns -1 or proce...
void setDistance(const scalar d) noexcept
Set the distance.
constexpr scalar pi(M_PI)
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
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.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
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.
int optimisationSwitch(const char *name, const int deflt=0)
Lookup optimisation switch or add default value.
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 gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
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.
OSstream & masterStream(int communicator)
Return OSstream for output operations on the master process only, Snull on other processes.
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.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
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 List< int > & procID(int communicator)
The list of ranks within a given communicator.
static Ostream & output(Ostream &os, const IntRange< T > &range)
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))
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.
bool equal(const UList< Type1 > &a, const UList< Type2 > &b)
Test for list equality with different but compatible data types. Eg, int32 and int64.
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.
virtual void write(Ostream &os) const
Write AMI as a dictionary.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.