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

Container for information needed to couple to meshes. When constructed from two meshes and a geometric tolerance finds the corresponding boundary faces. More...

Public Member Functions

 ClassName ("faceCoupleInfo")
 Runtime type information. More...
 
 faceCoupleInfo (const polyMesh &mesh0, const polyMesh &mesh1, const scalar absTol, const bool perfectMatch)
 Construct from two meshes and absolute tolerance. More...
 
 faceCoupleInfo (const polyMesh &masterMesh, const labelList &masterAddressing, const polyMesh &slaveMesh, const labelList &slaveAddressing, const scalar absTol, const bool perfectMatch, const bool orderedFaces, const bool patchDivision)
 Construct from meshes and subset of mesh faces. More...
 
 ~faceCoupleInfo ()
 Destructor. More...
 
const indirectPrimitivePatchmasterPatch () const
 Addressing engine for coupled faces on mesh0. More...
 
const indirectPrimitivePatchslavePatch () const
 Addressing engine for coupled faces on mesh1. More...
 
const primitiveFacePatchcutFaces () const
 Addressing engine for combined set of faces. More...
 
const pointFieldcutPoints () const
 Points for combined set of faces. More...
 
const labelListcutToMasterFaces () const
 Master face for every face on cut. Will always be at least. More...
 
const labelListmasterToCutPoints () const
 
const labelListcutToSlaveFaces () const
 
const labelListslaveToCutPoints () const
 
const edgeLookupcutEdgeToPoints () const
 From two cut points (original edge) to list of inserted. More...
 
template<template< class > class FaceList>
Foam::pointField calcFaceCentres (const FaceList< face > &faces, const pointField &points, const label start, const label size)
 
template<template< class > class FaceList>
Foam::pointField calcFacePointAverages (const FaceList< face > &faces, const pointField &points, const label start, const label size)
 

Static Public Member Functions

static labelList faceLabels (const polyPatch &)
 Utility functions. More...
 
static Map< labelmakeMap (const labelList &)
 Create Map from List. More...
 
static Map< labelListmakeMap (const labelListList &)
 

Detailed Description

Container for information needed to couple to meshes. When constructed from two meshes and a geometric tolerance finds the corresponding boundary faces.

The information it keeps is the set of faces&points (cutFaces, cutPoints) that should replace a set of faces on the master (masterPatch) and a set of faces on the slave (slavePatch)

Uses same tolerance to match faces and points on matched faces since they both originate from the same points and the tolerance usually comes from writing these points with limited precision (6 by default)

  1. Perfect match:
    • one-to-one match for faces and points.
    • the cut is always the 'most connected' of the master and slave so multiple master or slave points might point to the same cut point.
e.g. master:

    +--+
    |  |
    |  |
    +--+
        +--+
        |  |
        |  |
        +--+
slave:
        +--+
        |  |
        |  |
        +--+
    +--+
    |  |
    |  |
    +--+

adding both together creates a singly connected 2x2 cavity so suddenly the duplicate master points and the duplicate slave points all become a single cut point.

  1. Subdivision match:
    • Can be constructed from slave being subdivision of master with the polyPatch constructor.
    • Does not include above shared-point detection!

Notes on multiple slave faces per master:

As long as

  • all master edges are present in slave
  • slave can have extra edges/points/faces BUT all subfaces have to have at least one point on a maste face.
So master:
+-------+
|       |
|       |
|       |
|       |
|       |
|       |
|       |
+-------+

slave:
+---+---+
|\  |  /|
| \ | / |
|  \|/  |
+---+---+
|  /|\  |
| / | \ |
|/  |  \|
+---+---+
is ok.

For this kind of matching the order is:

  • match cutpoint to masterpoint
  • find those cutEdges that align with a master edge. This gives two sets of cut edges: those that have a master equivalent ('border edges') and those that don't ('internal edges'). The border edges now divide the cutFaces into regions with the same masterFace correspondence.
  • find cutFaces that are fully determined by the border edges they use.
  • all cutFaces that are connected through an internal edge have the same master face.

Note: matching refined faces onto master is a bit dodgy and will probably only work for unwarped faces. Also it will fail if e.g. face is split into 3x3 since then middle face has no point/edge in common with master. (problem is in face matching (findSlavesCoveringMaster), probably point/edge matching might just work)

Source files

Definition at line 157 of file faceCoupleInfo.H.

Constructor & Destructor Documentation

◆ faceCoupleInfo() [1/2]

faceCoupleInfo ( const polyMesh mesh0,
const polyMesh mesh1,
const scalar  absTol,
const bool  perfectMatch 
)

Construct from two meshes and absolute tolerance.

Finds out matches geometrically. No checking for nonsense match. Tolerance is absolute one so use with care. perfectMatch : each point/edge/face has corresponding point on other side if this is false then assumes slave is subdivision. Matching then will work only for non-warped faces since does nearest-to-face comparison with absTol.

Definition at line 1901 of file faceCoupleInfo.C.

References polyMesh::faces(), and polyMesh::points().

Here is the call graph for this function:

◆ faceCoupleInfo() [2/2]

faceCoupleInfo ( const polyMesh masterMesh,
const labelList masterAddressing,
const polyMesh slaveMesh,
const labelList slaveAddressing,
const scalar  absTol,
const bool  perfectMatch,
const bool  orderedFaces,
const bool  patchDivision 
)

Construct from meshes and subset of mesh faces.

(i.e. indirectPrimitivePatch addressing) All faces in patch are considered matched (but don't have to be ordered) perfectMatch : each point/edge/face has corresponding point on other side orderedFaces : faces in patch are ordered (so masterAddressing[i] matches slaveAddressing[i]) patchDivision: faces in slave mesh that originate from the same master face have the same patch. Used by some triangulation methods.

Definition at line 1989 of file faceCoupleInfo.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::min(), primitiveMesh::nInternalFaces(), and List< T >::size().

Here is the call graph for this function:

◆ ~faceCoupleInfo()

Destructor.

Definition at line 2077 of file faceCoupleInfo.C.

Member Function Documentation

◆ ClassName()

ClassName ( "faceCoupleInfo"  )

Runtime type information.

◆ faceLabels()

Foam::labelList faceLabels ( const polyPatch pp)
static

Utility functions.

Get patch face labels

Definition at line 2083 of file faceCoupleInfo.C.

References forAll, and polyPatch::start().

Here is the call graph for this function:

◆ makeMap() [1/2]

Foam::Map< Foam::label > makeMap ( const labelList lst)
static

Create Map from List.

Definition at line 2097 of file faceCoupleInfo.C.

References forAll, and List< T >::size().

Here is the call graph for this function:

◆ makeMap() [2/2]

Foam::Map< Foam::labelList > makeMap ( const labelListList lst)
static

Definition at line 2113 of file faceCoupleInfo.C.

References forAll, and List< T >::size().

Here is the call graph for this function:

◆ masterPatch()

const indirectPrimitivePatch& masterPatch ( ) const
inline

Addressing engine for coupled faces on mesh0.

Definition at line 451 of file faceCoupleInfo.H.

◆ slavePatch()

const indirectPrimitivePatch& slavePatch ( ) const
inline

Addressing engine for coupled faces on mesh1.

Definition at line 457 of file faceCoupleInfo.H.

◆ cutFaces()

const primitiveFacePatch& cutFaces ( ) const
inline

Addressing engine for combined set of faces.

Definition at line 463 of file faceCoupleInfo.H.

Referenced by polyMeshAdder::add().

Here is the caller graph for this function:

◆ cutPoints()

const pointField& cutPoints ( ) const
inline

Points for combined set of faces.

Definition at line 469 of file faceCoupleInfo.H.

References faceCoupleInfo::cutToMasterFaces().

Here is the call graph for this function:

◆ cutToMasterFaces()

const labelList& cutToMasterFaces ( ) const
inline

Master face for every face on cut. Will always be at least.

one but there might be multiple cut faces pointing to the same master

Definition at line 480 of file faceCoupleInfo.H.

Referenced by faceCoupleInfo::cutPoints().

Here is the caller graph for this function:

◆ masterToCutPoints()

const labelList& masterToCutPoints ( ) const
inline

Definition at line 484 of file faceCoupleInfo.H.

◆ cutToSlaveFaces()

const labelList& cutToSlaveFaces ( ) const
inline

Definition at line 489 of file faceCoupleInfo.H.

◆ slaveToCutPoints()

const labelList& slaveToCutPoints ( ) const
inline

Definition at line 493 of file faceCoupleInfo.H.

References faceCoupleInfo::cutEdgeToPoints().

Here is the call graph for this function:

◆ cutEdgeToPoints()

const edgeLookup& cutEdgeToPoints ( ) const
inline

From two cut points (original edge) to list of inserted.

points

Definition at line 500 of file faceCoupleInfo.H.

Referenced by faceCoupleInfo::slaveToCutPoints().

Here is the caller graph for this function:

◆ calcFaceCentres()

Foam::pointField calcFaceCentres ( const FaceList< face > &  faces,
const pointField points,
const label  start,
const label  size 
)

Definition at line 33 of file faceCoupleInfoTemplates.C.

References forAll.

◆ calcFacePointAverages()

Foam::pointField calcFacePointAverages ( const FaceList< face > &  faces,
const pointField points,
const label  start,
const label  size 
)

Definition at line 54 of file faceCoupleInfoTemplates.C.

References forAll, List< T >::size(), and Foam::Zero.

Here is the call graph for this function:

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