SheafSystem  0.0.0.0
e1.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 
22 #ifndef E1_H
23 #define E1_H
24 
25 #ifndef SHEAF_DLL_SPEC_H
26 #include "SheafSystem/sheaf_dll_spec.h"
27 #endif
28 
29 #ifndef ED_H
30 #include "SheafSystem/ed.h"
31 #endif
32 
33 namespace fiber_bundle
34 {
35 
36 //==============================================================================
37 // CLASS E1_ROW_DOFS_TYPE
38 //==============================================================================
39 
43 template <typename T>
45 {
46 public:
47 
51  typedef T dof_type;
52 
57 
61  static const std::string& static_class_name();
62 
66  static int d();
67 
72  T& operator[] (int xindex);
73 
78  const T& operator[] (int xindex) const;
79 
83  e1_row_dofs_type<T>* clone() const;
84 
89  e1_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
90  {
91  return clone();
92  }
93 
97  T components[1];
98 
99 protected:
100 private:
101 
102 };
103 
104 
105 //==============================================================================
106 // CLASS E1_LITE
107 //==============================================================================
108 
113 class SHEAF_DLL_SPEC e1_lite : public ed_lite
114 {
115  //============================================================================
117  //============================================================================
119 
120 public:
121 
122  // Typedefs:
123 
128 
132  e1_lite();
133 
137  e1_lite(const e1_lite& xother);
138 
142  e1_lite& operator=(const e1_lite& xother);
143 
147  virtual ~e1_lite();
148 
152  e1_lite(const row_dofs_type& xrow_dofs);
153 
157  e1_lite& operator=(const row_dofs_type& xrow_dofs);
158 
162  e1_lite(const value_type& x_comp);
163 
168  operator row_dofs_type& ();
169 
174  operator const row_dofs_type& () const;
175 
176  using ed_lite::component;
178 
182  virtual void put_component(value_type x_comp);
183 
187  virtual value_type component() const;
188 
189 protected:
190 
194  row_dofs_type _row_dofs;
195 
196 private:
197 
199 
200 
201  //============================================================================
203  //============================================================================
205 
206 public:
207 protected:
208 private:
209 
211 
212 
213  //============================================================================
215  //============================================================================
217 
218 public:
219 protected:
220 private:
221 
223 
224 
225  //============================================================================
227  //============================================================================
229 
230 public:
231 protected:
232 private:
233 
235 
236 
237  //============================================================================
239  //============================================================================
241 
242 public:
243 
247  virtual int dd() const;
248 
249 protected:
250 private:
251 
253 
254 
255  //============================================================================
257  //============================================================================
259 
260 public:
261 
265  bool operator==(const e1_lite& xother) const;
266 
271  static const tp_lite& static_tp_prototype(int xp);
272 
277  virtual const tp_lite& tp_prototype(int xp) const;
278 
283  static const atp_lite& static_atp_prototype(int xp);
284 
289  virtual const atp_lite& atp_prototype(int xp) const;
290 
295  static const stp_lite& static_stp_prototype(int xp);
296 
301  virtual const stp_lite& stp_prototype(int xp) const;
302 
303 protected:
304 private:
305 
306  //============================================================================
308  //============================================================================
310 
311 public:
312 protected:
313 private:
314 
316 
317 
318  //============================================================================
320  //============================================================================
322 
323 public:
324 
328  virtual const std::string& class_name() const;
329 
333  static const std::string& static_class_name();
334 
338  virtual e1_lite* clone() const;
339 
344  virtual e1_lite* clone(bool xnew_state, bool xauto_access) const
345  {
346  return clone();
347  }
348 
349 protected:
350 private:
351 
353 
354 
355  //============================================================================
357  //============================================================================
359 
360 public:
361 
365  virtual bool is_ancestor_of(const any_lite& xother) const;
366 
370  bool invariant() const;
371 
375  virtual void* row_dofs();
376 
380  virtual const void* row_dofs() const;
381 
382 protected:
383 private:
384 
386 };
387 
388 //==============================================================================
389 // CLASS E1
390 //==============================================================================
391 
392 class tp_space;
393 class tp;
394 class atp;
395 class stp;
396 
400 class SHEAF_DLL_SPEC e1 : public ed
401 {
402  // ===========================================================
404  // ===========================================================
406 
407 public:
408 
412  static const poset_path& standard_schema_path();
413 
417  static void make_standard_schema(namespace_poset& xns);
418 
424  static host_type& new_host(namespace_type& xns,
425  const poset_path& xhost_path,
426  const poset_path& xschema_path,
427  const poset_path& xscalar_space_path,
428  bool xauto_access);
429 
436  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
437 
438 protected:
439 
440 private:
441 
443 
444 
445  //============================================================================
447  //============================================================================
449 
450 public:
451 
452  // Typedefs:
453 
458 
463 
468 
472  e1();
473 
478  e1(const poset_state_handle* xhost, pod_index_type xhub_id);
479 
484  e1(const poset_state_handle* xhost, const scoped_index& xid);
485 
490  e1(const poset_state_handle* xhost, const std::string& xname);
491 
495  explicit e1(abstract_poset_member* xother);
496 
500  e1(poset_state_handle* xhost, bool xauto_access = true);
501 
505  e1(poset_state_handle& xhost,
506  const row_dofs_type& xrdt,
507  bool xauto_access = true);
508 
512  e1& operator=(const row_dofs_type& xrdt);
513 
517  virtual e1& operator=(const abstract_poset_member& xother);
518 
522  e1& operator=(const e1& xother);
523 
527  ~e1();
528 
532  virtual const volatile_type& lite_prototype() const;
533 
537  virtual volatile_type* lite_type() const;
538 
539 protected:
540 private:
541 
543 
544 
545  //============================================================================
547  //============================================================================
549 
550 public:
551 protected:
552 private:
553 
555 
556 
557  //===========================================================================
559  //===========================================================================
561 
562 public:
563 protected:
564 private:
565 
567 
568 
569  //===========================================================================
571  //===========================================================================
573 
574 public:
575 protected:
576 private:
577 
579 
580 
581  //===========================================================================
583  //===========================================================================
585 
586 public:
587 protected:
588 private:
589 
591 
592 
593  //===========================================================================
595  //===========================================================================
597 
598 public:
599 
600  using ed::component;
601  using ed::put_component;
602 
606  virtual dof_type component() const;
607 
611  virtual void put_component(dof_type xcomp);
612 
617  operator row_dofs_type& ();
618 
623  operator const row_dofs_type& () const;
624 
625 protected:
626 private:
627 
629 
630 
631  //===========================================================================
633  //===========================================================================
635 
636 public:
637 
638  //@todo: Reword comments.
643  static tp* new_tp(tp_space& xvector_space, int xp);
644 
649  static atp* new_atp(tp_space& xvector_space, int xp);
650 
655  static stp* new_stp(tp_space& xvector_space, int xp);
656 
661  virtual tp* new_tp(int xp, bool xauto_access) const;
662 
667  virtual atp* new_atp(int xp, bool xauto_access) const;
668 
673  virtual stp* new_stp(int xp, bool xauto_access) const;
674 
675 protected:
676 private:
677 
678 
680 
681 
682  //============================================================================
684  //============================================================================
686 
687 public:
688 
692  virtual const std::string& class_name() const;
693 
697  static const std::string& static_class_name();
698 
702  virtual e1* clone() const;
703 
709  inline e1* clone(bool xnew_state, bool xauto_access = true) const
710  {
711  return static_cast<e1*>(ed::clone(xnew_state, xauto_access));
712  }
713 
714 protected:
715 private:
716 
718 
719 
720  //============================================================================
722  //============================================================================
724 
725 public:
726 
730  bool is_ancestor_of(const any* other) const;
731 
735  bool invariant() const;
736 
737 
738 protected:
739 private:
740 
742 };
743 
744 //==============================================================================
745 // NON-MEMBER FUNCTIONS
746 //==============================================================================
747 
751 template <typename T>
752 std::ostream& operator<<(std::ostream& xos, const e1_row_dofs_type<T>& xrdt);
753 
754 
755 } // namespace fiber_bundle
756 
757 #endif // ifndef E1_H
virtual e1_lite * clone(bool xnew_state, bool xauto_access) const
Virtual constructor, makes a new instance of the same type as this; synonym for clone(), intended for use only in certain templates.
Definition: e1.h:344
e1_row_dofs_type< T > * clone(bool xnew_state, bool xauto_access) const
Virtual constructor, makes a new instance of the same type as this; synonym for clone(), intended for use only in certain templates.
Definition: e1.h:89
A symmetric tensor of degree p over an abstract vector space.
Definition: stp.h:190
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: vd.h:129
An antisymmetric tensor of degree p.
Definition: atp.h:190
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...
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
value_type component(int xindex) const
The xindex-th component.
Definition: vd.cc:209
T components[1]
The components (row_dofs).
Definition: e1.h:97
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
Euclidean vector space of dimension 1 (persistent version).
Definition: e1.h:400
static const std::string & static_class_name()
The name of this class.
Definition: e1.impl.h:42
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Definition: atp.h:44
A general tensor of "degree" p and given "variance" over an abstract vector space.
Definition: tp.h:253
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
e1_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: e1.h:56
Abstract base class with useful features for all objects.
Definition: any.h:39
Euclidean vector space of dimension d (volatile version).
Definition: ed.h:44
e1_lite volatile_type
The associated volatile type.
Definition: e1.h:462
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
virtual value_type component(int xindex) const
The value of the xi-th component.
Definition: vd.cc:1115
e1_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: e1.h:457
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
static int d()
The dimension of the row dof components.
Definition: e1.impl.h:62
virtual ed * clone() const
Make a new handle, no state instance of current.
Definition: ed.cc:759
Row dofs type for class e1.
Definition: e1.h:44
bool operator==(const singly_linked_list< T, Alloc > &lhs, const singly_linked_list< T, Alloc > &rhs)
Checks if the contents of lhs and rhs are equal, that is, whether lhs.size() == rhs.size() and each element in lhs compares equal with the element in rhs at the same position.
e1_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: e1.h:127
void put_component(int xindex, value_type xcomp)
Set the xindex-th component to xcomp.
Definition: vd.cc:230
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
Definition: at1_space.h:42
Euclidean vector space of dimension d (peresistent version).
Definition: ed.h:210
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
Euclidean vector space of dimension 1 (volatile version).
Definition: e1.h:113
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: e1.impl.h:82
An abstract client handle for a member of a poset.
e1_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: e1.impl.h:125
vd_dof_type dof_type
The type of the degrees of freedom. Note that although dof_type == value_type in this implementation...
Definition: vd.h:431
virtual void put_component(int xindex, value_type xvalue)
Sets the value of the xindex-th component to xvalue.
Definition: vd.cc:1169
An abstract tensor space of degree p.
Definition: tp_space.h:47
row_dofs_type _row_dofs
Row_dofs_type.
Definition: e1.h:194
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
e1 vector_space_type
Type of underlying vector space.
Definition: e1.h:467
Namespace for the fiber_bundles component of the sheaf system.
e1 * 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...
Definition: e1.h:709
T dof_type
The type of the dofs.
Definition: e1.h:51