SheafSystem  0.0.0.0
sec_rep_space_member.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 SEC_REP_SPACE_MEMBER_H
22 #define SEC_REP_SPACE_MEMBER_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef POSET_MEMBER_H
29 #include "SheafSystem/poset_member.h"
30 #endif
31 
32 #ifndef FIBER_BUNDLE_H
33 #include "SheafSystem/fiber_bundle.h"
34 #endif
35 
36 #ifndef SECTION_DOF_MAP_H
37 #include "SheafSystem/section_dof_map.h"
38 #endif
39 
40 #ifndef SECTION_SPACE_SCHEMA_MEMBER_H
41 #include "SheafSystem/section_space_schema_member.h"
42 #endif
43 
44 #ifndef TOTAL_POSET_MEMBER_H
45 #include "SheafSystem/total_poset_member.h"
46 #endif
47 
48 namespace sheaf
49 {
50 class scattered_insertion_index_space_handle;
51 class index_space_handle;
52 class index_space_iterator;
53 class poset_dof_map;
54 }
55 
56 namespace fiber_bundle
57 {
58 
59 using namespace sheaf;
60 class sec_rep_space;
61 class binary_section_space_schema_member;
62 class binary_section_space_schema_poset;
63 
67 class SHEAF_DLL_SPEC sec_rep_space_member : public poset_member
68 {
69  // ===========================================================
71  // ===========================================================
73 
74 public:
75 
76  // Typedefs:
77 
82 
87 
91  virtual const std::string& class_name() const;
92 
96  static const std::string& static_class_name();
97 
106  static std::string standard_schema_poset_name(const std::string& xschema_member_name);
107 
112  static std::string standard_fiber_space_name(const poset_path& xschema_path);
113 
118  static std::string standard_section_space_name(const std::string& xfiber_space_name,
119  const std::string& xbase_space_name);
120 
125 
133  bool xnew_jem = false);
134 
138  virtual sec_rep_space_member& operator=(const abstract_poset_member& xother);
139 
143  sec_rep_space_member& operator=(const sec_rep_space_member& xother);
144 
149 
155  inline sec_rep_space_member* clone(bool xnew_state, bool xauto_access = true) const
156  {
157  return static_cast<sec_rep_space_member*>
158  (poset_member::clone(xnew_state, xauto_access));
159  }
160 
161 
162  // NEW HANDLE, NEW STATE CONSTRUCTORS
163 
169  explicit sec_rep_space_member(sec_rep_space* xhost,
170  section_dof_map* xdof_map = 0,
171  bool xauto_access = true);
172 
179  abstract_poset_member& xbase_mbr,
180  int xbase_version = CURRENT_HOST_VERSION,
181  bool xauto_access = true);
182 
188  sec_rep_space_member(sec_rep_space* xhost, const subposet& xbase_parts, bool xauto_access);
189 
196  scoped_index* xexpansion,
197  int xexpansion_ct,
198  const tern& xnew_jem,
199  bool xauto_access);
200 
201 
202  // NEW HANDLE, EXISTING STATE CONSTRUCTORS
203 
208  sec_rep_space_member(const sec_rep_space* xhost, pod_index_type xindex);
209 
214  sec_rep_space_member(const sec_rep_space* xhost, const scoped_index& xindex);
215 
220  sec_rep_space_member(const sec_rep_space* xhost, const std::string& xname);
221 
226  sec_rep_space_member(const namespace_poset* xnamespace,
227  const poset_path& xpath,
228  bool xauto_access = true);
229 
235  sec_rep_space_member(const namespace_poset* xnamespace,
236  pod_index_type xposet_index,
237  pod_index_type xmember_index);
238 
244  sec_rep_space_member(const namespace_poset* xnamespace,
245  const scoped_index& xposet_index,
246  const scoped_index& xmember_index);
247 
253  explicit sec_rep_space_member(const sec_rep_space_member* xother);
254 
255 
256  // EXISTING HANDLE, NEW STATE "CONSTRUCTORS"
257 
259 
265  void new_jim_state(abstract_poset_member& xbase_mbr,
266  int xbase_version = CURRENT_HOST_VERSION,
267  bool xauto_access = true);
268 
274  void new_jim_state(sec_rep_space* xhost,
275  const abstract_poset_member& xbase_mbr,
276  int xbase_version = CURRENT_HOST_VERSION,
277  bool xauto_access = true);
278 
280 
286  void new_jrm_state(sec_rep_space* xhost, const subposet& xbase_parts, bool xauto_access);
287 
288 protected:
289 
290 private:
291 
293 
294 
295  // =============================================================================
297  // =============================================================================
299 
300 public:
301 
305  bool is_multisection(bool xauto_access) const;
306 
310  bool has_branch_id_space(bool xauto_access) const;
311 
316  scattered_insertion_index_space_handle& get_branch_id_space(bool xauto_access);
317 
321  void release_branch_id_space(index_space_handle& xid_space, bool xauto_access) const;
322 
326  bool allocated_branch_handle(index_space_handle& xid_space, bool xauto_access) const;
327 
332  index_space_iterator& get_branch_id_space_iterator(bool xauto_access) const;
333 
337  void release_branch_id_space_iterator(index_space_iterator& xitr, bool xauto_access) const;
338 
342  bool allocated_branch_iterator(index_space_iterator& xitr, bool xauto_access) const;
343 
344 protected:
345 
346 private:
347 
349 
350 
351  // ===========================================================
353  // ===========================================================
355 
356 public:
357 
358  using poset_member::schema;
359 
363  virtual section_space_schema_member& schema();
364 
368  virtual const section_space_schema_member& schema() const;
369 
373  section_space_schema_member& schema(bool xauto_access);
374 
378  const section_space_schema_member& schema(bool xauto_access) const;
379 
383  virtual section_space_schema_member& unrestricted_schema();
384 
388  virtual const section_space_schema_member& unrestricted_schema() const;
389 
390 protected:
391 
392 private:
393 
395 
396 
397  // ===========================================================
399  // ===========================================================
401 
402 public:
403 
407  abstract_poset_member& base();
408 
412  const abstract_poset_member& base() const;
413 
417  bool same_base(const sec_rep_space_member* xother) const;
418 
419 
422 
426  virtual int db() const;
427 
434  bool same_rep(const sec_rep_space_member* xother) const;
435 
440  int discretization_ct() const;
441 
445  // (version with access control).
447  int discretization_ct(bool xaxto_access) const;
448 
453  int evaluation_ct() const;
454 
458  schema_poset_member& fiber_schema();
459 
463  const schema_poset_member& fiber_schema() const;
464 
468  poset& fiber();
469 
473  const poset& fiber() const;
474 
478  int df() const;
479 
481 
486  virtual void restrict_to(pod_index_type xbase_id, pod_index_type xfiber_schema_id);
487 
492  void restrict_to(const scoped_index& xbase_id, const scoped_index& xfiber_schema_id);
493 
497  virtual void restrict_to(const abstract_poset_member* xbase, const abstract_poset_member* xfiber_schema);
498 
502  bool base_is_restricted() const;
503 
507  bool fiber_schema_is_restricted() const;
508 
512  int version() const;
513 
514 protected:
515 
516 private:
517 
519 
520 
521  // ===========================================================
523  // ===========================================================
525 
526 public:
527 
528  using poset_member::get_dof;
529 
533  virtual void get_dof(pod_index_type xdisc_id,
534  pod_index_type xfiber_dof_id,
535  void* xdof,
536  size_type xdof_size) const;
537 
541  void get_dof(const scoped_index& xdisc_id,
542  const scoped_index& xfiber_dof_id,
543  void* xdof,
544  size_type xdof_size,
545  bool xauto_access) const;
546 
547  using poset_member::put_dof;
548 
552  virtual void put_dof(pod_index_type xdisc_id,
553  pod_index_type xfiber_dof_id,
554  const void* xdof,
555  size_type xdof_size);
556 
560  void put_dof(const scoped_index& xdisc_id,
561  const scoped_index& xfiber_dof_id,
562  const void* xdof,
563  size_type xdof_size,
564  bool xauto_access);
565 
569  void get_fiber(pod_index_type xdisc_id, void* xfiber, size_type xfiber_size) const;
570 
574  void get_fiber(const scoped_index& xdisc_id, void* xfiber, size_type xfiber_size, bool xauto_access) const;
575 
579  void put_fiber(pod_index_type xdisc_id, const void* xfiber, size_type xfiber_size);
580 
584  void put_fiber(const scoped_index& xdisc_id, const void* xfiber, size_type xfiber_size, bool xauto_access);
585 
590  void force_fiber(pod_index_type xdisc_id, const void* xfiber, size_type xfiber_size);
591 
596  void force_fiber(const scoped_index& xdisc_id, const void* xfiber, size_type xfiber_size, bool xauto_access);
597 
601  void get_component(pod_index_type xfiber_dof_id, void* xcomponent, size_type xcomponent_size) const;
602 
606  void get_component(const scoped_index& xfiber_dof_id,
607  void* xcomponent,
608  size_type xcomponent_size,
609  bool xauto_access) const;
610 
614  void put_component(pod_index_type xfiber_dof_id, const void* xcomponent, size_type xcomponent_size);
615 
619  void put_component(const scoped_index& xfiber_dof_id,
620  const void* xcomponent,
621  size_type xcomponent_size,
622  bool xauto_access);
623 
624 protected:
625 
626 private:
627 
629 
630 
631  // ===========================================================
633  // ===========================================================
635 
636 public:
637 
641  size_t dof_tuple_size();
642 
646  size_t fiber_size();
647 
651  virtual section_dof_map& dof_map(bool xrequire_write_access = false);
652 
656  virtual const section_dof_map& dof_map(bool xrequire_write_access = false) const;
657 
662  virtual bool dof_map_is_ancestor_of(const poset_dof_map* xdof_map) const;
663 
664 protected:
665 
666 private:
667 
669 
670 
671  // ===========================================================
673  // ===========================================================
675 
676 public:
677 
681  sec_rep_space* host() const;
682 
686  virtual bool host_is_ancestor_of(const poset_state_handle* xother) const;
687 
688 protected:
689 
690 private:
691 
693 
694 
695  // ===========================================================
697  // ===========================================================
699 
700 public:
701 
705  virtual bool is_ancestor_of(const any* other) const;
706 
710  virtual sec_rep_space_member* clone() const;
711 
715  bool invariant() const;
716 
717 protected:
718 
719 private:
720 
722 };
723 
724 } // namespace fiber_bundle
725 
726 #endif // ifndef SEC_REP_SPACE_MEMBER_H
A client handle for a subposet.
Definition: subposet.h:86
sec_rep_space_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 client handle for a poset member which has been prepared for use as a schema for a section space...
virtual void new_jim_state(poset_dof_map *xdof_map=0, bool xcopy_dof_map=false, bool xauto_access=true)
Creates a new jim (join-irreducible member) state in host() and attaches this to it. If xdof_map == 0 a new dof map is created. If xdof_map != 0 and xcopy_dof_map == false, xdof_map is used as the dof map. If xdof_map != 0 and xcopy_dof_map is true, a copy of xdof_map is used.
The abstract map from section dof ids to section dof values of heterogeneous type.
An abstract iterator over the ids of an id space.
The default name space; a poset which contains other posets as members.
A client handle for a general, abstract partially order set.
A three state "bool". Does not provide the operations of ternary logic and is intended for use mostly...
Definition: tern.h:45
virtual schema_poset_member & schema()
The restricted schema for this poset member (mutable version).
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
A member of a sec_rep_space; a section.
virtual poset_member * clone() const
Make a new handle, no state instance of current.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
The general, abstract map from dof ids to dof values.
Definition: poset_dof_map.h:59
Abstract base class with useful features for all objects.
Definition: any.h:39
A client handle for a restrictable member of a poset. A poset_member is a poset_member which can ...
Definition: poset_member.h:59
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
void put_dof(pod_index_type xdof_id, const primitive_value &xdof)
Sets the dof referred to by xdof_id to xdof.
void get_dof(pod_index_type xdof_id, void *xdof, size_type xdof_size) const
Copies the dof referred to by xdof_id into xdof.
binary_section_space_schema_poset schema_host_type
The host type of the schema.
binary_section_space_schema_member schema_type
The schema type.
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.
A client handle for a poset member which has been prepared for use as a schema for a section space...
virtual void restrict_to(const abstract_poset_member *xschema)
Restricts this handle to the down set of xschema.
An abstract client handle for a member of a poset.
Namespace for the fiber_bundles component of the sheaf system.
A client handle for a poset member which has been prepared for use as a schema.
virtual void new_jrm_state(bool xauto_access=true)
Creates a new jrm (join-reducible member) state in host() and attaches this to it.
A handle for a poset whose members are numerical representations of sections of a fiber bundle...
Definition: sec_rep_space.h:61