VTK  9.6.1
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
19
20#ifndef vtkAMRUtilities_h
21#define vtkAMRUtilities_h
22
23#include "vtkCommonDataModelModule.h" // For export macro
24#include "vtkObject.h"
25#include <vector> // For C++ vector
26
27// Forward declarations
28VTK_ABI_NAMESPACE_BEGIN
29class vtkDataArray;
30class vtkFieldData;
32class vtkUniformGrid;
34
35class VTKCOMMONDATAMODEL_EXPORT vtkAMRUtilities : public vtkObject
36{
37public:
38 // Standard Routines
39 vtkTypeMacro(vtkAMRUtilities, vtkObject);
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
52 static void StripGhostLayers(
53 vtkOverlappingAMR* ghostedAMRData, vtkOverlappingAMR* strippedAMRData);
54
62
66 static void BlankCells(vtkOverlappingAMR* amr);
67
68protected:
69 vtkAMRUtilities() = default;
70 ~vtkAMRUtilities() override = default;
71
77 int realExtent[6], vtkUniformGrid* ghostedGrid, vtkUniformGrid* strippedGrid);
78
82 static void CopyFieldData(
83 vtkFieldData* target, vtkIdType targetIdx, vtkFieldData* source, vtkIdType sourceIdx);
84
93
94 static void BlankGridsAtLevel(vtkOverlappingAMR* amr, int levelIdx,
95 std::vector<std::vector<unsigned int>>& children, const std::vector<int>& processMap);
96
97private:
98 vtkAMRUtilities(const vtkAMRUtilities&) = delete;
99 void operator=(const vtkAMRUtilities&) = delete;
100
101 static void MergeGhostArrays(vtkDataArray* existingArray, vtkUnsignedCharArray* ghosts);
102};
103
104VTK_ABI_NAMESPACE_END
105#endif /* vtkAMRUtilities_h */
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 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 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 void BlankGridsAtLevel(vtkOverlappingAMR *amr, int levelIdx, std::vector< std::vector< unsigned int > > &children, const std::vector< int > &processMap)
Represents and manipulates a collection of data arrays.
a simple class to control print indentation
Definition vtkIndent.h:29
a multi-resolution dataset based on vtkCartesianGrid allowing overlaps
Deprecated vtkImageData.
dynamic, self-adjusting array of unsigned char
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 *)
#define vtkDataArray
int vtkIdType
Definition vtkType.h:368