SheafSystem  0.0.0.0
block_adjacency.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 block_adjacency
19 
20 #ifndef BLOCK_ADJACENCY_H
21 #define BLOCK_ADJACENCY_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef BLOCK_RELATION_H
28 #include "SheafSystem/block_relation.h"
29 #endif
30 
31 #ifndef STD_MAP_H
32 #include "SheafSystem/std_map.h"
33 #endif
34 
35 #ifndef SINGLY_LINKED_LIST_H
36 #include "SheafSystem/singly_linked_list.h"
37 #endif
38 
39 namespace fiber_bundle
40 {
41 
42  class block_connectivity;
43  using namespace sheaf;
44 
48 class SHEAF_DLL_SPEC block_adjacency : public block_relation
49 {
50 
51  // ===========================================================
52  // BLOCK_ADJACENCY FACET
53  // ===========================================================
54 
55 public:
56 
60  typedef std::map< pod_index_type, singly_linked_list<pod_index_type> > adj_type;
61 
65  typedef adj_type::iterator node_iterator_type;
66 
70  typedef adj_type::const_iterator const_node_iterator_type;
71 
75  typedef adj_type::mapped_type::iterator zone_iterator_type;
76 
80  typedef adj_type::mapped_type::const_iterator const_zone_iterator_type;
81 
82 
88 
93  block_adjacency(const block_adjacency& xother);
94 
98  block_adjacency(const block_connectivity& xconn);
99 
104  block_adjacency(size_type xzone_ct,
105  size_type xnodes_per_zone,
106  size_type xnode_ids_ct,
107  const pod_index_type* xnode_ids,
108  cell_type xelement_type = CELL_TYPE_END);
109 
113  virtual ~block_adjacency();
114 
118  void put_connectivity(const block_connectivity& xconn);
119 
123  void put_connectivity(size_type xzone_ct,
124  size_type xnodes_per_zone,
125  size_type xnode_ids_ct,
126  const pod_index_type* xnode_ids);
127 
132  block_adjacency& operator=(const block_connectivity& xconn);
133 
137  node_iterator_type begin();
138 
142  const_node_iterator_type begin() const;
143 
147  node_iterator_type end();
148 
152  const_node_iterator_type end() const;
153 
157  size_type node_ct() const;
158 
162  size_type zone_ct() const;
163 
164 
165 protected:
166 
170  adj_type _adj;
171 
176 
181 
182 
183 private:
184 
185  // ===========================================================
186  // BLOCK_RELATION FACET
187  // ===========================================================
188 
189 public:
190 
194  virtual cell_type element_type() const;
195 
196 protected:
197 
202 
203 private:
204 
205 
206  // ===========================================================
207  // ANY FACET
208  // ===========================================================
209 
210 public:
211 
215  virtual bool is_ancestor_of(const any* other) const;
216 
221  virtual block_adjacency* clone() const;
222 
227  block_adjacency& operator=(const block_adjacency& xother);
228 
232  virtual bool invariant() const;
233 
234 protected:
235 private:
236 
237 };
238 
239 // ===========================================================
240 // NON-MEMBER FUNCTIONS
241 // ===========================================================
242 
243 #ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
244 
248 SHEAF_DLL_SPEC
249 std::ostream& operator<<(std::ostream& xos, const block_adjacency& xconn);
250 
251 #endif // ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
252 
253 } // namespace fiber_bundle
254 
255 
256 #endif // ifndef BLOCK_ADJACENCY_H
adj_type::iterator node_iterator_type
Type of iterator for nodes.
size_type _zone_ct
The number of distinct zones.
std::map< pod_index_type, singly_linked_list< pod_index_type > > adj_type
The type of the adjacency relation.
cell_type _element_type
The element type.
size_type _node_ct
The number of distinct nodes.
Zone to node connectivity relation for a block of zones of a given type.
adj_type::const_iterator const_node_iterator_type
Type of const iterator for nodes.
Abstract base class with useful features for all objects.
Definition: any.h:39
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
adj_type::mapped_type::iterator zone_iterator_type
Type of iterator for zones.
Abstract cell relation for a block of zones of a given type.
Node to zone adjacency relation for a block of zones of a given type.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
adj_type::mapped_type::const_iterator const_zone_iterator_type
Type of const iterator for zones.
Namespace for the sheaves component of the sheaf system.
adj_type _adj
Storage for the adjcency relation.
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const binary_index &xbi)
Insert binary_index& xbi into ostream& os.
Definition: binary_index.cc:35