Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
AMIMethod< SourcePatch, TargetPatch > Class Template Referenceabstract

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

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

Public Member Functions

 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...
 
virtual void calculate (labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFaceI=-1, label tgtFaceI=-1)=0
 Update addressing and weights. More...
 

Static Public Member Functions

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

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...
 

Protected Attributes

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

Base class for Arbitrary Mesh Interface (AMI) methods.

Source files

Definition at line 55 of file AMIMethod.H.

Member Typedef Documentation

typedef treeDataPrimitivePatch<TargetPatch> treeType
protected

Local typedef to octree tree-type.

Definition at line 72 of file AMIMethod.H.

Constructor & Destructor Documentation

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.

Definition at line 338 of file AMIMethod.C.

~AMIMethod ( )
virtual

Destructor.

Definition at line 362 of file AMIMethod.C.

Member Function Documentation

void checkPatches ( ) const
protected

Check AMI patch coupling.

Definition at line 34 of file AMIMethod.C.

References Foam::endl(), AMIMethod< SourcePatch, TargetPatch >::initialise(), Foam::nl, Foam::Pout, and WarningIn.

Here is the call graph for this function:

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

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorIn, forAll, Foam::Pout, List< T >::setSize(), WarningIn, and AMIMethod< SourcePatch, TargetPatch >::writeIntersectionOBJ().

Referenced by AMIMethod< SourcePatch, TargetPatch >::checkPatches().

Here is the call graph for this function:

Here is the caller graph for this function:

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 168 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< SourcePatch, TargetPatch >::initialise().

Here is the call graph for this function:

Here is the caller graph for this function:

void resetTree ( )
protected

Reset the octree for the target patch face search.

Definition at line 219 of file AMIMethod.C.

References AMIMethod< SourcePatch, TargetPatch >::findTargetFace(), and boundBox::inflate().

Here is the call graph for this function:

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

Find face on target patch that overlaps source face.

Definition at line 251 of file AMIMethod.C.

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

Referenced by AMIMethod< SourcePatch, TargetPatch >::resetTree().

Here is the call graph for this function:

Here is the caller graph for this function:

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

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), Foam::cos(), Foam::degToRad(), and forAll.

Referenced by AMIMethod< SourcePatch, TargetPatch >::findTargetFace().

Here is the call graph for this function:

Here is the caller graph for this function:

TypeName ( "AMIMethod< SourcePatch, TargetPatch >"  )

Runtime type information.

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

Foam::autoPtr< Foam::AMIMethod< SourcePatch, TargetPatch > > New ( 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 
)
static

Selector.

Definition at line 31 of file AMIMethodNew.C.

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

Here is the call graph for this function:

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 28 of file AMIMethodI.H.

bool conformal ( ) const
virtual

Flag to indicate that interpolation patches are conformal.

Reimplemented in partialFaceAreaWeightAMI< SourcePatch, TargetPatch >.

Definition at line 369 of file AMIMethod.C.

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

Member Data Documentation

const SourcePatch& srcPatch_
protected

Reference to source patch.

Definition at line 78 of file AMIMethod.H.

const TargetPatch& tgtPatch_
protected

Reference to target patch.

Definition at line 81 of file AMIMethod.H.

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

const bool requireMatch_
protected

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

exists between them

Definition at line 89 of file AMIMethod.H.

const scalarField& srcMagSf_
protected

Source face areas.

Definition at line 92 of file AMIMethod.H.

const scalarField& tgtMagSf_
protected

Target face areas.

Definition at line 95 of file AMIMethod.H.

labelList srcNonOverlap_
protected

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

(should be empty for correct functioning)

Definition at line 99 of file AMIMethod.H.

autoPtr<indexedOctree<treeType> > treePtr_
protected

Octree used to find face seeds.

Definition at line 102 of file AMIMethod.H.

const faceAreaIntersect::triangulationMode triMode_
protected

Face triangulation mode.

Definition at line 105 of file AMIMethod.H.


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