All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sweptFaceAreaWeightAMI Class Reference

Swept face area weighted Arbitrary Mesh Interface (AMI) method. More...

Inheritance diagram for sweptFaceAreaWeightAMI:
Collaboration diagram for sweptFaceAreaWeightAMI:

Public Member Functions

 TypeName ("sweptFaceAreaWeightAMI")
 Runtime type information. More...
 
virtual ~sweptFaceAreaWeightAMI ()
 Destructor. More...
 
- Public Member Functions inherited from faceAreaWeightAMI
 TypeName ("faceAreaWeightAMI")
 Runtime type information. More...
 
 faceAreaWeightAMI (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const scalarField &srcMagSf, const scalarField &tgtMagSf, const faceAreaIntersect::triangulationMode &triMode, const bool reverseTarget=false, const bool requireMatch=true, const bool restartUncoveredSourceFace=true)
 Construct from components. More...
 
 faceAreaWeightAMI (const faceAreaWeightAMI &)=delete
 Disallow default bitwise copy construction. 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...
 
void operator= (const faceAreaWeightAMI &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from AMIMethod
 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...
 
void operator= (const AMIMethod &)=delete
 Disallow default bitwise assignment. More...
 

Protected Member Functions

virtual scalar interArea (const label srcFacei, const label tgtFacei) const
 Area of intersection between source and target faces. More...
 
- Protected Member Functions inherited from faceAreaWeightAMI
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...
 
- Protected Member Functions inherited from AMIMethod
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from AMIMethod
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 inherited from AMIMethod
typedef treeDataPrimitivePatch< primitivePatchtreeType
 Local typedef to octree tree-type. More...
 
- Protected Attributes inherited from AMIMethod
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

Swept face area weighted Arbitrary Mesh Interface (AMI) method.

This method uses the point normals of the source patch to sweep the source faces over the target patches. This creates a projection which fills space, and which therefore generates overlap areas which are consistent between neighbouring faces. The projection of a source edge is shown below:

            /
           /
      n_1 ^
         /
        /
   p_1 o
        \\  ^ u
         \\  \
          \\  + - > v
            o - - - > - - -
          p_0      n_0

The surface is, in general, not flat. Any deviation between the two end normals generates expansion, contraction, and twist in the surface. The surface connects with surfaces emanating from connected edges along the end normals. This is what makes the projection fill space and generate consistent overlaps between neighbouring faces.

The projected surface is parameterised by the local coordinates, $u$ and $v$, and a position on this plane is calculated from $u$ and $v$ as follows:

\[ x(u, v) = p_0 + (p_1 - p_0) u + [ q_0 + (q_1 - q_0) u ] v \]

To calculate an intersection with a line between points $l_0$ to $l_1$, we define a local coordinate, $w$, along the line, and subtract it's equation from that of the surface:

\[ 0 = (p_0 - l_0) - (l_1 - l_0) w + (p_1 - p_0) u + [ q_0 + (q_1 - q_0) u ] v \]

This is a system of three equations in three unknowns. It is non-linear, courtesy of the $u v$ term at the end. It can be reduced to a single quadratic in any of the three variables. We choose to solve for $u$ by taking the dot product of the above equation with the following vector:

\[ (l_1 - l_0) \times [ q_0 + (q_1 - q_0) u ] \]

The sign of the intersection (i.e., whether the line crosses from below the surface to above or vice versa) can be determined by taking the dot product of the line vector with the surface normal at the intersection. The surface normal is as follows:

\[ n(u, v) = (p_1 - p_0) \times [q_0 + (q_1 - q_0) u] + (q_1 \times q_0) v \]

Source files

Definition at line 103 of file sweptFaceAreaWeightAMI.H.

Constructor & Destructor Documentation

◆ ~sweptFaceAreaWeightAMI()

~sweptFaceAreaWeightAMI ( )
virtual

Destructor.

Definition at line 591 of file sweptFaceAreaWeightAMI.C.

Member Function Documentation

◆ interArea()

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

Area of intersection between source and target faces.

Reimplemented from faceAreaWeightAMI.

Definition at line 358 of file sweptFaceAreaWeightAMI.C.

References Foam::degToRad(), Foam::endl(), forAllConstIter(), Foam::Info, faceAreaWeightAMI::interArea(), Foam::mag(), Foam::name(), Foam::Swap(), faceAreaIntersect::triangulate(), Foam::triCut(), Foam::Zero, and VectorSpace< Vector< scalar >, scalar, 3 >::zero.

Here is the call graph for this function:

◆ TypeName()

TypeName ( "sweptFaceAreaWeightAMI"  )

Runtime type information.


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