AMIMethod Class Referenceabstract

Base class for Arbitrary Mesh Interface (AMI) methods. More...

Inheritance diagram for AMIMethod:
Collaboration diagram for AMIMethod:

Public Member Functions

 TypeName ("AMIMethod")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, AMIMethod, components,(const primitivePatch &srcPatch, const primitivePatch &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 primitivePatch &srcPatch, const primitivePatch &tgtPatch, const scalarField &srcMagSf, const scalarField &tgtMagSf, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget, const bool requireMatch)
 Construct from components. More...
 
 AMIMethod (const AMIMethod &)=delete
 Disallow default bitwise copy construction. 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...
 
virtual void calculate (labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFacei=-1, label tgtFacei=-1)=0
 Update addressing and weights. More...
 
void operator= (const AMIMethod &)=delete
 Disallow default bitwise assignment. More...
 

Static Public Member Functions

static autoPtr< AMIMethodNew (const word &methodName, const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const scalarField &srcMagSf, const scalarField &tgtMagSf, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget, const bool requireMatch)
 Selector. More...
 

Protected Types

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

Protected Member Functions

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 primitivePatch &patch, const DynamicList< label > &visitedFaces, DynamicList< label > &faceIDs) const
 Add faces neighbouring facei to the ID list. More...
 
virtual scalar maxWalkAngle () const
 The maximum edge angle that the walk will cross. More...
 

Protected Attributes

const primitivePatchsrcPatch_
 Reference to source patch. More...
 
const primitivePatchtgtPatch_
 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

Base class for Arbitrary Mesh Interface (AMI) methods.

Source files

Definition at line 55 of file AMIMethod.H.

Member Typedef Documentation

◆ treeType

Local typedef to octree tree-type.

Definition at line 60 of file AMIMethod.H.

Constructor & Destructor Documentation

◆ AMIMethod() [1/2]

AMIMethod ( const primitivePatch srcPatch,
const primitivePatch tgtPatch,
const scalarField srcMagSf,
const scalarField tgtMagSf,
const faceAreaIntersect::triangulationMode triMode,
const bool  reverseTarget,
const bool  requireMatch 
)

Construct from components.

Definition at line 325 of file AMIMethod.C.

Referenced by AMIMethod::maxWalkAngle().

Here is the caller graph for this function:

◆ AMIMethod() [2/2]

AMIMethod ( const AMIMethod )
delete

Disallow default bitwise copy construction.

◆ ~AMIMethod()

~AMIMethod ( )
virtual

Destructor.

Definition at line 348 of file AMIMethod.C.

Member Function Documentation

◆ checkPatches()

void checkPatches ( ) const
protected

Check AMI patch coupling.

Definition at line 42 of file AMIMethod.C.

References Foam::endl(), AMIMethod::initialise(), Foam::nl, Foam::Pout, and WarningInFunction.

Here is the call graph for this function:

◆ initialise()

bool initialise ( labelListList srcAddress,
scalarListList srcWeights,
labelListList tgtAddress,
scalarListList tgtWeights,
label srcFacei,
label tgtFacei 
)
protected

Initialise and return true if all ok.

Definition at line 79 of file AMIMethod.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Pout, List< T >::setSize(), WarningInFunction, and AMIMethod::writeIntersectionOBJ().

Referenced by AMIMethod::checkPatches().

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

◆ writeIntersectionOBJ()

void writeIntersectionOBJ ( const scalar  area,
const face f1,
const face f2,
const pointField f1Points,
const pointField f2Points 
) const
protected

Write triangle intersection to OBJ file.

Definition at line 153 of file AMIMethod.C.

References Foam::endl(), forAll, Foam::name(), Foam::nl, face::points(), Foam::Pout, List< T >::size(), and Foam::meshTools::writeOBJ().

Referenced by AMIMethod::initialise().

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

◆ resetTree()

void resetTree ( )
protected

Reset the octree for the target patch face search.

Definition at line 203 of file AMIMethod.C.

References AMIMethod::findTargetFace(), and boundBox::inflate().

Here is the call graph for this function:

◆ findTargetFace()

Foam::label findTargetFace ( const label  srcFacei) const
protected

Find face on target patch that overlaps source face.

Definition at line 234 of file AMIMethod.C.

References AMIMethod::appendNbrFaces(), face::centre(), Foam::endl(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), and Foam::Pout.

Referenced by AMIMethod::resetTree().

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

◆ appendNbrFaces()

void appendNbrFaces ( const label  facei,
const primitivePatch patch,
const DynamicList< label > &  visitedFaces,
DynamicList< label > &  faceIDs 
) const
protected

Add faces neighbouring facei to the ID list.

Definition at line 264 of file AMIMethod.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), Foam::cos(), PrimitivePatch< FaceList, PointField >::faceFaces(), PrimitivePatch< FaceList, PointField >::faceNormals(), and forAll.

Referenced by AMIMethod::findTargetFace().

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

◆ maxWalkAngle()

Foam::scalar maxWalkAngle ( ) const
protectedvirtual

The maximum edge angle that the walk will cross.

Definition at line 316 of file AMIMethod.C.

References AMIMethod::AMIMethod(), and Foam::degToRad().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "AMIMethod"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
AMIMethod  ,
components  ,
(const primitivePatch &srcPatch, const primitivePatch &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.

◆ New()

Foam::autoPtr< Foam::AMIMethod > New ( const word methodName,
const primitivePatch srcPatch,
const primitivePatch tgtPatch,
const scalarField srcMagSf,
const scalarField tgtMagSf,
const faceAreaIntersect::triangulationMode triMode,
const bool  reverseTarget,
const bool  requireMatch 
)
static

Selector.

Definition at line 31 of file AMIMethodNew.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, and Foam::nl.

Referenced by AMIInterpolation::update().

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

◆ srcNonOverlap()

const Foam::labelList & srcNonOverlap ( ) const
inline

Labels of faces that are not overlapped by any target faces.

Note: this should be empty for correct functioning

Definition at line 26 of file AMIMethodI.H.

References AMIMethod::srcNonOverlap_.

◆ conformal()

bool conformal ( ) const
virtual

Flag to indicate that interpolation patches are conformal.

Reimplemented in partialFaceAreaWeightAMI.

Definition at line 354 of file AMIMethod.C.

◆ calculate()

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

Update addressing and weights.

Implemented in faceAreaWeightAMI, mapNearestAMI, directAMI, and partialFaceAreaWeightAMI.

Referenced by AMIInterpolation::update().

Here is the caller graph for this function:

◆ operator=()

void operator= ( const AMIMethod )
delete

Disallow default bitwise assignment.

Member Data Documentation

◆ srcPatch_

const primitivePatch& srcPatch_
protected

Reference to source patch.

Definition at line 66 of file AMIMethod.H.

◆ tgtPatch_

const primitivePatch& tgtPatch_
protected

Reference to target patch.

Definition at line 69 of file AMIMethod.H.

◆ 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 73 of file AMIMethod.H.

◆ requireMatch_

const bool requireMatch_
protected

Flag to indicate that the two patches must be matched/an overlap.

exists between them

Definition at line 77 of file AMIMethod.H.

◆ srcMagSf_

const scalarField& srcMagSf_
protected

Source face areas.

Definition at line 80 of file AMIMethod.H.

◆ tgtMagSf_

const scalarField& tgtMagSf_
protected

Target face areas.

Definition at line 83 of file AMIMethod.H.

◆ srcNonOverlap_

labelList srcNonOverlap_
protected

Labels of faces that are not overlapped by any target faces.

(should be empty for correct functioning)

Definition at line 87 of file AMIMethod.H.

Referenced by AMIMethod::srcNonOverlap().

◆ treePtr_

autoPtr<indexedOctree<treeType> > treePtr_
protected

Octree used to find face seeds.

Definition at line 90 of file AMIMethod.H.

◆ triMode_

const faceAreaIntersect::triangulationMode triMode_
protected

Face triangulation mode.

Definition at line 93 of file AMIMethod.H.


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