SheafSystem  0.0.0.0
homogeneous_block.h
Go to the documentation of this file.
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 
20 
21 #ifndef HOMOGENEOUS_BLOCK_H
22 #define HOMOGENEOUS_BLOCK_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef BASE_SPACE_MEMBER_H
29 #include "SheafSystem/base_space_member.h"
30 #endif
31 
32 namespace sheaf
33 {
34 class index_space_handle;
35 class index_space_iterator;
36 class hub_index_space_handle;
37 
38 }
39 
40 namespace fiber_bundle
41 {
42 
43 using namespace sheaf;
44 
45 class homogeneous_block_crg_interval;
46 
51 class SHEAF_DLL_SPEC homogeneous_block : public base_space_member
52 {
53  // ===========================================================
55  // ===========================================================
57 
58 public:
59 
64  static host_type& new_host(namespace_type& xns,
65  const poset_path& xhost_path,
66  const poset_path& xschema_path,
67  int xmax_db,
68  bool xauto_access);
69 
75  static host_type& new_host(namespace_type& xns,
76  const poset_path& xhost_path,
77  int xmax_db,
78  bool xauto_access);
79 
80 
81 protected:
82 
83 private:
84 
86 
87 
88  // ===========================================================
90  // ===========================================================
92 
93 public:
94 
98  virtual ~homogeneous_block();
99 
103  const hub_index_space_handle& hub_id_space() const;
104 
108  const index_space_handle& local_id_space() const;
109 
115  const pod_index_type& local_cell_type_id() const;
116 
120  const char* local_cell_type_name() const;
121 
125  virtual const size_type& size() const;
126 
127  using base_space_member::new_row_dof_map;
128 
135  array_poset_dof_map* new_row_dof_map(const poset* xhost,
136  const std::string& xprototype_name,
137  const std::string& xlocal_cell_name,
138  size_type xsize);
139 
145  static const scoped_index& new_row_dof_map(poset_state_handle& xhost,
146  const std::string& xprototype_name,
147  const std::string& xlocal_cell_name,
148  size_type xsize,
149  bool xauto_access);
150 
151 protected:
152 
157 
163  virtual void attach_handle_data_members();
164 
168  virtual const homogeneous_block_crg_interval& interval() const;
169 
173  void put_size(const size_type& xsize);
174 
175 // ///
176 // /// The type of row dof tuple for this.
177 // ///
178 // struct SHEAF_DLL_SPEC row_dof_tuple_type
179 // {
180 // ///
181 // /// The base space dimension.
182 // ///
183 // int db;
184 
185 // ///
186 // /// The cell type id.
187 // ///
188 // int type_id;
189 
190 // ///
191 // /// The cell type name.
192 // ///
193 // const char* type_name;
194 
195 // ///
196 // /// The refinement depth.
197 // ///
198 // int refinement_depth;
199 
200 // ///
201 // /// The local cell type id.
202 // ///
203 // int local_cell_type_id;
204 
205 // ///
206 // /// The local cell type name.
207 // ///
208 // const char * local_cell_type_name;
209 
210 // ///
211 // /// The number of local cell instances in this block.
212 // ///
213 // size_type size;
214 // };
215 
216 
217 // ///
218 // /// The row dof tuple for this.
219 // ///
220 // inline row_dof_tuple_type* row_dof_tuple()
221 // {
222 // return reinterpret_cast<row_dof_tuple_type*>(dof_map().dof_tuple());
223 // }
224 
229 
230 private:
231 
233 
234 
235  // ===========================================================
237  // ===========================================================
239 
240 public:
241 
245  bool contains_zone_id_space(bool xauto_access) const;
246 
250  index_space_handle& get_zone_id_space(bool xauto_access) const;
251 
255  void release_zone_id_space(index_space_handle& xid_space, bool xauto_access) const;
256 
260  index_space_iterator& get_zone_id_space_iterator(bool xauto_access) const;
261 
265  void release_zone_id_space_iterator(index_space_iterator& xitr, bool xauto_access) const;
266 
267 protected:
268 
269 private:
270 
272 
273 
274  // ===========================================================
276  // ===========================================================
278 
279 public:
280 
284  bool contains_vertex_id_space(bool xauto_access) const;
285 
289  index_space_handle& get_vertex_id_space(bool xauto_access) const;
290 
294  void release_vertex_id_space(index_space_handle& xid_space, bool xauto_access) const;
295 
299  index_space_iterator& get_vertex_id_space_iterator(bool xauto_access) const;
300 
304  void release_vertex_id_space_iterator(index_space_iterator& xitr, bool xauto_access) const;
305 
306 protected:
307 
308 private:
309 
311 
312 
313  // ==========================================================
315  // ===========================================================
317 
318 public:
319 
323  bool contains_connectivity_id_space(pod_index_type xzone_id, bool xauto_access) const;
324 
329  bool contains_connectivity_id_space(const scoped_index& xzone_id, bool xauto_access) const;
330 
335  index_space_handle& get_connectivity_id_space(pod_index_type xzone_id, bool xauto_access) const;
336 
342  index_space_handle& get_connectivity_id_space(const scoped_index& xzone_id, bool xauto_access) const;
343 
347  void release_connectivity_id_space(index_space_handle& xid_space, bool xauto_access) const;
348 
353  index_space_iterator& get_connectivity_id_space_iterator(pod_index_type xzone_id, bool xauto_access) const;
354 
360  index_space_iterator& get_connectivity_id_space_iterator(const scoped_index& xzone_id, bool xauto_access) const;
361 
365  void release_connectivity_id_space_iterator(index_space_iterator& xid_space, bool xauto_access) const;
366 
367 protected:
368 
369 private:
370 
372 
373 
374  // ==========================================================
376  // ===========================================================
378 
379 public:
380 
384  bool contains_adjacency_id_space(pod_index_type xvertex_id, bool xauto_access) const;
385 
390  bool contains_adjacency_id_space(const scoped_index& xvertex_id, bool xauto_access) const;
391 
396  index_space_handle& get_adjacency_id_space(pod_index_type xvertex_id, bool xauto_access) const;
397 
403  index_space_handle& get_adjacency_id_space(const scoped_index& xvertex_id, bool xauto_access) const;
404 
408  void release_adjacency_id_space(index_space_handle& xid_space, bool xauto_access) const;
409 
414  index_space_iterator& get_adjacency_id_space_iterator(pod_index_type xvertex_id, bool xauto_access) const;
415 
421  index_space_iterator& get_adjacency_id_space_iterator(const scoped_index& xvertex_id, bool xauto_access) const;
422 
426  void release_adjacency_id_space_iterator(index_space_iterator& xid_space, bool xauto_access) const;
427 
428 protected:
429 
430 private:
431 
433 
434 
435  // ===========================================================
437  // ===========================================================
439 
440 public:
441 
442 protected:
443 
444 private:
445 
447 
448 
449  // ===========================================================
451  // ===========================================================
453 
454 public:
455 
456 protected:
457 
458 private:
459 
461 
462 
463  // ===========================================================
465  // ===========================================================
467 
468 public:
469 
473  virtual homogeneous_block* clone() const = 0;
474 
480  inline homogeneous_block* clone(bool xnew_state, bool xauto_access = true) const
481  {
482  return static_cast<homogeneous_block*>(base_space_member::clone(xnew_state, xauto_access));
483  }
484 
485 protected:
486 
487 private:
488 
490 
491 
492  // ===========================================================
494  // ===========================================================
496 
497 public:
498 
503  {
504  return static_cast<homogeneous_block*>(base_space_member::greatest_jem());
505  };
506 
510  inline homogeneous_block* least_jem() const
511  {
512  return static_cast<homogeneous_block*>(base_space_member::least_jem());
513  };
514 
515 protected:
516 
517 private:
518 
520 
521 
522  // ===========================================================
524  // ===========================================================
526 
527 public:
528 
534  {
535  return static_cast<homogeneous_block*>(base_space_member::p_join(other));
536  };
537 
543  {
544  return static_cast<homogeneous_block*>(base_space_member::p_meet(other));
545  };
546 
547 protected:
548 
549 private:
550 
552 
553 
554  // ===========================================================
556  // ===========================================================
558 
559 public:
560 
566  inline homogeneous_block* l_join(abstract_poset_member* other, bool xnew_jem = true)
567  {
568  return static_cast<homogeneous_block*>(base_space_member::l_join(other, xnew_jem));
569  };
570 
576  inline homogeneous_block* l_meet(abstract_poset_member* other, bool xnew_jem = true)
577  {
578  return static_cast<homogeneous_block*>(base_space_member::l_meet(other, xnew_jem));
579  };
580 
586  inline homogeneous_block* l_not(bool xnew_jem = true) const
587  {
588  return static_cast<homogeneous_block*>(base_space_member::l_not(xnew_jem));
589  };
590 
591 protected:
592 
593 private:
594 
596 
597 
598  // ===========================================================
600  // ===========================================================
602 
603 public:
604 
608  virtual bool invariant() const;
609 
613  virtual bool is_ancestor_of(const any* other) const;
614 
618  virtual homogeneous_block& operator=(const abstract_poset_member& xother);
619 
623  homogeneous_block& operator=(const homogeneous_block& xother);
624 
625 protected:
626 
627 private:
628 
630 };
631 
632 } // namespace fiber_bundle
633 
634 #endif // HOMOGENEOUS_BLOCK_H
homogeneous_block * p_meet(abstract_poset_member *other)
poset meet of this with other, auto-, pre-, and self-allocated versions the poset meet is the greates...
homogeneous_block * l_join(abstract_poset_member *other, bool xnew_jem=true)
lattice join of this with other, auto-, pre-, and self-allocated versions the lattice join is the lea...
An abstract iterator over the ids of an id space.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
homogeneous_block * least_jem() const
The smallest member which is join-equivalent to this.
homogeneous_block * greatest_jem() const
The largest member which is join-equivalent to this.
A client handle for a general, abstract partially order set.
A path defined by a poset name and a member name separated by a forward slash (&#39;/&#39;). For example: "cell_definitions/triangle".
Definition: poset_path.h:48
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
An implementation of class sum_index_space_handle that has a primary sum id space state...
A client handle for a member of a base space poset.
Abstract base class with useful features for all objects.
Definition: any.h:39
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
homogeneous_block * l_not(bool xnew_jem=true) const
lattice pseudo-complement of this, auto-, pre- and self allocated versions The lattice pseudo-complem...
Struct representing the closed interval [_begin, _end].
Definition: interval_set.h:48
Emulator for a interval of implicit base space members representing a homogeneous collection of cells...
A client handle for a mutable partially ordered set.
Definition: poset.h:40
homogeneous_block_crg_interval * _interval
The implicit interval posetmember for this block.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
A client handle for a base space member which represents a homgeneous collection of local cells...
homogeneous_block * l_meet(abstract_poset_member *other, bool xnew_jem=true)
lattice meet of thisposet with other, auto-, pre-, and self-allocated versions the lattice meet is th...
homogeneous_block * p_join(abstract_poset_member *other) const
poset join of this with other, auto-, pre-, and self-allocated versions the poset join is the least u...
homogeneous_block * clone(bool xnew_state, bool xauto_access=true) const
Make a new handle instance of current. Attach the new instance to a new state if xnew_state is true...
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
Namespace for the sheaves component of the sheaf system.
An abstract client handle for a member of a poset.
An array representation of abstract class poset_dof_map.
Namespace for the fiber_bundles component of the sheaf system.