VTK: Filters/Geometry/vtkStructuredAMRGridConnectivity.h Source File

| VTK 9.3.1

vtkStructuredAMRGridConnectivity.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
22 #ifndef vtkStructuredAMRGridConnectivity_h
23 #define vtkStructuredAMRGridConnectivity_h
24
25 #include "vtkAbstractGridConnectivity.h"
26 #include "vtkFiltersGeometryModule.h" // For export macro
27
28 #include "vtkStructuredAMRNeighbor.h" // For vtkStructuredAMRNeighbor def.
29
30 // C++ includes
31 #include <map> // For STL map
32 #include <ostream> // For STL stream
33 #include <set> // For STL set
34 #include <vector> // For STL vector
35
36 VTK_ABI_NAMESPACE_BEGIN
37 class VTKFILTERSGEOMETRY_EXPORT vtkStructuredAMRGridConnectivity
38 : public vtkAbstractGridConnectivity
39 {
40 public:
41 static vtkStructuredAMRGridConnectivity* New();
42 vtkTypeMacro(vtkStructuredAMRGridConnectivity, vtkAbstractGridConnectivity);
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
52 void Initialize(unsigned int NumberOfLevels, unsigned int N, int RefinementRatio = -1);
53
57 void ComputeNeighbors() override;
58
62 void CreateGhostLayers(int N = 1) override;
63
69 virtual void RegisterGrid(int gridIdx, int level, int refinementRatio, int extents[6],
70 vtkUnsignedCharArray* nodesGhostArray, vtkUnsignedCharArray* cellGhostArray,
71 vtkPointData* pointData, vtkCellData* cellData, vtkPoints* gridNodes);
72
78 virtual void RegisterGrid(int gridIdx, int level, int extents[6],
79 vtkUnsignedCharArray* nodesGhostArray, vtkUnsignedCharArray* cellGhostArray,
80 vtkPointData* pointData, vtkCellData* cellData, vtkPoints* gridNodes);
81
83
88 vtkSetMacro(BalancedRefinement, bool);
89 vtkGetMacro(BalancedRefinement, bool);
91
93
98 vtkSetMacro(NodeCentered, bool);
99 vtkGetMacro(NodeCentered, bool);
101
103
107 vtkSetMacro(CellCentered, bool);
108 vtkGetMacro(CellCentered, bool);
110
115 int GetNumberOfNeighbors(int gridID);
116
120 void GetGhostedExtent(int gridID, int ext[6]);
121
125 vtkStructuredAMRNeighbor GetNeighbor(int gridID, int nei);
126
127 protected:
128 vtkStructuredAMRGridConnectivity();
129 ~vtkStructuredAMRGridConnectivity() override;
130
134 void SetNumberOfGrids(unsigned int N) override;
135
139 void CreateGhostedMaskArrays(int gridID);
140
144 void CreateGhostedExtent(int gridID, int N);
145
149 void SetGhostedExtent(int gridID, int ext[6]);
150
154 void GetCoarsenedExtent(int gridIdx, int fromLevel, int toLevel, int ext[6]);
155
159 void GetRefinedExtent(int gridIdx, int fromLevel, int toLevel, int ext[6]);
160
164 void RefineExtent(int orient[3], int ndim, int fromLevel, int toLevel, int ext[6]);
165
170 void GetCellRefinedExtent(
171 int orient[3], int ndim, int i, int j, int k, int fromLevel, int toLevel, int ext[6]);
172
176 void CoarsenExtent(int orient[3], int ndim, int fromLevel, int toLevel, int ext[6]);
177
181 void GetGridExtent(int gridIdx, int ext[6]);
182
186 int GetGridLevel(int gridIdx);
187
191 bool LevelExists(int level);
192
196 bool IsNodeInterior(int i, int j, int k, int GridExtent[6]);
197
201 bool IsNodeWithinExtent(int i, int j, int k, int GridExtent[6]);
202
206 bool IsNodeOnSharedBoundary(int i, int j, int k, int gridId, int gridExt[6]);
207
211 bool IsNodeOnBoundaryOfExtent(int i, int j, int k, int ext[6]);
212
216 void InsertGridAtLevel(int level, int gridID);
217
222 void ComputeNeighborSendAndRcvExtent(int gridID, int N);
223
228 void ComputeWholeExtent();
229
234 void GetWholeExtentAtLevel(int level, int ext[6]);
235
240 void EstablishNeighbors(int i, int j);
241
245 void GetNodeOrientation(int i, int j, int k, int gridExt[6], int nodeOrientation[3]);
246
254 void GetOrientationVector(int dataDescription, int orient[3], int& ndim);
255
259 bool HasConstantRefinementRatio();
260
264 void SetRefinementRatioAtLevel(int level, int r);
265
269 int GetRefinementRatioAtLevel(int level);
270
274 bool AreExtentsEqual(int ext1[6], int ext2[6]);
275
279 void SetBlockTopology(int gridID);
280
288 int GetNumberOfConnectingBlockFaces(int gridID);
289
291
305 bool HasBlockConnection(int gridID, int blockDirection)
306 {
307 // Sanity check
308 assert("pre: gridID is out-of-bounds" && (gridID >= 0) &&
309 (gridID < static_cast<int>(this->NumberOfGrids)));
310 assert("pre: BlockTopology has not been properly allocated" &&
311 (this->NumberOfGrids == this->BlockTopology.size()));
312 assert("pre: blockDirection is out-of-bounds" && (blockDirection >= 0) && (blockDirection < 6));
313 bool status = false;
314 if (this->BlockTopology[gridID] & (1 << blockDirection))
315 {
316 status = true;
317 }
318 return (status);
319 }
321
336 void RemoveBlockConnection(int gridID, int blockDirection);
337
352 void AddBlockConnection(int gridID, int blockDirection);
353
358 void ClearBlockConnections(int gridID);
359
363 virtual void MarkNodeProperty(
364 int gridId, int i, int j, int k, int gridExt[6], int wholeExt[6], unsigned char& p);
365
369 virtual void FillNodesGhostArray(int gridId, vtkUnsignedCharArray* nodesArray);
370
374 virtual void FillCellsGhostArray(int gridId, vtkUnsignedCharArray* cellsArray);
375
379 void FillGhostArrays(
380 int gridId, vtkUnsignedCharArray* nodesArray, vtkUnsignedCharArray* cellsArray) override;
381
393 vtkStructuredAMRNeighbor GetAMRNeighbor(int i, int iLevel, int next1[6], int j, int jLevel,
394 int next2[6], int normalizedLevel, int levelDiff, vtkStructuredNeighbor& nei);
395
401 void ComputeAMRNeighborOverlapExtents(int iLevel, int jLevel, int normalizedLevel,
402 const vtkStructuredNeighbor& nei, int orient[3], int ndim, int gridOverlapExtent[6],
403 int neiOverlapExtent[6]);
404
408 int Get1DOrientation(int idx, int ExtentLo, int ExtentHi, int OnLo, int OnHi, int NotOnBoundary);
409
413 void PrintExtent(std::ostream& os, int ext[6]);
414
418 void InitializeGhostData(int gridID);
419
423 void TransferRegisteredDataToGhostedData(int gridID);
424
428 void TransferLocalNodeCenteredNeighborData(int gridID, vtkStructuredAMRNeighbor& nei);
429
434 void GetLocalCellCentersFromCoarserLevel(int gridID, vtkStructuredAMRNeighbor& nei);
435
439 void GetLocalCellCentersFromFinerLevel(int gridID, vtkStructuredAMRNeighbor& nei);
440
445 void GetLocalCellCentersAtSameLevel(int gridID, vtkStructuredAMRNeighbor& nei);
446
450 void TransferLocalCellCenteredNeighborData(int gridID, vtkStructuredAMRNeighbor& nei);
451
455 void TransferLocalNeighborData(int gridID, vtkStructuredAMRNeighbor& nei);
456
460 virtual void TransferGhostDataFromNeighbors(int gridID);
461
466 void AverageFieldData(
467 vtkFieldData* source, vtkIdType* sourceIds, int N, vtkFieldData* target, vtkIdType targetIdx);
468
475 void CopyFieldData(
476 vtkFieldData* source, vtkIdType sourceIdx, vtkFieldData* target, vtkIdType targetIdx);
477
478 unsigned int NumberOfLevels; // The total number of levels;
479 int DataDimension; // The dimension of the data, i.e. 2 or 3
480 int DataDescription; // The data description, i.e., VTK_XY_PLANE, etc.
481 int WholeExtent[6]; // The whole extent w.r.t. to the root level, level 0.
482 int MaxLevel; // The max level of the AMR hierarchy
483 int RefinementRatio; // The refinement ratio, set in the initialization,iff,
484 // a constant refinement ratio is used. A value of -1
485 // indicates that the refinement ratio is not constant
486 // and the RefinementRatios vector is used instead.
487
488 bool NodeCentered; // Indicates if the data is node-centered
489 bool CellCentered; // Indicates if the data is cell-centered
490
491 bool BalancedRefinement; // If Balanced refinement is true, then adjacent
492 // grids in the hierarchy can only differ by one
493 // level.
494
495 // AMRHierarchy stores the set of grid Ids in [0,N] for each level
496 std::map<int, std::set<int>> AMRHierarchy;
497
498 // For each grid, [0,N] store the grid extents,level, and list of neighbors
499 std::vector<int> GridExtents; // size of this vector is 6*N
500 std::vector<int> GhostedExtents; // size of this vector is 6*N
501 std::vector<unsigned char> BlockTopology; // size of this vector is N
502 std::vector<int> GridLevels; // size of this vector is N
503 std::vector<std::vector<vtkStructuredAMRNeighbor>> Neighbors;
504
505 // For each grid, [0,N], store the donor level,grid and cell information, a
506 // DonorLevel of -1 indicates that the cell is not receiving any information
507 // from a donor.
508 std::vector<std::vector<int>> CellCenteredDonorLevel;
509
510 // RefinementRatios stores the refinement ratio at each level, this vector
511 // is used only when the refinement ratio varies across levels
512 std::vector<int> RefinementRatios;
513
514 private:
515 vtkStructuredAMRGridConnectivity(const vtkStructuredAMRGridConnectivity&) = delete;
516 void operator=(const vtkStructuredAMRGridConnectivity&) = delete;
517 };
518
519 //=============================================================================
520 // INLINE METHODS
521 //=============================================================================
522
523 //------------------------------------------------------------------------------
524 inline int vtkStructuredAMRGridConnectivity::GetNumberOfNeighbors(int gridID)
525 {
526 assert("pre: grid ID is out-of-bounds" && (gridID >= 0) &&
527 (gridID < static_cast<int>(this->NumberOfGrids)));
528 assert("pre: neighbors vector has not been properly allocated" &&
529 (this->Neighbors.size() == this->NumberOfGrids));
530 return (static_cast<int>(this->Neighbors[gridID].size()));
531 }
532
533 //------------------------------------------------------------------------------
534 inline vtkStructuredAMRNeighbor vtkStructuredAMRGridConnectivity::GetNeighbor(int gridID, int nei)
535 {
536 assert("pre: grid ID is out-of-bounds" && (gridID >= 0) &&
537 (gridID < static_cast<int>(this->NumberOfGrids)));
538 assert("pre: neighbors vector has not been properly allocated" &&
539 (this->Neighbors.size() == this->NumberOfGrids));
540 assert("pre: nei index is out-of-bounds" && (nei >= 0) &&
541 (nei < static_cast<int>(this->Neighbors[gridID].size())));
542 return (this->Neighbors[gridID][nei]);
543 }
544
545 //------------------------------------------------------------------------------
546 inline int vtkStructuredAMRGridConnectivity::Get1DOrientation(
547 int idx, int ExtentLo, int ExtentHi, int OnLo, int OnHi, int NotOnBoundary)
548 {
549 if (idx == ExtentLo)
550 {
551 return OnLo;
552 }
553 else if (idx == ExtentHi)
554 {
555 return OnHi;
556 }
557 return NotOnBoundary;
558 }
559
560 //------------------------------------------------------------------------------
561 inline int vtkStructuredAMRGridConnectivity::GetNumberOfConnectingBlockFaces(int gridID)
562 {
563 // Sanity check
564 assert("pre: gridID is out-of-bounds" && (gridID >= 0) &&
565 (gridID < static_cast<int>(this->NumberOfGrids)));
566 assert("pre: BlockTopology has not been properly allocated" &&
567 (this->NumberOfGrids == this->BlockTopology.size()));
568
569 int count = 0;
570 for (int i = 0; i < 6; ++i)
571 {
572 if (this->HasBlockConnection(gridID, i))
573 {
574 ++count;
575 }
576 }
577 assert("post: count must be in [0,5]" && (count >= 0 && count <= 6));
578 return (count);
579 }
580
581 //------------------------------------------------------------------------------
582 inline void vtkStructuredAMRGridConnectivity::RemoveBlockConnection(int gridID, int blockDirection)
583 {
584 // Sanity check
585 assert("pre: gridID is out-of-bounds" && (gridID >= 0) &&
586 (gridID < static_cast<int>(this->NumberOfGrids)));
587 assert("pre: BlockTopology has not been properly allocated" &&
588 (this->NumberOfGrids == this->BlockTopology.size()));
589 assert("pre: blockDirection is out-of-bounds" && (blockDirection >= 0) && (blockDirection < 6));
590
591 this->BlockTopology[gridID] &= ~(1 << blockDirection);
592 }
593
594 //------------------------------------------------------------------------------
595 inline void vtkStructuredAMRGridConnectivity::AddBlockConnection(int gridID, int blockDirection)
596 {
597 // Sanity check
598 assert("pre: gridID is out-of-bounds" && (gridID >= 0) &&
599 (gridID < static_cast<int>(this->NumberOfGrids)));
600 assert("pre: BlockTopology has not been properly allocated" &&
601 (this->NumberOfGrids == this->BlockTopology.size()));
602 assert("pre: blockDirection is out-of-bounds" && (blockDirection >= 0) && (blockDirection < 6));
603 this->BlockTopology[gridID] |= (1 << blockDirection);
604 }
605
606 //------------------------------------------------------------------------------
607 inline void vtkStructuredAMRGridConnectivity::ClearBlockConnections(int gridID)
608 {
609 // Sanity check
610 assert("pre: gridID is out-of-bounds" && (gridID >= 0) &&
611 (gridID < static_cast<int>(this->NumberOfGrids)));
612 assert("pre: BlockTopology has not been properly allocated" &&
613 (this->NumberOfGrids == this->BlockTopology.size()));
614 for (int i = 0; i < 6; ++i)
615 {
616 this->RemoveBlockConnection(gridID, i);
617 } // END for all block directions
618 }
619
620 //------------------------------------------------------------------------------
621 inline bool vtkStructuredAMRGridConnectivity::AreExtentsEqual(int ext1[6], int ext2[6])
622 {
623 for (int i = 0; i < 6; ++i)
624 {
625 if (ext1[i] != ext2[i])
626 {
627 return false;
628 }
629 } // END for
630 return true;
631 }
632
633 //------------------------------------------------------------------------------
634 inline void vtkStructuredAMRGridConnectivity::PrintExtent(std::ostream& os, int ext[6])
635 {
636 for (int i = 0; i < 6; i += 2)
637 {
638 os << "[";
639 os << ext[i] << " ";
640 os << ext[i + 1] << "] ";
641 } // END for
642 }
643
644 //------------------------------------------------------------------------------
645 inline int vtkStructuredAMRGridConnectivity::GetGridLevel(int gridIdx)
646 {
647 assert("pre: grid Index is out-of-bounds!" && (gridIdx < static_cast<int>(this->NumberOfGrids)));
648 assert("pre: grid levels vector has not been allocated" &&
649 (this->GridLevels.size() == this->NumberOfGrids));
650 return (this->GridLevels[gridIdx]);
651 }
652
653 //------------------------------------------------------------------------------
654 inline void vtkStructuredAMRGridConnectivity::SetRefinementRatioAtLevel(int level, int r)
655 {
656 assert("pre: RefinementRatios vector is not properly allocated" &&
657 this->RefinementRatios.size() == this->NumberOfLevels);
658 assert("pre: leve is out-of-bounds!" && (level >= 0) &&
659 (level < static_cast<int>(this->RefinementRatios.size())));
660 assert("pre: invalid refinement ratio" && (r >= 2));
661
662 this->RefinementRatios[level] = r;
663 }
664
665 //------------------------------------------------------------------------------
666 inline int vtkStructuredAMRGridConnectivity::GetRefinementRatioAtLevel(int level)
667 {
668 assert("pre: RefinementRatios vector is not properly allocated" &&
669 this->RefinementRatios.size() == this->NumberOfLevels);
670 assert("pre: leve is out-of-bounds!" && (level >= 0) &&
671 (level < static_cast<int>(this->RefinementRatios.size())));
672 assert(
673 "pre: refinement ratio for level has not been set" && (this->RefinementRatios[level] >= 2));
674
675 return (this->RefinementRatios[level]);
676 }
677
678 //------------------------------------------------------------------------------
679 inline bool vtkStructuredAMRGridConnectivity::HasConstantRefinementRatio()
680 {
681 if (this->RefinementRatio < 2)
682 {
683 return false;
684 }
685 return true;
686 }
687
688 //------------------------------------------------------------------------------
689 inline void vtkStructuredAMRGridConnectivity::GetGridExtent(int gridIdx, int ext[6])
690 {
691 assert("pre: grid index is out-of-bounds" &&
692 ((gridIdx >= 0) && (gridIdx < static_cast<int>(this->GridExtents.size()))));
693
694 for (int i = 0; i < 6; ++i)
695 {
696 ext[i] = this->GridExtents[gridIdx * 6 + i];
697 }
698 }
699
700 //------------------------------------------------------------------------------
701 inline bool vtkStructuredAMRGridConnectivity::LevelExists(int level)
702 {
703 if (this->AMRHierarchy.find(level) != this->AMRHierarchy.end())
704 {
705 return true;
706 }
707 return false;
708 }
709
710 //------------------------------------------------------------------------------
711 inline void vtkStructuredAMRGridConnectivity::InsertGridAtLevel(int level, int gridID)
712 {
713 if (this->LevelExists(level))
714 {
715 this->AMRHierarchy[level].insert(gridID);
716 }
717 else
718 {
719 std::set<int> grids;
720 grids.insert(gridID);
721 this->AMRHierarchy[level] = grids;
722 }
723 }
724
725 VTK_ABI_NAMESPACE_END
726 #endif /* VTKSTRUCTUREDAMRGRIDCONNECTIVITY_H_ */
vtkAbstractGridConnectivity
A superclass that defines the interface to be implemented by all concrete grid connectivity classes.
Definition: vtkAbstractGridConnectivity.h:55
vtkAbstractGridConnectivity::NumberOfGrids
unsigned int NumberOfGrids
Definition: vtkAbstractGridConnectivity.h:180
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:40
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:61
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:39
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkStructuredAMRGridConnectivity
grid connectivity.
Definition: vtkStructuredAMRGridConnectivity.h:39
vtkStructuredAMRGridConnectivity::NumberOfLevels
unsigned int NumberOfLevels
Definition: vtkStructuredAMRGridConnectivity.h:478
vtkStructuredAMRGridConnectivity::RefinementRatio
int RefinementRatio
Definition: vtkStructuredAMRGridConnectivity.h:483
vtkStructuredAMRGridConnectivity::InsertGridAtLevel
void InsertGridAtLevel(int level, int gridID)
Inserts the grid corresponding to the given ID at the prescribed level.
Definition: vtkStructuredAMRGridConnectivity.h:711
vtkStructuredAMRGridConnectivity::CreateGhostedMaskArrays
void CreateGhostedMaskArrays(int gridID)
Creates the ghosted mask arrays.
vtkStructuredAMRGridConnectivity::GetNeighbor
vtkStructuredAMRNeighbor GetNeighbor(int gridID, int nei)
Returns the AMR neighbor for the patch with the corresponding grid ID.
Definition: vtkStructuredAMRGridConnectivity.h:534
vtkStructuredAMRGridConnectivity::Get1DOrientation
int Get1DOrientation(int idx, int ExtentLo, int ExtentHi, int OnLo, int OnHi, int NotOnBoundary)
Get 1-D orientation.
Definition: vtkStructuredAMRGridConnectivity.h:546
vtkStructuredAMRGridConnectivity::RegisterGrid
virtual void RegisterGrid(int gridIdx, int level, int extents[6], vtkUnsignedCharArray *nodesGhostArray, vtkUnsignedCharArray *cellGhostArray, vtkPointData *pointData, vtkCellData *cellData, vtkPoints *gridNodes)
Registers the AMR grid with the given global linear grid ID (starting numbering from 0) and level.
vtkStructuredAMRGridConnectivity::GetLocalCellCentersFromFinerLevel
void GetLocalCellCentersFromFinerLevel(int gridID, vtkStructuredAMRNeighbor &nei)
Copy cell center values from a finer level by cell averaging.
vtkStructuredAMRGridConnectivity::New
static vtkStructuredAMRGridConnectivity * New()
vtkStructuredAMRGridConnectivity::GridLevels
std::vector< int > GridLevels
Definition: vtkStructuredAMRGridConnectivity.h:502
vtkStructuredAMRGridConnectivity::MaxLevel
int MaxLevel
Definition: vtkStructuredAMRGridConnectivity.h:482
vtkStructuredAMRGridConnectivity::FillNodesGhostArray
virtual void FillNodesGhostArray(int gridId, vtkUnsignedCharArray *nodesArray)
Fills the node ghost arrays for the given grid.
vtkStructuredAMRGridConnectivity::NodeCentered
bool NodeCentered
Definition: vtkStructuredAMRGridConnectivity.h:488
vtkStructuredAMRGridConnectivity::RefinementRatios
std::vector< int > RefinementRatios
Definition: vtkStructuredAMRGridConnectivity.h:512
vtkStructuredAMRGridConnectivity::TransferLocalNeighborData
void TransferLocalNeighborData(int gridID, vtkStructuredAMRNeighbor &nei)
Transfers local neighbor data.
vtkStructuredAMRGridConnectivity::AreExtentsEqual
bool AreExtentsEqual(int ext1[6], int ext2[6])
Checks if the extent ext1 and ext2 are equal.
Definition: vtkStructuredAMRGridConnectivity.h:621
vtkStructuredAMRGridConnectivity::CellCentered
bool CellCentered
Definition: vtkStructuredAMRGridConnectivity.h:489
vtkStructuredAMRGridConnectivity::ClearBlockConnections
void ClearBlockConnections(int gridID)
Clears all block connections for the block corresponding to the given grid ID.
Definition: vtkStructuredAMRGridConnectivity.h:607
vtkStructuredAMRGridConnectivity::GetLocalCellCentersAtSameLevel
void GetLocalCellCentersAtSameLevel(int gridID, vtkStructuredAMRNeighbor &nei)
Copy cell center values to fill in the ghost levels from a neighbor at the same level as the grid cor...
vtkStructuredAMRGridConnectivity::RemoveBlockConnection
void RemoveBlockConnection(int gridID, int blockDirection)
Removes a block connection along the given direction for the block corresponding to the given gridID.
Definition: vtkStructuredAMRGridConnectivity.h:582
vtkStructuredAMRGridConnectivity::InitializeGhostData
void InitializeGhostData(int gridID)
Initializes the ghost data-structures.
vtkStructuredAMRGridConnectivity::GetNumberOfConnectingBlockFaces
int GetNumberOfConnectingBlockFaces(int gridID)
Returns the number of faces of the block corresponding to the given grid ID that are adjacent to at l...
Definition: vtkStructuredAMRGridConnectivity.h:561
vtkStructuredAMRGridConnectivity::TransferLocalNodeCenteredNeighborData
void TransferLocalNodeCenteredNeighborData(int gridID, vtkStructuredAMRNeighbor &nei)
Transfers local node-centered neighbor data.
vtkStructuredAMRGridConnectivity::CreateGhostLayers
void CreateGhostLayers(int N=1) override
Creates ghost layers.
vtkStructuredAMRGridConnectivity::GetGridExtent
void GetGridExtent(int gridIdx, int ext[6])
Gets the grid extent for the grid with the given grid ID.
Definition: vtkStructuredAMRGridConnectivity.h:689
vtkStructuredAMRGridConnectivity::SetBlockTopology
void SetBlockTopology(int gridID)
Constructs the block topology for the given grid.
vtkStructuredAMRGridConnectivity::LevelExists
bool LevelExists(int level)
Checks if the given level has been registered.
Definition: vtkStructuredAMRGridConnectivity.h:701
vtkStructuredAMRGridConnectivity::GetOrientationVector
void GetOrientationVector(int dataDescription, int orient[3], int &ndim)
Establishes the orientation vector and dimension based on the computed data description.
vtkStructuredAMRGridConnectivity::CellCenteredDonorLevel
std::vector< std::vector< int > > CellCenteredDonorLevel
Definition: vtkStructuredAMRGridConnectivity.h:508
vtkStructuredAMRGridConnectivity::GetRefinementRatioAtLevel
int GetRefinementRatioAtLevel(int level)
Returns the refinement ratio at the given level.
Definition: vtkStructuredAMRGridConnectivity.h:666
vtkStructuredAMRGridConnectivity::GetWholeExtentAtLevel
void GetWholeExtentAtLevel(int level, int ext[6])
Gets the whole extent with respect to the given level.
vtkStructuredAMRGridConnectivity::HasBlockConnection
bool HasBlockConnection(int gridID, int blockDirection)
Checks if the block corresponding to the given grid ID has a block adjacent to it in the given block ...
Definition: vtkStructuredAMRGridConnectivity.h:305
vtkStructuredAMRGridConnectivity::TransferRegisteredDataToGhostedData
void TransferRegisteredDataToGhostedData(int gridID)
Transfers the data of the registered grid, to the ghosted data-structures.
vtkStructuredAMRGridConnectivity::Initialize
void Initialize(unsigned int NumberOfLevels, unsigned int N, int RefinementRatio=-1)
Initializes this instance of vtkStructuredAMRGridConnectivity where N is the total number of grids in...
vtkStructuredAMRGridConnectivity::GetCoarsenedExtent
void GetCoarsenedExtent(int gridIdx, int fromLevel, int toLevel, int ext[6])
Gets the coarsened extent for the grid with the given grid index.
vtkStructuredAMRGridConnectivity::SetGhostedExtent
void SetGhostedExtent(int gridID, int ext[6])
Sets the ghost extent for the grid corresponding to the given grid ID.
vtkStructuredAMRGridConnectivity::TransferLocalCellCenteredNeighborData
void TransferLocalCellCenteredNeighborData(int gridID, vtkStructuredAMRNeighbor &nei)
Transfers local cell-centered neighbor data.
vtkStructuredAMRGridConnectivity::FillCellsGhostArray
virtual void FillCellsGhostArray(int gridId, vtkUnsignedCharArray *cellsArray)
Fills the cell ghost arrays for the given grid.
vtkStructuredAMRGridConnectivity::IsNodeOnBoundaryOfExtent
bool IsNodeOnBoundaryOfExtent(int i, int j, int k, int ext[6])
Checks if the node is on the boundary of the given extent.
vtkStructuredAMRGridConnectivity::GhostedExtents
std::vector< int > GhostedExtents
Definition: vtkStructuredAMRGridConnectivity.h:500
vtkStructuredAMRGridConnectivity::ComputeNeighborSendAndRcvExtent
void ComputeNeighborSendAndRcvExtent(int gridID, int N)
Loops through the neighbors of this grid and computes the send and rcv extents for the N requested gh...
vtkStructuredAMRGridConnectivity::vtkStructuredAMRGridConnectivity
vtkStructuredAMRGridConnectivity()
vtkStructuredAMRGridConnectivity::IsNodeWithinExtent
bool IsNodeWithinExtent(int i, int j, int k, int GridExtent[6])
Checks if the node is within the extent.
vtkStructuredAMRGridConnectivity::EstablishNeighbors
void EstablishNeighbors(int i, int j)
Establishes neighboring relationship between grids i,j wheren i,j are global indices.
vtkStructuredAMRGridConnectivity::TransferGhostDataFromNeighbors
virtual void TransferGhostDataFromNeighbors(int gridID)
Fills in the ghost data from the neighbors.
vtkStructuredAMRGridConnectivity::DataDimension
int DataDimension
Definition: vtkStructuredAMRGridConnectivity.h:479
vtkStructuredAMRGridConnectivity::GetRefinedExtent
void GetRefinedExtent(int gridIdx, int fromLevel, int toLevel, int ext[6])
Gets the refined extent for the grid with the given grid index.
vtkStructuredAMRGridConnectivity::GetNodeOrientation
void GetNodeOrientation(int i, int j, int k, int gridExt[6], int nodeOrientation[3])
Computes the node orientation tuple for the given i,j,k node.
vtkStructuredAMRGridConnectivity::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkStructuredAMRGridConnectivity::GetCellRefinedExtent
void GetCellRefinedExtent(int orient[3], int ndim, int i, int j, int k, int fromLevel, int toLevel, int ext[6])
Given the global i,j,k index of a cell at a coarse level, fromLevel, this method computes the range o...
vtkStructuredAMRGridConnectivity::Neighbors
std::vector< std::vector< vtkStructuredAMRNeighbor > > Neighbors
Definition: vtkStructuredAMRGridConnectivity.h:503
vtkStructuredAMRGridConnectivity::GetLocalCellCentersFromCoarserLevel
void GetLocalCellCentersFromCoarserLevel(int gridID, vtkStructuredAMRNeighbor &nei)
Copy cell center value from a coarser level by direct-injection, i.e., the values within the coarse c...
vtkStructuredAMRGridConnectivity::DataDescription
int DataDescription
Definition: vtkStructuredAMRGridConnectivity.h:480
vtkStructuredAMRGridConnectivity::RegisterGrid
virtual void RegisterGrid(int gridIdx, int level, int refinementRatio, int extents[6], vtkUnsignedCharArray *nodesGhostArray, vtkUnsignedCharArray *cellGhostArray, vtkPointData *pointData, vtkCellData *cellData, vtkPoints *gridNodes)
Registers the AMR grid with the given global linear grid ID (starting numbering from 0) and level and...
vtkStructuredAMRGridConnectivity::IsNodeInterior
bool IsNodeInterior(int i, int j, int k, int GridExtent[6])
Checks if the node is an interior node in the given extent.
vtkStructuredAMRGridConnectivity::GetGhostedExtent
void GetGhostedExtent(int gridID, int ext[6])
Returns the ghost extend for the grid corresponding to the given grid ID.
vtkStructuredAMRGridConnectivity::GridExtents
std::vector< int > GridExtents
Definition: vtkStructuredAMRGridConnectivity.h:499
vtkStructuredAMRGridConnectivity::AddBlockConnection
void AddBlockConnection(int gridID, int blockDirection)
Adds a block connection along the given direction for the block corresponding to the given gridID.
Definition: vtkStructuredAMRGridConnectivity.h:595
vtkStructuredAMRGridConnectivity::ComputeNeighbors
void ComputeNeighbors() override
Computes neighboring information.
vtkStructuredAMRGridConnectivity::CopyFieldData
void CopyFieldData(vtkFieldData *source, vtkIdType sourceIdx, vtkFieldData *target, vtkIdType targetIdx)
Loops through all arrays in the source and for each array, it copies the tuples from sourceIdx to the...
vtkStructuredAMRGridConnectivity::~vtkStructuredAMRGridConnectivity
~vtkStructuredAMRGridConnectivity() override
vtkStructuredAMRGridConnectivity::AMRHierarchy
std::map< int, std::set< int > > AMRHierarchy
Definition: vtkStructuredAMRGridConnectivity.h:496
vtkStructuredAMRGridConnectivity::CoarsenExtent
void CoarsenExtent(int orient[3], int ndim, int fromLevel, int toLevel, int ext[6])
Coarsens the given extent.
vtkStructuredAMRGridConnectivity::ComputeWholeExtent
void ComputeWholeExtent()
Computes the whole extent w.r.t.
vtkStructuredAMRGridConnectivity::IsNodeOnSharedBoundary
bool IsNodeOnSharedBoundary(int i, int j, int k, int gridId, int gridExt[6])
Checks if the node is on a shared boundary.
vtkStructuredAMRGridConnectivity::ComputeAMRNeighborOverlapExtents
void ComputeAMRNeighborOverlapExtents(int iLevel, int jLevel, int normalizedLevel, const vtkStructuredNeighbor &nei, int orient[3], int ndim, int gridOverlapExtent[6], int neiOverlapExtent[6])
A Helper method to compute the AMR neighbor overlap extents.
vtkStructuredAMRGridConnectivity::BalancedRefinement
bool BalancedRefinement
Definition: vtkStructuredAMRGridConnectivity.h:491
vtkStructuredAMRGridConnectivity::AverageFieldData
void AverageFieldData(vtkFieldData *source, vtkIdType *sourceIds, int N, vtkFieldData *target, vtkIdType targetIdx)
Loops through all arrays and computes the average of the supplied source indices and stores the corre...
vtkStructuredAMRGridConnectivity::BlockTopology
std::vector< unsigned char > BlockTopology
Definition: vtkStructuredAMRGridConnectivity.h:501
vtkStructuredAMRGridConnectivity::CreateGhostedExtent
void CreateGhostedExtent(int gridID, int N)
Creates the ghosted extent of the given grid.
vtkStructuredAMRGridConnectivity::SetRefinementRatioAtLevel
void SetRefinementRatioAtLevel(int level, int r)
Sets the refinement ratio at the given level.
Definition: vtkStructuredAMRGridConnectivity.h:654
vtkStructuredAMRGridConnectivity::FillGhostArrays
void FillGhostArrays(int gridId, vtkUnsignedCharArray *nodesArray, vtkUnsignedCharArray *cellsArray) override
Fills ghost arrays.
vtkStructuredAMRGridConnectivity::RefineExtent
void RefineExtent(int orient[3], int ndim, int fromLevel, int toLevel, int ext[6])
Refines the given extent.
vtkStructuredAMRGridConnectivity::GetGridLevel
int GetGridLevel(int gridIdx)
Returns the level of the grid with the corresponding grid ID.
Definition: vtkStructuredAMRGridConnectivity.h:645
vtkStructuredAMRGridConnectivity::MarkNodeProperty
virtual void MarkNodeProperty(int gridId, int i, int j, int k, int gridExt[6], int wholeExt[6], unsigned char &p)
Marks the ghost property for the given node.
vtkStructuredAMRGridConnectivity::GetAMRNeighbor
vtkStructuredAMRNeighbor GetAMRNeighbor(int i, int iLevel, int next1[6], int j, int jLevel, int next2[6], int normalizedLevel, int levelDiff, vtkStructuredNeighbor &nei)
Compute the AMR neighbor of grid "i" and its neighbor grid "j".
vtkStructuredAMRGridConnectivity::PrintExtent
void PrintExtent(std::ostream &os, int ext[6])
Prints the extent.
Definition: vtkStructuredAMRGridConnectivity.h:634
vtkStructuredAMRGridConnectivity::HasConstantRefinementRatio
bool HasConstantRefinementRatio()
Checks if a constant refinement ratio has been specified.
Definition: vtkStructuredAMRGridConnectivity.h:679
vtkStructuredAMRGridConnectivity::SetNumberOfGrids
void SetNumberOfGrids(unsigned int N) override
Sets the total number of grids(blocks) in the AMR hierarchy.
vtkStructuredAMRGridConnectivity::GetNumberOfNeighbors
int GetNumberOfNeighbors(int gridID)
Returns the number of neighbors for the grid corresponding to the given grid ID.
Definition: vtkStructuredAMRGridConnectivity.h:524
vtkStructuredAMRNeighbor
An internal, light-weight object used to store neighbor information for AMR grids.
Definition: vtkStructuredAMRNeighbor.h:23
vtkStructuredNeighbor
An internal, light-weight class used to store neighbor information.
Definition: vtkStructuredNeighbor.h:19
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:40
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkAbstractGridConnectivity.h
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:964
target
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:970
vtkStructuredAMRNeighbor.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315