SheafSystem  0.0.0.0
base_space_poset.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 BASE_SPACE_POSET_H
22 #define BASE_SPACE_POSET_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef REFINABLE_POSET_H
29 #include "SheafSystem/refinable_poset.h"
30 #endif
31 
32 namespace sheaf
33 {
34 class namespace_poset;
35 }
36 
37 namespace fiber_bundle
38 {
39 
40 using namespace sheaf;
41 
42 class base_space_crg_interval;
43 class base_space_member_row_dof_tuple_type;
44 class base_space_poset;
45 
46 // Following functions must be forward declared before friend statement.
47 
57 SHEAF_DLL_SPEC
58 size_t deep_size(const base_space_poset& xp,
59  bool xinclude_shallow = true,
60  size_t xresults[4] = 0);
61 
66 {
67 public:
68 
72  int max_db;
73 
74 protected:
75 
76 private:
77 
78 };
79 
84 class SHEAF_DLL_SPEC base_space_poset : public refinable_poset
85 {
86 
87  friend class sheaf::namespace_poset;
88  friend class unstructured_block_builder;
89  friend class fiber_bundles_namespace;
90  friend SHEAF_DLL_SPEC size_t fiber_bundle::deep_size(const base_space_poset& xp, bool xinclude_shallow, size_t xresults[4]);
91 
92  // ===========================================================
94  // ===========================================================
96 
97 public:
98 
103 
108 
112  static const poset_path& standard_schema_path();
113 
119  static base_space_poset& new_table(namespace_type& xhost,
120  const poset_path& xpath,
121  const poset_path& xschema_path,
122  int xmax_db,
123  bool xauto_access);
124 
125 protected:
126 
131 
135  base_space_poset(const base_space_poset& xother) { };
136 
140  virtual ~base_space_poset();
141 
142 private:
143 
147  static bool make_prototype();
148 
150 
151 
152 
153  // ===========================================================
155  // ===========================================================
157 
158 public:
159 
164  bool contains_zone_id_space(pod_index_type xmbr_id, bool xauto_access) const;
165 
171  bool contains_zone_id_space(const scoped_index& xmbr_id, bool xauto_access) const;
172 
177  index_space_handle& get_zone_id_space(pod_index_type xmbr_id, bool xauto_access) const;
178 
184 
185  index_space_handle& get_zone_id_space(const scoped_index& xmbr_id, bool xauto_access) const;
186 
191  void release_zone_id_space(index_space_handle& xid_space, bool xauto_access) const;
192 
197  index_space_iterator& get_zone_id_space_iterator(pod_index_type xmbr_id, bool xauto_access) const;
198 
204  index_space_iterator& get_zone_id_space_iterator(const scoped_index& xmbr_id, bool xauto_access) const;
205 
210  void release_zone_id_space_iterator(index_space_iterator& xitr, bool xauto_access) const;
211 
212 protected:
213 
214 private:
215 
217 
218 
219  // ===========================================================
221  // ===========================================================
223 
224 public:
225 
230  bool contains_vertex_id_space(pod_index_type xmbr_id, bool xauto_access) const;
231 
237  bool contains_vertex_id_space(const scoped_index& xmbr_id, bool xauto_access) const;
238 
243  index_space_handle& get_vertex_id_space(pod_index_type xmbr_id, bool xauto_access) const;
244 
250  index_space_handle& get_vertex_id_space(const scoped_index& xmbr_id, bool xauto_access) const;
251 
256  void release_vertex_id_space(index_space_handle& xid_space, bool xauto_access) const;
257 
262  index_space_iterator& get_vertex_id_space_iterator(pod_index_type xmbr_id, bool xauto_access) const;
263 
269  index_space_iterator& get_vertex_id_space_iterator(const scoped_index& xmbr_id, bool xauto_access) const;
270 
275  void release_vertex_id_space_iterator(index_space_iterator& xitr, bool xauto_access) const;
276 
277 protected:
278 
279 private:
280 
282 
283 
284  // ===========================================================
286  // ===========================================================
288 
289 public:
290 
295  bool contains_vertex_client_id_space(pod_index_type xmbr_id, bool xauto_access) const;
296 
302  bool contains_vertex_client_id_space(const scoped_index& xmbr_id, bool xauto_access) const;
303 
308  index_space_handle& get_vertex_client_id_space(pod_index_type xmbr_id, bool xauto_access) const;
309 
315  index_space_handle& get_vertex_client_id_space(const scoped_index& xmbr_id, bool xauto_access) const;
316 
321  void release_vertex_client_id_space(index_space_handle& xid_space, bool xauto_access) const;
322 
327  index_space_iterator& get_vertex_client_id_space_iterator(pod_index_type xmbr_id, bool xauto_access) const;
328 
334  index_space_iterator& get_vertex_client_id_space_iterator(const scoped_index& xmbr_id, bool xauto_access) const;
335 
340  void release_vertex_client_id_space_iterator(index_space_iterator& xitr, bool xauto_access) const;
341 
342 protected:
343 
344 private:
345 
347 
348 
349  // ==========================================================
351  // ===========================================================
353 
354 public:
355 
359  bool contains_connectivity_id_space(pod_index_type xzone_id, bool xauto_access) const;
360 
365  bool contains_connectivity_id_space(const scoped_index& xzone_id, bool xauto_access) const;
366 
371  index_space_handle& get_connectivity_id_space(pod_index_type xzone_id, bool xauto_access) const;
372 
378  index_space_handle& get_connectivity_id_space(const scoped_index& xzone_id, bool xauto_access) const;
379 
383  void release_connectivity_id_space(index_space_handle& xid_space, bool xauto_access) const;
384 
389  index_space_iterator& get_connectivity_id_space_iterator(pod_index_type xzone_id, bool xauto_access) const;
390 
396  index_space_iterator& get_connectivity_id_space_iterator(const scoped_index& xzone_id, bool xauto_access) const;
397 
401  void release_connectivity_id_space_iterator(index_space_iterator& xid_space, bool xauto_access) const;
402 
403 protected:
404 
405 private:
406 
408 
409 
410  // ==========================================================
412  // ===========================================================
414 
415 public:
416 
420  bool contains_adjacency_id_space(pod_index_type xvertex_id, bool xauto_access) const;
421 
426  bool contains_adjacency_id_space(const scoped_index& xvertex_id, bool xauto_access) const;
427 
432  index_space_handle& get_adjacency_id_space(pod_index_type xvertex_id, bool xauto_access) const;
433 
439  index_space_handle& get_adjacency_id_space(const scoped_index& xvertex_id, bool xauto_access) const;
440 
444  void release_adjacency_id_space(index_space_handle& xid_space, bool xauto_access) const;
445 
450  index_space_iterator& get_adjacency_id_space_iterator(pod_index_type xvertex_id, bool xauto_access) const;
451 
457  index_space_iterator& get_adjacency_id_space_iterator(const scoped_index& xvertex_id, bool xauto_access) const;
458 
462  void release_adjacency_id_space_iterator(index_space_iterator& xid_space, bool xauto_access) const;
463 
464 protected:
465 
466 private:
467 
469 
470 
471 
472  // ===========================================================
474  // ===========================================================
476 
477 public:
478 
483  static const std::string& prototypes_poset_name();
484 
488  pod_index_type prototype_type_id(const std::string& xname, bool xauto_access = true) const;
489 
495  scoped_index prototype_dof_tuple_id(const std::string& xname,
496  int xdepth,
497  bool xcreate,
498  bool xauto_access) const;
499 
500 protected:
501 
502 private:
503 
505 
506 
507  // ===========================================================
509  // ===========================================================
511 
512 public:
513 
514 protected:
515 
516 private:
517 
519 
520 
521  // ===========================================================
523  // ===========================================================
525 
526 public:
527 
531  virtual poset_type type_id() const;
532 
536  virtual const char* class_name() const;
537 
538 protected:
539 
544  virtual void attach_handle_data_members();
545 
546 private:
547 
549 
550  // ===========================================================
552  // ===========================================================
554 
555 public:
556 
558 
565  pod_index_type new_member(const std::string& xprototype_name, bool xcopy_dof_map);
566 
572  pod_index_type new_member(const char* xprototype_name, bool xcopy_dof_map);
573 
578  pod_index_type new_member(const std::string& xtype_name, int xdb, const std::string& xlocal_cell_name);
579 
580 protected:
581 
582 private:
583 
585 
586  // ===========================================================
588  // ===========================================================
590 
591 public:
592 
596  subposet& blocks();
597 
601  const subposet& blocks() const;
602 
606  static std::string blocks_name();
607 
611  subposet& block_vertices();
612 
616  const subposet& block_vertices() const;
617 
621  static std::string block_vertices_name();
622 
626  subposet& vertices();
627 
631  const subposet& vertices() const;
632 
636  subposet& elements();
637 
641  const subposet& elements() const;
642 
646  subposet& d_cells(int xd);
647 
651  const subposet& d_cells(int xd) const;
652 
656  scattered_insertion_index_space_handle& d_cells_id_space(int xd);
657 
661  const scattered_insertion_index_space_handle& d_cells_id_space(int xd) const;
662 
666  static std::string d_cells_name(int xdb, int xmax_db);
667 
671  subposet& cells();
672 
676  const subposet& cells() const;
677 
681  static std::string cells_name();
682 
686  void insert_interval_in_standard_subposets(base_space_crg_interval& xinterval);
687 
688 protected:
689 
694 
699 
704 
709 
714 
718  virtual void initialize_standard_subposets(const std::string& xname);
719 
720 private:
721 
723 
724 
725  // ===========================================================
727  // ===========================================================
729 
730 public:
731 
735  int max_db() const;
736 
740  void put_max_db(int xmax_db);
741 
745  void update_max_db(int xmax_db);
746 
750  const table_dof_tuple_type* table_dof_tuple() const;
751 
755  table_dof_tuple_type* table_dof_tuple();
756 
757 protected:
758 
759 private:
760 
762 
763  // ===========================================================
765  // ===========================================================
767 
768 public:
769 
773  int db(pod_index_type xmbr_hub_id) const;
774 
778  int db(const scoped_index& xmbr_id) const;
779 
783  pod_index_type type_id(pod_index_type xmbr_hub_id) const;
784 
788  pod_index_type type_id(const scoped_index& xmbr_id) const;
789 
793  std::string type_name(pod_index_type xmbr_hub_id) const;
794 
798  std::string type_name(const scoped_index& xmbr_id) const;
799 
803  int refinement_depth(pod_index_type xmbr_hub_id) const;
804 
808  int refinement_depth(const scoped_index& xmbr_id) const;
809 
813  void put_refinement_depth(pod_index_type xmbr_hub_id, int xdepth);
814 
818  void put_refinement_depth(const scoped_index& xmbr_id, int xdepth);
819 
821 
825  row_dof_tuple_type* member_dof_tuple(pod_index_type xmbr_hub_id,
826  bool xrequire_write_access = false) const;
827 
831  row_dof_tuple_type* member_dof_tuple(const scoped_index& xmbr_id,
832  bool xrequire_write_access = false) const;
833 
837  row_dof_tuple_type* row_dof_tuple(pod_index_type xtuple_hub_id,
838  bool xrequire_write_access = false) const;
839 
843  row_dof_tuple_type* row_dof_tuple(const scoped_index& xtuple_id,
844  bool xrequire_write_access = false) const;
845 
847 
852  const scoped_index& new_row_dof_map(const std::string& xprototype_name);
853 
854 protected:
855 
856 private:
857 
859 
860  // ===========================================================
862  // ===========================================================
864 
865 public:
866 
874  bool is_explicit_member(pod_index_type xmbr_id) const;
875 
883  bool is_block_member(pod_index_type xmbr_id) const;
884 
885 protected:
886 
887 private:
888 
890 
891 
892  // ===========================================================
894  // ===========================================================
896 
897 public:
898 
902  virtual bool is_ancestor_of(const any* other) const;
903 
907  virtual bool invariant() const;
908 
909 protected:
910 
915  virtual base_space_poset* clone() const;
916 
921  {
922  return const_cast<base_space_poset&>(*this);
923  };
924 
925 private:
926 
928 };
929 
930 // ===========================================================
931 // NON-MEMBER FUNCTIONS
932 // ===========================================================
933 
934 
935 
936 } // namespace fiber_bundle
937 
938 
939 #endif // BASE_SPACE_POSET_H
OBSOLETE: use zone_nodes_block or point_block_*d. A builder object for constructing unstructured bloc...
subposet _cells
The subposet containing all the cells.
A client handle for a subposet.
Definition: subposet.h:86
base_space_member_row_dof_tuple_type row_dof_tuple_type
The type of row dof tuple for this.
An abstract iterator over the ids of an id space.
The default name space; a poset which contains other posets as members.
The type of table dof tuple for base_space_poset.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
subposet _block_vertices
The subposet containing the vertices associated with blocks.
base_space_poset & operator=(const poset_state_handle &xother)
Assignment operator; disabled.
poset_type
Identifiers for poset types.
Definition: poset_type.h:41
base_space_poset_table_dof_tuple_type table_dof_tuple_type
The type of table dof tuple for 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...
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...
virtual const scoped_index & new_row_dof_map()
Creates a new row dof map.
A client handle for a partially order set that can be refined, that is, a jim can be converted to a j...
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
SHEAF_DLL_SPEC size_t deep_size(const dof_descriptor_array &xp, bool xinclude_shallow=true)
The deep size of the referenced object of type dof_descriptor_array.
virtual pod_index_type new_member(bool xis_jim, pod_index_type xdof_tuple_id)
Create a disconnected member with is_jim == xis_jim and the dof tuple identified by xdof_tuple_id...
subposet _blocks
The subposet containing all the blocks.
SHEAF_DLL_SPEC size_t deep_size(const sec_vd &x0, bool xinclude_shallow=true)
The deep size of the referenced object of type sec_vd. if xinclude_shallow, add the sizeof x0 to the ...
Definition: sec_vd.cc:1448
block< scattered_insertion_index_space_handle * > _d_cells_id_spaces
The id spaces for the subposets containing the cells of dimension 0 <= d <= db(). ...
int max_db
The maximum dimension of the members of this base space.
block< subposet > _d_cells
The subposets containing the cells of dimension 0 <= d <= db().
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
A handle for a scattered_insertion_index_space_state.
Namespace for the sheaves component of the sheaf system.
Abstract emulator for a interval of implicit base space members.
The type of row dof tuple for base_space_member.
An auto_block with a no-initialization initialization policy.
Namespace for the fiber_bundles component of the sheaf system.
void member_dof_tuple(pod_index_type xmbr_hub_id, void *xbuf, size_t xbuf_len, bool xauto_access) const
Copies the dof tuple of the member with hub id xmbr_hub_id into the buffer xbuf of length xbuf_len by...
base_space_poset(const base_space_poset &xother)
Copy constructor; disabled.