VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkGhostArray.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGhostArray.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  =========================================================================*/
33 #ifndef vtkGhostArray_H_
34 #define vtkGhostArray_H_
35 
36 #include "vtkFiltersCoreModule.h" // For export macro
37 #include "vtkObject.h"
38 
39 #include <cassert> // For assert
40 
42 {
43 public:
44 
45  enum
46  {
47  INTERNAL = 0, // Nodes that are on the interior domain of a partition
48  SHARED = 1, // Nodes that are on the abutting/internal interface of
49  // two or more partitions.
50  GHOST = 2, // Nodes whose value comes from another process/partition
51  VOID = 3, // Nodes that are ignored in computation/visualization,
52  // their value is typically garbage.
53  IGNORE = 4, // Nodes that are ignored in computation/visualization but
54  // have a valid value, e.g., if a SHARED node is going to be
55  // processed by another partition, then, this property is
56  // used to indicate to the rest of the partitions sharing
57  // that node to ignore it.
58  BOUNDARY = 5, // Nodes that are on the boundaries of the domain
59  PERIODIC = 6 // Nodes that are on periodic boundaries
60  } NodeProperties;
61 
62  enum
63  {
64  DUPLICATE = 0, // Ghost cells that exist in another partition, i.e, are
65  // composed of internal boundary and/or ghost nodes
66  EXTERNAL = 1, // Cells that are created "artificially" outside the domain,
67  // i.e., are composed from boundary nodes and nodes outside
68  // the domain.
69  BLANK = 2, // Cells that are ignored in computation/visualization, their
70  // value is typically garbage, or in the case of AMR data,
71  // they have a value that is typically the average of the
72  // the values of each subdivision cell.
73  INTERIOR = 3 // Cells that are internal/owned by a given partition.
74  } CellProperties;
75 
76  static vtkGhostArray* New();
78  void PrintSelf(ostream& os, vtkIndent indent );
79 
81 
82  static void SetProperty(
83  unsigned char &propertyField,const int property )
84  {
85  assert("pre:invalid property" && (property >= 0 && property < 8));
86  propertyField |= (1 << property);
87  }
89 
91 
92  static void UnsetProperty(
93  unsigned char &propertyField,const int property )
94  {
95  assert("pre:invalid property" && (property >= 0 && property < 8));
96  propertyField &= ~(1 << property);
97  }
99 
101 
102  static bool IsPropertySet(
103  unsigned char &propertyField,const int property )
104  {
105  assert("pre:invalid property" && (property >= 0 && property < 8));
106  bool status = false;
107  if( propertyField & (1 << property) )
108  {
109  status = true;
110  }
112 
113  return status;
114  }
115 
117 
118  static void Reset( unsigned char &propertyField )
119  {
120  for( int i=0; i < 8; ++i )
121  {
122  vtkGhostArray::UnsetProperty( propertyField, i );
123  }
124  }
126 
127 protected:
128  vtkGhostArray();
129  ~vtkGhostArray();
130 
131 private:
132  vtkGhostArray( const vtkGhostArray& ); // Not implemented
133  void operator=(const vtkGhostArray& ); // Not implemented
134 };
135 
136 #endif /* vtkGhostArray_H_ */
static bool IsPropertySet(unsigned char &propertyField, const int property)
abstract base class for most VTK objects
Definition: vtkObject.h:61
#define VTKFILTERSCORE_EXPORT
static void SetProperty(unsigned char &propertyField, const int property)
Definition: vtkGhostArray.h:82
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
static void Reset(unsigned char &propertyField)
static vtkObject * New()
static void UnsetProperty(unsigned char &propertyField, const int property)
Definition: vtkGhostArray.h:92