VTK  9.0.1
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  =========================================================================*/
29 #ifndef vtkStructuredGridConnectivity_h
30 #define vtkStructuredGridConnectivity_h
31 
32 #define VTK_NO_OVERLAP 0
33 #define VTK_NODE_OVERLAP 1
34 #define VTK_EDGE_OVERLAP 2
35 #define VTK_PARTIAL_OVERLAP 3
36 
37 // VTK include directives
39 #include "vtkFiltersGeometryModule.h" // For export macro
40 #include "vtkStructuredData.h" // For data description definitions
41 #include "vtkStructuredNeighbor.h" // For Structured Neighbor object definition
42 
43 // C++ include directives
44 #include <cassert> // For assert()
45 #include <iostream> // For cout
46 #include <map> // For STL map
47 #include <utility> // For STL pair and overloaded relational operators
48 #include <vector> // For STL vector
49 
50 // Forward Declarations
51 class vtkIdList;
53 class vtkPointData;
54 class vtkCellData;
55 class vtkPoints;
56 
57 class VTKFILTERSGEOMETRY_EXPORT vtkStructuredGridConnectivity : public vtkAbstractGridConnectivity
58 {
59 public:
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
65 
68  vtkSetVector6Macro(WholeExtent, int);
69  vtkGetVector6Macro(WholeExtent, int);
71 
73 
76  vtkGetMacro(DataDimension, int);
78 
82  void SetNumberOfGrids(const unsigned int N) override;
83 
88  virtual void RegisterGrid(const int gridID, int extents[6], vtkUnsignedCharArray* nodesGhostArray,
89  vtkUnsignedCharArray* cellGhostArray, vtkPointData* pointData, vtkCellData* cellData,
90  vtkPoints* gridNodes);
91 
95  void GetGridExtent(const int gridID, int extent[6]);
96 
101  void SetGhostedGridExtent(const int gridID, int ext[6]);
102 
106  void GetGhostedGridExtent(const int gridID, int ext[6]);
107 
111  void ComputeNeighbors() override;
112 
117  int GetNumberOfNeighbors(const int gridID)
118  {
119  return (static_cast<int>(this->Neighbors[gridID].size()));
120  }
121 
126  vtkStructuredNeighbor GetGridNeighbor(const int gridID, const int nei);
127 
135  vtkIdList* GetNeighbors(const int gridID, int* extents);
136 
142  void FillGhostArrays(
143  const int gridID, vtkUnsignedCharArray* nodesArray, vtkUnsignedCharArray* cellsArray) override;
144 
148  void CreateGhostLayers(const int N = 1) override;
149 
150 protected:
152  ~vtkStructuredGridConnectivity() override;
153 
157  bool InBounds(const int idx, const int Lo, const int Hi) { return ((idx >= Lo) && (idx <= Hi)); }
158 
162  bool StrictlyInsideBounds(const int idx, const int Lo, const int Hi)
163  {
164  return ((idx > Lo) && (idx < Hi));
165  }
166 
170  bool IsSubset(int A[2], int B[2])
171  {
172  return (this->InBounds(A[0], B[0], B[1]) && this->InBounds(A[1], B[0], B[1]));
173  }
174 
178  int Cardinality(int S[2]) { return (S[1] - S[0] + 1); }
179 
181 
184  int GetNumberOfNodesPerCell(const int dim)
185  {
186  int numNodes = 0;
187  switch (dim)
188  {
189  case 1:
190  numNodes = 2; // line cell
191  break;
192  case 2:
193  numNodes = 4; // quad cell
194  break;
195  case 3:
196  numNodes = 8; // hex cell
197  break;
198  default:
199  assert("ERROR: code should not reach here!" && false);
200  } // END switch
201  return (numNodes);
202  }
204 
208  void FillNodesGhostArray(const int gridID, const int dataDescription, int GridExtent[6],
209  int RealExtent[6], vtkUnsignedCharArray* nodeArray);
210 
214  void FillCellsGhostArray(const int dataDescription, const int numNodesPerCell, int dims[3],
215  int CellExtent[6], vtkUnsignedCharArray* nodesArray, vtkUnsignedCharArray* cellsArray);
216 
222  void SearchNeighbors(const int gridID, const int i, const int j, const int k, vtkIdList* neiList);
223 
228  void MarkNodeProperty(const int gridID, const int i, const int j, const int k, int ext[6],
229  int RealExtent[6], unsigned char& pfield);
230 
235  void MarkCellProperty(unsigned char& pfield, unsigned char* nodeGhostFields, const int numNodes);
236 
240  void GetRealExtent(const int gridID, int GridExtent[6], int RealExtent[6]);
241 
246  bool IsGhostNode(int GridExtent[6], int RealExtent[6], const int i, const int j, const int k);
247 
252  bool IsNodeOnBoundaryOfExtent(const int i, const int j, const int k, int ext[6]);
253 
259  bool IsNodeOnSharedBoundary(
260  const int gridID, int RealExtent[6], const int i, const int j, const int k);
261 
266  bool IsNodeOnBoundary(const int i, const int j, const int k);
267 
272  bool IsNodeInterior(const int i, const int j, const int k, int GridExtent[6]);
273 
278  bool IsNodeWithinExtent(const int i, const int j, const int k, int GridExtent[6])
279  {
280  bool status = false;
281 
282  switch (this->DataDescription)
283  {
284  case VTK_X_LINE:
285  if ((GridExtent[0] <= i) && (i <= GridExtent[1]))
286  {
287  status = true;
288  }
289  break;
290  case VTK_Y_LINE:
291  if ((GridExtent[2] <= j) && (j <= GridExtent[3]))
292  {
293  status = true;
294  }
295  break;
296  case VTK_Z_LINE:
297  if ((GridExtent[4] <= k) && (k <= GridExtent[5]))
298  {
299  status = true;
300  }
301  break;
302  case VTK_XY_PLANE:
303  if ((GridExtent[0] <= i) && (i <= GridExtent[1]) && (GridExtent[2] <= j) &&
304  (j <= GridExtent[3]))
305  {
306  status = true;
307  }
308  break;
309  case VTK_YZ_PLANE:
310  if ((GridExtent[2] <= j) && (j <= GridExtent[3]) && (GridExtent[4] <= k) &&
311  (k <= GridExtent[5]))
312  {
313  status = true;
314  }
315  break;
316  case VTK_XZ_PLANE:
317  if ((GridExtent[0] <= i) && (i <= GridExtent[1]) && (GridExtent[4] <= k) &&
318  (k <= GridExtent[5]))
319  {
320  status = true;
321  }
322  break;
323  case VTK_XYZ_GRID:
324  if ((GridExtent[0] <= i) && (i <= GridExtent[1]) && (GridExtent[2] <= j) &&
325  (j <= GridExtent[3]) && (GridExtent[4] <= k) && (k <= GridExtent[5]))
326  {
327  status = true;
328  }
329  break;
330  default:
331  std::cout << "Data description is: " << this->DataDescription << "\n";
332  std::cout.flush();
333  assert("pre: Undefined data-description!" && false);
334  } // END switch
335 
336  return (status);
337  }
338 
342  void SetNeighbors(
343  const int i, const int j, int i2jOrientation[3], int j2iOrientation[3], int overlapExtent[6]);
344 
353  void DetermineNeighborOrientation(
354  const int idx, int A[2], int B[2], int overlap[2], int orient[3]);
355 
361  void DetectNeighbors(
362  const int i, const int j, int ex1[6], int ex2[6], int orientation[3], int ndim);
363 
373  int IntervalOverlap(int A[2], int B[2], int overlap[2]);
374 
384  int DoPartialOverlap(int s[2], int S[2], int overlap[2]);
385 
395  int PartialOverlap(int A[2], const int CofA, int B[2], const int CofB, int overlap[2]);
396 
401  void EstablishNeighbors(const int i, const int j);
402 
407  void AcquireDataDescription();
408 
423  bool HasBlockConnection(const int gridID, const int blockDirection);
424 
439  void RemoveBlockConnection(const int gridID, const int blockDirection);
440 
455  void AddBlockConnection(const int gridID, const int blockDirection);
456 
461  void ClearBlockConnections(const int gridID);
462 
470  int GetNumberOfConnectingBlockFaces(const int gridID);
471 
475  void SetBlockTopology(const int gridID);
476 
483  void GetIJKBlockOrientation(
484  const int i, const int j, const int k, int ext[6], int orientation[3]);
485 
490  int Get1DOrientation(const int idx, const int ExtentLo, const int ExtentHi, const int OnLo,
491  const int OnHi, const int NotOnBoundary);
492 
497  void CreateGhostedExtent(const int gridID, const int N);
498 
504  void GetGhostedExtent(
505  int* ghostedExtent, int GridExtent[6], const int minIdx, const int maxIdx, const int N);
506 
511  void CreateGhostedMaskArrays(const int gridID);
512 
519  void InitializeGhostData(const int gridID);
520 
526  void AllocatePointData(vtkPointData* RPD, const int N, vtkPointData* PD);
527 
533  void AllocateCellData(vtkCellData* RCD, const int N, vtkCellData* CD);
534 
539  void TransferRegisteredDataToGhostedData(const int gridID);
540 
545  void ComputeNeighborSendAndRcvExtent(const int gridID, const int N);
546 
552  virtual void TransferGhostDataFromNeighbors(const int gridID);
553 
557  void TransferLocalNeighborData(const int gridID, const vtkStructuredNeighbor& Neighor);
558 
562  void CopyCoordinates(
563  vtkPoints* source, vtkIdType sourceIdx, vtkPoints* target, vtkIdType targetIdx);
564 
571  void CopyFieldData(
572  vtkFieldData* source, vtkIdType sourceIdx, vtkFieldData* target, vtkIdType targetIdx);
573 
579  int GetNeighborIndex(const int gridIdx, const int NeighborGridIdx);
580 
584  void PrintExtent(int extent[6]);
585 
588  int WholeExtent[6];
589 
590  std::vector<int> GridExtents;
591  std::vector<int> GhostedExtents;
592  std::vector<unsigned char> BlockTopology;
593  std::vector<std::vector<vtkStructuredNeighbor> > Neighbors;
594  std::map<std::pair<int, int>, int> NeighborPair2NeighborListIndex;
595 
596 private:
598  void operator=(const vtkStructuredGridConnectivity&) = delete;
599 };
600 
601 //=============================================================================
602 // INLINE METHODS
603 //=============================================================================
604 
605 //------------------------------------------------------------------------------
607  const int gridIdx, const int NeighborGridIdx)
608 {
609  assert("pre: Grid index is out-of-bounds!" && (gridIdx >= 0) &&
610  (gridIdx < static_cast<int>(this->NumberOfGrids)));
611  assert("pre: Neighbor grid index is out-of-bounds!" && (NeighborGridIdx >= 0) &&
612  (NeighborGridIdx < static_cast<int>(this->NumberOfGrids)));
613 
614  std::pair<int, int> gridPair = std::make_pair(gridIdx, NeighborGridIdx);
615  assert("pre: Neighboring grid pair does not exist in hash!" &&
616  (this->NeighborPair2NeighborListIndex.find(gridPair) !=
617  this->NeighborPair2NeighborListIndex.end()));
618 
619  return (this->NeighborPair2NeighborListIndex[gridPair]);
620 }
621 
622 //------------------------------------------------------------------------------
624  int* ghostedExtent, int GridExtent[6], const int minIdx, const int maxIdx, const int N)
625 {
626  assert("pre: Number of ghost layers must be N >= 1" && (N >= 1));
627  assert("pre: ghosted extent pointer is nullptr" && ghostedExtent != nullptr);
628 
629  ghostedExtent[minIdx] = GridExtent[minIdx] - N;
630  ghostedExtent[maxIdx] = GridExtent[maxIdx] + N;
631 
632  // Clamp the ghosted extent to be within the WholeExtent
633  ghostedExtent[minIdx] = (ghostedExtent[minIdx] < this->WholeExtent[minIdx])
634  ? this->WholeExtent[minIdx]
635  : ghostedExtent[minIdx];
636  ghostedExtent[maxIdx] = (ghostedExtent[maxIdx] > this->WholeExtent[maxIdx])
637  ? this->WholeExtent[maxIdx]
638  : ghostedExtent[maxIdx];
639 }
640 
641 //------------------------------------------------------------------------------
642 inline void vtkStructuredGridConnectivity::SetGhostedGridExtent(const int gridID, int ext[6])
643 {
644  assert("pre: gridID is out-of-bounds" && (gridID >= 0) &&
645  (gridID < static_cast<int>(this->NumberOfGrids)));
646  assert("pre: ghosted-extents vector has not been allocated" &&
647  (this->NumberOfGrids == this->GhostedExtents.size() / 6));
648 
649  for (int i = 0; i < 6; ++i)
650  {
651  this->GhostedExtents[gridID * 6 + i] = ext[i];
652  }
653 }
654 
655 //------------------------------------------------------------------------------
656 inline void vtkStructuredGridConnectivity::GetGridExtent(const int gridID, int ext[6])
657 {
658  assert("pre: gridID out-of-bounds!" &&
659  (gridID >= 0 && gridID < static_cast<int>(this->NumberOfGrids)));
660  for (int i = 0; i < 6; ++i)
661  {
662  ext[i] = this->GridExtents[gridID * 6 + i];
663  }
664 }
665 
666 //------------------------------------------------------------------------------
667 inline void vtkStructuredGridConnectivity::GetGhostedGridExtent(const int gridID, int ext[6])
668 {
669  assert("pre: gridID out-of-bounds!" &&
670  (gridID >= 0 && gridID < static_cast<int>(this->NumberOfGrids)));
671 
672  if (this->GhostedExtents.size() == 0)
673  {
674  ext[0] = ext[2] = ext[4] = -1;
675  ext[1] = ext[3] = ext[5] = 0;
676  vtkErrorMacro("No ghosted extents found for registered grid extends!!!");
677  return;
678  }
679 
680  assert("GhostedExtents are not aligned with registered grid extents" &&
681  (this->GhostedExtents.size() == this->GridExtents.size()));
682  for (int i = 0; i < 6; ++i)
683  {
684  ext[i] = this->GhostedExtents[gridID * 6 + i];
685  }
686 }
687 
688 //------------------------------------------------------------------------------
690  const int i, const int j, const int k, int ext[6])
691 {
692  if (!this->IsNodeWithinExtent(i, j, k, ext))
693  {
694  return false;
695  }
696 
697  bool status = false;
698  switch (this->DataDescription)
699  {
700  case VTK_X_LINE:
701  if (i == ext[0] || i == ext[1])
702  {
703  status = true;
704  }
705  break;
706  case VTK_Y_LINE:
707  if (j == ext[2] || j == ext[3])
708  {
709  status = true;
710  }
711  break;
712  case VTK_Z_LINE:
713  if (k == ext[4] || k == ext[5])
714  {
715  status = true;
716  }
717  break;
718  case VTK_XY_PLANE:
719  if ((i == ext[0] || i == ext[1]) || (j == ext[2] || j == ext[3]))
720  {
721  status = true;
722  }
723  break;
724  case VTK_YZ_PLANE:
725  if ((j == ext[2] || j == ext[3]) || (k == ext[4] || k == ext[5]))
726  {
727  status = true;
728  }
729  break;
730  case VTK_XZ_PLANE:
731  if ((i == ext[0] || i == ext[1]) || (k == ext[4] || k == ext[5]))
732  {
733  status = true;
734  }
735  break;
736  case VTK_XYZ_GRID:
737  if ((i == ext[0] || i == ext[1]) || (j == ext[2] || j == ext[3]) ||
738  (k == ext[4] || k == ext[5]))
739  {
740  status = true;
741  }
742  break;
743  default:
744  std::cout << "Data description is: " << this->DataDescription << "\n";
745  std::cout.flush();
746  assert("pre: Undefined data-description!" && false);
747  } // END switch
748 
749  return (status);
750 }
751 
752 //------------------------------------------------------------------------------
754  const int i, const int j, const int k, int GridExtent[6])
755 {
756  bool status = false;
757 
758  switch (this->DataDescription)
759  {
760  case VTK_X_LINE:
761  if ((GridExtent[0] < i) && (i < GridExtent[1]))
762  {
763  status = true;
764  }
765  break;
766  case VTK_Y_LINE:
767  if ((GridExtent[2] < j) && (j < GridExtent[3]))
768  {
769  status = true;
770  }
771  break;
772  case VTK_Z_LINE:
773  if ((GridExtent[4] < k) && (k < GridExtent[5]))
774  {
775  status = true;
776  }
777  break;
778  case VTK_XY_PLANE:
779  if ((GridExtent[0] < i) && (i < GridExtent[1]) && (GridExtent[2] < j) && (j < GridExtent[3]))
780  {
781  status = true;
782  }
783  break;
784  case VTK_YZ_PLANE:
785  if ((GridExtent[2] < j) && (j < GridExtent[3]) && (GridExtent[4] < k) && (k < GridExtent[5]))
786  {
787  status = true;
788  }
789  break;
790  case VTK_XZ_PLANE:
791  if ((GridExtent[0] < i) && (i < GridExtent[1]) && (GridExtent[4] < k) && (k < GridExtent[5]))
792  {
793  status = true;
794  }
795  break;
796  case VTK_XYZ_GRID:
797  if ((GridExtent[0] < i) && (i < GridExtent[1]) && (GridExtent[2] < j) &&
798  (j < GridExtent[3]) && (GridExtent[4] < k) && (k < GridExtent[5]))
799  {
800  status = true;
801  }
802  break;
803  default:
804  std::cout << "Data description is: " << this->DataDescription << "\n";
805  std::cout.flush();
806  assert("pre: Undefined data-description!" && false);
807  } // END switch
808 
809  return (status);
810 }
811 
812 //------------------------------------------------------------------------------
814  const int idx, int A[2], int B[2], int overlap[2], int orient[3])
815 {
816  assert("pre: idx is out-of-bounds" && (idx >= 0) && (idx < 3));
817 
818  // A. Non-overlapping cases
819  if (overlap[0] == overlap[1])
820  {
821  if (A[1] == B[0])
822  {
823  orient[idx] = vtkStructuredNeighbor::HI;
824  }
825  else if (A[0] == B[1])
826  {
827  orient[idx] = vtkStructuredNeighbor::LO;
828  }
829  else
830  {
831  orient[idx] = vtkStructuredNeighbor::UNDEFINED;
832  assert("ERROR: Code should not reach here!" && false);
833  }
834  } // END non-overlapping cases
835  // B. Sub-set cases
836  else if (this->IsSubset(A, B))
837  {
838  if ((A[0] == B[0]) && (A[1] == B[1]))
839  {
840  orient[idx] = vtkStructuredNeighbor::ONE_TO_ONE;
841  }
842  else if (this->StrictlyInsideBounds(A[0], B[0], B[1]) &&
843  this->StrictlyInsideBounds(A[1], B[0], B[1]))
844  {
846  }
847  else if (A[0] == B[0])
848  {
849  orient[idx] = vtkStructuredNeighbor::SUBSET_HI;
850  }
851  else if (A[1] == B[1])
852  {
853  orient[idx] = vtkStructuredNeighbor::SUBSET_LO;
854  }
855  else
856  {
857  orient[idx] = vtkStructuredNeighbor::UNDEFINED;
858  assert("ERROR: Code should not reach here!" && false);
859  }
860  }
861  // C. Super-set cases
862  else if (this->IsSubset(B, A))
863  {
864  orient[idx] = vtkStructuredNeighbor::SUPERSET;
865  }
866  // D. Partially-overlapping (non-subset) cases
867  else if (!(this->IsSubset(A, B) || this->IsSubset(A, B)))
868  {
869  if (this->InBounds(A[0], B[0], B[1]))
870  {
871  orient[idx] = vtkStructuredNeighbor::LO;
872  }
873  else if (this->InBounds(A[1], B[0], B[1]))
874  {
875  orient[idx] = vtkStructuredNeighbor::HI;
876  }
877  else
878  {
879  orient[idx] = vtkStructuredNeighbor::UNDEFINED;
880  assert("ERROR: Code should not reach here!" && false);
881  }
882  }
883  else
884  {
885  orient[idx] = vtkStructuredNeighbor::UNDEFINED;
886  assert("ERROR: Code should not reach here!" && false);
887  }
888 }
889 
890 //------------------------------------------------------------------------------
891 inline int vtkStructuredGridConnectivity::Get1DOrientation(const int idx, const int ExtentLo,
892  const int ExtentHi, const int OnLo, const int OnHi, const int NotOnBoundary)
893 {
894  if (idx == ExtentLo)
895  {
896  return OnLo;
897  }
898  else if (idx == ExtentHi)
899  {
900  return OnHi;
901  }
902  return NotOnBoundary;
903 }
904 
905 //------------------------------------------------------------------------------
907  const int gridID, const int blockDirection)
908 {
909  // Sanity check
910  assert("pre: gridID is out-of-bounds" && (gridID >= 0) &&
911  (gridID < static_cast<int>(this->NumberOfGrids)));
912  assert("pre: BlockTopology has not been properly allocated" &&
913  (this->NumberOfGrids == this->BlockTopology.size()));
914  assert("pre: blockDirection is out-of-bounds" && (blockDirection >= 0) && (blockDirection < 6));
915  bool status = false;
916  if (this->BlockTopology[gridID] & (1 << blockDirection))
917  {
918  status = true;
919  }
920  return (status);
921 }
922 
923 //------------------------------------------------------------------------------
925  const int gridID, const int blockDirection)
926 {
927  // Sanity check
928  assert("pre: gridID is out-of-bounds" && (gridID >= 0) &&
929  (gridID < static_cast<int>(this->NumberOfGrids)));
930  assert("pre: BlockTopology has not been properly allocated" &&
931  (this->NumberOfGrids == this->BlockTopology.size()));
932  assert("pre: blockDirection is out-of-bounds" && (blockDirection >= 0) && (blockDirection < 6));
933 
934  this->BlockTopology[gridID] &= ~(1 << blockDirection);
935 }
936 
937 //------------------------------------------------------------------------------
939  const int gridID, const int blockDirection)
940 {
941  // Sanity check
942  assert("pre: gridID is out-of-bounds" && (gridID >= 0) &&
943  (gridID < static_cast<int>(this->NumberOfGrids)));
944  assert("pre: BlockTopology has not been properly allocated" &&
945  (this->NumberOfGrids == this->BlockTopology.size()));
946  assert("pre: blockDirection is out-of-bounds" && (blockDirection >= 0) && (blockDirection < 6));
947  this->BlockTopology[gridID] |= (1 << blockDirection);
948 }
949 
950 //------------------------------------------------------------------------------
952 {
953  // Sanity check
954  assert("pre: gridID is out-of-bounds" && (gridID >= 0) &&
955  (gridID < static_cast<int>(this->NumberOfGrids)));
956  assert("pre: BlockTopology has not been properly allocated" &&
957  (this->NumberOfGrids == this->BlockTopology.size()));
958  for (int i = 0; i < 6; ++i)
959  {
960  this->RemoveBlockConnection(gridID, i);
961  } // END for all block directions
962 }
963 
964 //------------------------------------------------------------------------------
966 {
967  // Sanity check
968  assert("pre: gridID is out-of-bounds" && (gridID >= 0) &&
969  (gridID < static_cast<int>(this->NumberOfGrids)));
970  assert("pre: BlockTopology has not been properly allocated" &&
971  (this->NumberOfGrids == this->BlockTopology.size()));
972 
973  int count = 0;
974  for (int i = 0; i < 6; ++i)
975  {
976  if (this->HasBlockConnection(gridID, i))
977  {
978  ++count;
979  }
980  }
981  assert("post: count must be in [0,5]" && (count >= 0 && count <= 6));
982  return (count);
983 }
984 
985 //------------------------------------------------------------------------------
986 inline void vtkStructuredGridConnectivity::SetNumberOfGrids(const unsigned int N)
987 {
988  if (N == 0)
989  {
990  vtkErrorMacro("Number of grids cannot be 0.");
991  return;
992  }
993 
994  this->NumberOfGrids = N;
996 
997  this->GridExtents.resize(6 * N, -1);
998  this->Neighbors.resize(N);
999  this->BlockTopology.resize(N);
1000 }
1001 #endif /* vtkStructuredGridConnectivity_h */
int Cardinality(int S[2])
Returns the cardinality of a range S.
int GetNumberOfConnectingBlockFaces(const int gridID)
Returns the number of faces of the block corresponding to the given grid ID that are adjacent to at l...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetNumberOfNodesPerCell(const int dim)
Returns the number of nodes per cell according to the given dimension.
std::vector< std::vector< vtkStructuredNeighbor > > Neighbors
bool HasBlockConnection(const int gridID, const int blockDirection)
Checks if the block corresponding to the given grid ID has a block adjacent to it in the given block ...
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph *>::edge_descriptor e, vtkGraph *)
represent and manipulate point attribute data
Definition: vtkPointData.h:31
void AddBlockConnection(const int gridID, const int blockDirection)
Adds a block connection along the given direction for the block corresponding to the given gridID...
bool IsSubset(int A[2], int B[2])
Returns true iff A is a subset of B, otherwise false.
void SetGhostedGridExtent(const int gridID, int ext[6])
Sets the ghosted grid extent for the grid corresponding to the given grid ID to the given extent...
void GetGhostedGridExtent(const int gridID, int ext[6])
Returns the ghosted grid extent for the block corresponding the.
virtual void ComputeNeighbors()=0
Computes the grid neighboring topology for the domain.
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
#define VTK_XZ_PLANE
bool InBounds(const int idx, const int Lo, const int Hi)
Returns true iff Lo <= idx <= Hi, otherwise false.
int vtkIdType
Definition: vtkType.h:338
int GetNeighborIndex(const int gridIdx, const int NeighborGridIdx)
Given a global grid ID and the neighbor grid ID, this method returns the neighbor index w...
void GetGhostedExtent(int *ghostedExtent, int GridExtent[6], const int minIdx, const int maxIdx, const int N)
Gets the ghosted extent from the given grid extent along the dimension given by minIdx and maxIdx...
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph *>::edge_descriptor e, vtkGraph *)
void DetermineNeighborOrientation(const int idx, int A[2], int B[2], int overlap[2], int orient[3])
Given two overlapping extents A,B and the corresponding overlap extent this method computes A&#39;s relat...
void SetNumberOfGrids(const unsigned int N) override
Set/Get the total number of domains distributed among processors.
void RemoveBlockConnection(const int gridID, const int blockDirection)
Removes a block connection along the given direction for the block corresponding to the given gridID...
void GetGridExtent(const int gridID, int extent[6])
Returns the grid extent of the grid corresponding to the given grid ID.
vtkStructuredGridConnectivity is a concrete instance of vtkObject that implements functionality for c...
std::vector< unsigned char > BlockTopology
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
#define VTK_XY_PLANE
A superclass that defines the interface to be implemented by all concrete grid connectivity classes...
virtual void SetNumberOfGrids(const unsigned int N)=0
Sets the total number of grids in the domain.
bool IsNodeInterior(const int i, const int j, const int k, int GridExtent[6])
Checks if the node, corresponding to the given global i,j,k coordinates is within the interior of the...
bool IsNodeWithinExtent(const int i, const int j, const int k, int GridExtent[6])
Checks if the node corresponding to the given global i,j,k coordinates is within the given extent...
#define VTK_XYZ_GRID
dynamic, self-adjusting array of unsigned char
std::map< std::pair< int, int >, int > NeighborPair2NeighborListIndex
int Get1DOrientation(const int idx, const int ExtentLo, const int ExtentHi, const int OnLo, const int OnHi, const int NotOnBoundary)
A helper method that computes the 1-D i-j-k orientation to facilitate the implementation of GetNodeBl...
An internal, light-weight class used to store neighbor information.
bool StrictlyInsideBounds(const int idx, const int Lo, const int Hi)
Returns true iff Lo < idx < Hi, otherwise false.
int GetNumberOfNeighbors(const int gridID)
Returns the number of neighbors for the grid corresponding to the given grid ID.
bool IsNodeOnBoundaryOfExtent(const int i, const int j, const int k, int ext[6])
Checks if the node corresponding to the given global i,j,k coordinates is on the boundary of the give...
void AllocateUserRegisterDataStructures()
Allocate/De-allocate the data-structures where the user-supplied grids will be registered.
#define VTK_YZ_PLANE
virtual void FillGhostArrays(const int gridId, vtkUnsignedCharArray *nodesArray, vtkUnsignedCharArray *cellsArray)=0
Fills the ghost arrays for the given grid.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
#define VTK_X_LINE
virtual void CreateGhostLayers(const int N=1)=0
Creates N layers of ghost layers where N is the number of cells that will be added to each grid...
#define VTK_Z_LINE
represent and manipulate 3D points
Definition: vtkPoints.h:33
void ClearBlockConnections(const int gridID)
Clears all block connections for the block corresponding to the given grid ID.
represent and manipulate fields of data
Definition: vtkFieldData.h:53
#define VTK_Y_LINE