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

vtkPUnstructuredGridConnectivity implements functionality for generating ghost zones for a distributed unstructured grid. More...

#include <vtkPUnstructuredGridConnectivity.h>

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

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkPUnstructuredGridConnectivityNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
void RegisterGrid (vtkUnstructuredGrid *gridPtr)
 Registers the grid in this process. More...
 
void BuildGhostZoneConnectivity ()
 Builds the ghost-zone connectivity. More...
 
void UpdateGhosts ()
 Exchanges ghost zone data (i.e., node-centered or cell-centered fields). More...
 
virtual void SetController (vtkMPIController *)
 Set/Get the underlying MPI controller used for communication. More...
 
virtual vtkMPIControllerGetController ()
 Set/Get the underlying MPI controller used for communication. More...
 
virtual void SetGlobalIDFieldName (const char *)
 Set/Get the name of the GlobalID field. More...
 
virtual char * GetGlobalIDFieldName ()
 Set/Get the name of the GlobalID field. More...
 
virtual vtkUnstructuredGridGetGhostedGrid ()
 Returns the ghosted grid. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
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)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
int HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
int HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
int InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
void PrintRevisions (ostream &)
 Legacy. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 

Static Public Member Functions

static vtkPUnstructuredGridConnectivityNew ()
 
static int IsTypeOf (const char *type)
 
static vtkPUnstructuredGridConnectivitySafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static int GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkPUnstructuredGridConnectivity ()
 
virtual ~vtkPUnstructuredGridConnectivity ()
 
void FillGhostZoneCells (const int neiRank, vtkCellData *ghostData, vtkIdType *cellIdx, const unsigned int numGhostCells)
 Given the deserialized cell-centered ghost data from the given neighboring rank, this method fills in the cell-centered fields of the ghost zone. More...
 
void FillGhostZoneNodes (const int neiRank, vtkPointData *ghostData, vtkIdType *globalIdx, const unsigned int numGhostNodes)
 Given the deserialized node-centered ghost data from the given neighboring rank, this method fills in the node-centered fields of the ghost zone. More...
 
void DeSerializeGhostZones ()
 Deserializes the raw buffers received from each neighboring rank and updates the ghosted grid instance by filling in the values for the ghost zones. More...
 
void CreatePersistentRcvBuffers ()
 This method exchanges the buffer sizes among neighboring processes and allocates a persistent buffer for the communication. More...
 
void SerializeGhostZones ()
 This method serializes the local data (node-centered and/or cell-centered) for each rank that this process/grid communicates with. More...
 
void SynchLocalData ()
 Synchs the data on the input grid in this process to the ghosted grid instance. More...
 
void EnqueueNodeLinks (const int rmtRank, const vtkIdType ghostCell, const vtkIdType adjCell, vtkIdList *shared)
 Loops through the nodes of the ghost cell and the local adjacent cell and determines what. More...
 
bool IsCellConnected (vtkCell *c, vtkIdType *globalId, const vtkIdType N, vtkIdType &adjCell, vtkIdList *sharedIds)
 Given the cell, c, this method checks if it is connected to the grid assigned to this process. More...
 
void InsertGhostCellNodes (vtkCell *ghostCell, vtkIdTypeArray *ghostGridGlobalIdx, vtkIdType *globalIdArray, vtkUnstructuredGrid *bGrid, vtkIdType *cellPts)
 Inserts the ghost cell nodes in to the ghosted instance of the grid. More...
 
void ProcessRemoteGrid (const int rmtRank, vtkUnstructuredGrid *bGrid)
 Process the remote boundary grid and injects cells in to the ghosted grid if a match is found. More...
 
void BuildGhostedGridAndCommLists ()
 Builds the ghosted grid and communication lists. More...
 
void SerializeUnstructuredGrid (vtkUnstructuredGrid *g, vtkMultiProcessStream &bytestream)
 Serializes the unstructured grid into a bytestream. More...
 
void DeSerializeUnstructuredGrid (vtkUnstructuredGrid *g, vtkMultiProcessStream &bytestream)
 De-serializes the unstructured grid from the given bytestream. More...
 
void WriteUnstructuredGrid (vtkUnstructuredGrid *grid, const char *fileName)
 Writes the given unstructured grid to an ASCII file. More...
 
void ExtractSurfaceMesh ()
 Loops through the auxiliary FaceList, constructed in MarkFaces, and extracts the faces and nodes on the boundary. More...
 
void MarkFaces ()
 Loops through the input grid cell faces and updates the auxiliary data-structures to associates a count with each face. More...
 
void ExtractBoundaryCell (const vtkIdType cellIdx, const vtkIdType numCellNodes, vtkIdType *cellNodes, vtkPoints *nodes, vtkIdTypeArray *localIdx, vtkIdTypeArray *globaIdx)
 Extracts the boundary cell from the input grid and inserts it in to the boundary grid. More...
 
bool IsCellOnBoundary (vtkIdType *cellNodes, vtkIdType N)
 Checks if the cell, composed by the supplied nodes, is on the boundary. More...
 
void ExchangeBoundaryGrids ()
 Exchanged the boundary grids among candidate ranks. More...
 
void ExchangeBoundaryGridSizes (int size)
 Exchange boundary grid sizes. More...
 
void BoundingBoxCollision ()
 Collides the bounds of this process with the bounding boxes of all other processes. More...
 
void ExchangeGridBounds ()
 Exchanges the grid bounds of this process with all other processes. More...
 
void ExtractBoundaryGrid ()
 Extracts the boundary grid geometry from the input grid. More...
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- 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 99 of file vtkPUnstructuredGridConnectivity.h.

Member Typedef Documentation

Definition at line 104 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 vtkObjectBase.

static vtkPUnstructuredGridConnectivity* vtkPUnstructuredGridConnectivity::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkPUnstructuredGridConnectivity::NewInstanceInternal ( ) const
protectedvirtual
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 153 of file vtkPUnstructuredGridConnectivity.h.

vtkUnstructuredGrid* vtkPUnstructuredGridConnectivity::InputGrid
protected

Definition at line 154 of file vtkPUnstructuredGridConnectivity.h.

vtkUnstructuredGrid* vtkPUnstructuredGridConnectivity::GhostedGrid
protected

Definition at line 155 of file vtkPUnstructuredGridConnectivity.h.

vtkMPIController* vtkPUnstructuredGridConnectivity::Controller
protected

Definition at line 156 of file vtkPUnstructuredGridConnectivity.h.

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

Definition at line 158 of file vtkPUnstructuredGridConnectivity.h.

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

Definition at line 159 of file vtkPUnstructuredGridConnectivity.h.


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