SheafSystem  0.0.0.0
st2_e2.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 ST2_E2_H
22 #define ST2_E2_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ST2_H
29 #include "SheafSystem/st2.h"
30 #endif
31 
32 #ifndef SYMMETRIC_MATRIX_2X2_H
33 #include "SheafSystem/symmetric_matrix_2x2.h"
34 #endif
35 
36 #ifndef E2_H
37 #include "SheafSystem/e2.h"
38 #endif
39 
40 namespace fiber_bundle
41 {
42 
43 class gl2_lite;
44 
45 //==============================================================================
46 // CLASS ST2_E2_ROW_DOFS_TYPE
47 //==============================================================================
48 
52 template <typename T>
54 {
55 public:
56 
60  typedef T dof_type;
61 
66 
71 
75  static const std::string& static_class_name();
76 
80  static int d();
81 
86  T& operator[] (int xindex);
87 
92  const T& operator[] (int xindex) const;
93 
98  operator typename st2_e2_row_dofs_type<T>::matrix_type& ();
99 
104  operator const typename st2_e2_row_dofs_type<T>::matrix_type& () const;
105 
110 
115  st2_e2_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
116  {
117  return clone();
118  }
119 
123  //st2_e2_row_dofs_type<T>& operator=(const dof_type* xcomponents);
124 
133 
134 protected:
135 private:
136 
137 };
138 
139 
140 //==============================================================================
141 // CLASS ST2_E2_LITE
142 //==============================================================================
143 
144 class e2_lite;
145 
150 class SHEAF_DLL_SPEC st2_e2_lite : public st2_lite
151 {
152  //============================================================================
154  //============================================================================
156 
157 public:
158 
159  // Typedefs:
160 
165 
170 
174  st2_e2_lite();
175 
179  st2_e2_lite(const st2_e2_lite& xother);
180 
184  st2_e2_lite& operator=(const st2_e2_lite& xother);
185 
189  virtual ~st2_e2_lite();
190 
194  st2_e2_lite(const row_dofs_type& xrow_dofs);
195 
199  st2_e2_lite& operator=(const row_dofs_type& xrow_dofs);
200 
204  st2_e2_lite(const matrix_type& xmatrix);
205 
209  st2_e2_lite& operator=(const matrix_type& xmatrix);
210 
215  operator matrix_type& ();
216 
221  operator const matrix_type& () const;
222 
227  operator row_dofs_type& ();
228 
233  operator const row_dofs_type& () const;
234 
238  st2_e2_lite(const value_type& xx_comp,
239  const value_type& xy_comp,
240  const value_type& yy_comp);
241 
243 
247  virtual void put_components(const value_type& xx_comp,
248  const value_type& xy_comp,
249  const value_type& yy_comp);
250 
251 protected:
252 
256  row_dofs_type _row_dofs;
257 
258 private:
259 
261 
262 
263  //============================================================================
265  //============================================================================
267 
268 public:
269 protected:
270 private:
271 
273 
274 
275  //============================================================================
277  //============================================================================
279 
280 public:
281 protected:
282 private:
283 
285 
286 
287  //============================================================================
289  //============================================================================
291 
292 public:
293 
298 
302  virtual int dd() const;
303 
304 protected:
305 private:
306 
308 
309 
310  //============================================================================
312  //============================================================================
314 
315 public:
316 
321  virtual const tp_lite& tp_prototype(int xp) const;
322 
327  virtual const atp_lite& atp_prototype(int xp) const;
328 
333  virtual const stp_lite& stp_prototype(int xp) const;
334 
335 protected:
336 private:
337 
339 
340 
341  //============================================================================
343  //============================================================================
345 
346 public:
347 protected:
348 private:
349 
351 
352 
353  //============================================================================
355  //============================================================================
357 
358 public:
359 
363  virtual const std::string& class_name() const;
364 
368  static const std::string& static_class_name();
369 
373  virtual st2_e2_lite* clone() const;
374 
379  virtual st2_e2_lite* clone(bool xnew_state, bool xauto_access) const
380  {
381  return clone();
382  }
383 
384 protected:
385 private:
386 
388 
389 
390  //============================================================================
392  //============================================================================
394 
395 public:
396 
400  virtual bool is_ancestor_of(const any_lite& xother) const;
401 
405  bool invariant() const;
406 
410  virtual void* row_dofs();
411 
415  virtual const void* row_dofs() const;
416 
417 protected:
418 private:
419 
421 };
422 
423 //==============================================================================
424 // CLASS ST2_E2
425 //==============================================================================
426 
431 class SHEAF_DLL_SPEC st2_e2 : public st2
432 {
433  // ===========================================================
435  // ===========================================================
437 
438 public:
439 
443  static const poset_path& standard_schema_path();
444 
448  static void make_standard_schema(namespace_poset& xns);
449 
455  static host_type& new_host(namespace_type& xns,
456  const poset_path& xhost_path,
457  const poset_path& xschema_path,
458  const poset_path& xvector_space_path,
459  bool xauto_access);
460 
467  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
468 
469 protected:
470 
471 private:
472 
474 
475 
476  //============================================================================
478  //============================================================================
480 
481 public:
482 
483  // Typedefs:
484 
489 
494 
499 
504  virtual tp* new_tp(int xp, bool xauto_access) const;
505 
510  virtual atp* new_atp(int xp, bool xauto_access) const;
511 
516  virtual stp* new_stp(int xp, bool xauto_access) const;
517 
521  st2_e2();
522 
527  st2_e2(const poset_state_handle* xhost, pod_index_type xhub_id);
528 
533  st2_e2(const poset_state_handle* xhost, const scoped_index& xid);
534 
539  st2_e2(const poset_state_handle* xhost, const std::string& xname);
540 
544  explicit st2_e2(abstract_poset_member* xother);
545 
549  st2_e2(poset_state_handle* xhost, bool xauto_access = true);
550 
554  st2_e2(poset_state_handle& xhost,
555  const row_dofs_type& xrdt,
556  bool xauto_access = true);
557 
561  st2_e2& operator=(const row_dofs_type& xrdt);
562 
566  virtual st2_e2& operator=(const abstract_poset_member& xother);
567 
571  st2_e2& operator=(const st2_e2& xother);
572 
576  ~st2_e2();
577 
581  virtual const volatile_type& lite_prototype() const;
582 
586  virtual volatile_type* lite_type() const;
587 
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 st2::put_components;
639 
643  virtual void put_components(dof_type xx_comp,
644  dof_type xy_comp,
645  dof_type yy_comp);
646 
651  operator row_dofs_type& ();
652 
657  operator const row_dofs_type& () const;
658 
659 protected:
660 private:
661 
663 
664 
665  //============================================================================
667  //============================================================================
669 
670 public:
671 protected:
672 private:
673 
675 
676 
677  //============================================================================
679  //============================================================================
681 
682 public:
683 
687  virtual const std::string& class_name() const;
688 
692  static const std::string& static_class_name();
693 
697  virtual st2_e2* clone() const;
698 
704  inline st2_e2* clone(bool xnew_state, bool xauto_access = true) const
705  {
706  return static_cast<st2_e2*>(st2::clone(xnew_state, xauto_access));
707  }
708 
709 protected:
710 private:
711 
713 
714 
715  //============================================================================
717  //============================================================================
719 
720 public:
721 
725  bool is_ancestor_of(const any* xother) const;
726 
730  bool invariant() const;
731 
732 
733 protected:
734 private:
735 
737 };
738 
739 //==============================================================================
740 // NON-MEMBER FUNCTIONS
741 //==============================================================================
742 
743 
747 template <typename T>
748 std::ostream& operator<<(std::ostream& xos, const st2_e2_row_dofs_type<T>& xrdt);
749 
750 
751 //==============================================================================
752 // ST2 FACET
753 //==============================================================================
754 
755 namespace st2_algebra
756 {
757 
758 #ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
759 
764 SHEAF_DLL_SPEC void determinant(const st2_e2& x0, vd_value_type& xresult, bool xauto_access);
765 
770 SHEAF_DLL_SPEC vd_value_type determinant(const st2_e2& x0, bool xauto_access);
771 
776 SHEAF_DLL_SPEC void determinant(const st2_e2_lite& x0, vd_value_type& xresult);
777 
782 SHEAF_DLL_SPEC vd_value_type determinant(const st2_e2_lite& x0);
783 
784 #endif // ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
785 
786 // ===========================================================
787 // TEMPLATE SPECIALIZATIONS
788 // ===========================================================
789 
795 template <> SHEAF_DLL_SPEC void to_principal_axes(const st2_e2_lite& xlite, gl2_lite& xtransform, st2_e2_lite& xresult);
796 
805 template <> SHEAF_DLL_SPEC void to_principal_axes(const st2_e2_lite& xlite, const st2_e2_lite& xpd_lite, gl2_lite& xtransform, st2_e2_lite& xresult);
806 
807 } // namespace st2_algebra
808 
809 } // namespace fiber_bundle
810 
811 #endif // ifndef ST2_E2_H
e2 vector_space_type
Type of underlying vector space.
Definition: st2_e2.h:498
st2_e2_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: st2_e2.h:65
A symmetric tensor of degree p over an abstract vector space.
Definition: stp.h:190
e2_lite vector_space_type
Type of underlying vector space.
Definition: st2_e2.h:297
row_dofs_type::matrix_type matrix_type
The type of the associated matrix.
Definition: st2_e2.h:169
row_dofs_type _row_dofs
Row_dofs_type.
Definition: st2_e2.h:256
An antisymmetric tensor of degree p.
Definition: atp.h:190
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: st2.h:56
Euclidean vector space of dimension 2 (persistent version).
Definition: e2.h:405
T dof_type
The type of the dofs.
Definition: st2_e2.h:60
The default name space; a poset which contains other posets as members.
st2_e2_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: st2_e2.h:164
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
st2_e2_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: st2_e2.h:115
Row dofs type for class st2_e2.
Definition: st2_e2.h:53
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
virtual st2 * clone() const
Make a new handle, no state instance of current.
Definition: st2.cc:999
SHEAF_DLL_SPEC void to_principal_axes(const st2_e2_lite &xlite, const st2_e2_lite &xpd_lite, gl2_lite &xtransform, st2_e2_lite &xresult)
Computes the principal axes basis for xlite and an associated positive definite tensor xpd_lite...
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
static int d()
The dimension of the row dof components.
Definition: st2_e2.impl.h:73
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
st2_e2_lite volatile_type
The associated volatile type.
Definition: st2_e2.h:493
static const std::string & static_class_name()
The name of this class.
Definition: st2_e2.impl.h:53
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
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: st2_e2.impl.h:89
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
A general symmetric tensor of degree 2 over an abstract vector space (volatile version).
Definition: st2.h:43
The mathematical group GL(2, R). The group of all invertible, linear transformations on the R2...
Definition: gl2.h:173
Euclidean vector space of dimension 2 (volatile version).
Definition: e2.h:112
st2_e2 * 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: st2_e2.h:704
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
Symmetric matrix with 2 rows and 2 columns.
T components[3]
Assignment to array of type dof_type.
Definition: st2_e2.h:132
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
void determinant(const S0 &x0, SR &xresult, bool xauto_access)
Definition: sec_st2.impl.h:131
st2_e2_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: st2_e2.impl.h:160
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 2 (persistent version)...
Definition: st2_e2.h:431
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 2 (volatile version)...
Definition: st2_e2.h:150
symmetric_matrix_2x2< T > matrix_type
The type of the associated matrix.
Definition: st2_e2.h:70
An abstract client handle for a member of a poset.
virtual st2_e2_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: st2_e2.h:379
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
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
An abstract symmetric tensor space of degree p.
Definition: stp_space.h:42
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 symmetric tensor of degree 2 over an abstract vector space (persistent version).
Definition: st2.h:234
st2_e2_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: st2_e2.h:488
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: fiber_bundle.h:63