Public Member Functions | Private Member Functions
mapNearestAMI< SourcePatch, TargetPatch > Class Template Reference

Nearest-mapping Arbitrary Mesh Interface (AMI) method. More...

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

Public Member Functions

 TypeName ("mapNearestAMI")
 Runtime type information. More...
 
 mapNearestAMI (const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const scalarField &srcMagSf, const scalarField &tgtMagSf, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget=false, const bool requireMatch=true)
 Construct from components. More...
 
virtual ~mapNearestAMI ()
 Destructor. More...
 
virtual void calculate (labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFaceI=-1, label tgtFaceI=-1)
 Update addressing and weights. More...
 
- 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 scalarField &srcMagSf, const scalarField &tgtMagSf, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget, const bool requireMatch),(srcPatch, tgtPatch, srcMagSf, tgtMagSf, triMode, reverseTarget, requireMatch))
 Declare runtime constructor selection table. More...
 
 AMIMethod (const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const scalarField &srcMagSf, const scalarField &tgtMagSf, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget, const bool requireMatch)
 Construct from components. More...
 
virtual ~AMIMethod ()
 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...
 

Private Member Functions

 mapNearestAMI (const mapNearestAMI &)
 Disallow default bitwise copy construct. More...
 
void operator= (const mapNearestAMI &)
 Disallow default bitwise assignment. More...
 
void findNearestFace (const SourcePatch &srcPatch, const TargetPatch &tgtPatch, const label &srcFaceI, label &tgtFaceI) const
 Find nearest target face for source face srcFaceI. More...
 
void setNextNearestFaces (boolList &mapFlag, label &startSeedI, label &srcFaceI, label &tgtFaceI) const
 Determine next source-target face pair. More...
 
label findMappedSrcFace (const label tgtFaceI, const List< DynamicList< label > > &tgtToSrc) const
 Find mapped source face. More...
 
scalar interArea (const label srcFaceI, const label tgtFaceI) const
 Area of intersection between source and target faces. 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 scalarField &srcMagSf, const scalarField &tgtMagSf, 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 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...
 
- 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_
 Flag to indicate that the two patches are co-directional and. More...
 
const bool requireMatch_
 Flag to indicate that the two patches must be matched/an overlap. More...
 
const scalarFieldsrcMagSf_
 Source face areas. More...
 
const scalarFieldtgtMagSf_
 Target face areas. More...
 
labelList srcNonOverlap_
 Labels of faces that are not overlapped by any target faces. More...
 
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::mapNearestAMI< SourcePatch, TargetPatch >

Nearest-mapping Arbitrary Mesh Interface (AMI) method.

Source files

Definition at line 49 of file mapNearestAMI.H.

Constructor & Destructor Documentation

◆ mapNearestAMI() [1/2]

mapNearestAMI ( const mapNearestAMI< SourcePatch, TargetPatch > &  )
private

Disallow default bitwise copy construct.

◆ mapNearestAMI() [2/2]

mapNearestAMI ( const SourcePatch &  srcPatch,
const TargetPatch &  tgtPatch,
const scalarField srcMagSf,
const scalarField tgtMagSf,
const faceAreaIntersect::triangulationMode triMode,
const bool  reverseTarget = false,
const bool  requireMatch = true 
)

Construct from components.

Definition at line 172 of file mapNearestAMI.C.

◆ ~mapNearestAMI()

~mapNearestAMI
virtual

Destructor.

Definition at line 198 of file mapNearestAMI.C.

Member Function Documentation

◆ operator=()

void operator= ( const mapNearestAMI< SourcePatch, TargetPatch > &  )
private

Disallow default bitwise assignment.

◆ findNearestFace()

void findNearestFace ( const SourcePatch &  srcPatch,
const TargetPatch &  tgtPatch,
const label srcFaceI,
label tgtFaceI 
) const
private

Find nearest target face for source face srcFaceI.

Definition at line 32 of file mapNearestAMI.C.

References DynamicList::append(), Foam::magSqr(), and DynamicList::remove().

Here is the call graph for this function:

◆ setNextNearestFaces()

void setNextNearestFaces ( boolList mapFlag,
label startSeedI,
label srcFaceI,
label tgtFaceI 
) const
private

Determine next source-target face pair.

Definition at line 77 of file mapNearestAMI.C.

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

Here is the call graph for this function:

◆ findMappedSrcFace()

Foam::label findMappedSrcFace ( const label  tgtFaceI,
const List< DynamicList< label > > &  tgtToSrc 
) const
private

Find mapped source face.

Definition at line 125 of file mapNearestAMI.C.

References DynamicList::append(), Foam::findIndex(), forAll, and DynamicList::remove().

Here is the call graph for this function:

◆ interArea()

scalar interArea ( const label  srcFaceI,
const label  tgtFaceI 
) const
private

Area of intersection between source and target faces.

◆ TypeName()

TypeName ( "mapNearestAMI< 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 >.

Definition at line 206 of file mapNearestAMI.C.

References List::append(), DynamicList::append(), DynamicList::clear(), forAll, Foam::magSqr(), List::size(), and List::transfer().

Here is the call graph for this function:

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