VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkStructuredGridConnectivity.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkStructuredGridConnectivity.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14  =========================================================================*/
31 #ifndef vtkStructuredGridConnectivity_H_
32 #define vtkStructuredGridConnectivity_H_
33 
34 #define VTK_NO_OVERLAP 0
35 #define VTK_NODE_OVERLAP 1
36 #define VTK_EDGE_OVERLAP 2
37 #define VTK_PARTIAL_OVERLAP 3
38 
39 // VTK include directives
40 #include "vtkFiltersGeometryModule.h" // For export macro
42 #include "vtkStructuredNeighbor.h" // For Structured Neighbor object definition
43 #include "vtkStructuredData.h" // For data description definitions
44 
45 // C++ include directives
46 #include <iostream> // For cout
47 #include <vector> // For STL vector
48 #include <map> // For STL map
49 #include <utility> // For STL pair and overloaded relational operators
50 #include <cassert> // For assert()
51 
52 // Forward Declarations
53 class vtkIdList;
54 class vtkUnsignedCharArray;
55 class vtkPointData;
56 class vtkCellData;
57 class vtkPoints;
58 
59 class VTKFILTERSGEOMETRY_EXPORT vtkStructuredGridConnectivity :
61 {
62 public:
63  static vtkStructuredGridConnectivity* New();
65  void PrintSelf(ostream& os, vtkIndent indent );
66 
68 
69  vtkSetVector6Macro(WholeExtent,int);
70  vtkGetVector6Macro(WholeExtent,int);
72 
74 
75  vtkGetMacro(DataDimension,int);
77 
79  virtual void SetNumberOfGrids( const unsigned int N );
80 
82 
84  virtual void RegisterGrid( const int gridID, int extents[6],
85  vtkUnsignedCharArray* nodesGhostArray,
86  vtkUnsignedCharArray* cellGhostArray,
87  vtkPointData* pointData,
88  vtkCellData* cellData,
89  vtkPoints* gridNodes );
91 
94  void GetGridExtent( const int gridID, int extent[6] );
95 
98  void SetGhostedGridExtent( const int gridID, int ext[6] );
99 
101  void GetGhostedGridExtent( const int gridID, int ext[6] );
102 
104  virtual void ComputeNeighbors();
105 
107 
109  int GetNumberOfNeighbors( const int gridID )
110  { return( static_cast<int>(this->Neighbors[ gridID ].size() )); };
112 
115  vtkStructuredNeighbor GetGridNeighbor(const int gridID, const int nei);
116 
120  vtkIdList* GetNeighbors( const int gridID, int *extents );
121 
123 
126  void FillGhostArrays(
127  const int gridID,
128  vtkUnsignedCharArray *nodesArray,
129  vtkUnsignedCharArray *cellsArray );
131 
133  virtual void CreateGhostLayers( const int N=1 );
134 
135 protected:
138 
140 
141  bool InBounds( const int idx, const int Lo, const int Hi )
142  { return( (idx>=Lo) && (idx<=Hi) ); };
144 
146 
147  bool StrictlyInsideBounds( const int idx, const int Lo, const int Hi )
148  { return( (idx > Lo) && (idx < Hi) ); };
150 
152 
153  bool IsSubset( int A[2], int B[2] )
154  { return( this->InBounds(A[0], B[0], B[1]) &&
155  this->InBounds(A[1], B[0], B[1]) ); };
157 
159  int Cardinality( int S[2] ) { return( S[1]-S[0]+1 ); };
160 
162 
164  int GetNumberOfNodesPerCell( const int dim )
165  {
166  int numNodes = 0;
167  switch( dim )
168  {
169  case 1:
170  numNodes = 2; // line cell
171  break;
172  case 2:
173  numNodes = 4; // quad cell
174  break;
175  case 3:
176  numNodes = 8; // hex cell
177  break;
178  default:
179  assert( "ERROR: code should not reach here!" && false );
180  } // END switch
181  return( numNodes );
182  }
184 
186 
187  void FillNodesGhostArray(
188  const int gridID, const int dataDescription,
189  int GridExtent[6], int RealExtent[6], vtkUnsignedCharArray *nodeArray );
191 
193 
194  void FillCellsGhostArray(
195  const int dataDescription, const int numNodesPerCell,
196  int dims[3], int CellExtent[6], vtkUnsignedCharArray *nodesArray,
197  vtkUnsignedCharArray *cellsArray );
199 
201 
204  void SearchNeighbors(
205  const int gridID,
206  const int i, const int j, const int k,
207  vtkIdList *neiList );
209 
211 
213  void MarkNodeProperty(
214  const int gridID,
215  const int i, const int j, const int k,
216  int ext[6], int RealExtent[6], unsigned char &pfield );
218 
220 
222  void MarkCellProperty(
223  unsigned char &pfield,
224  unsigned char *nodeGhostFields, const int numNodes );
226 
228  void GetRealExtent( const int gridID, int GridExtent[6],int RealExtent[6] );
229 
231 
233  bool IsGhostNode(
234  int GridExtent[6], int RealExtent[6],
235  const int i, const int j, const int k );
237 
239 
241  bool IsNodeOnBoundaryOfExtent(
242  const int i, const int j, const int k, int ext[6] );
244 
246 
249  bool IsNodeOnSharedBoundary(
250  const int gridID, int RealExtent[6],
251  const int i, const int j, const int k );
253 
257  bool IsNodeOnBoundary( const int i, const int j, const int k );
258 
260 
262  bool IsNodeInterior(
263  const int i, const int j, const int k,
264  int GridExtent[6] );
266 
268 
272  const int i, const int j, const int k,
273  int GridExtent[6] )
274  {
275  bool status = false;
277 
278  switch( this->DataDescription )
279  {
280  case VTK_X_LINE:
281  if( (GridExtent[0] <= i) && (i <= GridExtent[1]) )
282  {
283  status = true;
284  }
285  break;
286  case VTK_Y_LINE:
287  if( (GridExtent[2] <= j) && (j <= GridExtent[3] ) )
288  {
289  status = true;
290  }
291  break;
292  case VTK_Z_LINE:
293  if( (GridExtent[4] <= k) && (k <= GridExtent[5] ) )
294  {
295  status = true;
296  }
297  break;
298  case VTK_XY_PLANE:
299  if( (GridExtent[0] <= i) && (i <= GridExtent[1]) &&
300  (GridExtent[2] <= j) && (j <= GridExtent[3]) )
301  {
302  status = true;
303  }
304  break;
305  case VTK_YZ_PLANE:
306  if( (GridExtent[2] <= j) && (j <= GridExtent[3] ) &&
307  (GridExtent[4] <= k) && (k <= GridExtent[5] ) )
308  {
309  status = true;
310  }
311  break;
312  case VTK_XZ_PLANE:
313  if( (GridExtent[0] <= i) && (i <= GridExtent[1] ) &&
314  (GridExtent[4] <= k) && (k <= GridExtent[5] ) )
315  {
316  status = true;
317  }
318  break;
319  case VTK_XYZ_GRID:
320  if( (GridExtent[0] <= i) && (i <= GridExtent[1]) &&
321  (GridExtent[2] <= j) && (j <= GridExtent[3]) &&
322  (GridExtent[4] <= k) && (k <= GridExtent[5]) )
323  {
324  status = true;
325  }
326  break;
327  default:
328  std::cout << "Data description is: " << this->DataDescription << "\n";
329  std::cout.flush();
330  assert( "pre: Undefined data-description!" && false );
331  } // END switch
332 
333  return( status );
334  }
335 
337 
338  void SetNeighbors(
339  const int i, const int j,
340  int i2jOrientation[3], int j2iOrientation[3],
341  int overlapExtent[6] );
343 
345 
351  void DetermineNeighborOrientation(
352  const int idx, int A[2], int B[2], int overlap[2], int orient[3] );
354 
356 
359  void DetectNeighbors(
360  const int i, const int j, int ex1[6], int ex2[6],
361  int orientation[3], int ndim);
363 
369  int IntervalOverlap( int A[2], int B[2], int overlap[2] );
370 
376  int DoPartialOverlap( int s[2], int S[2], int overlap[2] );
377 
379 
384  int PartialOverlap(
385  int A[2], const int CofA,
386  int B[2], const int CofB,
387  int overlap[2] );
389 
392  void EstablishNeighbors( const int i, const int j );
393 
397  void AcquireDataDescription();
398 
406  bool HasBlockConnection( const int gridID, const int blockDirection );
407 
415  void RemoveBlockConnection( const int gridID, const int blockDirection );
416 
424  void AddBlockConnection( const int gridID, const int blockDirection );
425 
428  void ClearBlockConnections( const int gridID );
429 
435  int GetNumberOfConnectingBlockFaces( const int gridID );
436 
439  void SetBlockTopology( const int gridID );
440 
442 
447  void GetIJKBlockOrientation(
448  const int i, const int j, const int k, int ext[6], int orientation[3] );
450 
452 
454  int Get1DOrientation(
455  const int idx, const int ExtentLo, const int ExtentHi,
456  const int OnLo, const int OnHi, const int NotOnBoundary );
458 
461  void CreateGhostedExtent( const int gridID, const int N );
462 
464 
467  void GetGhostedExtent(
468  int *ghostedExtent, int GridExtent[6],
469  const int minIdx, const int maxIdx, const int N);
471 
475  void CreateGhostedMaskArrays(const int gridID);
476 
481  void InitializeGhostData( const int gridID );
482 
486  void AllocatePointData( vtkPointData *RPD, const int N, vtkPointData *PD );
487 
491  void AllocateCellData( vtkCellData *RCD, const int N, vtkCellData *CD );
492 
495  void TransferRegisteredDataToGhostedData( const int gridID );
496 
499  void ComputeNeighborSendAndRcvExtent( const int gridID, const int N );
500 
504  virtual void TransferGhostDataFromNeighbors( const int gridID );
505 
507 
508  void TransferLocalNeighborData(
509  const int gridID, const vtkStructuredNeighbor& Neighor);
511 
513 
514  void CopyCoordinates(
515  vtkPoints *source, vtkIdType sourceIdx,
516  vtkPoints *target, vtkIdType targetIdx );
518 
520 
525  void CopyFieldData(
526  vtkFieldData *source, vtkIdType sourceIdx,
527  vtkFieldData *target, vtkIdType targetIdx );
529 
533  int GetNeighborIndex( const int gridIdx, const int NeighborGridIdx );
534 
536  void PrintExtent( int extent[6] );
537 
540  int WholeExtent[6];
541 
542  // BTX
543  std::vector< int > GridExtents;
544  std::vector< int > GhostedExtents;
545  std::vector< unsigned char > BlockTopology;
546  std::vector< std::vector<vtkStructuredNeighbor> > Neighbors;
547  std::map< std::pair< int,int >, int > NeighborPair2NeighborListIndex;
548  // ETX
549 
550 private:
552  void operator=(const vtkStructuredGridConnectivity& ); // Not implemented
553 };
554 
555 //=============================================================================
556 // INLINE METHODS
557 //=============================================================================
558 
559 //------------------------------------------------------------------------------
561  const int gridIdx, const int NeighborGridIdx )
562 {
563  assert("pre: Grid index is out-of-bounds!" &&
564  (gridIdx >= 0) &&
565  (gridIdx < static_cast<int>(this->NumberOfGrids)));
566  assert("pre: Neighbor grid index is out-of-bounds!" &&
567  (NeighborGridIdx >= 0) &&
568  (NeighborGridIdx < static_cast<int>(this->NumberOfGrids) ) );
569 
570  std::pair<int,int> gridPair = std::make_pair(gridIdx,NeighborGridIdx);
571  assert("pre: Neighboring grid pair does not exist in hash!" &&
572  (this->NeighborPair2NeighborListIndex.find(gridPair) !=
573  this->NeighborPair2NeighborListIndex.end() ) );
574 
575  return(this->NeighborPair2NeighborListIndex[gridPair]);
576 }
577 
578 //------------------------------------------------------------------------------
580  int *ghostedExtent, int GridExtent[6],
581  const int minIdx, const int maxIdx, const int N )
582 {
583  assert( "pre: Number of ghost layers must be N >= 1" && (N >= 1) );
584  assert( "pre: ghosted extent pointer is NULL" && ghostedExtent != NULL);
585 
586  ghostedExtent[minIdx] = GridExtent[minIdx]-N;
587  ghostedExtent[maxIdx] = GridExtent[maxIdx]+N;
588 
589  // Clamp the ghosted extent to be within the WholeExtent
590  ghostedExtent[minIdx] =
591  (ghostedExtent[minIdx] < this->WholeExtent[minIdx] )?
592  this->WholeExtent[minIdx] : ghostedExtent[minIdx];
593  ghostedExtent[maxIdx] =
594  (ghostedExtent[maxIdx] > this->WholeExtent[maxIdx])?
595  this->WholeExtent[maxIdx] : ghostedExtent[maxIdx];
596 }
597 
598 //------------------------------------------------------------------------------
600  const int gridID, int ext[6] )
601 {
602  assert( "pre: gridID is out-of-bounds" &&
603  (gridID >= 0) && (gridID < static_cast<int>(this->NumberOfGrids)));
604  assert( "pre: ghosted-extents vector has not been allocated" &&
605  (this->NumberOfGrids == this->GhostedExtents.size()/6 ) );
606 
607  for( int i=0; i < 6; ++i )
608  {
609  this->GhostedExtents[ gridID*6+i ] = ext[i];
610  }
611 }
612 
613 //------------------------------------------------------------------------------
615  const int gridID, int ext[6])
616 {
617  assert( "pre: gridID out-of-bounds!" &&
618  (gridID >= 0 && gridID < static_cast<int>(this->NumberOfGrids)));
619  for( int i=0; i < 6; ++i )
620  {
621  ext[i] = this->GridExtents[ gridID*6+i ];
622  }
623 }
624 
625 //------------------------------------------------------------------------------
627  const int gridID, int ext[6])
628 {
629  assert( "pre: gridID out-of-bounds!" &&
630  (gridID >= 0 && gridID < static_cast<int>(this->NumberOfGrids)));
631 
632  if( this->GhostedExtents.size() == 0 )
633  {
634  vtkErrorMacro( "No ghosted extents found for registered grid extends!!!" );
635  return;
636  }
637 
638  assert( "GhostedExtents are not aligned with registered grid extents" &&
639  ( this->GhostedExtents.size() == this->GridExtents.size() ) );
640  for( int i=0; i < 6; ++i )
641  {
642  ext[i] = this->GhostedExtents[ gridID*6+i ];
643  }
644 }
645 
646 //------------------------------------------------------------------------------
648  const int i, const int j, const int k, int ext[6] )
649 {
650  if( !this->IsNodeWithinExtent( i,j,k, ext) )
651  {
652  return false;
653  }
654 
655  bool status = false;
656  switch( this->DataDescription )
657  {
658  case VTK_X_LINE:
659  if( i==ext[0] || i==ext[1] )
660  {
661  status = true;
662  }
663  break;
664  case VTK_Y_LINE:
665  if( j==ext[2] || j==ext[3] )
666  {
667  status = true;
668  }
669  break;
670  case VTK_Z_LINE:
671  if( k==ext[4] || k==ext[5] )
672  {
673  status = true;
674  }
675  break;
676  case VTK_XY_PLANE:
677  if( (i==ext[0] || i==ext[1]) ||
678  (j==ext[2] || j==ext[3]) )
679  {
680  status = true;
681  }
682  break;
683  case VTK_YZ_PLANE:
684  if( (j==ext[2] || j==ext[3]) ||
685  (k==ext[4] || k==ext[5]) )
686  {
687  status = true;
688  }
689  break;
690  case VTK_XZ_PLANE:
691  if( (i==ext[0] || i==ext[1]) ||
692  (k==ext[4] || k==ext[5]) )
693  {
694  status = true;
695  }
696  break;
697  case VTK_XYZ_GRID:
698  if( (i==ext[0] || i==ext[1]) ||
699  (j==ext[2] || j==ext[3]) ||
700  (k==ext[4] || k==ext[5]) )
701  {
702  status = true;
703  }
704  break;
705  default:
706  std::cout << "Data description is: " << this->DataDescription << "\n";
707  std::cout.flush();
708  assert( "pre: Undefined data-description!" && false );
709  } // END switch
710 
711  return( status );
712 }
713 
714 //------------------------------------------------------------------------------
716  const int i, const int j, const int k,
717  int GridExtent[6] )
718 {
719  bool status = false;
720 
721  switch( this->DataDescription )
722  {
723  case VTK_X_LINE:
724  if( (GridExtent[0] < i) && (i < GridExtent[1]) )
725  {
726  status = true;
727  }
728  break;
729  case VTK_Y_LINE:
730  if( (GridExtent[2] < j) && (j < GridExtent[3] ) )
731  {
732  status = true;
733  }
734  break;
735  case VTK_Z_LINE:
736  if( (GridExtent[4] < k) && (k < GridExtent[5] ) )
737  {
738  status = true;
739  }
740  break;
741  case VTK_XY_PLANE:
742  if( (GridExtent[0] < i) && (i < GridExtent[1]) &&
743  (GridExtent[2] < j) && (j < GridExtent[3]) )
744  {
745  status = true;
746  }
747  break;
748  case VTK_YZ_PLANE:
749  if( (GridExtent[2] < j) && (j < GridExtent[3] ) &&
750  (GridExtent[4] < k) && (k < GridExtent[5] ) )
751  {
752  status = true;
753  }
754  break;
755  case VTK_XZ_PLANE:
756  if( (GridExtent[0] < i) && (i < GridExtent[1] ) &&
757  (GridExtent[4] < k) && (k < GridExtent[5] ) )
758  {
759  status = true;
760  }
761  break;
762  case VTK_XYZ_GRID:
763  if( (GridExtent[0] < i) && (i < GridExtent[1]) &&
764  (GridExtent[2] < j) && (j < GridExtent[3]) &&
765  (GridExtent[4] < k) && (k < GridExtent[5]) )
766  {
767  status = true;
768  }
769  break;
770  default:
771  std::cout << "Data description is: " << this->DataDescription << "\n";
772  std::cout.flush();
773  assert( "pre: Undefined data-description!" && false );
774  } // END switch
775 
776  return( status );
777 }
778 
779 //------------------------------------------------------------------------------
781  const int idx, int A[2], int B[2], int overlap[2], int orient[3] )
782 {
783  assert( "pre: idx is out-of-bounds" && (idx >= 0) && (idx < 3) );
784 
785  // A. Non-overlapping cases
786  if( overlap[0] == overlap[1] )
787  {
788  if( A[1] == B[0] )
789  {
790  orient[ idx ] = vtkStructuredNeighbor::HI;
791  }
792  else if( A[0] == B[1] )
793  {
794  orient[ idx ] = vtkStructuredNeighbor::LO;
795  }
796  else
797  {
798  orient[ idx ] = vtkStructuredNeighbor::UNDEFINED;
799  assert( "ERROR: Code should not reach here!" && false );
800  }
801  } // END non-overlapping cases
802  // B. Sub-set cases
803  else if( this->IsSubset( A, B) )
804  {
805  if( (A[0] == B[0]) && (A[1] == B[1]) )
806  {
807  orient[ idx ] = vtkStructuredNeighbor::ONE_TO_ONE;
808  }
809  else if( this->StrictlyInsideBounds( A[0], B[0], B[1] ) &&
810  this->StrictlyInsideBounds( A[1], B[0], B[1] ) )
811  {
812  orient[ idx ] = vtkStructuredNeighbor::SUBSET_BOTH;
813  }
814  else if( A[0] == B[0] )
815  {
816  orient[ idx ] = vtkStructuredNeighbor::SUBSET_HI;
817  }
818  else if( A[1] == B[1] )
819  {
820  orient[ idx ] = vtkStructuredNeighbor::SUBSET_LO;
821  }
822  else
823  {
824  orient[ idx ] = vtkStructuredNeighbor::UNDEFINED;
825  assert( "ERROR: Code should not reach here!" && false );
826  }
827  }
828  // C. Super-set cases
829  else if( this->IsSubset( B, A ) )
830  {
831  orient[ idx ] = vtkStructuredNeighbor::SUPERSET;
832  }
833  // D. Partially-overlapping (non-subset) cases
834  else if( !(this->IsSubset(A,B) || this->IsSubset(A,B)) )
835  {
836  if( this->InBounds( A[0], B[0], B[1] ) )
837  {
838  orient[ idx ] = vtkStructuredNeighbor::LO;
839  }
840  else if( this->InBounds( A[1], B[0], B[1] ) )
841  {
842  orient[ idx ] = vtkStructuredNeighbor::HI;
843  }
844  else
845  {
846  orient[ idx ] = vtkStructuredNeighbor::UNDEFINED;
847  assert( "ERROR: Code should not reach here!" && false );
848  }
849  }
850  else
851  {
852  orient[ idx ] = vtkStructuredNeighbor::UNDEFINED;
853  assert( "ERROR: Code should not reach here!" && false );
854  }
855 }
856 
857 //------------------------------------------------------------------------------
859  const int idx, const int ExtentLo, const int ExtentHi,
860  const int OnLo, const int OnHi, const int NotOnBoundary )
861 {
862  if( idx == ExtentLo )
863  {
864  return OnLo;
865  }
866  else if( idx == ExtentHi )
867  {
868  return OnHi;
869  }
870  return NotOnBoundary;
871 }
872 
873 //------------------------------------------------------------------------------
875  const int gridID, const int blockDirection )
876 {
877  // Sanity check
878  assert("pre: gridID is out-of-bounds" &&
879  (gridID >=0) && (gridID < static_cast<int>(this->NumberOfGrids)));
880  assert("pre: BlockTopology has not been properly allocated" &&
881  (this->NumberOfGrids == this->BlockTopology.size()));
882  assert("pre: blockDirection is out-of-bounds" &&
883  (blockDirection >= 0) && (blockDirection < 6) );
884  bool status = false;
885  if( this->BlockTopology[ gridID ] & (1 << blockDirection) )
886  {
887  status = true;
888  }
889  return( status );
890 }
891 
892 //------------------------------------------------------------------------------
894  const int gridID, const int blockDirection )
895 {
896  // Sanity check
897  assert("pre: gridID is out-of-bounds" &&
898  (gridID >=0) && (gridID < static_cast<int>(this->NumberOfGrids)));
899  assert("pre: BlockTopology has not been properly allocated" &&
900  (this->NumberOfGrids == this->BlockTopology.size()));
901  assert("pre: blockDirection is out-of-bounds" &&
902  (blockDirection >= 0) && (blockDirection < 6) );
903 
904  this->BlockTopology[ gridID ] &= ~(1 << blockDirection);
905 }
906 
907 //------------------------------------------------------------------------------
909  const int gridID, const int blockDirection )
910 {
911  // Sanity check
912  assert("pre: gridID is out-of-bounds" &&
913  (gridID >=0) && (gridID < static_cast<int>(this->NumberOfGrids)));
914  assert("pre: BlockTopology has not been properly allocated" &&
915  (this->NumberOfGrids == this->BlockTopology.size()));
916  assert("pre: blockDirection is out-of-bounds" &&
917  (blockDirection >= 0) && (blockDirection < 6) );
918  this->BlockTopology[ gridID ] |= (1 << blockDirection);
919 }
920 
921 //------------------------------------------------------------------------------
923  const int gridID )
924 {
925  // Sanity check
926  assert("pre: gridID is out-of-bounds" &&
927  (gridID >=0) && (gridID < static_cast<int>(this->NumberOfGrids)));
928  assert("pre: BlockTopology has not been properly allocated" &&
929  (this->NumberOfGrids == this->BlockTopology.size()));
930  for( int i=0; i < 6; ++i )
931  {
932  this->RemoveBlockConnection( gridID, i );
933  } // END for all block directions
934 }
935 
936 //------------------------------------------------------------------------------
938  const int gridID )
939 {
940  // Sanity check
941  assert("pre: gridID is out-of-bounds" &&
942  (gridID >=0) && (gridID < static_cast<int>(this->NumberOfGrids)));
943  assert("pre: BlockTopology has not been properly allocated" &&
944  (this->NumberOfGrids == this->BlockTopology.size()));
945 
946  int count = 0;
947  for( int i=0; i < 6; ++i )
948  {
949  if( this->HasBlockConnection( gridID, i ) )
950  {
951  ++count;
952  }
953  }
954  assert( "post: count must be in [0,5]" && (count >=0 && count <= 6) );
955  return( count );
956 }
957 
958 //------------------------------------------------------------------------------
960  const unsigned int N )
961 {
962  this->NumberOfGrids = N;
964 
965  this->GridExtents.resize( 6*N,-1);
966  this->Neighbors.resize( N );
967  this->BlockTopology.resize( N );
968 }
969 #endif /* vtkStructuredGridConnectivity_H_ */
int GetNumberOfConnectingBlockFaces(const int gridID)
std::map< std::pair< int, int >, int > NeighborPair2NeighborListIndex
bool HasBlockConnection(const int gridID, const int blockDirection)
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
void AddBlockConnection(const int gridID, const int blockDirection)
void SetGhostedGridExtent(const int gridID, int ext[6])
void GetGhostedGridExtent(const int gridID, int ext[6])
virtual void ComputeNeighbors()=0
std::vector< unsigned char > BlockTopology
std::vector< std::vector< vtkStructuredNeighbor > > Neighbors
bool InBounds(const int idx, const int Lo, const int Hi)
int GetNeighborIndex(const int gridIdx, const int NeighborGridIdx)
void GetGhostedExtent(int *ghostedExtent, int GridExtent[6], const int minIdx, const int maxIdx, const int N)
void DetermineNeighborOrientation(const int idx, int A[2], int B[2], int overlap[2], int orient[3])
void RemoveBlockConnection(const int gridID, const int blockDirection)
void GetGridExtent(const int gridID, int extent[6])
virtual void SetNumberOfGrids(const unsigned int N)=0
void PrintSelf(ostream &os, vtkIndent indent)
bool IsNodeInterior(const int i, const int j, const int k, int GridExtent[6])
bool IsNodeWithinExtent(const int i, const int j, const int k, int GridExtent[6])
int Get1DOrientation(const int idx, const int ExtentLo, const int ExtentHi, const int OnLo, const int OnHi, const int NotOnBoundary)
bool StrictlyInsideBounds(const int idx, const int Lo, const int Hi)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
bool IsNodeOnBoundaryOfExtent(const int i, const int j, const int k, int ext[6])
virtual void FillGhostArrays(const int gridId, vtkUnsignedCharArray *nodesArray, vtkUnsignedCharArray *cellsArray)=0
virtual void CreateGhostLayers(const int N=1)=0
virtual void SetNumberOfGrids(const unsigned int N)