AMIMethod< SourcePatch, TargetPatch > Class Template Referenceabstract

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

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

Public Member Functions

 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...
 
virtual void calculate (labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFacei=-1, label tgtFacei=-1)=0
 Update addressing and weights. More...
 
virtual void setMagSf (const TargetPatch &tgtPatch, const mapDistribute &map, scalarList &srcMagSf, scalarList &tgtMagSf) const =0
 Set the face areas for parallel runs. More...
 
virtual void normaliseWeights (const bool verbose, AMIInterpolation< SourcePatch, TargetPatch > &inter)=0
 

Static Public Member Functions

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

typedef treeDataPrimitivePatch< TargetPatch > treeType
 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 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...
 

Protected Attributes

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::AMIMethod< SourcePatch, TargetPatch >

Base class for Arbitrary Mesh Interface (AMI) methods.

Source files

Definition at line 60 of file AMIMethod.H.

Member Typedef Documentation

◆ treeType

typedef treeDataPrimitivePatch<TargetPatch> treeType
protected

Local typedef to octree tree-type.

Definition at line 77 of file AMIMethod.H.

Constructor & Destructor Documentation

◆ AMIMethod()

AMIMethod ( const SourcePatch &  srcPatch,
const TargetPatch &  tgtPatch,
const faceAreaIntersect::triangulationMode triMode,
const bool  reverseTarget,
const bool  requireMatch 
)

Construct from components.

Definition at line 367 of file AMIMethod.C.

◆ ~AMIMethod()

virtual ~AMIMethod ( )
virtualdefault

Destructor.

Member Function Documentation

◆ checkPatches()

void checkPatches ( ) const
protected

Check AMI patch coupling.

Definition at line 37 of file AMIMethod.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), 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 75 of file AMIMethod.C.

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

Here is the call 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 150 of file AMIMethod.C.

References Foam::fieldTypes::area, Foam::BitOps::count(), Foam::endl(), forAll, n, Foam::name(), Foam::nl, face::points(), Foam::Pout, and Foam::meshTools::writeOBJ().

Here is the call graph for this function:

◆ resetTree()

void resetTree ( )
protected

Reset the octree for the target patch face search.

Definition at line 201 of file AMIMethod.C.

References 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 233 of file AMIMethod.C.

References face::centre(), Foam::expressions::patchExpr::debug, Foam::endl(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), and Foam::Pout.

Here is the call graph for this function:

◆ appendNbrFaces()

void appendNbrFaces ( const label  facei,
const TargetPatch &  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, SizeMin >::append(), Foam::cos(), Foam::degToRad(), and Foam::foamVersion::patch.

Here is the call graph for this function:

◆ triangulatePatch()

void triangulatePatch ( const PatchType &  patch,
List< DynamicList< face >> &  tris,
List< scalar > &  magSf 
) const
protected

Helper function to decompose a patch.

Definition at line 320 of file AMIMethod.C.

References f(), forAll, Foam::foamVersion::patch, points, and List< T >::setSize().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "AMIMethod< SourcePatch, TargetPatch >"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
AMIMethod< SourcePatch, TargetPatch >  ,
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.

◆ New()

Foam::autoPtr< Foam::AMIMethod< SourcePatch, TargetPatch > > New ( const word methodName,
const SourcePatch &  srcPatch,
const TargetPatch &  tgtPatch,
const faceAreaIntersect::triangulationMode triMode,
const bool  reverseTarget,
const bool  requireMatch 
)
static

Selector.

Definition at line 34 of file AMIMethodNew.C.

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

Here is the call 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 62 of file AMIMethodI.H.

◆ conformal()

bool conformal ( ) const
virtual

Flag to indicate that interpolation patches are conformal.

Reimplemented in partialFaceAreaWeightAMI< SourcePatch, TargetPatch >.

Definition at line 392 of file AMIMethod.C.

◆ srcMagSf() [1/2]

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

Return const access to source patch face areas.

Definition at line 30 of file AMIMethodI.H.

◆ srcMagSf() [2/2]

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

Return access to source patch face areas.

Definition at line 38 of file AMIMethodI.H.

◆ tgtMagSf() [1/2]

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

Return const access to target patch face areas.

Definition at line 46 of file AMIMethodI.H.

◆ tgtMagSf() [2/2]

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

Return access to target patch face areas.

Definition at line 54 of file AMIMethodI.H.

◆ calculate()

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

◆ setMagSf()

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

◆ normaliseWeights()

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

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

Implemented in faceAreaWeightAMI< SourcePatch, TargetPatch >, mapNearestAMI< SourcePatch, TargetPatch >, and directAMI< SourcePatch, TargetPatch >.

Member Data Documentation

◆ srcPatch_

const SourcePatch& srcPatch_
protected

Reference to source patch.

Definition at line 83 of file AMIMethod.H.

◆ tgtPatch_

const TargetPatch& tgtPatch_
protected

Reference to target patch.

Definition at line 86 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 90 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 94 of file AMIMethod.H.

◆ srcMagSf_

List<scalar> srcMagSf_
protected

Source face areas.

Definition at line 97 of file AMIMethod.H.

◆ tgtMagSf_

List<scalar> tgtMagSf_
protected

Target face areas.

Definition at line 100 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 104 of file AMIMethod.H.

◆ treePtr_

autoPtr<indexedOctree<treeType> > treePtr_
protected

Octree used to find face seeds.

Definition at line 107 of file AMIMethod.H.

◆ triMode_

const faceAreaIntersect::triangulationMode triMode_
protected

Face triangulation mode.

Definition at line 110 of file AMIMethod.H.


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