SheafSystem  0.0.0.0
base_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 BASE_SPACE_MEMBER_H
22 #define BASE_SPACE_MEMBER_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef TOTAL_POSET_MEMBER_H
29 #include "SheafSystem/total_poset_member.h"
30 #endif
31 
32 #ifndef ARRAY_POSET_DOF_MAP_H
33 #include "SheafSystem/array_poset_dof_map.h"
34 #endif
35 
36 #ifndef FIBER_BUNDLES_NAMESPACE_H
37 #include "SheafSystem/fiber_bundles_namespace.h"
38 #endif
39 
40 #ifndef NAMESPACE_RELATIVE_MEMBER_INDEX_H
41 #include "SheafSystem/namespace_relative_member_index.h"
42 #endif
43 
44 namespace sheaf
45 {
46  class poset;
47 }
48 
49 namespace fiber_bundle
50 {
51 
52 class base_space_poset;
53 
54 using namespace sheaf;
55 
56 
61 {
62 public:
63 
67  int db;
68 
72  int type_id;
73 
77  const char* type_name;
78 
83 
88 
92  const char* local_cell_type_name;
93 
98 
103 
108 
113 
114 protected:
115 
116 private:
117 
118 };
119 
120 
124 class SHEAF_DLL_SPEC base_space_member : public total_poset_member
125 {
126 
127  // ===========================================================
129  // ===========================================================
131 
132 public:
133 
138 
143 
147  static const poset_path& standard_schema_path();
148 
152  virtual const poset_path& schema_path() const;
153 
157  static void make_standard_schema(namespace_poset& xns);
158 
162  static const std::string& prototypes_poset_name();
163 
168  template <typename F>
169  SHEAF_DLL_SPEC
170  static bool standard_host_is_available(namespace_type& xns, const std::string& xhost_path, bool xauto_access);
171 
176  static host_type& new_host(namespace_type& xns,
177  const poset_path& xhost_path,
178  const poset_path& xschema_path,
179  int xmax_db,
180  bool xauto_access);
181 
188  static host_type& standard_host(namespace_type& xns,
189  const poset_path& xhost_path,
190  int xmax_db,
191  bool xauto_access);
192 
193 
194 protected:
195 
196 private:
197 
199 
200 
201  // ===========================================================
203  // ===========================================================
205 
206 public:
207 
212 
217 
224  explicit base_space_member(const abstract_poset_member& xother,
225  bool xnew_jem = false,
226  bool xauto_access = true);
227 
231  virtual ~base_space_member();
232 
233  // NEW HANDLE, NEW STATE CONSTRUCTORS
234 
240  explicit base_space_member(poset* xhost,
241  array_poset_dof_map* xdof_map = 0,
242  bool xcopy_dof_map = false,
243  bool xauto_access = true);
244 
254  const std::string& xprototype_name,
255  bool xcopy_dof_map,
256  bool xauto_access);
257 
264  const std::string& xtype_name,
265  int xdb,
266  const std::string& xlocal_cell_name,
267  bool xauto_access);
268 
274  base_space_member(poset* xhost,
275  scoped_index* xexpansion,
276  int xexpansion_ct,
277  const tern& xnew_jem,
278  bool xauto_access);
279 
280  // NEW HANDLE, EXISTING STATE CONSTRUCTORS
281 
286  base_space_member(const poset* xhost, pod_index_type xhub_id);
287 
292  base_space_member(const poset* xhost, const scoped_index& xid);
293 
298  base_space_member(const poset* xhost, const std::string& xname);
299 
304  base_space_member(const namespace_poset* xnamespace, const poset_path& xpath, bool xauto_access);
305 
310  base_space_member(const namespace_poset* xnamespace,
311  const pod_index_type xposet_id,
312  const pod_index_type xmember_id);
313 
318  base_space_member(const namespace_poset* xnamespace,
319  const scoped_index& xposet_id,
320  const scoped_index& xmember_id);
321 
322  // EXISTING HANDLE, NEW STATE "CONSTRUCTORS" FACET
323 
324  // FEATURES:
325 
329  poset_path prototype_path() const;
330 
335  static poset_path prototype_path(const namespace_poset* xnamespace,
337 
342  static bool prototype_exists(const std::string& xname, bool xauto_access);
343 
347  row_dof_tuple_type* row_dof_tuple(bool xrequire_write_access = false);
348 
354  static array_poset_dof_map* new_row_dof_map(const poset* xhost, const std::string& xprototype_name);
355 
360  static const scoped_index& new_row_dof_map(poset_state_handle& xhost,
361  const std::string& xprototype_name,
362  bool xauto_access = true);
363 
364 protected:
365 
366 private:
367 
369 
370 
371  // ===========================================================
373  // ===========================================================
375 
376 public:
377 
381  int db() const;
382 
388  const pod_index_type& type_id() const;
389 
393  const char* type_name() const;
394 
398  int refinement_depth() const;
399 
403  void put_refinement_depth(int xdepth);
404 
408  pod_index_type local_cell_type_id() const;
409 
413  const char* local_cell_type_name() const;
414 
415 protected:
416 
417 private:
418 
420 
421 
422  // ===========================================================
424  // ===========================================================
426 
427 public:
428 
432  void d_cells_ct(block<size_type>& xresult, bool xauto_access) const;
433 
445  base_space_member* c_not(bool xauto_access);
446 
450  void c_not_pa(base_space_member& result, bool xauto_access);
451 
459  base_space_member* c_minus(base_space_member& xother,
460  bool xnew_jem,
461  bool xauto_access);
462 
466  void c_minus(base_space_member& xother,
467  base_space_member& result,
468  bool xnew_jem,
469  bool xauto_access);
470 
471 protected:
472 
473 private:
474 
476 
477 
478  // ===========================================================
480  // ===========================================================
482 
483 public:
484 
485 protected:
486 
487 private:
488 
490 
491 
492  // ===========================================================
494  // ===========================================================
496 
497 public:
498 
504  inline base_space_member* clone(bool xnew_state, bool xauto_access = true) const
505  {
506  return reinterpret_cast<base_space_member*>(total_poset_member::clone(xnew_state, xauto_access));
507  }
508 
509 protected:
510 
511 private:
512 
514 
515 
516  // ===========================================================
518  // ===========================================================
520 
521 public:
522 
526  virtual array_poset_dof_map& dof_map(bool xrequire_write_access = false);
527 
531  virtual const array_poset_dof_map& dof_map(bool xrequire_write_access = false) const;
532 
537  virtual bool dof_map_is_ancestor_of(const poset_dof_map* xdof_map) const;
538 
539 protected:
540 
541 private:
542 
544 
545 
546  // ===========================================================
548  // ===========================================================
550 
551 public:
552 
557  {
558  return reinterpret_cast<base_space_member*>(total_poset_member::greatest_jem());
559  };
560 
564  inline base_space_member* least_jem() const
565  {
566  return reinterpret_cast<base_space_member*>(total_poset_member::least_jem());
567  };
568 
569 protected:
570 
571 private:
572 
574 
575 
576  // ===========================================================
578  // ===========================================================
580 
581 public:
582 
588  {
589  return reinterpret_cast<base_space_member*>(total_poset_member::p_join(other));
590  };
591 
597  {
598  return reinterpret_cast<base_space_member*>(total_poset_member::p_meet(other));
599  };
600 
601 protected:
602 
603 private:
604 
606 
607 
608  // ===========================================================
610  // ===========================================================
612 
613 public:
614 
620  inline base_space_member* l_join(abstract_poset_member* other, bool xnew_jem = true)
621  {
622  return reinterpret_cast<base_space_member*>(total_poset_member::l_join(other, xnew_jem));
623  };
624 
630  inline base_space_member* l_meet(abstract_poset_member* other, bool xnew_jem = true)
631  {
632  return reinterpret_cast<base_space_member*>(total_poset_member::l_meet(other, xnew_jem));
633  };
634 
640  inline base_space_member* l_not(bool xnew_jem = true) const
641  {
642  return reinterpret_cast<base_space_member*>(total_poset_member::l_not(xnew_jem));
643  };
644 
645 protected:
646 
647 private:
648 
650 
651 
652  // ===========================================================
654  // ===========================================================
656 
657 public:
658 
660 
661  // ///
662  // /// The namespace of host()
663  // ///
664  // virtual fiber_bundles_namespace* name_space();
665 
666  // ///
667  // /// True if other conforms to name_space().
668  // ///
669  // virtual bool namespace_is_ancestor_of(namespace_poset* other);
670 
671  // ///
672  // /// The poset which this is a handle to a member of.
673  // ///
674  // virtual base_space_poset* host();
675 
679  poset* host() const;
680 
684  virtual bool host_is_ancestor_of(const poset_state_handle* other) const;
685 
686 protected:
687 
688 private:
689 
691 
692 
693  // ===========================================================
695  // ===========================================================
696 
697 public:
698 
702  virtual bool invariant() const;
703 
707  virtual bool is_ancestor_of(const any* other) const;
708 
712  virtual base_space_member* clone() const;
713 
717  virtual base_space_member& operator=(const abstract_poset_member& xother);
718 
722  base_space_member& operator=(const base_space_member& xother);
723 
724 protected:
725 
726 private:
727 
729 };
730 
731 } // namespace fiber_bundle
732 
733 #endif // BASE_SPACE_MEMBER_H
base_space_member * 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...
Index for identifying a poset member relative to a given name space.
base_space_poset host_type
The type of host poset for this type of member.
virtual total_poset_member * clone() const
Make a new handle, no state instance of current.
base_space_member * 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...
size_type size
The number of local cells.
total_poset_member * p_meet(abstract_poset_member *other)
poset meet of this with other, auto-, pre-, and self-allocated versions the poset meet is the greates...
The default name space; a poset which contains other posets as members.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
const char * local_cell_type_name
The local cell type name.
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
total_poset_member * greatest_jem() const
The largest member which is join-equivalent to this.
base_space_member_row_dof_tuple_type row_dof_tuple_type
The type of rowe dof tuple for this.
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
base_space_member * least_jem() const
The smallest member which is join-equivalent to this.
The general, abstract map from dof ids to dof values.
Definition: poset_dof_map.h:59
A client handle for a member of a base space poset.
base_space_member * l_not(bool xnew_jem=true) const
lattice pseudo-complement of this, auto-, pre- and self allocated versions The lattice pseudo-complem...
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...
size_type k_size
The upper bound on the z direction index for structured blocks.
total_poset_member * least_jem() const
The smallest member which is join-equivalent to this.
fiber_bundles_namespace namespace_type
The type of namespace for this type of member.
size_type i_size
The upper bound on the x direction index for structured blocks.
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
base_space_member * p_meet(abstract_poset_member *other)
poset meet of this with other, auto-, pre-, and self-allocated versions the poset meet is the greates...
size_type j_size
The upper bound on the y direction index for structured blocks.
base_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...
base_space_member * l_meet(abstract_poset_member *other, bool xnew_jem=true)
lattice meet of this with other, auto-, pre-, and self-allocated versions the lattice meet is the gre...
total_poset_member * 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...
total_poset_member * l_meet(abstract_poset_member *other, bool xnew_jem=true)
lattice meet of this with other, auto-, pre-, and self-allocated versions the lattice meet is the gre...
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.
total_poset_member * 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...
base_space_member * greatest_jem() const
The largest member which is join-equivalent to this.
An abstract client handle for a member of a poset.
The type of row dof tuple for base_space_member.
An array representation of abstract class poset_dof_map.
Namespace for the fiber_bundles component of the sheaf system.
total_poset_member * l_not(bool xnew_jem=true) const
lattice pseudo-complement of this, auto-, pre- and self allocated versions The lattice pseudo-complem...
A client handle for an unrestricted member of a poset. A total_poset_member is guaranteed not to be r...