faceAreaWeightAMI Class Reference

Face area weighted Arbitrary Mesh Interface (AMI) method. More...

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

Public Member Functions

 TypeName ("faceAreaWeightAMI")
 Runtime type information. More...
 
 faceAreaWeightAMI (const dictionary &dict, const bool reverseTarget=false)
 Construct from dictionary. More...
 
 faceAreaWeightAMI (const bool requireMatch, const bool reverseTarget=false, const scalar lowWeightCorrection=-1, const faceAreaIntersect::triangulationMode triMode=faceAreaIntersect::tmMesh, const bool restartUncoveredSourceFace=true)
 Construct from components. More...
 
 faceAreaWeightAMI (const faceAreaWeightAMI &ami)
 Construct as copy. More...
 
virtual autoPtr< AMIInterpolationclone () const
 Construct and return a clone. More...
 
virtual ~faceAreaWeightAMI ()=default
 Destructor. More...
 
virtual bool calculate (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const autoPtr< searchableSurface > &surfPtr=nullptr)
 Update addressing, weights and (optional) centroids. More...
 
virtual void write (Ostream &os) const
 Write. More...
 
- Public Member Functions inherited from advancingFrontAMI
 TypeName ("advancingFrontAMI")
 Runtime type information. More...
 
 advancingFrontAMI (const dictionary &dict, const bool reverseTarget)
 Construct from components. More...
 
 advancingFrontAMI (const bool requireMatch=true, const bool reverseTarget=false, const scalar lowWeightCorrection=-1, const faceAreaIntersect::triangulationMode triMode=faceAreaIntersect::tmMesh)
 Construct from components. More...
 
 advancingFrontAMI (const advancingFrontAMI &ami)
 Construct as copy. More...
 
virtual ~advancingFrontAMI ()=default
 Destructor. More...
 
const primitivePatchsrcPatch () const
 Return const access to the source patch. More...
 
const primitivePatchtgtPatch () const
 Return const access to the target patch. More...
 
const labelListsrcNonOverlap () const
 Labels of faces that are not overlapped by any target faces. More...
 
- Public Member Functions inherited from AMIInterpolation
 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 ~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
 
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...
 
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
 

Protected Member Functions

void operator= (const faceAreaWeightAMI &)=delete
 No copy assignment. More...
 
virtual void calcAddressing (List< DynamicList< label >> &srcAddress, List< DynamicList< scalar >> &srcWeights, List< DynamicList< point >> &srcCentroids, List< DynamicList< label >> &tgtAddress, List< DynamicList< scalar >> &tgtWeights, label srcFacei, label tgtFacei)
 
virtual bool processSourceFace (const label srcFacei, const label tgtStartFacei, DynamicList< label > &nbrFaces, DynamicList< label > &visitedFaces, List< DynamicList< label >> &srcAddr, List< DynamicList< scalar >> &srcWght, List< DynamicList< point >> &srcCtr, List< DynamicList< label >> &tgtAddr, List< DynamicList< scalar >> &tgtWght)
 Determine overlap contributions for source face srcFacei. More...
 
virtual void restartUncoveredSourceFace (List< DynamicList< label >> &srcAddr, List< DynamicList< scalar >> &srcWght, List< DynamicList< point >> &srcCtr, List< DynamicList< label >> &tgtAddr, List< DynamicList< scalar >> &tgtWght)
 Attempt to re-evaluate source faces that have not been included. More...
 
virtual bool setNextFaces (label &startSeedi, label &srcFacei, label &tgtFacei, const bitSet &mapFlag, labelList &seedFaces, const DynamicList< label > &visitedFaces, const bool errorOnNotFound=true) const
 Set the source and target seed faces. More...
 
virtual void calcInterArea (const label srcFacei, const label tgtFacei, scalar &area, vector &centroid) const
 Area of intersection between source and target faces. More...
 
virtual bool overlaps (const label srcFacei, const label tgtFacei, const scalar threshold) const
 Return true if faces overlap. More...
 
- Protected Member Functions inherited from advancingFrontAMI
void createExtendedTgtPatch ()
 Create a map that extends tgtPatch so that it covers srcPatch. More...
 
void checkPatches () const
 Check AMI patch coupling. More...
 
bool initialiseWalk (label &srcFacei, label &tgtFacei)
 Initialise walk and return true if all ok. More...
 
void writeIntersectionOBJ (const scalar area, const face &f1, const face &f2, const pointField &f1Points, const pointField &f2Points) const
 Write triangle intersection to OBJ file. More...
 
label findTargetFace (const label srcFacei, const UList< label > &excludeFaces=UList< label >::null(), const label srcFacePti=-1) const
 
void appendNbrFaces (const label facei, const primitivePatch &patch, const DynamicList< label > &visitedFaces, DynamicList< label > &faceIDs) const
 Add faces neighbouring facei to the ID list. More...
 
void triangulatePatch (const primitivePatch &patch, List< DynamicList< face >> &tris, List< scalar > &magSf) const
 Helper function to decompose a patch. More...
 
virtual void nonConformalCorrection ()
 Correction for non-conformal interpolations, e.g. for ACMI. More...
 
- Protected Member Functions inherited from AMIInterpolation
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from AMIInterpolation
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 inherited from AMIInterpolation
static bool cacheIntersections_ = false
 
- Protected Types inherited from AMIInterpolation
typedef treeDataPrimitivePatch< primitivePatchtreeType
 Local typedef to octree tree-type. More...
 
- Static Protected Member Functions inherited from AMIInterpolation
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 inherited from advancingFrontAMI
List< DynamicList< face > > srcTris_
 Storage for src-side triangle decomposition. More...
 
List< DynamicList< face > > tgtTris_
 Storage for tgt-side triangle decomposition. More...
 
autoPtr< primitivePatchextendedTgtPatchPtr_
 Demand-driven extended target mesh (distributed parallel usage) More...
 
faceList extendedTgtFaces_
 Extended patch faces. More...
 
pointField extendedTgtPoints_
 Extended patch points. More...
 
labelList extendedTgtFaceIDs_
 Extended patch face IDs. More...
 
autoPtr< mapDistributeextendedTgtMapPtr_
 Extended patch map. More...
 
labelList srcNonOverlap_
 
autoPtr< indexedOctree< treeType > > treePtr_
 Octree used to find face seeds. More...
 
const faceAreaIntersect::triangulationMode triMode_
 Face triangulation mode. More...
 
- Protected Attributes inherited from AMIInterpolation
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

Face area weighted Arbitrary Mesh Interface (AMI) method.

Searching is performed using an advancing front.

Source files

Definition at line 53 of file faceAreaWeightAMI.H.

Constructor & Destructor Documentation

◆ faceAreaWeightAMI() [1/3]

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

Construct from dictionary.

Definition at line 598 of file faceAreaWeightAMI.C.

Referenced by faceAreaWeightAMI::clone().

Here is the caller graph for this function:

◆ faceAreaWeightAMI() [2/3]

faceAreaWeightAMI ( const bool  requireMatch,
const bool  reverseTarget = false,
const scalar  lowWeightCorrection = -1,
const faceAreaIntersect::triangulationMode  triMode = faceAreaIntersect::tmMesh,
const bool  restartUncoveredSourceFace = true 
)

Construct from components.

Definition at line 612 of file faceAreaWeightAMI.C.

◆ faceAreaWeightAMI() [3/3]

Construct as copy.

Definition at line 631 of file faceAreaWeightAMI.C.

◆ ~faceAreaWeightAMI()

virtual ~faceAreaWeightAMI ( )
virtualdefault

Destructor.

Member Function Documentation

◆ operator=()

void operator= ( const faceAreaWeightAMI )
protecteddelete

No copy assignment.

◆ calcAddressing()

void calcAddressing ( List< DynamicList< label >> &  srcAddress,
List< DynamicList< scalar >> &  srcWeights,
List< DynamicList< point >> &  srcCentroids,
List< DynamicList< label >> &  tgtAddress,
List< DynamicList< scalar >> &  tgtWeights,
label  srcFacei,
label  tgtFacei 
)
protectedvirtual

Calculate addressing, weights and centroids using temporary storage

Definition at line 98 of file faceAreaWeightAMI.C.

References addProfiling, DynamicList< T, SizeMin >::append(), DynamicList< T, SizeMin >::clear(), and bitSet::unset().

Here is the call graph for this function:

◆ processSourceFace()

bool processSourceFace ( const label  srcFacei,
const label  tgtStartFacei,
DynamicList< label > &  nbrFaces,
DynamicList< label > &  visitedFaces,
List< DynamicList< label >> &  srcAddr,
List< DynamicList< scalar >> &  srcWght,
List< DynamicList< point >> &  srcCtr,
List< DynamicList< label >> &  tgtAddr,
List< DynamicList< scalar >> &  tgtWght 
)
protectedvirtual

Determine overlap contributions for source face srcFacei.

Definition at line 183 of file faceAreaWeightAMI.C.

References addProfiling, DynamicList< T, SizeMin >::append(), Foam::expressions::patchExpr::debug, DebugVar, Foam::max(), DynamicList< T, SizeMin >::remove(), and Foam::Zero.

Here is the call graph for this function:

◆ restartUncoveredSourceFace()

void restartUncoveredSourceFace ( List< DynamicList< label >> &  srcAddr,
List< DynamicList< scalar >> &  srcWght,
List< DynamicList< point >> &  srcCtr,
List< DynamicList< label >> &  tgtAddr,
List< DynamicList< scalar >> &  tgtWght 
)
protectedvirtual

Attempt to re-evaluate source faces that have not been included.

Definition at line 522 of file faceAreaWeightAMI.C.

References addProfiling, DynamicList< T, SizeMin >::clear(), Foam::expressions::patchExpr::debug, Foam::endl(), f(), forAll, s, Foam::sum(), and WarningInFunction.

Here is the call graph for this function:

◆ setNextFaces()

bool setNextFaces ( label &  startSeedi,
label &  srcFacei,
label &  tgtFacei,
const bitSet mapFlag,
labelList seedFaces,
const DynamicList< label > &  visitedFaces,
const bool  errorOnNotFound = true 
) const
protectedvirtual

Set the source and target seed faces.

Definition at line 256 of file faceAreaWeightAMI.C.

References Foam::abort(), addProfiling, bitSet::count(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::FatalError, FatalErrorInFunction, bitSet::find_next(), Foam::Pout, and bitSet::test().

Here is the call graph for this function:

◆ calcInterArea()

void calcInterArea ( const label  srcFacei,
const label  tgtFacei,
scalar &  area,
vector centroid 
) const
protectedvirtual

Area of intersection between source and target faces.

Definition at line 373 of file faceAreaWeightAMI.C.

References addProfiling, Foam::fieldTypes::area, faceAreaIntersect::calc(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::mag(), n, faceAreaIntersect::triangles(), WarningInFunction, and OBJstream::write().

Here is the call graph for this function:

◆ overlaps()

bool overlaps ( const label  srcFacei,
const label  tgtFacei,
const scalar  threshold 
) const
protectedvirtual

Return true if faces overlap.

Definition at line 456 of file faceAreaWeightAMI.C.

References Foam::endl(), Foam::mag(), n, faceAreaIntersect::overlaps(), and WarningInFunction.

Here is the call graph for this function:

◆ TypeName()

TypeName ( "faceAreaWeightAMI"  )

Runtime type information.

◆ clone()

virtual autoPtr<AMIInterpolation> clone ( ) const
inlinevirtual

Construct and return a clone.

Reimplemented from advancingFrontAMI.

Definition at line 175 of file faceAreaWeightAMI.H.

References faceAreaWeightAMI::faceAreaWeightAMI().

Here is the call 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 from advancingFrontAMI.

Definition at line 641 of file faceAreaWeightAMI.C.

References addProfiling, advancingFrontAMI::calculate(), Foam::expressions::patchExpr::debug, mapDistributeBase::distribute(), Foam::endl(), forAll, globalIndex::inplaceToGlobal(), UPstream::nonBlocking, and Foam::Pout.

Here is the call graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write.

Reimplemented from AMIInterpolation.

Definition at line 804 of file faceAreaWeightAMI.C.

References os(), AMIInterpolation::write(), and Ostream::writeEntry().

Here is the call graph for this function:

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