VTK  9.3.20240328
vtkAMRUtilities.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
59 #ifndef vtkAMRUtilities_h
60 #define vtkAMRUtilities_h
61 
62 #include "vtkCommonDataModelModule.h" // For export macro
63 #include "vtkObject.h"
64 #include <vector> // For C++ vector
65 
66 // Forward declarations
67 VTK_ABI_NAMESPACE_BEGIN
68 class vtkDataArray;
69 class vtkFieldData;
70 class vtkOverlappingAMR;
71 class vtkUniformGrid;
73 
74 class VTKCOMMONDATAMODEL_EXPORT vtkAMRUtilities : public vtkObject
75 {
76 public:
77  // Standard Routines
78  vtkTypeMacro(vtkAMRUtilities, vtkObject);
79  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
90  static void StripGhostLayers(
91  vtkOverlappingAMR* ghostedAMRData, vtkOverlappingAMR* strippedAMRData);
92 
100 
104  static void BlankCells(vtkOverlappingAMR* amr);
105 
106 protected:
107  vtkAMRUtilities() = default;
108  ~vtkAMRUtilities() override = default;
109 
115  int realExtent[6], vtkUniformGrid* ghostedGrid, vtkUniformGrid* strippedGrid);
116 
120  static void CopyFieldData(
121  vtkFieldData* target, vtkIdType targetIdx, vtkFieldData* source, vtkIdType sourceIdx);
122 
131 
132  static void BlankGridsAtLevel(vtkOverlappingAMR* amr, int levelIdx,
133  std::vector<std::vector<unsigned int>>& children, const std::vector<int>& processMap);
134 
135 private:
136  vtkAMRUtilities(const vtkAMRUtilities&) = delete;
137  void operator=(const vtkAMRUtilities&) = delete;
138 
139  static void MergeGhostArrays(vtkDataArray* existingArray, vtkUnsignedCharArray* ghosts);
140 };
141 
142 VTK_ABI_NAMESPACE_END
143 #endif /* vtkAMRUtilities_h */
A concrete instance of vtkObject that employs a singleton design pattern and implements functionality...
static void StripGhostLayers(vtkOverlappingAMR *ghostedAMRData, vtkOverlappingAMR *strippedAMRData)
This method detects and strips partially overlapping cells from a given AMR dataset.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkAMRUtilities() override=default
static void CopyFieldData(vtkFieldData *target, vtkIdType targetIdx, vtkFieldData *source, vtkIdType sourceIdx)
Copies the fields from the given source to the given target.
static void CopyFieldsWithinRealExtent(int realExtent[6], vtkUniformGrid *ghostedGrid, vtkUniformGrid *strippedGrid)
Given the real-extent w.r.t.
static void BlankCells(vtkOverlappingAMR *amr)
Blank cells in overlapping AMR.
static bool HasPartiallyOverlappingGhostCells(vtkOverlappingAMR *amr)
A quick test of whether partially overlapping ghost cells exist.
vtkAMRUtilities()=default
static vtkUniformGrid * StripGhostLayersFromGrid(vtkUniformGrid *grid, int ghost[6])
Strips ghost layers from the given grid according to the given ghost vector which encodes the number ...
static void BlankGridsAtLevel(vtkOverlappingAMR *amr, int levelIdx, std::vector< std::vector< unsigned int >> &children, const std::vector< int > &processMap)
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:154
represent and manipulate fields of data
Definition: vtkFieldData.h:161
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
hierarchical dataset of vtkUniformGrids
image data with blanking
dynamic, self-adjusting array of unsigned char
@ vector
Definition: vtkX3D.h:237
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
int vtkIdType
Definition: vtkType.h:315