Go to the documentation of this file.
51 #ifndef AMIInterpolation_H
52 #define AMIInterpolation_H
220 const word& patchName,
224 const bool conformal,
226 const scalar lowWeightTol
239 const labelList& sourceRestrictAddressing,
240 const labelList& targetRestrictAddressing,
294 const word& modelName,
302 const word& modelName,
331 const labelList& sourceRestrictAddressing,
332 const labelList& neighbourRestrictAddressing
497 template<
class Type,
class CombineOp>
501 const CombineOp& cop,
508 template<
class Type,
class CombineOp>
512 const CombineOp& cop,
519 template<
class Type,
class CombineOp>
523 const CombineOp& cop,
528 template<
class Type,
class CombineOp>
532 const CombineOp& cop,
537 template<
class Type,
class CombineOp>
541 const CombineOp& cop,
546 template<
class Type,
class CombineOp>
550 const CombineOp& cop,
595 const label tgtFacei,
606 const label srcFacei,
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
bool upToDate() const
Access to the up-to-date flag.
virtual bool calculate(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const autoPtr< searchableSurface > &surfPtr=nullptr)
Update addressing, weights and (optional) centroids.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
autoPtr< mapDistribute > tgtMapPtr_
Target map pointer - parallel running only.
static Ostream & output(Ostream &os, const IntRange< T > &range)
scalarListList srcWeights_
Weights of target faces per source face.
A class for handling words, derived from Foam::string.
void operator=(const AMIInterpolation &)=delete
No copy assignment.
const pointListList & srcCentroids() const
Return const access to source patch face centroids.
A class for managing temporary objects.
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.
const scalarField & tgtWeightsSum() const
bool distributed() const
Access to the distributed flag.
refPtr< primitivePatch > tsrcPatch0_
Source patch using manipulated input points.
labelListList srcAddress_
Addresses of target faces per source face.
scalarListList tgtWeights_
Weights of source faces per target face.
void writeFaceConnectivity(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const labelListList &srcAddress) const
Write face connectivity as OBJ file.
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...
const scalarField & srcWeightsSum() const
declareRunTimeSelectionTable(autoPtr, AMIInterpolation, dict,(const dictionary &dict, const bool reverseTarget),(dict, reverseTarget))
Selection table for dictionary construction.
static autoPtr< AMIInterpolation > New(const word &modelName, const dictionary &dict, const bool reverseTarget=false)
Selector for dictionary.
bool setRequireMatch(const bool flag)
Access to the requireMatch flag.
const labelListList & tgtAddress() const
Return const access to target patch addressing.
const scalarListList & tgtWeights() const
Return const access to target patch weights.
void interpolateToTarget(const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const
const scalar lowWeightCorrection_
Threshold weight below which interpolation is deactivated.
const mapDistribute & tgtMap() const
label calcDistribution(const primitivePatch &srcPatch, const primitivePatch &tgtPatch) const
Calculate if patches are on multiple processors.
void interpolateToSource(const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const
scalarField srcWeightsSum_
Sum of weights of target faces per source face.
static bool cacheIntersections_
const primitivePatch & srcPatch0() const
Return the orginal src patch with optionally updated points.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Class containing processor-to-processor mapping information.
Macro definitions for declaring ClassName(), NamespaceName(), etc.
AMIInterpolation(const dictionary &dict, const bool reverseTarget=false)
Construct from dictionary.
virtual void write(Ostream &os) const
Write.
autoPtr< mapDistribute > srcMapPtr_
Source map pointer - parallel running only.
bool requireMatch() const
Access to the requireMatch flag.
virtual autoPtr< AMIInterpolation > clone() const
Construct and return a clone.
virtual ~AMIInterpolation()=default
Destructor.
void append(const primitivePatch &srcPatch, const primitivePatch &tgtPatch)
Append additional addressing and weights.
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;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
label singlePatchProc() const
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)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const primitivePatch & tgtPatch0() const
Return the orginal tgt patch with optionally updated points.
bool mustMatchFaces() const
Return true if requireMatch and lowWeightCorrectionin active.
dimensionedScalar log(const dimensionedScalar &ds)
OBJstream os(runTime.globalPath()/outputName)
const List< scalar > & srcMagSf() const
Return const access to source patch face areas.
TypeName("AMIInterpolation")
Runtime type information.
pointListList tgtCentroids_
Centroid of source faces per target face.
pointListList srcCentroids_
Centroid of target faces per source face.
refPtr< primitivePatch > ttgtPatch0_
Target patch using manipulated input points.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
scalar lowWeightCorrection() const
Threshold weight below which interpolation is deactivated.
void reset(autoPtr< mapDistribute > &&srcToTgtMap, autoPtr< mapDistribute > &&tgtToSrcMap, labelListList &&srcAddress, scalarListList &&srcWeights, labelListList &&tgtAddress, scalarListList &&tgtWeights)
Set the maps, addresses and weights from an external source.
const mapDistribute & srcMap() const
labelListList tgtAddress_
Addresses of source faces per target face.
bool applyLowWeightCorrection() const
Return true if employing a 'lowWeightCorrection'.
const std::string patch
OpenFOAM patch number as a std::string.
Macros to ease declaration of run-time selection tables.
treeDataPrimitivePatch< primitivePatch > treeType
Local typedef to octree tree-type.
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)
scalarField tgtWeightsSum_
Sum of weights of source faces per target face.
Encapsulation of data needed to search on PrimitivePatches.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
scalarList srcMagSf_
Source face areas.
bool checkSymmetricWeights(const bool log) const
bool upToDate_
Up-to-date flag.
const bool reverseTarget_
bool reverseTarget() const
Access to the reverseTarget flag.
void projectPointsToSurface(const searchableSurface &surf, pointField &pts) const
Project points to surface.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const List< scalar > & tgtMagSf() const
Return const access to target patch face areas.
scalarList tgtMagSf_
Target face areas.
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.
autoPtr< indexedOctree< treeType > > createTree(const primitivePatch &patch) const
Reset the octree for the patch face search.
const labelListList & srcAddress() const
Return const access to source patch addressing.
const scalarListList & srcWeights() const
Return const access to source patch weights.
A class for managing references or pointers (no reference counting)
A list of faces which address into the list of points.