VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGhostArray.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00033 #ifndef vtkGhostArray_H_ 00034 #define vtkGhostArray_H_ 00035 00036 #include "vtkFiltersCoreModule.h" // For export macro 00037 #include "vtkObject.h" 00038 00039 #include <cassert> // For assert 00040 00041 class VTKFILTERSCORE_EXPORT vtkGhostArray : public vtkObject 00042 { 00043 public: 00044 00045 enum 00046 { 00047 INTERNAL = 0, // Nodes that are on the interior domain of a partition 00048 SHARED = 1, // Nodes that are on the abutting/internal interface of 00049 // two or more partitions. 00050 GHOST = 2, // Nodes whose value comes from another process/partition 00051 VOID = 3, // Nodes that are ignored in computation/visualization, 00052 // their value is typically garbage. 00053 IGNORE = 4, // Nodes that are ignored in computation/visualization but 00054 // have a valid value, e.g., if a SHARED node is going to be 00055 // processed by another partition, then, this property is 00056 // used to indicate to the rest of the partitions sharing 00057 // that node to ignore it. 00058 BOUNDARY = 5, // Nodes that are on the boundaries of the domain 00059 PERIODIC = 6 // Nodes that are on periodic boundaries 00060 } NodeProperties; 00061 00062 enum 00063 { 00064 DUPLICATE = 0, // Ghost cells that exist in another partition, i.e, are 00065 // composed of internal boundary and/or ghost nodes 00066 EXTERNAL = 1, // Cells that are created "artificially" outside the domain, 00067 // i.e., are composed from boundary nodes and nodes outside 00068 // the domain. 00069 BLANK = 2, // Cells that are ignored in computation/visualization, their 00070 // value is typically garbage, or in the case of AMR data, 00071 // they have a value that is typically the average of the 00072 // the values of each subdivision cell. 00073 INTERIOR = 3 // Cells that are internal/owned by a given partition. 00074 } CellProperties; 00075 00076 static vtkGhostArray* New(); 00077 vtkTypeMacro( vtkGhostArray, vtkObject ); 00078 void PrintSelf(ostream& os, vtkIndent indent ); 00079 00081 00082 static void SetProperty( 00083 unsigned char &propertyField,const int property ) 00084 { 00085 assert("pre:invalid property" && (property >= 0 && property < 8)); 00086 propertyField |= (1 << property); 00087 } 00089 00091 00092 static void UnsetProperty( 00093 unsigned char &propertyField,const int property ) 00094 { 00095 assert("pre:invalid property" && (property >= 0 && property < 8)); 00096 propertyField &= ~(1 << property); 00097 } 00099 00101 00102 static bool IsPropertySet( 00103 unsigned char &propertyField,const int property ) 00104 { 00105 assert("pre:invalid property" && (property >= 0 && property < 8)); 00106 bool status = false; 00107 if( propertyField & (1 << property) ) 00108 { 00109 status = true; 00110 } 00112 00113 return status; 00114 } 00115 00117 00118 static void Reset( unsigned char &propertyField ) 00119 { 00120 for( int i=0; i < 8; ++i ) 00121 { 00122 vtkGhostArray::UnsetProperty( propertyField, i ); 00123 } 00124 } 00126 00127 protected: 00128 vtkGhostArray(); 00129 ~vtkGhostArray(); 00130 00131 private: 00132 vtkGhostArray( const vtkGhostArray& ); // Not implemented 00133 void operator=(const vtkGhostArray& ); // Not implemented 00134 }; 00135 00136 #endif /* vtkGhostArray_H_ */