Go to the documentation of this file.
49 #ifndef AMIInterpolation_H
50 #define AMIInterpolation_H
56 #include "primitivePatch.H"
77 template<
class SourcePatch,
class TargetPatch>
80 public AMIInterpolationName
185 const SourcePatch& srcPatch,
186 const TargetPatch& tgtPatch
199 const TargetPatch& pp,
209 const TargetPatch& tgtPatch,
218 const SourcePatch& srcPatch,
219 const TargetPatch& tgtPatch
243 const word& patchName,
247 const bool conformal,
249 const scalar lowWeightTol
262 const labelList& sourceRestrictAddressing,
263 const labelList& targetRestrictAddressing,
274 const SourcePatch& srcPatch,
275 const TargetPatch& tgtPatch,
286 const SourcePatch& srcPatch,
287 const TargetPatch& tgtPatch,
289 const bool requireMatch =
true,
292 const bool reverseTarget =
false
298 const SourcePatch& srcPatch,
299 const TargetPatch& tgtPatch,
301 const bool requireMatch =
true,
302 const word& methodName =
305 const bool reverseTarget =
false
311 const SourcePatch& srcPatch,
312 const TargetPatch& tgtPatch,
315 const bool requireMatch =
true,
318 const bool reverseTarget =
false
324 const SourcePatch& srcPatch,
325 const TargetPatch& tgtPatch,
328 const bool requireMatch =
true,
329 const word& methodName =
332 const bool reverseTarget =
false
340 const labelList& sourceRestrictAddressing,
341 const labelList& neighbourRestrictAddressing
417 const SourcePatch& srcPatch,
418 const TargetPatch& tgtPatch
424 const SourcePatch& srcPatch,
425 const TargetPatch& tgtPatch
438 template<
class Type,
class CombineOp>
442 const CombineOp& cop,
449 template<
class Type,
class CombineOp>
453 const CombineOp& cop,
460 template<
class Type,
class CombineOp>
464 const CombineOp& cop,
469 template<
class Type,
class CombineOp>
473 const CombineOp& cop,
478 template<
class Type,
class CombineOp>
482 const CombineOp& cop,
487 template<
class Type,
class CombineOp>
491 const CombineOp& cop,
533 const SourcePatch& srcPatch,
534 const TargetPatch& tgtPatch,
536 const label tgtFaceI,
544 const SourcePatch& srcPatch,
545 const TargetPatch& tgtPatch,
547 const label srcFaceI,
558 const SourcePatch& srcPatch,
559 const TargetPatch& tgtPatch,
interpolationMethod
Enumeration specifying interpolation method.
void append(const SourcePatch &srcPatch, const TargetPatch &tgtPatch)
Append additional addressing and weights.
autoPtr< mapDistribute > calcProcMap(const SourcePatch &srcPatch, const TargetPatch &tgtPatch) const
static word interpolationMethodToWord(const interpolationMethod &method)
Convert interpolationMethod to word representation.
autoPtr< mapDistribute > tgtMapPtr_
Target map pointer - parallel running only.
scalarListList srcWeights_
Weights of target faces per source face.
A class for handling words, derived from string.
const scalarField & srcMagSf() const
Return const access to source patch face areas.
const word methodName_
Interpolation method.
void constructFromSurface(const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const autoPtr< searchableSurface > &surfPtr)
A class for managing temporary objects.
void operator=(const AMIInterpolation &)
Disallow default bitwise assignment.
const scalarField & tgtWeightsSum() const
Return const access to normalisation factor of target.
labelListList srcAddress_
Addresses of target faces per source face.
label singlePatchProc_
Index of processor that holds all of both sides. -1 in all other.
Standard boundBox + extra functionality for use in octree.
scalarListList tgtWeights_
Weights of source faces per target face.
Combination-Reduction operation for a parallel run.
const scalarField & srcWeightsSum() const
Return const access to normalisation factor of source.
label calcOverlappingProcs(const List< treeBoundBoxList > &procBb, const treeBoundBox &bb, boolList &overlaps) const
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
Interpolate from source to target with supplied op.
static void normaliseWeights(const scalarField &patchAreas, const word &patchName, const labelListList &addr, scalarListList &wght, scalarField &wghtSum, const bool conformal, const bool output, const scalar lowWeightTol)
Normalise the (area) weights - suppresses numerical error in.
TargetPatch targetPatchType
static void agglomerate(const autoPtr< mapDistribute > &targetMap, const scalarField &fineSrcMagSf, const labelListList &fineSrcAddress, const scalarListList &fineSrcWeights, const labelList &sourceRestrictAddressing, const labelList &targetRestrictAddressing, scalarField &srcMagSf, labelListList &srcAddress, scalarListList &srcWeights, scalarField &srcWeightsSum, autoPtr< mapDistribute > &tgtMap)
const mapDistribute & tgtMap() const
Target map pointer - valid only if singlePatchProc=-1.
AMIInterpolation(const AMIInterpolation &)
Disallow default bitwise copy construct.
scalarField tgtMagSf_
Target face areas.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void interpolateToSource(const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const
Interpolate from target to source with supplied op.
Pre-declare SubField and related Field type.
scalarField srcWeightsSum_
Sum of weights of target faces per source face.
~AMIInterpolation()
Destructor.
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.
TemplateName(blendedSchemeBase)
autoPtr< mapDistribute > srcMapPtr_
Source map pointer - parallel running only.
void writeFaceConnectivity(const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const labelListList &srcAddress) const
Write face connectivity as OBJ file.
label singlePatchProc() const
Set to -1, or the processor holding all faces (both sides) of.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const scalarField & tgtMagSf() const
Return const access to target patch face areas.
scalarField srcMagSf_
Source face areas.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
void distributeAndMergePatches(const mapDistribute &map, const TargetPatch &tgtPatch, const globalIndex &gi, faceList &tgtFaces, pointField &tgtPoints, labelList &tgtFaceIDs) const
const bool requireMatch_
Flag to indicate that the two patches must be matched/an overlap.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
scalar lowWeightCorrection() const
Threshold weight below which interpolation is deactivated.
scalar lowWeightCorrection_
Threshold weight below which interpolation is deactivated.
const mapDistribute & srcMap() const
Source map pointer - valid only if singlePatchProc = -1.
labelListList tgtAddress_
Addresses of source faces per target face.
void distributePatches(const mapDistribute &map, const TargetPatch &pp, const globalIndex &gi, List< faceList > &faces, List< pointField > &points, List< labelList > &tgtFaceIDs) const
bool applyLowWeightCorrection() const
Return true if employing a 'lowWeightCorrection'.
label tgtPointFace(const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const vector &n, const label srcFaceI, point &srcPoint) const
Return target patch face index of point on source patch face.
scalarField tgtWeightsSum_
Sum of weights of source faces per target face.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
@ imPartialFaceAreaWeight
const bool reverseTarget_
Flag to indicate that the two patches are co-directional and.
void projectPointsToSurface(const searchableSurface &surf, pointField &pts) const
Project points to surface.
void update(const SourcePatch &srcPatch, const TargetPatch &tgtPatch)
Update addressing and weights.
label calcDistribution(const SourcePatch &srcPatch, const TargetPatch &tgtPatch) const
Calculate if patches are on multiple processors.
const faceAreaIntersect::triangulationMode triMode_
Face triangulation mode.
SourcePatch sourcePatchType
const labelListList & srcAddress() const
Return const access to source patch addressing.
const scalarListList & srcWeights() const
Return const access to source patch weights.
label srcPointFace(const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const vector &n, const label tgtFaceI, point &tgtPoint) const
Return source patch face index of point on target patch face.
static interpolationMethod wordTointerpolationMethod(const word &method)
Convert word to interpolationMethod.