SheafSystem  0.0.0.0
equivalence.h
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
18 // Interface for class EQUIVALENCE
19 
20 #ifndef EQUIVALENCE_H
21 #define EQUIVALENCE_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifdef PARALLEL_MPI
28 
29 #ifndef STD_HDF5_H
30 #include "SheafSystem/std_hdf5.h"
31 #endif
32 
33 #include "SheafSystem/mpi.h"
34 
35 namespace sheaf
36 {
37 
38 class poset_storage;
39 class poset;
40 
41 class SHEAF_DLL_SPEC equivalence
42 {
43 
44  friend class poset_storage;
45 
46 public:
47 
48  typedef struct
49  {
50  int local_index;
51  int remote_index;
52  int remote_proc;
53  }
54  hdf_rep;
55 
56  typedef struct
57  {
58  int remote_index;
59  int remote_proc;
60  MPI_Aint remote_storage;
61  }
62  mpi_rep;
63 
64  // queries:
65 
66  bool invariant() const;
67  static MPI_Datatype mpi_type();
68  static hid_t hdf_type();
69  void make_hdf_rep(hdf_rep *xhdf_rep, int xlocal_index);
70  void make_mpi_rep(mpi_rep *xmpi_rep);
71  int remote_index();
72  int remote_proc();
73  poset_storage *remote_storage();
74 
75  // actions:
76 
77  // constructors:
78 
79  equivalence(int xremote_index, int xremote_proc, poset_storage *xremote_storage);
80  ~equivalence();
81 
82 private:
83 
84  // data:
85 
86  int _remote_index; // index of sibling on other processor
87  int _remote_proc; // processor where sibling is stored
88  poset_storage *_remote_storage; // address of remote poset_storage object
89 
90  // actions:
91 
92  void put_remote_storage(poset_storage *xstorage);
93 
94  // constructors:
95 
96  equivalence(hdf_rep *xrep);
97 
98 };
99 
100 } // namespace sheaf
101 
102 #endif // PARALLEL_MPI
103 
104 #endif // ifndef EQUIVALENCE_H
Namespace for the sheaves component of the sheaf system.