SheafSystem  0.0.0.0
section_space_schema_member_2.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 SECTION_SPACE_SCHEMA_MEMBER_H
22 #define SECTION_SPACE_SCHEMA_MEMBER_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef SCOPED_INDEX_H
29 #include "SheafSystem/scoped_index.h"
30 #endif
31 
32 #ifndef SCHEMA_POSET_MEMBER_H
33 #include "SheafSystem/schema_poset_member.h"
34 #endif
35 
36 namespace sheaf
37 {
38 class cover_set_iterator;
39 }
40 
41 namespace fiber_bundle
42 {
43 
44 using namespace sheaf;
45 
46 class sec_rep_descriptor;
47 class section_space_schema_poset;
48 class section_space_schema_jims_index_space_handle;
49 
50 
61 class SHEAF_DLL_SPEC section_space_schema_member : public schema_poset_member
62 {
63  friend class section_space_schema_poset; // For access to get_ext_ids.
64 
65  // ===========================================================
67  // ===========================================================
69 
70 public:
71 
75  virtual const std::string& class_name() const;
76 
80  static const std::string& static_class_name();
81 
85  virtual section_space_schema_member& operator=(const abstract_poset_member& xother);
86 
90  section_space_schema_member& operator=(const section_space_schema_member& xother);
91 
95  virtual ~section_space_schema_member();
96 
102  inline section_space_schema_member* clone(bool xnew_state, bool xauto_access = true) const
103  {
104  return static_cast<section_space_schema_member*>(schema_poset_member::clone(xnew_state, xauto_access));
105  }
106 
107  // NEW HANDLE, NEW STATE CONSTRUCTORS
108 
109  // None - section_space_schema_member is abstract
110 
111  // NEW HANDLE, EXISTING STATE CONSTRUCTORS
112 
113  // None - section_space_schema_member is abstract
114 
115  // EXISTING HANDLE, NEW STATE "CONSTRUCTORS"
116 
117  // FEATURES:
118 
122  sec_rep_descriptor& rep();
123 
127  const sec_rep_descriptor& rep() const;
128 
132  bool same_rep(const section_space_schema_member& xother) const;
133 
137  pod_index_type base_space_id() const;
138 
142  void base_space_id(scoped_index& result) const;
143 
147  total_poset_member& base_space();
148 
152  const total_poset_member& base_space() const;
153 
157  bool same_base_space(const section_space_schema_member& xother) const;
158 
162  pod_index_type fiber_schema_id() const;
163 
167  void fiber_schema_id(scoped_index& result) const;
168 
172  schema_poset_member& fiber_schema();
173 
177  const schema_poset_member& fiber_schema() const;
178 
182  bool same_fiber_schema(const section_space_schema_member& xother) const;
183 
187  poset& fiber_space();
188 
192  const poset& fiber_space() const;
193 
197  int db() const;
198 
202  int df() const;
203 
207  int df(bool xauto_access);
208 
213  bool is_factorable() const;
214 
219  int evaluation_ct() const;
220 
225  int discretization_ct() const;
226 
230  subposet& discretization();
231 
235  const subposet& discretization() const;
236 
240  bool same_discretization(const section_space_schema_member& xother) const;
241 
245  subposet& evaluation();
246 
250  const subposet& evaluation() const;
251 
255  bool same_evaluation(const section_space_schema_member& xother) const;
256 
260  string evaluator_family_name() const;
261 
266  static string intersection_id_space_name(const subposet& xsp, const pod_index_type xindex);
267 
272  static string intersection_id_space_name(const subposet& xsp, const scoped_index& xindex);
273 
275 // ///
276 // /// The number of bytes in this dof
277 // ///
278 // virtual size_t size() const = 0;
279 
280 // ///
281 // /// The alignment for this dof
282 // ///
283 // virtual size_t alignment() const = 0;
284 
285 // ///
286 // /// The primitive type index of the dof defined by this.
287 // ///
288 // virtual sheaf::primitive_type type() const = 0;
289 
295  virtual poset_dof_iterator* dof_iterator(bool xis_table_dofs,
296  int xversion = CURRENT_MEMBER_VERSION) const = 0;
297 
303  virtual bool conforms_to(const schema_poset_member& xother, bool xis_table_dofs) const;
304 
305 protected:
306 
313 
318  virtual void attach_handle_data_members();
319 
323  pod_index_type _base_space_id;
324 
328  total_poset_member _base_space;
329 
333  pod_index_type _fiber_schema_id;
334 
338  schema_poset_member _fiber_schema;
339 
343  mutable int _db;
344 
349  mutable int _evaluation_ct;
350 
355  mutable int _discretization_ct;
356 
357 private:
358 
360 
361 
362  // ===========================================================
364  // ===========================================================
366 
367 public:
368 
370 // ///
371 // /// The type of table dofs (xis_table_dof == true) or
372 // /// row dofs (xis_table_dof == false) defined by this schema.
373 // /// Returns NOT_A_PRIMITIVE_TYPE if the dofs are
374 // /// not all the same type.
375 // ///
376 // virtual primitive_type dof_tuple_type(bool xis_table_dof) const = 0;
377 
385 
390  inline bool contains_dof(const schema_poset_member& xother, bool xin_table_dofs) const
391  {
392  return schema_poset_member::contains_dof(xother, xin_table_dofs);
393  };
394 
399  inline bool contains_table_dof(const schema_poset_member& xother) const
400  {
401  return contains_dof(xother, true);
402  };
403 
408  inline bool contains_row_dof(const schema_poset_member& xother) const
409  {
410  return contains_dof(xother, false);
411  };
412 
419  inline bool contains_dof(pod_index_type xother_id, bool xin_table_dofs) const
420  {
421  return schema_poset_member::contains_dof(xother_id, xin_table_dofs);
422  };
423 
430  inline bool contains_dof(const scoped_index& xother_id, bool xin_table_dofs) const
431  {
432  return schema_poset_member::contains_dof(xother_id, xin_table_dofs);
433  };
434 
440  inline bool contains_table_dof(pod_index_type xother_id) const
441  {
442  return contains_dof(xother_id, true);
443  };
444 
450  inline bool contains_table_dof(const scoped_index& xother_id) const
451  {
452  return contains_dof(xother_id, true);
453  };
454 
460  inline bool contains_row_dof(pod_index_type xother_id) const
461  {
462  return contains_dof(xother_id, false);
463  };
464 
470  inline bool contains_row_dof(const scoped_index& xother_id) const
471  {
472  return contains_dof(xother_id, false);
473  };
474 
481  bool contains_dof(pod_index_type xbase_id,
482  pod_index_type xfiber_id,
483  bool xin_table_dofs) const;
484 
491  bool contains_dof(const scoped_index& xbase_id,
492  const scoped_index& xfiber_id,
493  bool xin_table_dofs) const;
494 
500  inline bool contains_table_dof(pod_index_type xbase_id,
501  pod_index_type xfiber_id) const
502  {
503  return contains_dof(xbase_id, xfiber_id, true);
504  };
505 
511  inline bool contains_table_dof(const scoped_index& xbase_id,
512  const scoped_index& xfiber_id) const
513  {
514  return contains_dof(xbase_id, xfiber_id, true);
515  };
516 
522  inline bool contains_row_dof(pod_index_type xbase_id,
523  pod_index_type xfiber_id) const
524  {
525  return contains_dof(xbase_id, xfiber_id, false);
526  };
527 
533  inline bool contains_row_dof(const scoped_index& xbase_id,
534  const scoped_index& xfiber_id) const
535  {
536  return contains_dof(xbase_id, xfiber_id, false);
537  };
538 
540 // ///
541 // /// True if this is in the table dofs part (xin_table_dofs == true)
542 // /// or in the row dofs part (xin_table_dofs == false) of some schema.
543 // ///
544 // virtual bool is_dof(bool xin_table_dofs) const = 0;
545 
546 protected:
547 
558  virtual dof_descriptor_array* dof_descriptors(bool xis_table_dof) const = 0;
559 
563  virtual void update_table_dof_id_space() const;
564 
568  virtual void update_table_dof_descriptors() const;
569 
570 private:
571 
573 
574 
575  // ===========================================================
577  // ===========================================================
579 
580 public:
581 
586  const index_space_handle& discretization_id_space() const;
587 
592  const index_space_handle& discretization_id_space(bool xauto_access) const;
593 
598  index_space_handle& discretization_id_space();
599 
604  index_space_handle& discretization_id_space(bool xauto_access);
605 
610  const index_space_handle& fiber_schema_id_space(bool xis_table_dofs) const;
611 
616  const index_space_handle& fiber_schema_id_space(bool xis_table_dofs, bool xauto_access) const;
617 
619 
624  virtual size_type size(pod_index_type xdof_id,
625  bool xis_table_dof) const = 0;
626 
636  virtual size_type size(pod_index_type xdisc_id,
637  pod_index_type xfiber_dof_id,
638  bool xis_table_dof) const = 0;
639 
644  virtual size_type size(const scoped_index& xdisc_id,
645  const scoped_index& xfiber_dof_id,
646  bool xis_table_dof,
647  bool xauto_access) const = 0;
648 
650 
655  virtual size_type alignment(pod_index_type xdof_id,
656  bool xis_table_dof) const = 0;
657 
662  virtual size_type alignment(pod_index_type xdisc_id,
663  pod_index_type xfiber_dof_id,
664  bool xis_table_dof) const = 0;
665 
670  virtual size_type alignment(const scoped_index& xdisc_id,
671  const scoped_index& xfiber_dof_id,
672  bool xis_table_dof,
673  bool xauto_access) const = 0;
674 
676 
681  virtual primitive_type type(pod_index_type xdof_id,
682  bool xis_table_dof) const = 0;
683 
688  virtual primitive_type type(pod_index_type xdisc_id,
689  pod_index_type xfiber_dof_id,
690  bool xis_table_dof) const = 0;
691 
696  virtual primitive_type type(const scoped_index& xdisc_id,
697  const scoped_index& xfiber_dof_id,
698  bool xis_table_dof,
699  bool xauto_access) const = 0;
700 
702 
707  virtual size_type offset(pod_index_type xdof_id,
708  bool xis_table_dof) const = 0;
709 
714  virtual size_type offset(pod_index_type xdisc_id,
715  pod_index_type xfiber_dof_id,
716  bool xis_table_dof) const = 0;
717 
722  virtual size_type offset(const scoped_index& xdisc_id,
723  const scoped_index& xfiber_dof_id,
724  bool xis_table_dof,
725  bool xauto_access) const = 0;
726 
730  size_type fiber_size() const;
731 
735  size_type fiber_size(bool xauto_access) const;
736 
740  size_type component_size(pod_index_type xfiber_dof_id) const;
741 
745  size_type component_size(const scoped_index& xfiber_dof_id, bool xauto_access) const;
746 
747 protected:
748 
753  mutable index_space_handle* _discretization_id_space;
754 
755 private:
756 
758 
759 
760  // ===========================================================
762  // ===========================================================
764 
765 public:
766 
773  virtual pod_index_type get_ext_id(const std::string& xid_space_name) const;
774 
775 protected:
776 
777 private:
778 
780 
781 
782  // ===========================================================
784  // ===========================================================
786 
787 public:
788 
790 // ///
791 // /// Prepare this for use as a schema.
792 // /// @error host is immutable; remove this member.
793 // ///
794 // virtual void schematize();
795 
799  virtual schema_poset_member& unrestricted_schema();
800 
804  virtual const schema_poset_member& unrestricted_schema() const;
805 
806 protected:
807 
808 private:
809 
811 
812 
813  // ===========================================================
815  // ===========================================================
817 
818 public:
819 
821  // $$SCRIBBLE: Remove version hack.
822 
823 // ///
824 // /// Sets version to (possibly aliased) xversion. If unalias == true,
825 // /// set version to the actual version alias refers to.
826 // ///
827 // virtual void put_version(int xversion, bool xunalias = false);
828 
829 protected:
830 
831 private:
832 
834 
835 
836  // ===========================================================
838  // ===========================================================
840 
841 public:
842 
844 
849  virtual void attach_to_state(pod_index_type xbase_space_id,
850  pod_index_type xfiber_schema_id);
851 
856  void attach_to_state(const scoped_index& xbase_space_id,
857  const scoped_index& xfiber_schema_id);
858 
863  virtual void attach_to_state(const section_space_schema_poset* xhost,
864  pod_index_type xbase_space_id,
865  pod_index_type xfiber_schema_id);
866 
871  void attach_to_state(const section_space_schema_poset* xhost,
872  const scoped_index& xbase_space_id,
873  const scoped_index& xfiber_schema_id);
874 
879  virtual void attach_to_state(const section_space_schema_poset* xhost,
880  const poset_path& xbase_path,
881  const poset_path& xfiber_schema_path);
882 
886  virtual void detach_from_state();
887 
888 protected:
889 
890 private:
891 
893 
894 
895  // ===========================================================
897  // ===========================================================
899 
900 public:
901 
906  {
907  return reinterpret_cast<section_space_schema_poset*>(schema_poset_member::host());
908  }
909 
913  virtual bool host_is_ancestor_of(const poset_state_handle* other) const;
914 
915 protected:
916 
917 private:
918 
920 
921 
922  // ===========================================================
924  // ===========================================================
926 
927 public:
928 
932  virtual bool is_ancestor_of(const any* other) const;
933 
937  virtual section_space_schema_member* clone() const = 0;
938 
942  virtual bool invariant() const;
943 
944 protected:
945 
946 private:
947 
949 
950 
951  // ===========================================================
953  // ===========================================================
955 
956 public:
957 
961  virtual void to_stream(std::ostream& xos = std::cout) const;
962 
963 protected:
964 
965 private:
966 
968 };
969 
970 // ===========================================================
971 // NONMEMBER FUNCTIONS
972 // ===========================================================
973 
974 #ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
975 
979 SHEAF_DLL_SPEC std::ostream& operator << (std::ostream &os, section_space_schema_member& p);
980 
981 #endif // ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
982 
983 } // namespace fiber_bundle
984 
985 #endif // SECTION_SPACE_SCHEMA_MEMBER_H
bool contains_row_dof(const schema_poset_member &xother) const
True if this is in the row dofs part of the schema defined by this. Synonym for contains_dof(xother, false).
poset_state_handle * host() const
The poset which this is a handle to a component of.
bool contains_dof(pod_index_type xother_id, bool xin_table_dofs) const
True if xother_id is the index of a dof in the table dofs part (xin_table_dofs == true) or in the row...
A client handle for a subposet.
Definition: subposet.h:86
section_space_schema_poset * host() const
The poset which this is a handle to a component of.
virtual schema_poset_member * clone() const
Make a new handle, no state instance of current.
virtual size_t size() const
The number of bytes in this dof.
bool contains_table_dof(const schema_poset_member &xother) const
True if this is in the table dofs part of the schema defined by this. Synonym for contains_dof(xother...
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...
virtual primitive_type type() const
The primitive type index of the dof defined by this.
Abstract base class with useful features for all objects.
Definition: any.h:39
virtual size_t alignment() const
The alignment for this dof.
primitive_type
Type ids for sheaf primitives.
bool contains_table_dof(pod_index_type xbase_id, pod_index_type xfiber_id) const
True if xother_id is the index of a dof in the table dofs part of the schema defined by this...
bool contains_dof(const scoped_index &xother_id, bool xin_table_dofs) const
True if xother_id is the index of a dof in the table dofs part (xin_table_dofs == true) or in the row...
A client handle for a mutable partially ordered set.
Definition: poset.h:40
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
bool contains_row_dof(const scoped_index &xother_id) const
True if xother_id is the index of a dof in the row dofs part of the schema defined by this...
An array for storing structs which describe the size, alignment, and offset of dofs within a dof tupl...
bool contains_row_dof(const scoped_index &xbase_id, const scoped_index &xfiber_id) const
True if xother_id is the index of a dof in the row dofs part of the schema defined by this...
bool contains_row_dof(pod_index_type xbase_id, pod_index_type xfiber_id) const
True if xother_id is the index of a dof in the row dofs part of the schema defined by this...
bool contains_row_dof(pod_index_type xother_id) const
True if xother_id is the index of a dof in the row dofs part of the schema defined by this...
bool contains_dof(const schema_poset_member &xother, bool xin_table_dofs) const
True if xother is a dof in the table dofs part (xin_table_dofs == true) or in the row dofs part (xin_...
An abstract schema poset for a section space. A Cartesian product subspace of the tensor product of a...
Iterates in postorder over dofs of a schema member anchor. Attaches a handle of type schema_poset_mem...
bool contains_dof(const schema_poset_member &xother, bool xin_table_dofs) const
True if xother is a dof in the table dofs part (xin_table_dofs == true) or in the row dofs part (xin_...
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
Namespace for the sheaves component of the sheaf system.
A client handle for a poset member which has been prepared for use as a schema for a section space...
void attach_to_state(const namespace_poset *xns, const poset_path &xpath, bool xauto_access=true)
Attach to the state specified by path xpath in the namespace xns.
virtual size_type offset(pod_index_type xdof_id, bool xis_table_dof) const
The offset for the table dof (xis_table_dof true) or row dof referred to by xdof_id in the schema def...
An abstract client handle for a member of a poset.
bool contains_table_dof(const scoped_index &xbase_id, const scoped_index &xfiber_id) const
True if xother_id is the index of a dof in the table dofs part of the schema defined by this...
bool contains_table_dof(const scoped_index &xother_id) const
True if xother_id is the index of a dof in the table dofs part of the schema defined by this...
Namespace for the fiber_bundles component of the sheaf system.
bool contains_table_dof(pod_index_type xother_id) const
True if xother_id is the index of a dof in the table dofs part of the schema defined by this...
A client handle for a poset member which has been prepared for use as a schema.
A client handle for an unrestricted member of a poset. A total_poset_member is guaranteed not to be r...
section_space_schema_member * 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...
A description for a section representation scheme.