faceAreaWeightAMI< SourcePatch, TargetPatch > Class Template Reference

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

Inheritance diagram for faceAreaWeightAMI< SourcePatch, TargetPatch >:
[legend]
Collaboration diagram for faceAreaWeightAMI< SourcePatch, TargetPatch >:
[legend]

Public Member Functions

 TypeName ("faceAreaWeightAMI")
 Runtime type information. More...
 
 faceAreaWeightAMI (const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget=false, const bool requireMatch=true, const bool restartUncoveredSourceFace=true)
 Construct from components. More...
 
virtual ~faceAreaWeightAMI ()
 Destructor. More...
 
virtual void calculate (labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFacei=-1, label tgtFacei=-1)
 Update addressing and weights. More...
 
virtual void setMagSf (const TargetPatch &tgtPatch, const mapDistribute &map, scalarList &srcMagSf, scalarList &tgtMagSf) const
 Set the face areas for parallel runs. More...
 
virtual void normaliseWeights (const bool verbose, AMIInterpolation< SourcePatch, TargetPatch > &inter)
 
- Public Member Functions inherited from AMIMethod< SourcePatch, TargetPatch >
 TypeName ("AMIMethod")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, AMIMethod, components,(const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget, const bool requireMatch),(srcPatch, tgtPatch, triMode, reverseTarget, requireMatch))
 Declare runtime constructor selection table. More...
 
 AMIMethod (const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget, const bool requireMatch)
 Construct from components. More...
 
virtual ~AMIMethod ()=default
 Destructor. More...
 
const labelListsrcNonOverlap () const
 Labels of faces that are not overlapped by any target faces. More...
 
virtual bool conformal () const
 Flag to indicate that interpolation patches are conformal. More...
 
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 List< scalar > & tgtMagSf () const
 Return const access to target patch face areas. More...
 
List< scalar > & tgtMagSf ()
 Return access to target patch face areas. More...
 

Protected Member Functions

 faceAreaWeightAMI (const faceAreaWeightAMI &)=delete
 No copy construct. More...
 
void operator= (const faceAreaWeightAMI &)=delete
 No copy assignment. More...
 
virtual void calcAddressing (List< DynamicList< label >> &srcAddress, List< DynamicList< scalar >> &srcWeights, List< DynamicList< label >> &tgtAddress, List< DynamicList< scalar >> &tgtWeights, label srcFacei, label tgtFacei)
 Calculate addressing and weights using temporary storage. More...
 
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< 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< label >> &tgtAddr, List< DynamicList< scalar >> &tgtWght)
 Attempt to re-evaluate source faces that have not been included. More...
 
virtual void setNextFaces (label &startSeedi, label &srcFacei, label &tgtFacei, const boolList &mapFlag, labelList &seedFaces, const DynamicList< label > &visitedFaces, bool errorOnNotFound=true) const
 Set the source and target seed faces. More...
 
virtual scalar interArea (const label srcFacei, const label tgtFacei) 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 AMIMethod< SourcePatch, TargetPatch >
void checkPatches () const
 Check AMI patch coupling. More...
 
bool initialise (labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label &srcFacei, label &tgtFacei)
 Initialise 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...
 
void resetTree ()
 Reset the octree for the target patch face search. More...
 
label findTargetFace (const label srcFacei) const
 Find face on target patch that overlaps source face. More...
 
void appendNbrFaces (const label facei, const TargetPatch &patch, const DynamicList< label > &visitedFaces, DynamicList< label > &faceIDs) const
 Add faces neighbouring facei to the ID list. More...
 
template<class PatchType >
void triangulatePatch (const PatchType &patch, List< DynamicList< face >> &tris, List< scalar > &magSf) const
 Helper function to decompose a patch. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from AMIMethod< SourcePatch, TargetPatch >
static autoPtr< AMIMethodNew (const word &methodName, const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget, const bool requireMatch)
 Selector. More...
 
- Protected Types inherited from AMIMethod< SourcePatch, TargetPatch >
typedef treeDataPrimitivePatch< TargetPatch > treeType
 Local typedef to octree tree-type. More...
 
- Protected Attributes inherited from AMIMethod< SourcePatch, TargetPatch >
const SourcePatch & srcPatch_
 Reference to source patch. More...
 
const TargetPatch & tgtPatch_
 Reference to target patch. More...
 
const bool reverseTarget_
 
const bool requireMatch_
 
List< scalar > srcMagSf_
 Source face areas. More...
 
List< scalar > tgtMagSf_
 Target face areas. More...
 
labelList srcNonOverlap_
 
autoPtr< indexedOctree< treeType > > treePtr_
 Octree used to find face seeds. More...
 
const faceAreaIntersect::triangulationMode triMode_
 Face triangulation mode. More...
 

Detailed Description

template<class SourcePatch, class TargetPatch>
class Foam::faceAreaWeightAMI< SourcePatch, TargetPatch >

Face area weighted Arbitrary Mesh Interface (AMI) method.

Source files

Definition at line 52 of file faceAreaWeightAMI.H.

Constructor & Destructor Documentation

◆ faceAreaWeightAMI() [1/2]

faceAreaWeightAMI ( const faceAreaWeightAMI< SourcePatch, TargetPatch > &  )
protecteddelete

No copy construct.

◆ faceAreaWeightAMI() [2/2]

faceAreaWeightAMI ( const SourcePatch &  srcPatch,
const TargetPatch &  tgtPatch,
const faceAreaIntersect::triangulationMode triMode,
const bool  reverseTarget = false,
const bool  requireMatch = true,
const bool  restartUncoveredSourceFace = true 
)

Construct from components.

Definition at line 552 of file faceAreaWeightAMI.C.

◆ ~faceAreaWeightAMI()

~faceAreaWeightAMI ( )
virtual

Destructor.

Definition at line 581 of file faceAreaWeightAMI.C.

Member Function Documentation

◆ operator=()

void operator= ( const faceAreaWeightAMI< SourcePatch, TargetPatch > &  )
protecteddelete

No copy assignment.

◆ calcAddressing()

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

Calculate addressing and weights using temporary storage.

Definition at line 36 of file faceAreaWeightAMI.C.

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

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< label >> &  tgtAddr,
List< DynamicList< scalar >> &  tgtWght 
)
protectedvirtual

Determine overlap contributions for source face srcFacei.

Definition at line 116 of file faceAreaWeightAMI.C.

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

Here is the call graph for this function:

◆ restartUncoveredSourceFace()

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

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

Definition at line 452 of file faceAreaWeightAMI.C.

References addProfiling, DynamicList< T, SizeMin >::append(), DynamicList< T, SizeMin >::clear(), Foam::expressions::patchExpr::debug, Foam::endl(), forAll, HashTable< T, Key, Hash >::found(), HashSet< Key, Hash >::insert(), Foam::Pout, s, HashTable< T, Key, Hash >::size(), Foam::sum(), and DynamicList< T, SizeMin >::transfer().

Here is the call graph for this function:

◆ setNextFaces()

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

Set the source and target seed faces.

Definition at line 198 of file faceAreaWeightAMI.C.

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

Here is the call graph for this function:

◆ interArea()

Foam::scalar interArea ( const label  srcFacei,
const label  tgtFacei 
) const
protectedvirtual

Area of intersection between source and target faces.

Definition at line 311 of file faceAreaWeightAMI.C.

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

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 386 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< SourcePatch, TargetPatch >"  )

Runtime type information.

◆ calculate()

void calculate ( labelListList srcAddress,
scalarListList srcWeights,
labelListList tgtAddress,
scalarListList tgtWeights,
label  srcFacei = -1,
label  tgtFacei = -1 
)
virtual

Update addressing and weights.

Implements AMIMethod< SourcePatch, TargetPatch >.

Reimplemented in partialFaceAreaWeightAMI< SourcePatch, TargetPatch >.

Definition at line 589 of file faceAreaWeightAMI.C.

References addProfiling, Foam::expressions::patchExpr::debug, Foam::endl(), forAll, Foam::Pout, and List< T >::transfer().

Here is the call graph for this function:

◆ setMagSf()

void setMagSf ( const TargetPatch &  tgtPatch,
const mapDistribute map,
scalarList srcMagSf,
scalarList tgtMagSf 
) const
virtual

Set the face areas for parallel runs.

Implements AMIMethod< SourcePatch, TargetPatch >.

Reimplemented in partialFaceAreaWeightAMI< SourcePatch, TargetPatch >.

Definition at line 669 of file faceAreaWeightAMI.C.

References mapDistribute::reverseDistribute().

Here is the call graph for this function:

◆ normaliseWeights()

void normaliseWeights ( const bool  verbose,
AMIInterpolation< SourcePatch, TargetPatch > &  inter 
)
virtual

Normalise the weight. Can optionally subset addressing (e.g. for mapNearest)

Implements AMIMethod< SourcePatch, TargetPatch >.

Definition at line 684 of file faceAreaWeightAMI.C.


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