VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkPUnstructuredGridConnectivity Class Reference

#include <vtkPUnstructuredGridConnectivity.h>

Inheritance diagram for vtkPUnstructuredGridConnectivity:
[legend]
Collaboration diagram for vtkPUnstructuredGridConnectivity:
[legend]

Public Types

typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkPUnstructuredGridConnectivityNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
void RegisterGrid (vtkUnstructuredGrid *gridPtr)
 
void BuildGhostZoneConnectivity ()
 
void UpdateGhosts ()
 
virtual void SetController (vtkMPIController *)
 
virtual vtkMPIControllerGetController ()
 
virtual void SetGlobalIDFieldName (const char *)
 
virtual char * GetGlobalIDFieldName ()
 
virtual vtkUnstructuredGridGetGhostedGrid ()
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static vtkPUnstructuredGridConnectivityNew ()
 
static int IsTypeOf (const char *type)
 
static vtkPUnstructuredGridConnectivitySafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkPUnstructuredGridConnectivity ()
 
virtual ~vtkPUnstructuredGridConnectivity ()
 
void DeSerializeGhostZones ()
 
void CreatePersistentRcvBuffers ()
 
void SerializeGhostZones ()
 
void SynchLocalData ()
 
void BuildGhostedGridAndCommLists ()
 
void WriteUnstructuredGrid (vtkUnstructuredGrid *grid, const char *fileName)
 
void ExtractSurfaceMesh ()
 
void MarkFaces ()
 
bool IsCellOnBoundary (vtkIdType *cellNodes, vtkIdType N)
 
void ExchangeBoundaryGrids ()
 
void ExchangeBoundaryGridSizes (int size)
 
void BoundingBoxCollision ()
 
void ExchangeGridBounds ()
 
void ExtractBoundaryGrid ()
 
void FillGhostZoneCells (const int neiRank, vtkCellData *ghostData, vtkIdType *cellIdx, const unsigned int numGhostCells)
 
void FillGhostZoneNodes (const int neiRank, vtkPointData *ghostData, vtkIdType *globalIdx, const unsigned int numGhostNodes)
 
void EnqueueNodeLinks (const int rmtRank, const vtkIdType ghostCell, const vtkIdType adjCell, vtkIdList *shared)
 
bool IsCellConnected (vtkCell *c, vtkIdType *globalId, const vtkIdType N, vtkIdType &adjCell, vtkIdList *sharedIds)
 
void InsertGhostCellNodes (vtkCell *ghostCell, vtkIdTypeArray *ghostGridGlobalIdx, vtkIdType *globalIdArray, vtkUnstructuredGrid *bGrid, vtkIdType *cellPts)
 
void ProcessRemoteGrid (const int rmtRank, vtkUnstructuredGrid *bGrid)
 
void SerializeUnstructuredGrid (vtkUnstructuredGrid *g, vtkMultiProcessStream &bytestream)
 
void DeSerializeUnstructuredGrid (vtkUnstructuredGrid *g, vtkMultiProcessStream &bytestream)
 
void ExtractBoundaryCell (const vtkIdType cellIdx, const vtkIdType numCellNodes, vtkIdType *cellNodes, vtkPoints *nodes, vtkIdTypeArray *localIdx, vtkIdTypeArray *globaIdx)
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

char * GlobalIDFieldName
 
vtkUnstructuredGridInputGrid
 
vtkUnstructuredGridGhostedGrid
 
vtkMPIControllerController
 
vtk::details::GridInfo * AuxiliaryData
 
vtk::details::CommunicationLinks * CommLists
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

vtkPUnstructuredGridConnectivity implements functionality for generating ghost zones for a distributed unstructured grid. Generating ghost zones is implemented in two stages. First, we build the ghost zones, which amounts to building the connectivity of the ghosted grid and communication links, and second, we update the ghost zones by communicating the fields on the ghost cells and nodes. The main steps involved in this process are as follows:

  1. Each process computes a bounding box of the grid it owns.
  2. The bounding boxes are then distributed to all processes by an AllGather collective call.
  3. Each process loops through the list of bounding boxes and computes box intersections with its local bounding box.
  4. The list of intersecting bounding boxes, yields an abbreviated list of candidate neighbors.
  5. Given the local grid, each process then extracts the boundary grid, which consists of nodes/cells on the boundary, global node IDs and the local cell IDs w.r.t. the local grid.
  6. Boundary grids are then exchanged among candidate neighbors using point-to-point communication.
  7. Next, each process constructs the topology of the ghost zones and communication links, using the local boundary grid and the list of remote boundary grids.
  8. The communication links store a source/target pair for nodes/cells among connected grids and remain persistent in memory.
  9. Last, the fields (node- and/or cell-centered) are updated, using point-to-point communication by processing the communication links.
Deprecated:
Not maintained as of VTK 7.0 and will be removed eventually. Use vtkPUnstructuredGridGhostCellsGenerator instead.
Warning
  • The code currently assumes one grid per rank.
  • GlobalID information must be available.
  • The grid must be globally conforming, i.e., no hanging nodes.
  • Only topologically face-adjacent ghost cells are considered.
  • PointData and CellData must match across partitions/processes.
See also
vtkPUnstructuredGridGhostDataGenerator vtkPUnstructuredGridGhostCellsGenerator
Tests:
vtkPUnstructuredGridConnectivity (Tests)

Definition at line 98 of file vtkPUnstructuredGridConnectivity.h.

Member Typedef Documentation

Definition at line 103 of file vtkPUnstructuredGridConnectivity.h.

Constructor & Destructor Documentation

vtkPUnstructuredGridConnectivity::vtkPUnstructuredGridConnectivity ( )
protected
virtual vtkPUnstructuredGridConnectivity::~vtkPUnstructuredGridConnectivity ( )
protectedvirtual

Member Function Documentation

static vtkPUnstructuredGridConnectivity* vtkPUnstructuredGridConnectivity::New ( )
static
static int vtkPUnstructuredGridConnectivity::IsTypeOf ( const char *  type)
static
virtual int vtkPUnstructuredGridConnectivity::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

static vtkPUnstructuredGridConnectivity* vtkPUnstructuredGridConnectivity::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkPUnstructuredGridConnectivity::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkObject.

vtkPUnstructuredGridConnectivity* vtkPUnstructuredGridConnectivity::NewInstance ( ) const
void vtkPUnstructuredGridConnectivity::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

virtual void vtkPUnstructuredGridConnectivity::SetController ( vtkMPIController )
virtual

Set/Get the underlying MPI controller used for communication.

virtual vtkMPIController* vtkPUnstructuredGridConnectivity::GetController ( )
virtual

Set/Get the underlying MPI controller used for communication.

virtual void vtkPUnstructuredGridConnectivity::SetGlobalIDFieldName ( const char *  )
virtual

Set/Get the name of the GlobalID field. By default, "GlobalID" is assumed.

virtual char* vtkPUnstructuredGridConnectivity::GetGlobalIDFieldName ( )
virtual

Set/Get the name of the GlobalID field. By default, "GlobalID" is assumed.

virtual vtkUnstructuredGrid* vtkPUnstructuredGridConnectivity::GetGhostedGrid ( )
virtual

Returns the ghosted grid.

void vtkPUnstructuredGridConnectivity::RegisterGrid ( vtkUnstructuredGrid gridPtr)

Registers the grid in this process

void vtkPUnstructuredGridConnectivity::BuildGhostZoneConnectivity ( )

Builds the ghost-zone connectivity. This method sets up the necessary communication lists for updating the ghost zones. NOTE: the local grid, must be registered, by calling RegisterGrid(), prior to calling this method.

void vtkPUnstructuredGridConnectivity::UpdateGhosts ( )

Exchanges ghost zone data (i.e., node-centered or cell-centered fields). NOTE: This method must be called after BuildGhostZoneConnectivity.

void vtkPUnstructuredGridConnectivity::FillGhostZoneCells ( const int  neiRank,
vtkCellData ghostData,
vtkIdType cellIdx,
const unsigned int  numGhostCells 
)
protected

Given the deserialized cell-centered ghost data from the given neighboring rank, this method fills in the cell-centered fields of the ghost zone.

void vtkPUnstructuredGridConnectivity::FillGhostZoneNodes ( const int  neiRank,
vtkPointData ghostData,
vtkIdType globalIdx,
const unsigned int  numGhostNodes 
)
protected

Given the deserialized node-centered ghost data from the given neighboring rank, this method fills in the node-centered fields of the ghost zone.

void vtkPUnstructuredGridConnectivity::DeSerializeGhostZones ( )
protected

Deserializes the raw buffers received from each neighboring rank and updates the ghosted grid instance by filling in the values for the ghost zones.

void vtkPUnstructuredGridConnectivity::CreatePersistentRcvBuffers ( )
protected

This method exchanges the buffer sizes among neighboring processes and allocates a persistent buffer for the communication. This exchange and memory allocation happens only the first time the data is exchanged

void vtkPUnstructuredGridConnectivity::SerializeGhostZones ( )
protected

This method serializes the local data (node-centered and/or cell-centered) for each rank that this process/grid communicates with.

void vtkPUnstructuredGridConnectivity::SynchLocalData ( )
protected

Synchs the data on the input grid in this process to the ghosted grid instance.

void vtkPUnstructuredGridConnectivity::EnqueueNodeLinks ( const int  rmtRank,
const vtkIdType  ghostCell,
const vtkIdType  adjCell,
vtkIdList shared 
)
protected

Loops through the nodes of the ghost cell and the local adjacent cell and determines what

bool vtkPUnstructuredGridConnectivity::IsCellConnected ( vtkCell c,
vtkIdType globalId,
const vtkIdType  N,
vtkIdType adjCell,
vtkIdList sharedIds 
)
protected

Given the cell, c, this method checks if it is connected to the grid assigned to this process. The method will return -1, if the cell is not connected. If the cell is connected, adjCell will hold the cell index of the cell w.r.t. the input grid that the ghost cell is face-adjacent to as well as the shared global Ids of the face between the ghost and the face-adjacent, boundary cell.

void vtkPUnstructuredGridConnectivity::InsertGhostCellNodes ( vtkCell ghostCell,
vtkIdTypeArray ghostGridGlobalIdx,
vtkIdType globalIdArray,
vtkUnstructuredGrid bGrid,
vtkIdType cellPts 
)
protected

Inserts the ghost cell nodes in to the ghosted instance of the grid.

void vtkPUnstructuredGridConnectivity::ProcessRemoteGrid ( const int  rmtRank,
vtkUnstructuredGrid bGrid 
)
protected

Process the remote boundary grid and injects cells in to the ghosted grid if a match is found.

void vtkPUnstructuredGridConnectivity::BuildGhostedGridAndCommLists ( )
protected

Builds the ghosted grid and communication lists

void vtkPUnstructuredGridConnectivity::SerializeUnstructuredGrid ( vtkUnstructuredGrid g,
vtkMultiProcessStream bytestream 
)
protected

Serializes the unstructured grid into a bytestream.

void vtkPUnstructuredGridConnectivity::DeSerializeUnstructuredGrid ( vtkUnstructuredGrid g,
vtkMultiProcessStream bytestream 
)
protected

De-serializes the unstructured grid from the given bytestream.

void vtkPUnstructuredGridConnectivity::WriteUnstructuredGrid ( vtkUnstructuredGrid grid,
const char *  fileName 
)
protected

Writes the given unstructured grid to an ASCII file. NOTE: Used for debugging.

void vtkPUnstructuredGridConnectivity::ExtractSurfaceMesh ( )
protected

Loops through the auxiliary FaceList, constructed in MarkFaces, and extracts the faces and nodes on the boundary.

void vtkPUnstructuredGridConnectivity::MarkFaces ( )
protected

Loops through the input grid cell faces and updates the auxiliary data-structures to associates a count with each face.

void vtkPUnstructuredGridConnectivity::ExtractBoundaryCell ( const vtkIdType  cellIdx,
const vtkIdType  numCellNodes,
vtkIdType cellNodes,
vtkPoints nodes,
vtkIdTypeArray localIdx,
vtkIdTypeArray globaIdx 
)
protected

Extracts the boundary cell from the input grid and inserts it in to the boundary grid.

bool vtkPUnstructuredGridConnectivity::IsCellOnBoundary ( vtkIdType cellNodes,
vtkIdType  N 
)
protected

Checks if the cell, composed by the supplied nodes, is on the boundary. A cell is on the boundary iff any of its nodes touch the boundary.

void vtkPUnstructuredGridConnectivity::ExchangeBoundaryGrids ( )
protected

Exchanged the boundary grids among candidate ranks.

void vtkPUnstructuredGridConnectivity::ExchangeBoundaryGridSizes ( int  size)
protected

Exchange boundary grid sizes

void vtkPUnstructuredGridConnectivity::BoundingBoxCollision ( )
protected

Collides the bounds of this process with the bounding boxes of all other processes. The processes whose bounding boxes intersect yield the list of candidate ranks with which boundary grids will be exchanged.

void vtkPUnstructuredGridConnectivity::ExchangeGridBounds ( )
protected

Exchanges the grid bounds of this process with all other processes. Upon completion, each process will have the global grid bounds of every process.

void vtkPUnstructuredGridConnectivity::ExtractBoundaryGrid ( )
protected

Extracts the boundary grid geometry from the input grid. Note: this method only extract the mesh and global/local ID information.

Member Data Documentation

char* vtkPUnstructuredGridConnectivity::GlobalIDFieldName
protected

Definition at line 142 of file vtkPUnstructuredGridConnectivity.h.

vtkUnstructuredGrid* vtkPUnstructuredGridConnectivity::InputGrid
protected

Definition at line 143 of file vtkPUnstructuredGridConnectivity.h.

vtkUnstructuredGrid* vtkPUnstructuredGridConnectivity::GhostedGrid
protected

Definition at line 144 of file vtkPUnstructuredGridConnectivity.h.

vtkMPIController* vtkPUnstructuredGridConnectivity::Controller
protected

Definition at line 145 of file vtkPUnstructuredGridConnectivity.h.

vtk::details::GridInfo* vtkPUnstructuredGridConnectivity::AuxiliaryData
protected

Definition at line 148 of file vtkPUnstructuredGridConnectivity.h.

vtk::details::CommunicationLinks* vtkPUnstructuredGridConnectivity::CommLists
protected

Definition at line 149 of file vtkPUnstructuredGridConnectivity.h.


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