vtkMaterialInterfaceToProcMap.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkMaterialInterfaceToProcMap_h
14 #define vtkMaterialInterfaceToProcMap_h
15 
16 #include "vtkPVVTKExtensionsFiltersMaterialInterfaceModule.h" //needed for exports
17 
18 #include <vector> // for WhoHasAPiece()
19 
21 {
22 public:
24  vtkMaterialInterfaceToProcMap(int nFragments);
25  vtkMaterialInterfaceToProcMap(int nProcs, int nFragments);
29  // logistics
30  void Clear();
31  void Initialize(int nFragments);
32  void Initialize(int nProcs, int nFragments);
33  void DeepCopy(const vtkMaterialInterfaceToProcMap& from);
34  // interface
35  int GetProcOwnsPiece(int fragmentId) const;
36  int GetProcOwnsPiece(int procId, int fragmentId) const;
37  void SetProcOwnsPiece(int procId, int fragmentId);
38  void SetProcOwnsPiece(int fragmentId);
39  std::vector<int> WhoHasAPiece(int fragmentId, int excludeProc) const;
40  std::vector<int> WhoHasAPiece(int fragmentId) const;
41  int GetProcCount(int fragmentId);
42 
43 private:
44  // proc -> fragment -> bit mask, bit is 1 if
45  // the fragment is on proc
46  class PieceToProcMapContainer;
47  PieceToProcMapContainer* PieceToProcMap;
48  // fragment id -> count num procs
49  class ProcCountContainer;
50  ProcCountContainer* ProcCount;
51 
52  int NProcs; // number of procs
53  int NFragments; // number of fragments to map
54  int PieceToProcMapSize; // length of map array
55  int BitsPerInt; // number of bits in an integer
56 };
57 #endif
#define VTKPVVTKEXTENSIONSFILTERSMATERIALINTERFACE_EXPORT
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)