SheafSystem  0.0.0.0
at0.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 AT0_H
22 #define AT0_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ATP_H
29 #include "SheafSystem/atp.h"
30 #endif
31 
32 namespace fiber_bundle
33 {
34 
35  class at0_space;
36 
37 
38 //==============================================================================
39 // CLASS AT0_ROW_DOFS_TYPE
40 //==============================================================================
41 
45 template <typename T>
47 {
48 public:
49 
53  typedef T dof_type;
54 
59 
63  static const std::string& static_class_name();
64 
68  static int d();
69 
74  T& operator[] (int xindex);
75 
80  const T& operator[] (int xindex) const;
81 
82  // The value of the row dof (non-const version).
83 
84  T& component();
85 
86  // The value of the row dof (const version).
87 
88  const T& component() const;
89 
90  // Set the value of the row dof.
91 
92  void put_component(const T& xcomp);
93 
97  at0_row_dofs_type<T>* clone() const;
98 
103  at0_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
104  {
105  return clone();
106  }
107 
112 
113 
114 protected:
115 private:
116 
117 };
118 
119 //==============================================================================
120 // CLASS AT0_LITE
121 //==============================================================================
122 
127 class SHEAF_DLL_SPEC at0_lite : public atp_lite
128 {
129  //===========================================================================
131  //===========================================================================
133 
134 public:
135 
136  // Typedefs:
137 
142 
146  at0_lite();
147 
151  at0_lite(const at0_lite& xother);
152 
156  at0_lite& operator=(const at0_lite& xother);
157 
161  virtual ~at0_lite();
162 
166  at0_lite(const row_dofs_type& xrow_dofs);
167 
171  at0_lite& operator=(const row_dofs_type& xrow_dofs);
172 
176  at0_lite(const value_type& xcomp);
177 
181  at0_lite& operator=(const value_type& xcomp);
182 
186  bool operator==(const vd_value_type& xother) const;
187 
192  operator value_type ();
193 
198  operator value_type () const;
199 
204  operator row_dofs_type& ();
205 
210  operator const row_dofs_type& () const;
211 
212  using atp_lite::component;
214 
218  virtual void put_component(value_type xcomp);
219 
223  value_type component() const;
224 
225 protected:
226 
230  row_dofs_type _row_dofs;
231 
232 private:
233 
235 
236 
237  //============================================================================
239  //============================================================================
241 
242 public:
243 
249  enum static_const_int {P = 0};
250 
254  virtual int p() const;
255 
256 protected:
257 private:
258 
260 
261 
262  //============================================================================
264  //============================================================================
266 
267 public:
268 
272  virtual int dd() const;
273 
274 protected:
275 private:
276 
278 
279 
280  //============================================================================
282  //============================================================================
284 
285 public:
286 
291  static const tp_lite& static_tp_prototype(int xp);
292 
297  virtual const tp_lite& tp_prototype(int xp) const;
298 
303  static const atp_lite& static_atp_prototype(int xp);
304 
309  virtual const atp_lite& atp_prototype(int xp) const;
310 
315  static const stp_lite& static_stp_prototype(int xp);
316 
321  virtual const stp_lite& stp_prototype(int xp) const;
322 
323 protected:
324 private:
325 
327 
328 
329  //============================================================================
331  //============================================================================
333 
334 public:
335 protected:
336 private:
337 
339 
340 
341  //============================================================================
343  //============================================================================
345 
346 public:
347 
351  virtual const std::string& class_name() const;
352 
356  static const std::string& static_class_name();
357 
361  virtual at0_lite* clone() const;
362 
367  virtual at0_lite* clone(bool xnew_state, bool xauto_access) const
368  {
369  return clone();
370  }
371 
372 protected:
373 private:
374 
376 
377 
378  //============================================================================
380  //============================================================================
382 
383 public:
384 
388  virtual bool is_ancestor_of(const any_lite& xother) const;
389 
393  bool invariant() const;
394 
398  virtual void* row_dofs();
399 
403  virtual const void* row_dofs() const;
404 
405 
406 protected:
407 private:
408 
410 };
411 
412 //==============================================================================
413 // CLASS AT0
414 //==============================================================================
415 
416 class tp_space;
417 
424 class SHEAF_DLL_SPEC at0 : public atp
425 {
426  // ===========================================================
428  // ===========================================================
430 
431 public:
432 
437 
441  static const poset_path& standard_schema_path();
442 
446  static void make_standard_schema(namespace_poset& xns);
447 
453  static host_type& new_host(namespace_type& xns,
454  const poset_path& xhost_path,
455  const poset_path& xschema_path,
456  bool xauto_access);
457 
464  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
465 
466 protected:
467 
468 private:
469 
471 
472 
473  //============================================================================
475  //============================================================================
477 
478 public:
479 
480  // Typedefs:
481 
486 
491 
496 
500  at0();
501 
506  at0(const poset_state_handle* xhost, pod_index_type xhub_id);
507 
512  at0(const poset_state_handle* xhost, const scoped_index& xid);
513 
518  at0(const poset_state_handle* xhost, const std::string& xname);
519 
523  explicit at0(abstract_poset_member* xother);
524 
528  at0(poset_state_handle* xhost, bool xauto_access = true);
529 
533  at0(poset_state_handle& xhost,
534  const row_dofs_type& xrdt,
535  bool xauto_access = true);
536 
540  at0& operator=(const row_dofs_type& xrdt);
541 
545  virtual at0& operator=(const abstract_poset_member& xother);
546 
550  at0& operator=(const at0& xother);
551 
555  ~at0();
556 
560  virtual const volatile_type& lite_prototype() const;
561 
565  virtual volatile_type* lite_type() const;
566 
570  virtual value_type value() const;
571 
575  void put_value(value_type xvalue);
576 
581  operator row_dofs_type& ();
582 
587  operator const row_dofs_type& () const;
588 
589 protected:
590 private:
591 
593 
594 
595  //============================================================================
597  //============================================================================
599 
600 public:
601 protected:
602 private:
603 
605 
606 
607  //============================================================================
609  //============================================================================
611 
612 public:
613 protected:
614 private:
615 
617 
618 
619  //============================================================================
621  //============================================================================
623 
624 public:
625 protected:
626 private:
627 
629 
630 
631  //============================================================================
633  //============================================================================
635 
636 public:
637 
638  using atp::factor_ct;
639 
643  virtual int factor_ct() const;
644 
645 
646 protected:
647 private:
648 
650 
651 
652  //============================================================================
654  //============================================================================
656 
657 public:
658 
662  virtual const std::string& class_name() const;
663 
667  static const std::string& static_class_name();
668 
674  inline at0* clone(bool xnew_state, bool xauto_access = true) const
675  {
676  return static_cast<at0*>(atp::clone(xnew_state, xauto_access));
677  }
678 
679 protected:
680 private:
681 
683 
684 
685  // ===========================================================
687  // ===========================================================
689 
690 public:
691 
695  host_type* host() const;
696 
700  virtual bool host_is_ancestor_of(const poset_state_handle* other) const;
701 
702 protected:
703 
704 private:
705 
707 
708  //============================================================================
710  //============================================================================
712 
713 public:
714 
718  bool is_ancestor_of(const any* xother) const;
719 
723  virtual at0* clone() const;
724 
728  bool invariant() const;
729 
730 protected:
731 private:
732 
734 };
735 
736 
737 //==============================================================================
738 // NON-MEMBER FUNCTIONS
739 //==============================================================================
740 
744 template <typename T>
745 std::ostream& operator<<(std::ostream& xos, const at0_row_dofs_type<T>& xrdt);
746 
747 } // namespace fiber_bundle
748 
749 #endif // ifndef AT0_H
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
Row dofs type for class at0.
Definition: at0.h:46
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...
static_const_int
The tensor degree (static version)
Definition: at0.h:249
A client handle for a general, abstract partially order set.
T dof_type
The type of the dofs.
Definition: at0.h:53
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
at0_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: at0.h:485
at0_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: at0.h:103
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
T components[1]
The components (row_dofs), only one in this case.
Definition: at0.h:111
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Definition: atp.h:44
virtual int factor_ct() const
Number of factors (components) in tuple.
Definition: tuple.cc:551
static int d()
The dimension of the row dof components.
Definition: at0.impl.h:62
at0_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: at0.impl.h:176
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
at0 * 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: at0.h:674
Abstract base class with useful features for all objects.
Definition: any.h:39
at0_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: at0.h:141
A space of scalars viewed as an antisymmetric tensor space of degree 0.
Definition: at0_space.h:42
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
A scalar viewed as an antisymmetric tensor of degree 0. As the degree is 0 there is nothing to be sym...
Definition: at0.h:424
at0_lite volatile_type
The associated volatile type.
Definition: at0.h:490
Antisymetric tensor of degree 0 (volatile version).
Definition: at0.h:127
row_dofs_type _row_dofs
Row_dofs_type.
Definition: at0.h:230
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
static const std::string & static_class_name()
The name of this class.
Definition: at0.impl.h:42
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.
void put_component(int xindex, value_type xcomp)
Set the xindex-th component to xcomp.
Definition: vd.cc:230
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
vd_value_type value_type
The POD ("plain old data") type of scalar in the vector space of this.
Definition: vd.h:423
virtual atp * clone() const
Make a new handle, no state instance of current.
Definition: atp.cc:899
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: at0.impl.h:82
An abstract client handle for a member of a poset.
at0 vector_space_type
Type of underlying vector space.
Definition: at0.h:495
An abstract tensor space of degree p.
Definition: tp_space.h:47
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
Namespace for the fiber_bundles component of the sheaf system.
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: fiber_bundle.h:63
virtual at0_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: at0.h:367
at0_space host_type
The type of host poset.
Definition: at0.h:436
at0_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: at0.h:58