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,
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
label singlePatchProc() const
const mapDistribute & srcMap() const
virtual autoPtr< AMIInterpolation > clone() const
Construct and return a clone.
refPtr< primitivePatch > tsrcPatch0_
Source patch using manipulated input points.
bool reverseTarget() const
Access to the reverseTarget flag.
bool mustMatchFaces() const
Return true if requireMatch and lowWeightCorrectionin active.
bool upToDate() const
Access to the up-to-date flag.
const scalarField & srcWeightsSum() const
labelListList srcAddress_
Addresses of target faces per source face.
tmp< Field< Type > > interpolateToSource(const tmp< Field< Type > > &tFld, const UList< Type > &defaultValues=UList< Type >::null()) const
Interpolate from target tmp field.
tmp< Field< Type > > interpolateToTarget(const tmp< Field< Type > > &tFld, const CombineOp &cop, const UList< Type > &defaultValues=UList< Type >::null()) const
Interpolate from source tmp field to target with supplied op.
bool distributed() const
Access to the distributed flag.
scalarList tgtMagSf_
Target face areas.
const mapDistribute & tgtMap() const
const scalarListList & tgtWeights() const
Return const access to target patch weights.
void projectPointsToSurface(const searchableSurface &surf, pointField &pts) const
Project points to surface.
const labelListList & srcAddress() const
Return const access to source patch addressing.
const bool reverseTarget_
virtual ~AMIInterpolation()=default
Destructor.
autoPtr< mapDistribute > srcMapPtr_
Source map pointer - parallel running only.
const scalarField & tgtWeightsSum() const
tmp< Field< Type > > interpolateToTarget(const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >::null()) const
Interpolate from source to target.
treeDataPrimitivePatch< primitivePatch > treeType
Local typedef to octree tree-type.
virtual bool calculate(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const autoPtr< searchableSurface > &surfPtr=nullptr)
Update addressing, weights and (optional) centroids.
void interpolateToSource(const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const
bool checkSymmetricWeights(const bool log) const
bool requireMatch() const
Access to the requireMatch flag.
const primitivePatch & tgtPatch0() const
Return the orginal tgt patch with optionally updated points.
void operator=(const AMIInterpolation &)=delete
No copy assignment.
bool upToDate_
Up-to-date flag.
declareRunTimeSelectionTable(autoPtr, AMIInterpolation, dict,(const dictionary &dict, const bool reverseTarget),(dict, reverseTarget))
Selection table for dictionary construction.
autoPtr< mapDistribute > tgtMapPtr_
Target map pointer - parallel running only.
declareRunTimeSelectionTable(autoPtr, AMIInterpolation, component,(const bool requireMatch, const bool reverseTarget, const scalar lowWeightCorrection),(requireMatch, reverseTarget, lowWeightCorrection))
Selection table for component-wise construction.
const scalarListList & srcWeights() const
Return const access to source patch weights.
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)
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)
labelListList tgtAddress_
Addresses of source faces per target face.
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 scalar lowWeightCorrection_
Threshold weight below which interpolation is deactivated.
label calcDistribution(const primitivePatch &srcPatch, const primitivePatch &tgtPatch) const
Calculate if patches are on multiple processors.
pointListList srcCentroids_
Centroid of target faces per source face.
const pointListList & srcCentroids() const
Return const access to source patch face centroids.
static bool cacheIntersections_
void writeFaceConnectivity(const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const labelListList &srcAddress) const
Write face connectivity as OBJ file.
tmp< Field< Type > > interpolateToTarget(const Field< Type > &fld, const CombineOp &cop, const UList< Type > &defaultValues=UList< Type >::null()) const
Interpolate from source to target with supplied op.
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.
tmp< Field< Type > > interpolateToSource(const tmp< Field< Type > > &tFld, const CombineOp &cop, const UList< Type > &defaultValues=UList< Type >::null()) const
Interpolate from target tmp field to source with supplied op.
tmp< Field< Type > > interpolateToSource(const Field< Type > &fld, const CombineOp &cop, const UList< Type > &defaultValues=UList< Type >::null()) const
Interpolate from target to source with supplied op.
scalar lowWeightCorrection() const
Threshold weight below which interpolation is deactivated.
scalarField srcWeightsSum_
Sum of weights of target faces per source face.
refPtr< primitivePatch > ttgtPatch0_
Target patch using manipulated input points.
bool setRequireMatch(const bool flag)
Access to the requireMatch flag.
void append(const primitivePatch &srcPatch, const primitivePatch &tgtPatch)
Append additional addressing and weights.
autoPtr< indexedOctree< treeType > > createTree(const primitivePatch &patch) const
Reset the octree for the patch face search.
bool applyLowWeightCorrection() const
Return true if employing a 'lowWeightCorrection'.
scalarListList tgtWeights_
Weights of source faces per target face.
tmp< Field< Type > > interpolateToSource(const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >::null()) const
Interpolate from target to source.
pointListList tgtCentroids_
Centroid of source faces per target face.
scalarListList srcWeights_
Weights of target faces per source face.
const List< scalar > & srcMagSf() const
Return const access to source patch 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.
scalarList srcMagSf_
Source face areas.
const primitivePatch & srcPatch0() const
Return the orginal src patch with optionally updated points.
tmp< Field< Type > > interpolateToTarget(const tmp< Field< Type > > &tFld, const UList< Type > &defaultValues=UList< Type >::null()) const
Interpolate from source tmp field.
scalarField tgtWeightsSum_
Sum of weights of source faces per target face.
const List< scalar > & tgtMagSf() const
Return const access to target patch face areas.
const labelListList & tgtAddress() const
Return const access to target patch addressing.
void interpolateToTarget(const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const
static autoPtr< AMIInterpolation > New(const word &modelName, const dictionary &dict, const bool reverseTarget=false)
Selector for dictionary.
TypeName("AMIInterpolation")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of faces which address into the list of points.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Class containing processor-to-processor mapping information.
A class for managing references or pointers (no reference counting)
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
A class for managing temporary objects.
Encapsulation of data needed to search on PrimitivePatches.
A class for handling words, derived from Foam::string.
Macro definitions for declaring ClassName(), NamespaceName(), etc.
OBJstream os(runTime.globalPath()/outputName)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
dimensionedScalar log(const dimensionedScalar &ds)
static Ostream & output(Ostream &os, const IntRange< T > &range)
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.