Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
PointEdgeWave< Type, TrackingData > Class Template Reference

Wave propagation of information through grid. Every iteration information goes through one layer of edges. More...

Inheritance diagram for PointEdgeWave< Type, TrackingData >:
Inheritance graph
[legend]
Collaboration diagram for PointEdgeWave< Type, TrackingData >:
Collaboration graph
[legend]

Public Member Functions

 PointEdgeWave (const polyMesh &mesh, const labelList &initialPoints, const List< Type > &initialPointsInfo, UList< Type > &allPointInfo, UList< Type > &allEdgeInfo, const label maxIter, TrackingData &td=dummyTrackData_)
 Construct from mesh, list of changed points with the Type. More...
 
 PointEdgeWave (const polyMesh &mesh, UList< Type > &allPointInfo, UList< Type > &allEdgeInfo, TrackingData &td=dummyTrackData_)
 Construct from mesh. Use setPointInfo and iterate() to do. More...
 
 ~PointEdgeWave ()
 Destructor. More...
 
UList< Type > & allPointInfo () const
 Access allPointInfo. More...
 
UList< Type > & allEdgeInfo () const
 Access allEdgeInfo. More...
 
const TrackingData & data () const
 Additional data to be passed into container. More...
 
label getUnsetEdges () const
 Get number of unvisited edges, i.e. edges that were not (yet) More...
 
label getUnsetPoints () const
 
void setPointInfo (const labelList &changedPoints, const List< Type > &changedPointsInfo)
 Copy initial data into allPointInfo_. More...
 
label pointToEdge ()
 Propagate from point to edge. Returns total number of edges. More...
 
label edgeToPoint ()
 Propagate from edge to point. Returns total number of points. More...
 
label iterate (const label maxIter)
 Iterate until no changes or maxIter reached. Returns actual. More...
 
template<class PatchType >
Foam::label countPatchType () const
 

Static Public Member Functions

static scalar propagationTol ()
 Access to tolerance. More...
 
static void setPropagationTol (const scalar tol)
 Change tolerance. More...
 

Private Member Functions

void leaveDomain (const polyPatch &, const List< label > &patchPointLabels, List< Type > &pointInfo) const
 Adapt pointInfo for leaving domain. More...
 
void enterDomain (const polyPatch &, const List< label > &patchPointLabels, List< Type > &pointInfo) const
 Adapt pointInfo for entering domain. More...
 
void transform (const polyPatch &patch, const tensorField &rotTensor, List< Type > &pointInfo) const
 Transform. Implementation referred to Type. More...
 
bool updatePoint (const label pointI, const label neighbourEdgeI, const Type &neighbourInfo, Type &pointInfo)
 Updates pointInfo with information from neighbour. Updates all. More...
 
bool updatePoint (const label pointI, const Type &neighbourInfo, Type &pointInfo)
 Updates pointInfo with information from same point. Updates all. More...
 
bool updateEdge (const label edgeI, const label neighbourPointI, const Type &neighbourInfo, Type &edgeInfo)
 Updates edgeInfo with information from neighbour. Updates all. More...
 
template<class PatchType >
label countPatchType () const
 Has patches of certain type? More...
 
void handleProcPatches ()
 Merge data from across processor boundaries. More...
 
void handleCyclicPatches ()
 Merge data from across cyclic boundaries. More...
 
label handleCollocatedPoints ()
 Explicitly sync all collocated points. More...
 
 PointEdgeWave (const PointEdgeWave &)
 Disallow default bitwise copy construct. More...
 
void operator= (const PointEdgeWave &)
 Disallow default bitwise assignment. More...
 

Private Attributes

const polyMeshmesh_
 Reference to mesh. More...
 
UList< Type > & allPointInfo_
 Wall information for all points. More...
 
UList< Type > & allEdgeInfo_
 Information on all mesh edges. More...
 
TrackingData & td_
 Additional data to be passed into container. More...
 
boolList changedPoint_
 Has point changed. More...
 
labelList changedPoints_
 List of changed points. More...
 
label nChangedPoints_
 Number of changed points. More...
 
boolList changedEdge_
 Edges that have changed. More...
 
labelList changedEdges_
 
label nChangedEdges_
 
label nCyclicPatches_
 Number of cyclic patches. More...
 
label nEvals_
 Number of evaluations. More...
 
label nUnvisitedPoints_
 Number of unvisited edges/points. More...
 
label nUnvisitedEdges_
 

Static Private Attributes

static scalar propagationTol_ = 0.01
 Relative tolerance. Stop propagation if relative changes. More...
 
static int dummyTrackData_ = 12345
 Used as default trackdata value to satisfy default template. More...
 

Detailed Description

template<class Type, class TrackingData = int>
class Foam::PointEdgeWave< Type, TrackingData >

Wave propagation of information through grid. Every iteration information goes through one layer of edges.

Templated on information that is transferred.

Handles parallel and cyclics. Only parallel reasonably tested. Cyclics hardly tested.

Note: whether to propagate depends on the return value of Type::update which returns true (i.e. propagate) if the value changes by more than a certain tolerance.

Note: parallel is done in two steps:

  1. transfer patch points in offset notation, i.e. every patch point is denoted by a patchface label and an index in this face. Receiving end uses that fact that f[0] is shared and order is reversed.
  2. do all non-local shared points by means of reduce of data on them.

Note: cyclics is with offset in patchface as well. Patch is divided into two sub patches and the point-point addressing is never explicitly calculated but instead use is made of the face-face correspondence. (it probably is more efficient to calculate a point-point correspondence at the start and then reuse this; task to be done)

Source files

Definition at line 85 of file PointEdgeWave.H.

Constructor & Destructor Documentation

◆ PointEdgeWave() [1/3]

PointEdgeWave ( const PointEdgeWave< Type, TrackingData > &  )
private

Disallow default bitwise copy construct.

◆ PointEdgeWave() [2/3]

PointEdgeWave ( const polyMesh mesh,
const labelList initialPoints,
const List< Type > &  initialPointsInfo,
UList< Type > &  allPointInfo,
UList< Type > &  allEdgeInfo,
const label  maxIter,
TrackingData &  td = dummyTrackData_ 
)

Construct from mesh, list of changed points with the Type.

for these points. Gets work arrays to operate on, one of size number of mesh points, the other number of mesh edges. Iterates until nothing changes or maxIter reached. (maxIter can be 0)

Definition at line 609 of file PointEdgeWave.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, and Foam::returnReduce().

Here is the call graph for this function:

◆ PointEdgeWave() [3/3]

PointEdgeWave ( const polyMesh mesh,
UList< Type > &  allPointInfo,
UList< Type > &  allEdgeInfo,
TrackingData &  td = dummyTrackData_ 
)

Construct from mesh. Use setPointInfo and iterate() to do.

actual calculation

Definition at line 682 of file PointEdgeWave.C.

◆ ~PointEdgeWave()

Destructor.

Definition at line 709 of file PointEdgeWave.C.

Member Function Documentation

◆ leaveDomain()

void leaveDomain ( const polyPatch ,
const List< label > &  patchPointLabels,
List< Type > &  pointInfo 
) const
private

Adapt pointInfo for leaving domain.

Definition at line 76 of file PointEdgeWave.C.

References forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), and PrimitivePatch< Face, FaceList, PointField, PointType >::points().

Here is the call graph for this function:

◆ enterDomain()

void enterDomain ( const polyPatch ,
const List< label > &  patchPointLabels,
List< Type > &  pointInfo 
) const
private

Adapt pointInfo for entering domain.

Definition at line 98 of file PointEdgeWave.C.

References forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), and PrimitivePatch< Face, FaceList, PointField, PointType >::points().

Here is the call graph for this function:

◆ transform()

void transform ( const polyPatch patch,
const tensorField rotTensor,
List< Type > &  pointInfo 
) const
private

Transform. Implementation referred to Type.

Definition at line 120 of file PointEdgeWave.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, patchIdentifier::name(), and T.

Here is the call graph for this function:

◆ updatePoint() [1/2]

bool updatePoint ( const label  pointI,
const label  neighbourEdgeI,
const Type &  neighbourInfo,
Type &  pointInfo 
)
private

Updates pointInfo with information from neighbour. Updates all.

statistics.

Definition at line 158 of file PointEdgeWave.C.

◆ updatePoint() [2/2]

bool updatePoint ( const label  pointI,
const Type &  neighbourInfo,
Type &  pointInfo 
)
private

Updates pointInfo with information from same point. Updates all.

statistics.

Definition at line 205 of file PointEdgeWave.C.

◆ updateEdge()

bool updateEdge ( const label  edgeI,
const label  neighbourPointI,
const Type &  neighbourInfo,
Type &  edgeInfo 
)
private

Updates edgeInfo with information from neighbour. Updates all.

statistics.

Definition at line 250 of file PointEdgeWave.C.

◆ countPatchType() [1/2]

label countPatchType ( ) const
private

Has patches of certain type?

◆ handleProcPatches()

void handleProcPatches
private

◆ handleCyclicPatches()

void handleCyclicPatches
private

◆ handleCollocatedPoints()

Foam::label handleCollocatedPoints
private

◆ operator=()

void operator= ( const PointEdgeWave< Type, TrackingData > &  )
private

Disallow default bitwise assignment.

◆ propagationTol()

static scalar propagationTol ( )
inlinestatic

Access to tolerance.

Definition at line 223 of file PointEdgeWave.H.

References PointEdgeWave< Type, TrackingData >::propagationTol_.

◆ setPropagationTol()

static void setPropagationTol ( const scalar  tol)
inlinestatic

Change tolerance.

Definition at line 229 of file PointEdgeWave.H.

References PointEdgeWave< Type, TrackingData >::propagationTol_.

◆ allPointInfo()

UList<Type>& allPointInfo ( ) const
inline

Access allPointInfo.

Definition at line 271 of file PointEdgeWave.H.

References PointEdgeWave< Type, TrackingData >::allPointInfo_.

◆ allEdgeInfo()

UList<Type>& allEdgeInfo ( ) const
inline

Access allEdgeInfo.

Definition at line 277 of file PointEdgeWave.H.

References PointEdgeWave< Type, TrackingData >::allEdgeInfo_.

◆ data()

const TrackingData& data ( ) const
inline

Additional data to be passed into container.

Definition at line 283 of file PointEdgeWave.H.

References PointEdgeWave< Type, TrackingData >::td_.

Referenced by patchCorrectedInterpolation::propagateDataFromPatchGroup().

Here is the caller graph for this function:

◆ getUnsetEdges()

Foam::label getUnsetEdges

Get number of unvisited edges, i.e. edges that were not (yet)

reached from walking across mesh. This can happen from

  • not enough iterations done
  • a disconnected mesh
  • a mesh without walls in it

Definition at line 724 of file PointEdgeWave.C.

◆ getUnsetPoints()

Foam::label getUnsetPoints

Definition at line 717 of file PointEdgeWave.C.

Referenced by medialAxisMeshMover::update().

Here is the caller graph for this function:

◆ setPointInfo()

void setPointInfo ( const labelList changedPoints,
const List< Type > &  changedPointsInfo 
)

Copy initial data into allPointInfo_.

Definition at line 733 of file PointEdgeWave.C.

References forAll.

◆ pointToEdge()

Foam::label pointToEdge

Propagate from point to edge. Returns total number of edges.

(over all processors) changed.

Definition at line 845 of file PointEdgeWave.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::nl, and Foam::reduce().

Here is the call graph for this function:

◆ edgeToPoint()

Foam::label edgeToPoint

Propagate from edge to point. Returns total number of points.

(over all processors) changed.

Definition at line 769 of file PointEdgeWave.C.

References Foam::abort(), Foam::constant::electromagnetic::e, Foam::FatalError, FatalErrorInFunction, forAll, Foam::nl, and Foam::reduce().

Here is the call graph for this function:

◆ iterate()

Foam::label iterate ( const label  maxIter)

Iterate until no changes or maxIter reached. Returns actual.

number of iterations.

Definition at line 914 of file PointEdgeWave.C.

References Foam::endl(), Foam::Info, Foam::nl, nPoints, and Foam::returnReduce().

Referenced by medialAxisMeshMover::calculateDisplacement(), and medialAxisMeshMover::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ countPatchType() [2/2]

Foam::label countPatchType ( ) const

Definition at line 293 of file PointEdgeWave.C.

References forAll, and nPatches.

Field Documentation

◆ propagationTol_

Foam::scalar propagationTol_ = 0.01
staticprivate

Relative tolerance. Stop propagation if relative changes.

less than this tolerance (responsability for checking this is up to Type implementation)

Definition at line 94 of file PointEdgeWave.H.

Referenced by PointEdgeWave< Type, TrackingData >::propagationTol(), and PointEdgeWave< Type, TrackingData >::setPropagationTol().

◆ dummyTrackData_

int dummyTrackData_ = 12345
staticprivate

Used as default trackdata value to satisfy default template.

argument.

Definition at line 98 of file PointEdgeWave.H.

◆ mesh_

const polyMesh& mesh_
private

Reference to mesh.

Definition at line 104 of file PointEdgeWave.H.

◆ allPointInfo_

UList<Type>& allPointInfo_
private

Wall information for all points.

Definition at line 107 of file PointEdgeWave.H.

Referenced by PointEdgeWave< Type, TrackingData >::allPointInfo().

◆ allEdgeInfo_

UList<Type>& allEdgeInfo_
private

Information on all mesh edges.

Definition at line 110 of file PointEdgeWave.H.

Referenced by PointEdgeWave< Type, TrackingData >::allEdgeInfo().

◆ td_

TrackingData& td_
private

Additional data to be passed into container.

Definition at line 113 of file PointEdgeWave.H.

Referenced by PointEdgeWave< Type, TrackingData >::data().

◆ changedPoint_

boolList changedPoint_
private

Has point changed.

Definition at line 116 of file PointEdgeWave.H.

◆ changedPoints_

labelList changedPoints_
private

List of changed points.

Definition at line 119 of file PointEdgeWave.H.

◆ nChangedPoints_

label nChangedPoints_
private

Number of changed points.

Definition at line 122 of file PointEdgeWave.H.

◆ changedEdge_

boolList changedEdge_
private

Edges that have changed.

Definition at line 125 of file PointEdgeWave.H.

◆ changedEdges_

labelList changedEdges_
private

Definition at line 126 of file PointEdgeWave.H.

◆ nChangedEdges_

label nChangedEdges_
private

Definition at line 127 of file PointEdgeWave.H.

◆ nCyclicPatches_

label nCyclicPatches_
private

Number of cyclic patches.

Definition at line 130 of file PointEdgeWave.H.

◆ nEvals_

label nEvals_
private

Number of evaluations.

Definition at line 133 of file PointEdgeWave.H.

◆ nUnvisitedPoints_

label nUnvisitedPoints_
private

Number of unvisited edges/points.

Definition at line 136 of file PointEdgeWave.H.

◆ nUnvisitedEdges_

label nUnvisitedEdges_
private

Definition at line 137 of file PointEdgeWave.H.


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