AMIInterpolation Class Reference

Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mesh interface (AMI). More...

Inheritance diagram for AMIInterpolation:
[legend]
Collaboration diagram for AMIInterpolation:
[legend]

Public Member Functions

 TypeName ("AMIInterpolation")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, AMIInterpolation, dict,(const dictionary &dict, const bool reverseTarget),(dict, reverseTarget))
 Selection table for dictionary construction. More...
 
 declareRunTimeSelectionTable (autoPtr, AMIInterpolation, component,(const bool requireMatch, const bool reverseTarget, const scalar lowWeightCorrection),(requireMatch, reverseTarget, lowWeightCorrection))
 Selection table for component-wise construction. More...
 
 AMIInterpolation (const dictionary &dict, const bool reverseTarget=false)
 Construct from dictionary. More...
 
 AMIInterpolation (const bool requireMatch=true, const bool reverseTarget=false, const scalar lowWeightCorrection=-1)
 Construct from components. More...
 
 AMIInterpolation (const AMIInterpolation &fineAMI, const labelList &sourceRestrictAddressing, const labelList &neighbourRestrictAddressing)
 
 AMIInterpolation (const AMIInterpolation &ami)
 Construct as copy. More...
 
virtual autoPtr< AMIInterpolationclone () const
 Construct and return a clone. More...
 
virtual ~AMIInterpolation ()=default
 Destructor. More...
 
bool upToDate () const
 Access to the up-to-date flag. More...
 
boolupToDate ()
 Access to the up-to-date flag. More...
 
bool distributed () const
 Access to the distributed flag. More...
 
bool requireMatch () const
 Access to the requireMatch flag. More...
 
bool setRequireMatch (const bool flag)
 Access to the requireMatch flag. More...
 
bool mustMatchFaces () const
 Return true if requireMatch and lowWeightCorrectionin active. More...
 
bool reverseTarget () const
 Access to the reverseTarget flag. More...
 
scalar lowWeightCorrection () const
 Threshold weight below which interpolation is deactivated. More...
 
bool applyLowWeightCorrection () const
 Return true if employing a 'lowWeightCorrection'. More...
 
label singlePatchProc () const
 
const List< scalar > & srcMagSf () const
 Return const access to source patch face areas. More...
 
List< scalar > & srcMagSf ()
 Return access to source patch face areas. More...
 
const labelListListsrcAddress () const
 Return const access to source patch addressing. More...
 
labelListListsrcAddress ()
 Return access to source patch addressing. More...
 
const scalarListListsrcWeights () const
 Return const access to source patch weights. More...
 
scalarListListsrcWeights ()
 Return access to source patch weights. More...
 
const scalarFieldsrcWeightsSum () const
 
scalarFieldsrcWeightsSum ()
 
const pointListListsrcCentroids () const
 Return const access to source patch face centroids. More...
 
pointListListsrcCentroids ()
 Return access to source patch face centroids. More...
 
const mapDistributesrcMap () const
 
const List< scalar > & tgtMagSf () const
 Return const access to target patch face areas. More...
 
List< scalar > & tgtMagSf ()
 Return access to target patch face areas. More...
 
const labelListListtgtAddress () const
 Return const access to target patch addressing. More...
 
labelListListtgtAddress ()
 Return access to target patch addressing. More...
 
const scalarListListtgtWeights () const
 Return const access to target patch weights. More...
 
scalarListListtgtWeights ()
 Return access to target patch weights. More...
 
const scalarFieldtgtWeightsSum () const
 
scalarFieldtgtWeightsSum ()
 
const mapDistributetgtMap () const
 
virtual bool calculate (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const autoPtr< searchableSurface > &surfPtr=nullptr)
 Update addressing, weights and (optional) centroids. More...
 
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. More...
 
void append (const primitivePatch &srcPatch, const primitivePatch &tgtPatch)
 Append additional addressing and weights. More...
 
void normaliseWeights (const bool conformal, const bool output)
 Normalise the weights. More...
 
template<class Type , class CombineOp >
void interpolateToSource (const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const
 
template<class Type , class CombineOp >
void interpolateToTarget (const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const
 
template<class Type , class CombineOp >
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. More...
 
template<class Type , class CombineOp >
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. More...
 
template<class Type , class CombineOp >
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. More...
 
template<class Type , class CombineOp >
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. More...
 
template<class Type >
tmp< Field< Type > > interpolateToSource (const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >::null()) const
 Interpolate from target to source. More...
 
template<class Type >
tmp< Field< Type > > interpolateToSource (const tmp< Field< Type > > &tFld, const UList< Type > &defaultValues=UList< Type >::null()) const
 Interpolate from target tmp field. More...
 
template<class Type >
tmp< Field< Type > > interpolateToTarget (const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >::null()) const
 Interpolate from source to target. More...
 
template<class Type >
tmp< Field< Type > > interpolateToTarget (const tmp< Field< Type > > &tFld, const UList< Type > &defaultValues=UList< Type >::null()) const
 Interpolate from source tmp field. More...
 
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. More...
 
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. More...
 
bool checkSymmetricWeights (const bool log) const
 
void writeFaceConnectivity (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const labelListList &srcAddress) const
 Write face connectivity as OBJ file. More...
 
virtual void write (Ostream &os) const
 Write. More...
 
template<class Type , class CombineOp >
Foam::tmp< Foam::Field< Type > > interpolateToSource (const Field< Type > &fld, const CombineOp &cop, const UList< Type > &defaultValues) const
 
template<class Type , class CombineOp >
Foam::tmp< Foam::Field< Type > > interpolateToSource (const tmp< Field< Type > > &tFld, const CombineOp &cop, const UList< Type > &defaultValues) const
 
template<class Type , class CombineOp >
Foam::tmp< Foam::Field< Type > > interpolateToTarget (const Field< Type > &fld, const CombineOp &cop, const UList< Type > &defaultValues) const
 
template<class Type , class CombineOp >
Foam::tmp< Foam::Field< Type > > interpolateToTarget (const tmp< Field< Type > > &tFld, const CombineOp &cop, const UList< Type > &defaultValues) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > interpolateToSource (const Field< Type > &fld, const UList< Type > &defaultValues) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > interpolateToSource (const tmp< Field< Type > > &tFld, const UList< Type > &defaultValues) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > interpolateToTarget (const Field< Type > &fld, const UList< Type > &defaultValues) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > interpolateToTarget (const tmp< Field< Type > > &tFld, const UList< Type > &defaultValues) const
 

Static Public Member Functions

static autoPtr< AMIInterpolationNew (const word &modelName, const dictionary &dict, const bool reverseTarget=false)
 Selector for dictionary. More...
 
static autoPtr< AMIInterpolationNew (const word &modelName, const bool requireMatch=true, const bool reverseTarget=false, const scalar lowWeightCorrection=-1)
 Selector for components. More...
 

Static Public Attributes

static bool cacheIntersections_ = false
 

Protected Types

typedef treeDataPrimitivePatch< primitivePatchtreeType
 Local typedef to octree tree-type. More...
 

Protected Member Functions

void operator= (const AMIInterpolation &)=delete
 No copy assignment. More...
 
autoPtr< indexedOctree< treeType > > createTree (const primitivePatch &patch) const
 Reset the octree for the patch face search. More...
 
label calcDistribution (const primitivePatch &srcPatch, const primitivePatch &tgtPatch) const
 Calculate if patches are on multiple processors. More...
 
void projectPointsToSurface (const searchableSurface &surf, pointField &pts) const
 Project points to surface. More...
 
const primitivePatchsrcPatch0 () const
 Return the orginal src patch with optionally updated points. More...
 
const primitivePatchtgtPatch0 () const
 Return the orginal tgt patch with optionally updated points. More...
 

Static Protected Member Functions

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)
 
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)
 

Protected Attributes

bool requireMatch_
 
const bool reverseTarget_
 
const scalar lowWeightCorrection_
 Threshold weight below which interpolation is deactivated. More...
 
label singlePatchProc_
 
scalarList srcMagSf_
 Source face areas. More...
 
labelListList srcAddress_
 Addresses of target faces per source face. More...
 
scalarListList srcWeights_
 Weights of target faces per source face. More...
 
scalarField srcWeightsSum_
 Sum of weights of target faces per source face. More...
 
pointListList srcCentroids_
 Centroid of target faces per source face. More...
 
pointField srcPatchPts_
 
refPtr< primitivePatchtsrcPatch0_
 Source patch using manipulated input points. More...
 
autoPtr< mapDistributesrcMapPtr_
 Source map pointer - parallel running only. More...
 
scalarList tgtMagSf_
 Target face areas. More...
 
labelListList tgtAddress_
 Addresses of source faces per target face. More...
 
scalarListList tgtWeights_
 Weights of source faces per target face. More...
 
scalarField tgtWeightsSum_
 Sum of weights of source faces per target face. More...
 
pointListList tgtCentroids_
 Centroid of source faces per target face. More...
 
pointField tgtPatchPts_
 
refPtr< primitivePatchttgtPatch0_
 Target patch using manipulated input points. More...
 
autoPtr< mapDistributetgtMapPtr_
 Target map pointer - parallel running only. More...
 
bool upToDate_
 Up-to-date flag. More...
 

Detailed Description

Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mesh interface (AMI).

Based on the algorithm given in:

Conservative interpolation between volume meshes by local Galerkin projection, Farrell PE and Maddison JR, 2011, Comput. Methods Appl. Mech Engrg, Volume 200, Issues 1-4, pp 89-100

Interpolation requires that the two patches should have opposite orientations (opposite normals). The 'reverseTarget' flag can be used to reverse the orientation of the target patch.

Source files

Definition at line 79 of file AMIInterpolation.H.

Member Typedef Documentation

◆ treeType

Local typedef to octree tree-type.

Definition at line 91 of file AMIInterpolation.H.

Constructor & Destructor Documentation

◆ AMIInterpolation() [1/4]

AMIInterpolation ( const dictionary dict,
const bool  reverseTarget = false 
)

Construct from dictionary.

Definition at line 539 of file AMIInterpolation.C.

◆ AMIInterpolation() [2/4]

AMIInterpolation ( const bool  requireMatch = true,
const bool  reverseTarget = false,
const scalar  lowWeightCorrection = -1 
)

Construct from components.

Definition at line 565 of file AMIInterpolation.C.

◆ AMIInterpolation() [3/4]

◆ AMIInterpolation() [4/4]

Construct as copy.

Definition at line 699 of file AMIInterpolation.C.

◆ ~AMIInterpolation()

virtual ~AMIInterpolation ( )
virtualdefault

Destructor.

Member Function Documentation

◆ operator=()

void operator= ( const AMIInterpolation )
protecteddelete

No copy assignment.

◆ createTree()

Foam::autoPtr< Foam::indexedOctree< Foam::AMIInterpolation::treeType > > createTree ( const primitivePatch patch) const
protected

Reset the octree for the patch face search.

Definition at line 52 of file AMIInterpolation.C.

References boundBox::inflate(), and AMIInterpolation::New().

Here is the call graph for this function:

◆ calcDistribution()

Foam::label calcDistribution ( const primitivePatch srcPatch,
const primitivePatch tgtPatch 
) const
protected

Calculate if patches are on multiple processors.

Definition at line 76 of file AMIInterpolation.C.

References Pstream::broadcast(), bitSet::count(), DebugInFunction, Foam::endl(), bitSet::find_first(), and UPstream::parRun().

Here is the call graph for this function:

◆ projectPointsToSurface()

void projectPointsToSurface ( const searchableSurface surf,
pointField pts 
) const
protected

Project points to surface.

Definition at line 117 of file AMIInterpolation.C.

References Foam::abort(), addProfiling, DebugInfo, Foam::endl(), Foam::FatalError, FatalErrorInFunction, searchableSurface::findNearest(), forAll, and UList< T >::size().

Here is the call graph for this function:

◆ srcPatch0()

const Foam::primitivePatch & srcPatch0 ( ) const
inlineprotected

Return the orginal src patch with optionally updated points.

Definition at line 29 of file AMIInterpolationI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and AMIInterpolation::tsrcPatch0_.

Here is the call graph for this function:

◆ tgtPatch0()

const Foam::primitivePatch & tgtPatch0 ( ) const
inlineprotected

Return the orginal tgt patch with optionally updated points.

Definition at line 42 of file AMIInterpolationI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ normaliseWeights() [1/2]

void normaliseWeights ( const scalarList patchAreas,
const word patchName,
const labelListList addr,
scalarListList wght,
scalarField wghtSum,
const bool  conformal,
const bool  output,
const scalar  lowWeightTol 
)
staticprotected

Normalise the (area) weights - suppresses numerical error in weights calculation

NOTE: if area weights are incorrect by 'a significant amount' normalisation may stabilise the solution, but will introduce numerical error!

Definition at line 157 of file AMIInterpolation.C.

References addProfiling, Foam::endl(), forAll, Foam::gAverage(), Foam::gMax(), Foam::gMin(), Foam::indent(), Foam::Info, Foam::nl, Foam::output(), Foam::returnReduce(), s(), List< T >::setSize(), UList< T >::size(), and Foam::sum().

Here is the call graph for this function:

◆ agglomerate()

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 
)
staticprotected

Definition at line 235 of file AMIInterpolation.C.

References addProfiling, List< T >::append(), mapDistributeBase::constructMap(), mapDistributeBase::constructSize(), mapDistribute::distribute(), UList< T >::find(), forAll, Foam::identity(), Foam::labelMin, Foam::max(), processorFaPatch::myProcNo(), PstreamBuffers::nProcs(), autoPtr< T >::reset(), List< T >::setSize(), UList< T >::size(), and mapDistributeBase::subMap().

Referenced by AMIInterpolation::AMIInterpolation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TypeName()

TypeName ( "AMIInterpolation"  )

Runtime type information.

◆ declareRunTimeSelectionTable() [1/2]

declareRunTimeSelectionTable ( autoPtr  ,
AMIInterpolation  ,
dict  ,
(const dictionary &dict, const bool reverseTarget ,
(dict, reverseTarget  
)

Selection table for dictionary construction.

◆ declareRunTimeSelectionTable() [2/2]

declareRunTimeSelectionTable ( autoPtr  ,
AMIInterpolation  ,
component  ,
(const bool requireMatch, const bool reverseTarget, const scalar lowWeightCorrection ,
(requireMatch, reverseTarget, lowWeightCorrection  
)

Selection table for component-wise construction.

◆ New() [1/2]

Foam::autoPtr< Foam::AMIInterpolation > New ( const word modelName,
const dictionary dict,
const bool  reverseTarget = false 
)
static

Selector for dictionary.

Definition at line 32 of file AMIInterpolationNew.C.

References DebugInfo, dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInLookup, and AMIInterpolation::reverseTarget().

Referenced by AMIInterpolation::createTree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ New() [2/2]

Foam::autoPtr< Foam::AMIInterpolation > New ( const word modelName,
const bool  requireMatch = true,
const bool  reverseTarget = false,
const scalar  lowWeightCorrection = -1 
)
static

Selector for components.

Definition at line 57 of file AMIInterpolationNew.C.

References DebugInfo, Foam::endl(), Foam::exit(), Foam::FatalError, and FatalErrorInLookup.

Here is the call graph for this function:

◆ clone()

virtual autoPtr< AMIInterpolation > clone ( ) const
inlinevirtual

Construct and return a clone.

Reimplemented in advancingFrontAMI, faceAreaWeightAMI, faceAreaWeightAMI2D, and nearestFaceAMI.

Definition at line 338 of file AMIInterpolation.H.

References Time::New().

Here is the call graph for this function:

◆ upToDate() [1/2]

bool upToDate ( ) const
inline

Access to the up-to-date flag.

Definition at line 56 of file AMIInterpolationI.H.

◆ upToDate() [2/2]

bool & upToDate ( )
inline

Access to the up-to-date flag.

Definition at line 62 of file AMIInterpolationI.H.

◆ distributed()

bool distributed ( ) const
inline

Access to the distributed flag.

Definition at line 68 of file AMIInterpolationI.H.

Referenced by AMIInterpolation::interpolateToTarget().

Here is the caller graph for this function:

◆ requireMatch()

bool requireMatch ( ) const
inline

Access to the requireMatch flag.

Definition at line 74 of file AMIInterpolationI.H.

◆ setRequireMatch()

bool setRequireMatch ( const bool  flag)
inline

Access to the requireMatch flag.

Definition at line 80 of file AMIInterpolationI.H.

◆ mustMatchFaces()

bool mustMatchFaces ( ) const
inline

Return true if requireMatch and lowWeightCorrectionin active.

Definition at line 87 of file AMIInterpolationI.H.

Referenced by faceAreaWeightAMI::calcAddressing().

Here is the caller graph for this function:

◆ reverseTarget()

bool reverseTarget ( ) const
inline

Access to the reverseTarget flag.

Definition at line 93 of file AMIInterpolationI.H.

Referenced by AMIInterpolation::New().

Here is the caller graph for this function:

◆ lowWeightCorrection()

Foam::scalar lowWeightCorrection ( ) const
inline

Threshold weight below which interpolation is deactivated.

Definition at line 99 of file AMIInterpolationI.H.

◆ applyLowWeightCorrection()

bool applyLowWeightCorrection ( ) const
inline

Return true if employing a 'lowWeightCorrection'.

Definition at line 105 of file AMIInterpolationI.H.

◆ singlePatchProc()

Foam::label singlePatchProc ( ) const
inline

Set to -1, or the processor holding all faces (both sides) of the AMI

Definition at line 111 of file AMIInterpolationI.H.

Referenced by AMIWeights::reportPatch().

Here is the caller graph for this function:

◆ srcMagSf() [1/2]

const Foam::List< Foam::scalar > & srcMagSf ( ) const
inline

Return const access to source patch face areas.

Definition at line 117 of file AMIInterpolationI.H.

Referenced by AMIInterpolation::AMIInterpolation().

Here is the caller graph for this function:

◆ srcMagSf() [2/2]

Foam::List< Foam::scalar > & srcMagSf ( )
inline

Return access to source patch face areas.

Definition at line 123 of file AMIInterpolationI.H.

◆ srcAddress() [1/2]

const Foam::labelListList & srcAddress ( ) const
inline

Return const access to source patch addressing.

Definition at line 129 of file AMIInterpolationI.H.

Referenced by AMIInterpolation::AMIInterpolation(), mappedPatchFieldBase< Type >::distribute(), cyclicAMIPolyPatch::mapCollocatedFaces(), and AMIWeights::reportPatch().

Here is the caller graph for this function:

◆ srcAddress() [2/2]

Foam::labelListList & srcAddress ( )
inline

Return access to source patch addressing.

Definition at line 135 of file AMIInterpolationI.H.

◆ srcWeights() [1/2]

const Foam::scalarListList & srcWeights ( ) const
inline

Return const access to source patch weights.

Definition at line 141 of file AMIInterpolationI.H.

Referenced by AMIInterpolation::AMIInterpolation(), assemblyFaceAreaPairGAMGAgglomeration::assemblyFaceAreaPairGAMGAgglomeration(), and mappedPatchFieldBase< Type >::distribute().

Here is the caller graph for this function:

◆ srcWeights() [2/2]

Foam::scalarListList & srcWeights ( )
inline

Return access to source patch weights.

Definition at line 147 of file AMIInterpolationI.H.

◆ srcWeightsSum() [1/2]

const Foam::scalarField & srcWeightsSum ( ) const
inline

Return const access to normalisation factor of source patch weights (i.e. the sum before normalisation)

Definition at line 153 of file AMIInterpolationI.H.

Referenced by AMIWeights::reportPatch(), cyclicACMIPolyPatch::resetAMI(), and AMIWeights::writeWeightFields().

Here is the caller graph for this function:

◆ srcWeightsSum() [2/2]

Foam::scalarField & srcWeightsSum ( )
inline

Return access to normalisation factor of source patch weights (i.e. the sum before normalisation)

Definition at line 159 of file AMIInterpolationI.H.

◆ srcCentroids() [1/2]

const Foam::pointListList & srcCentroids ( ) const
inline

Return const access to source patch face centroids.

Definition at line 165 of file AMIInterpolationI.H.

◆ srcCentroids() [2/2]

Foam::pointListList & srcCentroids ( )
inline

Return access to source patch face centroids.

Definition at line 171 of file AMIInterpolationI.H.

◆ srcMap()

const Foam::mapDistribute & srcMap ( ) const
inline

Source map pointer - valid only if singlePatchProc = -1 This gets source data into a form to be consumed by tgtAddress, tgtWeights

Definition at line 177 of file AMIInterpolationI.H.

Referenced by mappedPatchFieldBase< Type >::distribute().

Here is the caller graph for this function:

◆ tgtMagSf() [1/2]

const Foam::List< Foam::scalar > & tgtMagSf ( ) const
inline

Return const access to target patch face areas.

Definition at line 183 of file AMIInterpolationI.H.

Referenced by AMIInterpolation::AMIInterpolation().

Here is the caller graph for this function:

◆ tgtMagSf() [2/2]

Foam::List< Foam::scalar > & tgtMagSf ( )
inline

Return access to target patch face areas.

Definition at line 189 of file AMIInterpolationI.H.

◆ tgtAddress() [1/2]

const Foam::labelListList & tgtAddress ( ) const
inline

Return const access to target patch addressing.

Definition at line 195 of file AMIInterpolationI.H.

Referenced by AMIInterpolation::AMIInterpolation(), mappedPatchFieldBase< Type >::distribute(), and AMIWeights::reportPatch().

Here is the caller graph for this function:

◆ tgtAddress() [2/2]

Foam::labelListList & tgtAddress ( )
inline

Return access to target patch addressing.

Definition at line 201 of file AMIInterpolationI.H.

◆ tgtWeights() [1/2]

const Foam::scalarListList & tgtWeights ( ) const
inline

Return const access to target patch weights.

Definition at line 207 of file AMIInterpolationI.H.

Referenced by AMIInterpolation::AMIInterpolation(), and mappedPatchFieldBase< Type >::distribute().

Here is the caller graph for this function:

◆ tgtWeights() [2/2]

Foam::scalarListList & tgtWeights ( )
inline

Return access to target patch weights.

Definition at line 213 of file AMIInterpolationI.H.

◆ tgtWeightsSum() [1/2]

const Foam::scalarField & tgtWeightsSum ( ) const
inline

Return const access to normalisation factor of target patch weights (i.e. the sum before normalisation)

Definition at line 219 of file AMIInterpolationI.H.

Referenced by AMIWeights::reportPatch(), cyclicACMIPolyPatch::resetAMI(), and AMIWeights::writeWeightFields().

Here is the caller graph for this function:

◆ tgtWeightsSum() [2/2]

Foam::scalarField & tgtWeightsSum ( )
inline

Return access to normalisation factor of target patch weights (i.e. the sum before normalisation)

Definition at line 225 of file AMIInterpolationI.H.

◆ tgtMap()

const Foam::mapDistribute & tgtMap ( ) const
inline

Target map pointer - valid only if singlePatchProc=-1. This gets target data into a form to be consumed by srcAddress, srcWeights

Definition at line 231 of file AMIInterpolationI.H.

Referenced by mappedPatchFieldBase< Type >::distribute().

Here is the caller graph for this function:

◆ calculate()

bool calculate ( const primitivePatch srcPatch,
const primitivePatch tgtPatch,
const autoPtr< searchableSurface > &  surfPtr = nullptr 
)
virtual

Update addressing, weights and (optional) centroids.

Reimplemented in advancingFrontAMI, faceAreaWeightAMI, faceAreaWeightAMI2D, and nearestFaceAMI.

Definition at line 723 of file AMIInterpolation.C.

References addProfiling, AMIInterpolation::calculate(), DebugInfo, Foam::endl(), Foam::indent(), Foam::Info, Time::New(), Foam::nl, PrimitivePatch< FaceList, PointField >::points(), and Foam::returnReduce().

Referenced by AMIInterpolation::calculate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

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.

Definition at line 791 of file AMIInterpolation.C.

References DebugInFunction, Foam::endl(), forAll, and Foam::sum().

Here is the call graph for this function:

◆ append()

void append ( const primitivePatch srcPatch,
const primitivePatch tgtPatch 
)

Append additional addressing and weights.

Definition at line 828 of file AMIInterpolation.C.

References addProfiling, List< T >::append(), forAll, Foam::identity(), and UList< T >::size().

Here is the call graph for this function:

◆ normaliseWeights() [2/2]

void normaliseWeights ( const bool  conformal,
const bool  output 
)

Normalise the weights.

Definition at line 1007 of file AMIInterpolation.C.

References Foam::output().

Here is the call graph for this function:

◆ interpolateToSource() [1/9]

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 to combine existing value with remote value and weight

Definition at line 121 of file AMIInterpolationTemplates.C.

References Foam::abort(), addProfiling, mapDistribute::distribute(), Foam::FatalError, FatalErrorInFunction, fld(), forAll, Foam::nl, List< T >::setSize(), and UList< T >::size().

Referenced by mappedPatchBase::distribute(), cyclicAMIPolyPatch::interpolateUntransformed(), regionModel::mapRegionPatchField(), and regionModel::mapRegionPatchInternalField().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ interpolateToTarget() [1/9]

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 to combine existing value with remote value and weight

Definition at line 35 of file AMIInterpolationTemplates.C.

References Foam::abort(), addProfiling, mapDistribute::distribute(), AMIInterpolation::distributed(), Foam::FatalError, FatalErrorInFunction, fld(), forAll, AMIInterpolation::lowWeightCorrection_, Foam::nl, List< T >::setSize(), UList< T >::size(), AMIInterpolation::srcAddress_, AMIInterpolation::srcMapPtr_, AMIInterpolation::tgtAddress_, AMIInterpolation::tgtWeights_, and AMIInterpolation::tgtWeightsSum_.

Referenced by mappedPatchBase::distribute(), and cyclicAMIPolyPatch::interpolateUntransformed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ interpolateToSource() [2/9]

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.

◆ interpolateToSource() [3/9]

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.

◆ interpolateToTarget() [2/9]

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.

◆ interpolateToTarget() [3/9]

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.

◆ interpolateToSource() [4/9]

tmp< Field< Type > > interpolateToSource ( const Field< Type > &  fld,
const UList< Type > &  defaultValues = UList< Type >::null() 
) const

Interpolate from target to source.

◆ interpolateToSource() [5/9]

tmp< Field< Type > > interpolateToSource ( const tmp< Field< Type > > &  tFld,
const UList< Type > &  defaultValues = UList< Type >::null() 
) const

Interpolate from target tmp field.

◆ interpolateToTarget() [4/9]

tmp< Field< Type > > interpolateToTarget ( const Field< Type > &  fld,
const UList< Type > &  defaultValues = UList< Type >::null() 
) const

Interpolate from source to target.

◆ interpolateToTarget() [5/9]

tmp< Field< Type > > interpolateToTarget ( const tmp< Field< Type > > &  tFld,
const UList< Type > &  defaultValues = UList< Type >::null() 
) const

Interpolate from source tmp field.

◆ srcPointFace()

Foam::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.

Definition at line 1039 of file AMIInterpolation.C.

References PointHit< PointType >::distance(), PointHit< PointType >::eligibleMiss(), f(), PointHit< PointType >::hit(), n, PrimitivePatch< FaceList, PointField >::points(), PointHit< PointType >::rawPoint(), PointHit< PointType >::setDistance(), and intersection::VISIBLE.

Here is the call graph for this function:

◆ tgtPointFace()

Foam::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.

Definition at line 1088 of file AMIInterpolation.C.

References PointHit< PointType >::distance(), PointHit< PointType >::eligibleMiss(), f(), PointHit< PointType >::hit(), n, PrimitivePatch< FaceList, PointField >::points(), PointHit< PointType >::rawPoint(), PointHit< PointType >::setDistance(), and intersection::VISIBLE.

Here is the call graph for this function:

◆ checkSymmetricWeights()

bool checkSymmetricWeights ( const bool  log) const

Check if src addresses are present in tgt addresses and viceversa

Definition at line 1138 of file AMIInterpolation.C.

References Foam::endl(), forAll, found, Log, Foam::nl, and UPstream::parRun().

Here is the call graph for this function:

◆ writeFaceConnectivity()

void writeFaceConnectivity ( const primitivePatch srcPatch,
const primitivePatch tgtPatch,
const labelListList srcAddress 
) const

Write face connectivity as OBJ file.

Definition at line 1201 of file AMIInterpolation.C.

References Foam::endl(), PrimitivePatch< FaceList, PointField >::faceCentres(), forAll, processorFaPatch::myProcNo(), Foam::name(), os(), and Foam::meshTools::writeOBJ().

Here is the call graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write.

Reimplemented in advancingFrontAMI, faceAreaWeightAMI, faceAreaWeightAMI2D, and nearestFaceAMI.

Definition at line 1233 of file AMIInterpolation.C.

References os(), Foam::type(), and Ostream::writeEntry().

Here is the call graph for this function:

◆ interpolateToSource() [6/9]

Foam::tmp< Foam::Field< Type > > interpolateToSource ( const Field< Type > &  fld,
const CombineOp &  cop,
const UList< Type > &  defaultValues 
) const

Definition at line 207 of file AMIInterpolationTemplates.C.

References fld(), Foam::New(), and Foam::Zero.

Here is the call graph for this function:

◆ interpolateToSource() [7/9]

Foam::tmp< Foam::Field< Type > > interpolateToSource ( const tmp< Field< Type > > &  tFld,
const CombineOp &  cop,
const UList< Type > &  defaultValues 
) const

Definition at line 229 of file AMIInterpolationTemplates.C.

◆ interpolateToTarget() [6/9]

Foam::tmp< Foam::Field< Type > > interpolateToTarget ( const Field< Type > &  fld,
const CombineOp &  cop,
const UList< Type > &  defaultValues 
) const

Definition at line 241 of file AMIInterpolationTemplates.C.

References fld(), Foam::New(), and Foam::Zero.

Here is the call graph for this function:

◆ interpolateToTarget() [7/9]

Foam::tmp< Foam::Field< Type > > interpolateToTarget ( const tmp< Field< Type > > &  tFld,
const CombineOp &  cop,
const UList< Type > &  defaultValues 
) const

Definition at line 263 of file AMIInterpolationTemplates.C.

◆ interpolateToSource() [8/9]

Foam::tmp< Foam::Field< Type > > interpolateToSource ( const Field< Type > &  fld,
const UList< Type > &  defaultValues 
) const

Definition at line 275 of file AMIInterpolationTemplates.C.

References fld().

Here is the call graph for this function:

◆ interpolateToSource() [9/9]

Foam::tmp< Foam::Field< Type > > interpolateToSource ( const tmp< Field< Type > > &  tFld,
const UList< Type > &  defaultValues 
) const

Definition at line 286 of file AMIInterpolationTemplates.C.

◆ interpolateToTarget() [8/9]

Foam::tmp< Foam::Field< Type > > interpolateToTarget ( const Field< Type > &  fld,
const UList< Type > &  defaultValues 
) const

Definition at line 297 of file AMIInterpolationTemplates.C.

References fld().

Here is the call graph for this function:

◆ interpolateToTarget() [9/9]

Foam::tmp< Foam::Field< Type > > interpolateToTarget ( const tmp< Field< Type > > &  tFld,
const UList< Type > &  defaultValues 
) const

Definition at line 308 of file AMIInterpolationTemplates.C.

Member Data Documentation

◆ cacheIntersections_

bool cacheIntersections_ = false
static

◆ requireMatch_

bool requireMatch_
protected

Flag to indicate that the two patches must be matched/an overlap exists between them

Definition at line 97 of file AMIInterpolation.H.

Referenced by advancingFrontAMI::checkPatches().

◆ reverseTarget_

const bool reverseTarget_
protected

Flag to indicate that the two patches are co-directional and that the orientation of the target patch should be reversed

Definition at line 101 of file AMIInterpolation.H.

◆ lowWeightCorrection_

const scalar lowWeightCorrection_
protected

Threshold weight below which interpolation is deactivated.

Definition at line 104 of file AMIInterpolation.H.

Referenced by AMIInterpolation::interpolateToTarget().

◆ singlePatchProc_

label singlePatchProc_
protected

Index of processor that holds all of both sides. -1 in all other cases

Definition at line 108 of file AMIInterpolation.H.

◆ srcMagSf_

scalarList srcMagSf_
protected

Source face areas.

Definition at line 114 of file AMIInterpolation.H.

Referenced by AMIInterpolation::AMIInterpolation().

◆ srcAddress_

labelListList srcAddress_
protected

Addresses of target faces per source face.

Definition at line 117 of file AMIInterpolation.H.

Referenced by AMIInterpolation::AMIInterpolation(), and AMIInterpolation::interpolateToTarget().

◆ srcWeights_

scalarListList srcWeights_
protected

Weights of target faces per source face.

Definition at line 120 of file AMIInterpolation.H.

Referenced by AMIInterpolation::AMIInterpolation().

◆ srcWeightsSum_

scalarField srcWeightsSum_
protected

Sum of weights of target faces per source face.

Definition at line 123 of file AMIInterpolation.H.

Referenced by AMIInterpolation::AMIInterpolation().

◆ srcCentroids_

pointListList srcCentroids_
protected

Centroid of target faces per source face.

Definition at line 126 of file AMIInterpolation.H.

◆ srcPatchPts_

pointField srcPatchPts_
protected

Source patch points if input points are manipulated, e.g. projected

Definition at line 130 of file AMIInterpolation.H.

◆ tsrcPatch0_

refPtr<primitivePatch> tsrcPatch0_
protected

Source patch using manipulated input points.

Definition at line 133 of file AMIInterpolation.H.

Referenced by advancingFrontAMI::srcPatch(), and AMIInterpolation::srcPatch0().

◆ srcMapPtr_

autoPtr<mapDistribute> srcMapPtr_
protected

Source map pointer - parallel running only.

Definition at line 136 of file AMIInterpolation.H.

Referenced by AMIInterpolation::AMIInterpolation(), and AMIInterpolation::interpolateToTarget().

◆ tgtMagSf_

scalarList tgtMagSf_
protected

Target face areas.

Definition at line 143 of file AMIInterpolation.H.

Referenced by AMIInterpolation::AMIInterpolation().

◆ tgtAddress_

labelListList tgtAddress_
protected

Addresses of source faces per target face.

Definition at line 146 of file AMIInterpolation.H.

Referenced by AMIInterpolation::AMIInterpolation(), and AMIInterpolation::interpolateToTarget().

◆ tgtWeights_

scalarListList tgtWeights_
protected

Weights of source faces per target face.

Definition at line 149 of file AMIInterpolation.H.

Referenced by AMIInterpolation::AMIInterpolation(), and AMIInterpolation::interpolateToTarget().

◆ tgtWeightsSum_

scalarField tgtWeightsSum_
protected

Sum of weights of source faces per target face.

Definition at line 152 of file AMIInterpolation.H.

Referenced by AMIInterpolation::AMIInterpolation(), and AMIInterpolation::interpolateToTarget().

◆ tgtCentroids_

pointListList tgtCentroids_
protected

Centroid of source faces per target face.

Definition at line 155 of file AMIInterpolation.H.

◆ tgtPatchPts_

pointField tgtPatchPts_
protected

Target patch points if input points are manipulated, e.g. projected

Definition at line 159 of file AMIInterpolation.H.

◆ ttgtPatch0_

refPtr<primitivePatch> ttgtPatch0_
protected

Target patch using manipulated input points.

Definition at line 162 of file AMIInterpolation.H.

◆ tgtMapPtr_

autoPtr<mapDistribute> tgtMapPtr_
protected

Target map pointer - parallel running only.

Definition at line 165 of file AMIInterpolation.H.

Referenced by AMIInterpolation::AMIInterpolation().

◆ upToDate_

bool upToDate_
protected

Up-to-date flag.

Definition at line 168 of file AMIInterpolation.H.


The documentation for this class was generated from the following files: