SheafSystem  0.0.0.0
at2_e3.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 AT2_E3_H
22 #define AT2_E3_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef AT2_H
29 #include "SheafSystem/at2.h"
30 #endif
31 
32 #ifndef ANTISYMMETRIC_MATRIX_3X3_H
33 #include "SheafSystem/antisymmetric_matrix_3x3.h"
34 #endif
35 
36 #ifndef E3_H
37 #include "SheafSystem/e3.h"
38 #endif
39 
40 namespace fiber_bundle
41 {
42 
43 //==============================================================================
44 // CLASS AT2_E3_ROW_DOFS_TYPE
45 //==============================================================================
46 
50 template <typename T>
52 {
53 public:
54 
58  typedef T dof_type;
59 
64 
69 
73  static const std::string& static_class_name();
74 
78  static int d();
79 
84  T& operator[] (int xindex);
85 
90  const T& operator[] (int xindex) const;
91 
96  operator typename at2_e3_row_dofs_type<T>::matrix_type& ();
97 
102  operator const typename at2_e3_row_dofs_type<T>::matrix_type& () const;
103 
108 
113  at2_e3_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
114  {
115  return clone();
116  }
117 
126 
127 protected:
128 private:
129 
130 };
131 
132 //==============================================================================
133 // CLASS AT2_E3_LITE
134 //==============================================================================
135 
136 class e3_lite;
137 
142 class SHEAF_DLL_SPEC at2_e3_lite : public at2_lite
143 {
144  //============================================================================
146  //============================================================================
148 
149 public:
150 
151  // Typedefs:
152 
157 
162 
166  at2_e3_lite();
167 
171  at2_e3_lite(const at2_e3_lite& xother);
172 
176  at2_e3_lite& operator=(const at2_e3_lite& xother);
177 
181  virtual ~at2_e3_lite();
182 
186  at2_e3_lite(const row_dofs_type& xrow_dofs);
187 
191  at2_e3_lite& operator=(const row_dofs_type& xrow_dofs);
192 
196  at2_e3_lite(const matrix_type& xmatrix);
197 
201  at2_e3_lite& operator=(const matrix_type& xmatrix);
202 
207  operator matrix_type& ();
208 
213  operator const matrix_type& () const;
214 
219  operator row_dofs_type& ();
220 
225  operator const row_dofs_type& () const;
226 
230  at2_e3_lite(const value_type& xy_comp,
231  const value_type& xz_comp,
232  const value_type& yz_comp);
233 
235 
239  virtual void put_components(const value_type& xy_comp,
240  const value_type& xz_comp,
241  const value_type& yz_comp);
242 
243 protected:
244 
248  row_dofs_type _row_dofs;
249 
250 private:
251 
253 
254 
255  //============================================================================
257  //============================================================================
259 
260 public:
261 protected:
262 private:
263 
265 
266 
267 
268  //============================================================================
270  //============================================================================
272 
273 public:
274 protected:
275 private:
276 
278 
279 
280  //============================================================================
282  //============================================================================
284 
285 public:
286 
291 
295  virtual int dd() const;
296 
297 protected:
298 private:
299 
301 
302 
303  //============================================================================
305  //============================================================================
307 
308 public:
309 
314  virtual const tp_lite& tp_prototype(int xp) const;
315 
320  virtual const atp_lite& atp_prototype(int xp) const;
321 
326  virtual const stp_lite& stp_prototype(int xp) const;
327 
328 protected:
329 private:
330 
332 
333 
334  //============================================================================
336  //============================================================================
338 
339 public:
340 protected:
341 private:
342 
344 
345 
346  //============================================================================
348  //============================================================================
350 
351 public:
352 
356  virtual const std::string& class_name() const;
357 
361  static const std::string& static_class_name();
362 
366  virtual at2_e3_lite* clone() const;
367 
372  virtual at2_e3_lite* clone(bool xnew_state, bool xauto_access) const
373  {
374  return clone();
375  }
376 
377 protected:
378 private:
379 
381 
382 
383  //============================================================================
385  //============================================================================
387 
388 public:
389 
393  virtual bool is_ancestor_of(const any_lite& xother) const;
394 
398  bool invariant() const;
399 
403  virtual void* row_dofs();
404 
408  virtual const void* row_dofs() const;
409 
410 protected:
411 private:
412 
414 };
415 
416 //==============================================================================
417 // CLASS AT2_E3
418 //==============================================================================
419 
424 class SHEAF_DLL_SPEC at2_e3 : public at2
425 {
426  // ===========================================================
428  // ===========================================================
430 
431 public:
432 
436  static const poset_path& standard_schema_path();
437 
441  static void make_standard_schema(namespace_poset& xns);
442 
448  static host_type& new_host(namespace_type& xns,
449  const poset_path& xhost_path,
450  const poset_path& xschema_path,
451  const poset_path& xvector_space_path,
452  bool xauto_access);
453 
460  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
461 
462 protected:
463 
464 private:
465 
467 
468 
469  //============================================================================
471  //============================================================================
473 
474 public:
475 
476  // Typedefs:
477 
482 
487 
492 
497 
501  at2_e3();
502 
507  at2_e3(const poset_state_handle* xhost, pod_index_type xhub_id);
508 
513  at2_e3(const poset_state_handle* xhost, const scoped_index& xid);
514 
519  at2_e3(const poset_state_handle* xhost, const std::string& xname);
520 
524  explicit at2_e3(abstract_poset_member* xother);
525 
529  at2_e3(poset_state_handle* xhost, bool xauto_access = true);
530 
534  at2_e3(poset_state_handle& xhost,
535  const row_dofs_type& xrdt,
536  bool xauto_access = true);
537 
541  at2_e3& operator=(const row_dofs_type& xrdt);
542 
546  virtual at2_e3& operator=(const abstract_poset_member& xother);
547 
551  at2_e3& operator=(const at2_e3& xother);
552 
556  ~at2_e3();
557 
561  virtual const volatile_type& lite_prototype() const;
562 
566  virtual volatile_type* lite_type() const;
567 
568  //============================================================================
569  // ROW DOF TUPLE RELATED MEMBER FUNCTIONS
570  //============================================================================
571 
572  using at2::put_components;
573 
577  virtual void put_components(dof_type xy_comp,
578  dof_type xz_comp,
579  dof_type yz_comp);
580 
585  operator row_dofs_type& ();
586 
591  operator const row_dofs_type& () const;
592 
593 protected:
594 private:
595 
597 
598 
599  //============================================================================
601  //============================================================================
603 
604 public:
605 protected:
606 private:
607 
609 
610 
611  //============================================================================
613  //============================================================================
615 
616 public:
617 protected:
618 private:
619 
621 
622 
623  //============================================================================
625  //============================================================================
627 
628 public:
629 protected:
630 private:
631 
633 
634 
635  //============================================================================
637  //============================================================================
639 
640 public:
641 protected:
642 private:
643 
645 
646 
647  //============================================================================
649  //============================================================================
651 
652 public:
653 
658  virtual tp* new_tp(int xp, bool xauto_access) const;
659 
664  virtual atp* new_atp(int xp, bool xauto_access) const;
665 
670  virtual stp* new_stp(int xp, bool xauto_access) const;
671 
672 protected:
673 private:
674 
676 
677 
678  //============================================================================
680  //============================================================================
682 
683 public:
684 
688  virtual const std::string& class_name() const;
689 
693  static const std::string& static_class_name();
694 
698  virtual at2_e3* clone() const;
699 
705  inline at2_e3* clone(bool xnew_state, bool xauto_access = true) const
706  {
707  return static_cast<at2_e3*>(at2::clone(xnew_state, xauto_access));
708  }
709 
710 protected:
711 private:
712 
714 
715 
716 
717  //============================================================================
719  //============================================================================
721 
722 public:
723 
727  bool is_ancestor_of(const any* xother) const;
728 
732  bool invariant() const;
733 
734 protected:
735 private:
736 
738 };
739 
740 //==============================================================================
741 // NON-MEMBER FUNCTIONS
742 //==============================================================================
743 
747 template <typename T>
748 std::ostream& operator<<(std::ostream& xos, const at2_e3_row_dofs_type<T>& xrdt);
749 
750 //==============================================================================
751 
752 class at0;
753 class at0_lite;
754 class e3;
755 class e3_lite;
756 
757 namespace atp_algebra
758 {
759 
764 SHEAF_DLL_SPEC void hook(const e3& x0, const e3& x1, at0& xresult, bool xauto_access);
765 
770 SHEAF_DLL_SPEC void hook(const e3_lite& x0, const e3_lite& x1, at0_lite& xresult);
771 
776 SHEAF_DLL_SPEC void hook(const at2_e3& x0, const e3& x1, e3& xresult, bool xauto_access);
777 
782 SHEAF_DLL_SPEC void hook(const at2_e3_lite& x0, const e3_lite& x1, e3_lite& xresult);
783 
788 SHEAF_DLL_SPEC void star(const at2_e3& x0, e3& xresult, bool xauto_access);
789 
794 SHEAF_DLL_SPEC void star(const at2_e3_lite& x0, e3_lite& xresult);
795 
800 SHEAF_DLL_SPEC e3_lite* star(const at2_e3_lite& x0);
801 
806 SHEAF_DLL_SPEC void star(const e3& x0, at2_e3& xresult, bool xauto_access);
807 
812 SHEAF_DLL_SPEC void star(const e3_lite& x0, at2_e3_lite& xresult);
813 
818 SHEAF_DLL_SPEC at2_e3_lite* star(const e3_lite& x0);
819 
824 SHEAF_DLL_SPEC void wedge(const e3& x0, const e3& x1, at2_e3& xresult, bool xauto_access);
825 
830 SHEAF_DLL_SPEC void wedge(const e3_lite& x0, const e3_lite& x1, at2_e3_lite& xresult);
831 
832 } // namespace atp_algebra
833 
834 } // namespace fiber_bundle
835 
836 
837 #endif // ifndef AT2_E3_H
A symmetric tensor of degree p over an abstract vector space.
Definition: stp.h:190
An antisymmetric tensor of degree p.
Definition: atp.h:190
at2_e3_lite volatile_type
The associated volatile type.
Definition: at2_e3.h:486
Euclidean vector space of dimension 3 (volatile version).
Definition: e3.h:116
static const std::string & static_class_name()
The name of this class.
Definition: at2_e3.impl.h:42
at2_e3_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: at2_e3.h:113
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (persistent version)...
Definition: at2_e3.h:424
The default name space; a poset which contains other posets as members.
at2_e3_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: at2_e3.h:63
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
Antisymmetric matrix with 3 rows and 3 columns.
A client handle for a general, abstract partially order set.
at2_e3 * 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: at2_e3.h:705
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
row_dofs_type _row_dofs
Row_dofs_type.
Definition: at2_e3.h:248
at2_e3_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: at2_e3.h:156
at2_e3_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: at2_e3.h:481
e3 vector_space_type
Type of underlying vector space.
Definition: at2_e3.h:491
virtual void put_components(const dof_type xcomps[], int xcomps_dimension)
Set values of all the components to the values in xcomps.
Definition: vd.cc:278
Euclidean vector space of dimension 3 (persistent version).
Definition: e3.h:467
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
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
Abstract base class with useful features for all objects.
Definition: any.h:39
T components[3]
The xy, xz, yz dofs.
Definition: at2_e3.h:125
at2_e3_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: at2_e3.h:161
An abstract antisymmetric tensor space of degree p.
Definition: atp_space.h:42
Row dofs type for class at2_e3.
Definition: at2_e3.h:51
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
e3_lite vector_space_type
Type of underlying vector space.
Definition: at2_e3.h:290
Antisymetric tensor of degree 0 (volatile version).
Definition: at0.h:127
at2_e3_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: at2_e3.impl.h:154
SHEAF_DLL_SPEC tensor_variance hook(const tensor_variance &x0)
The variance of the hook of a tensor with variance x0.
virtual at2 * clone() const
Make a new handle, no state instance of current.
Definition: at2.cc:1040
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: at2_e3.impl.h:82
T dof_type
The type of the dofs.
Definition: at2_e3.h:58
static int d()
The dimension of the row dof components.
Definition: at2_e3.impl.h:62
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: at2.h:56
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (volatile version)...
Definition: at2_e3.h:142
A general antisymmetric tensor of degree 2 over an abstract vector space (volatile version)...
Definition: at2.h:43
SHEAF_DLL_SPEC tensor_variance wedge(const tensor_variance &x0, const tensor_variance &x1)
The variance of the wedge of a tensor with variance x0 with a tnesor with variance x1...
virtual at2_e3_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: at2_e3.h:372
An abstract client handle for a member of a poset.
at2_e3_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: at2_e3.h:496
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
SHEAF_DLL_SPEC tensor_variance star(const tensor_variance &x0, int xdd)
The variance of the Hodge star of a tensor with variance x0 over a vector space of dimension xdd...
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
void put_components(const dof_type comps[], int comps_dimension)
Sets values of all the components to the values in comps.
Definition: vd.cc:1252
Namespace for the fiber_bundles component of the sheaf system.
A general antisymmetric tensor of degree 2 over an abstract vector space.
Definition: at2.h:233
antisymmetric_matrix_3x3< T > matrix_type
The type of the associated matrix.
Definition: at2_e3.h:68