nearest Class Reference

Class to generate patchToPatch coupling geometry. Couples a face to the single nearest opposite face only. More...

Inheritance diagram for nearest:
Collaboration diagram for nearest:

Public Member Functions

 TypeName ("nearest")
 Runtime type information. More...
 
 nearest (const bool reverse)
 Construct from components. More...
 
 ~nearest ()
 Destructor. More...
 
- Public Member Functions inherited from nearby
 TypeName ("nearby")
 Runtime type information. More...
 
 nearby (const bool reverse)
 Construct from components. More...
 
 ~nearby ()
 Destructor. More...
 
- Public Member Functions inherited from patchToPatch
 TypeName ("patchToPatch")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, patchToPatch, bool,(const bool reverse),(reverse))
 Declare runtime constructor selection table. More...
 
 patchToPatch (const bool reverse)
 Construct from components. More...
 
 patchToPatch (const patchToPatch &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~patchToPatch ()
 Destructor. More...
 
bool reverse () const
 Flag to indicate that the two patches are co-directional and. More...
 
label singleProcess () const
 Index of the processor holding all faces of the patchToPatch,. More...
 
bool isSingleProcess () const
 Is this intersection on a single process? More...
 
PackedBoolList srcCoupled () const
 Return a list indicating which source faces are coupled. More...
 
PackedBoolList tgtCoupled () const
 Return a list indicating which target faces are coupled. More...
 
List< List< remote > > srcTgtProcFaces () const
 For each source face, the coupled target procs and faces. More...
 
List< List< remote > > tgtSrcProcFaces () const
 For each target face, the coupled source procs and faces. More...
 
template<class Type >
tmp< Field< Type > > srcToTgt (const Field< Type > &srcFld) const
 Interpolate a source patch field to the target with no left. More...
 
template<class Type >
tmp< Field< Type > > srcToTgt (const Field< Type > &srcFld, const Field< Type > &leftOverTgtFld) const
 Interpolate a source patch field to the target with left over. More...
 
template<class Type >
tmp< Field< Type > > tgtToSrc (const Field< Type > &tgtFld) const
 Interpolate a target patch field to the source with no left. More...
 
template<class Type >
tmp< Field< Type > > tgtToSrc (const Field< Type > &tgtFld, const Field< Type > &leftOverSrcFld) const
 Interpolate a target patch field to the source with left. More...
 
void update (const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const transformer &tgtToSrc=NullObjectRef< transformer >())
 Update addressing and weights for the given patches. More...
 
void update (const primitivePatch &srcPatch, const vectorField &srcPointNormals, const primitivePatch &tgtPatch, const transformer &tgtToSrc=NullObjectRef< transformer >())
 Update addressing and weights for the given patches. More...
 
void operator= (const patchToPatch &)=delete
 Disallow default bitwise assignment. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > srcToTgt (const Field< Type > &srcFld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > srcToTgt (const Field< Type > &srcFld, const Field< Type > &leftOverTgtFld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > tgtToSrc (const Field< Type > &tgtFld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > tgtToSrc (const Field< Type > &tgtFld, const Field< Type > &leftOverSrcFld) const
 

Protected Member Functions

virtual bool intersectFaces (const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const label srcFacei, const label tgtFacei)
 Intersect two faces. More...
 
virtual void initialise (const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch)
 Initialisation. More...
 
virtual labelList finaliseLocal (const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch)
 Finalise the intersection locally. Trims the local target patch. More...
 
virtual void rDistributeTgt (const primitiveOldTimePatch &tgtPatch)
 Send data that resulted from an intersection between the source. More...
 
virtual label finalise (const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const transformer &tgtToSrc)
 Finalise the intersection. More...
 
virtual tmpNrc< List< DynamicList< scalar > > > srcWeights () const
 For each source face, the coupled target weights. More...
 
virtual tmpNrc< List< DynamicList< scalar > > > tgtWeights () const
 For each target face, the coupled source weights. More...
 
- Protected Member Functions inherited from nearby
virtual treeBoundBox srcBox (const face &srcFace, const pointField &srcPoints, const vectorField &srcPointNormals) const
 Get the bound box for a source face. More...
 
- Protected Member Functions inherited from patchToPatch
treeBoundBox srcBox (const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const label srcFacei) const
 Get the bound box for a source face. More...
 
treeBoundBox srcBox (const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0) const
 Get the bound box for the source patch. More...
 
treeBoundBox tgtBox (const primitiveOldTimePatch &tgtPatch, const label tgtFacei) const
 Get the bound box for a target face. More...
 
treeBoundBox tgtBox (const primitiveOldTimePatch &tgtPatch) const
 Get the bound box for the target patch. More...
 
bool findOrIntersectFaces (const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const label srcFacei, const label tgtFacei)
 Intersect two faces. More...
 
label intersectPatchQueue (const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const bool isSrc, const DynamicList< labelPair > &queue, labelList &faceComplete, DynamicList< labelPair > &otherQueue, const labelList &otherFaceComplete, boolList &otherFaceQueued, boolList &otherFaceVisited)
 Intersect a queue of source-target face pairs. Update completion. More...
 
void intersectPatches (const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch)
 Intersect the patches. More...
 
labelListList tgtPatchSendFaces (const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch) const
 Determine which target faces need to be sent to the source. More...
 
virtual void distributeSrc (const primitiveOldTimePatch &srcPatch)
 Distribute the source patch so that any information needed by. More...
 

Protected Attributes

List< scalar > srcDistances_
 For each source face, the distance to its coupled target face. More...
 
List< scalar > tgtDistances_
 For each target face, the distance to its coupled source face. More...
 
- Protected Attributes inherited from nearby
List< Tuple2< point, scalar > > srcSpheres_
 For each source face, the bounding sphere. More...
 
List< Tuple2< point, scalar > > tgtSpheres_
 For each target face, the bounding sphere. More...
 
- Protected Attributes inherited from patchToPatch
const bool reverse_
 Flag to indicate that the two patches are co-directional and. More...
 
label singleProcess_
 Index of the processor holding all faces of the patchToPatch, or -1. More...
 
List< DynamicList< label > > srcLocalTgtFaces_
 For each source face, the coupled local target faces. More...
 
List< DynamicList< label > > tgtLocalSrcFaces_
 For each target face, the coupled local source faces. More...
 
autoPtr< distributionMapsrcMapPtr_
 Map from source patch faces to target-local source patch faces. More...
 
autoPtr< distributionMaptgtMapPtr_
 Map from target patch faces to source-local target patch faces. More...
 
autoPtr< List< remote > > localSrcProcFacesPtr_
 When running in parallel, a map from local source face index to. More...
 
autoPtr< List< remote > > localTgtProcFacesPtr_
 When running in parallel, a map from local target face index to. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from patchToPatch
static autoPtr< patchToPatchNew (const word &patchToPatchType, const bool reverse)
 Select from name. More...
 
- Static Protected Member Functions inherited from patchToPatch
static List< remotedistributePatch (const distributionMap &map, const primitiveOldTimePatch &patch, autoPtr< PrimitiveOldTimePatch< faceList, pointField >> &localPatchPtr)
 Distribute a patch given its distribution map. More...
 

Detailed Description

Class to generate patchToPatch coupling geometry. Couples a face to the single nearest opposite face only.

Source files

Definition at line 51 of file nearestPatchToPatch.H.

Constructor & Destructor Documentation

◆ nearest()

nearest ( const bool  reverse)

Construct from components.

Definition at line 387 of file nearestPatchToPatch.C.

◆ ~nearest()

~nearest ( )

Destructor.

Definition at line 397 of file nearestPatchToPatch.C.

Member Function Documentation

◆ intersectFaces()

bool intersectFaces ( const primitiveOldTimePatch srcPatch,
const vectorField srcPointNormals,
const vectorField srcPointNormals0,
const primitiveOldTimePatch tgtPatch,
const label  srcFacei,
const label  tgtFacei 
)
protectedvirtual

◆ initialise()

void initialise ( const primitiveOldTimePatch srcPatch,
const vectorField srcPointNormals,
const vectorField srcPointNormals0,
const primitiveOldTimePatch tgtPatch 
)
protectedvirtual

Initialisation.

Reimplemented from nearby.

Definition at line 107 of file nearestPatchToPatch.C.

References nearby::initialise().

Here is the call graph for this function:

◆ finaliseLocal()

Foam::labelList finaliseLocal ( const primitiveOldTimePatch srcPatch,
const vectorField srcPointNormals,
const vectorField srcPointNormals0,
const primitiveOldTimePatch tgtPatch 
)
protectedvirtual

Finalise the intersection locally. Trims the local target patch.

so that only parts that actually intersect the source remain. Returns new-to-old map for trimming target-associated data.

Reimplemented from patchToPatch.

Definition at line 131 of file nearestPatchToPatch.C.

References patchToPatch::finaliseLocal().

Here is the call graph for this function:

◆ rDistributeTgt()

void rDistributeTgt ( const primitiveOldTimePatch tgtPatch)
protectedvirtual

Send data that resulted from an intersection between the source.

patch and a distributed source-local-target patch back to the original target processes

Reimplemented from patchToPatch.

Definition at line 154 of file nearestPatchToPatch.C.

References Foam::findMin(), forAll, Foam::min(), Foam::patchToPatchTools::rDistributeListList(), patchToPatch::rDistributeTgt(), and List< T >::resize().

Here is the call graph for this function:

◆ finalise()

◆ srcWeights()

Foam::tmpNrc< Foam::List< Foam::DynamicList< Foam::scalar > > > srcWeights ( ) const
protectedvirtual

For each source face, the coupled target weights.

Implements patchToPatch.

Definition at line 342 of file nearestPatchToPatch.C.

References forAll, tmpNrc< T >::ref(), and List< T >::resize().

Here is the call graph for this function:

◆ tgtWeights()

Foam::tmpNrc< Foam::List< Foam::DynamicList< Foam::scalar > > > tgtWeights ( ) const
protectedvirtual

For each target face, the coupled source weights.

Implements patchToPatch.

Definition at line 364 of file nearestPatchToPatch.C.

References forAll, tmpNrc< T >::ref(), and List< T >::resize().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "nearest"  )

Runtime type information.

Member Data Documentation

◆ srcDistances_

List<scalar> srcDistances_
protected

For each source face, the distance to its coupled target face.

Definition at line 60 of file nearestPatchToPatch.H.

Referenced by nearest::intersectFaces().

◆ tgtDistances_

List<scalar> tgtDistances_
protected

For each target face, the distance to its coupled source face.

Definition at line 63 of file nearestPatchToPatch.H.

Referenced by nearest::intersectFaces().


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