vtkMaterialInterfaceToProcMap.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: $RCSfile$
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 =========================================================================*/
24 #ifndef vtkMaterialInterfaceToProcMap_h
25 #define vtkMaterialInterfaceToProcMap_h
26 
27 #include "vtkPVVTKExtensionsFiltersMaterialInterfaceModule.h" //needed for exports
28 
29 #include <vector> // for WhoHasAPiece()
30 
32 {
33 public:
35  vtkMaterialInterfaceToProcMap(int nFragments);
36  vtkMaterialInterfaceToProcMap(int nProcs, int nFragments);
40  // logistics
41  void Clear();
42  void Initialize(int nFragments);
43  void Initialize(int nProcs, int nFragments);
44  void DeepCopy(const vtkMaterialInterfaceToProcMap& from);
45  // interface
46  int GetProcOwnsPiece(int fragmentId) const;
47  int GetProcOwnsPiece(int procId, int fragmentId) const;
48  void SetProcOwnsPiece(int procId, int fragmentId);
49  void SetProcOwnsPiece(int fragmentId);
50  std::vector<int> WhoHasAPiece(int fragmentId, int excludeProc) const;
51  std::vector<int> WhoHasAPiece(int fragmentId) const;
52  int GetProcCount(int fragmentId);
53 
54 private:
55  // proc -> fragment -> bit mask, bit is 1 if
56  // the fragment is on proc
57  class PieceToProcMapContainer;
58  PieceToProcMapContainer* PieceToProcMap;
59  // fragment id -> count num procs
60  class ProcCountContainer;
61  ProcCountContainer* ProcCount;
62 
63  int NProcs; // number of procs
64  int NFragments; // number of fragments to map
65  int PieceToProcMapSize; // length of map array
66  int BitsPerInt; // number of bits in an integer
67 };
68 #endif
69 
70 // VTK-HeaderTest-Exclude: vtkMaterialInterfaceToProcMap.h
#define VTKPVVTKEXTENSIONSFILTERSMATERIALINTERFACE_EXPORT
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)