SheafSystem  0.0.0.0
st2_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 ST2_E3_H
22 #define ST2_E3_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_3X3_H
33 #include "SheafSystem/symmetric_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 class gl3_lite;
44 
45 //==============================================================================
46 // CLASS ST2_E3_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_e3_row_dofs_type<T>::matrix_type& ();
99 
104  operator const typename st2_e3_row_dofs_type<T>::matrix_type& () const;
105 
110 
115  st2_e3_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
116  {
117  return clone();
118  }
119 
131 
132 protected:
133 private:
134 
135 };
136 
137 
138 //==============================================================================
139 // CLASS ST2_E3_LITE
140 //==============================================================================
141 
142 class e3_lite;
143 
148 class SHEAF_DLL_SPEC st2_e3_lite : public st2_lite
149 {
150  //============================================================================
152  //============================================================================
154 
155 public:
156 
157  // Typedefs:
158 
163 
168 
172  st2_e3_lite();
173 
177  st2_e3_lite(const st2_e3_lite& xother);
178 
182  st2_e3_lite& operator=(const st2_e3_lite& xother);
183 
187  virtual ~st2_e3_lite();
188 
192  st2_e3_lite(const row_dofs_type& xrow_dofs);
193 
197  st2_e3_lite& operator=(const row_dofs_type& xrow_dofs);
198 
202  st2_e3_lite(const matrix_type& xmatrix);
203 
207  st2_e3_lite& operator=(const matrix_type& xmatrix);
208 
213  operator matrix_type& ();
214 
219  operator const matrix_type& () const;
220 
225  operator row_dofs_type& ();
226 
231  operator const row_dofs_type& () const;
232 
236  st2_e3_lite(const value_type& xx, const value_type& xy, const value_type& xz,
237  const value_type& yy, const value_type& yz, const value_type& zz);
238 
239 
241 
245  virtual void put_components(const value_type& xx_comp,
246  const value_type& xy_comp,
247  const value_type& xz_comp,
248  const value_type& yy_comp,
249  const value_type& yz_comp,
250  const value_type& zz_comp);
251 
252 protected:
253 
257  row_dofs_type _row_dofs;
258 
259 private:
260 
262 
263 
264  //============================================================================
266  //============================================================================
268 
269 public:
270 protected:
271 private:
272 
274 
275 
276  //============================================================================
278  //============================================================================
280 
281 public:
282 protected:
283 private:
284 
286 
287 
288  //============================================================================
290  //============================================================================
292 
293 public:
294 
299 
303  virtual int dd() const;
304 
305 protected:
306 private:
307 
309 
310 
311  //============================================================================
313  //============================================================================
315 
316 public:
317 
322  virtual const tp_lite& tp_prototype(int xp) const;
323 
328  virtual const atp_lite& atp_prototype(int xp) const;
329 
334  virtual const stp_lite& stp_prototype(int xp) const;
335 
336 protected:
337 private:
338 
340 
341 
342  //============================================================================
344  //============================================================================
346 
347 public:
348 protected:
349 private:
350 
352 
353 
354  //============================================================================
356  //============================================================================
358 
359 public:
360 
364  virtual const std::string& class_name() const;
365 
369  static const std::string& static_class_name();
370 
374  virtual st2_e3_lite* clone() const;
375 
380  virtual st2_e3_lite* clone(bool xnew_state, bool xauto_access) const
381  {
382  return clone();
383  }
384 
385 protected:
386 private:
387 
389 
390 
391  //============================================================================
393  //============================================================================
395 
396 public:
397 
401  virtual bool is_ancestor_of(const any_lite& xother) const;
402 
406  bool invariant() const;
407 
411  virtual void* row_dofs();
412 
416  virtual const void* row_dofs() const;
417 
418 protected:
419 private:
420 
422 };
423 
424 //==============================================================================
425 // CLASS ST2_E3
426 //==============================================================================
427 
430 
435 class SHEAF_DLL_SPEC st2_e3 : public st2
436 {
437  // ===========================================================
439  // ===========================================================
441 
442 public:
443 
447  static const poset_path& standard_schema_path();
448 
452  static void make_standard_schema(namespace_poset& xns);
453 
459  static host_type& new_host(namespace_type& xns,
460  const poset_path& xhost_path,
461  const poset_path& xschema_path,
462  const poset_path& xvector_space_path,
463  bool xauto_access);
464 
471  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
472 
473 protected:
474 
475 private:
476 
478 
479 
480  //============================================================================
482  //============================================================================
484 
485 public:
486 
487  // Typedefs:
488 
493 
498 
503 
507  st2_e3();
508 
512  st2_e3(poset_state_handle* xhost, bool xauto_access = true);
513 
517  st2_e3(poset_state_handle& xhost,
518  const row_dofs_type& xrdt,
519  bool xauto_access = true);
520 
524  st2_e3& operator=(const row_dofs_type& xrdt);
525 
530  st2_e3(const poset_state_handle* xhost, pod_index_type xhub_id);
531 
536  st2_e3(const poset_state_handle* xhost, const scoped_index& xid);
537 
542  st2_e3(const poset_state_handle* xhost, const std::string& xname);
543 
547  explicit st2_e3(abstract_poset_member* xother);
548 
552  virtual st2_e3& operator=(const abstract_poset_member& xother);
553 
557  st2_e3& operator=(const st2_e3& xother);
558 
562  ~st2_e3();
563 
567  virtual const volatile_type& lite_prototype() const;
568 
572  virtual volatile_type* lite_type() const;
573 
574 
575  using st2::put_components;
576 
580  virtual void put_components(
581  dof_type xx_comp, dof_type xy_comp, dof_type xz_comp,
582  dof_type yy_comp, dof_type yz_comp, dof_type zz_comp);
583 
588  operator row_dofs_type& ();
589 
594  operator const row_dofs_type& () const;
595 
596 protected:
597 private:
598 
600 
601 
602  //============================================================================
604  //============================================================================
606 
607 public:
608 protected:
609 private:
610 
612 
613 
614  //============================================================================
616  //============================================================================
618 
619 public:
620 protected:
621 private:
622 
624 
625 
626  //============================================================================
628  //============================================================================
630 
631 public:
632 protected:
633 private:
634 
636 
637 
638  //============================================================================
640  //============================================================================
642 
643 public:
644 protected:
645 private:
646 
648 
649 
650 
651  //============================================================================
653  //============================================================================
655 
656 public:
657 
662  virtual tp* new_tp(int xp, bool xauto_access) const;
663 
668  virtual atp* new_atp(int xp, bool xauto_access) const;
669 
674  virtual stp* new_stp(int xp, bool xauto_access) const;
675 
676 protected:
677 private:
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 st2_e3* clone() const;
703 
709  inline st2_e3* clone(bool xnew_state, bool xauto_access = true) const
710  {
711  return static_cast<st2_e3*>(st2::clone(xnew_state, xauto_access));
712  }
713 
714 
715 protected:
716 private:
717 
719 
720 
721  //===========================================================================
723  //===========================================================================
725 
726 public:
727 
731  bool is_ancestor_of(const any* other) const;
732 
736  bool invariant() const;
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 st2_e3_row_dofs_type<T>& xrdt);
753 
754 //==============================================================================
755 // VD FACET
756 //==============================================================================
757 
758 namespace vd_algebra
759 {
760 
762 
766 SHEAF_DLL_SPEC void transform_basis_by(st2_e3_lite& xv, const gl3_lite& xtransform, bool is_contravariant);
767 
768 } // namespace vd_algebra
769 
770 //==============================================================================
771 // ST2 FACET
772 //==============================================================================
773 
774 namespace st2_algebra
775 {
776 
777 #ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
778 
783 SHEAF_DLL_SPEC void determinant(const st2_e3& x0, vd_value_type& xresult, bool xauto_access);
784 
789 SHEAF_DLL_SPEC vd_value_type determinant(const st2_e3& x0, bool xauto_access);
790 
795 SHEAF_DLL_SPEC void determinant(const st2_e3_lite& x0, vd_value_type& xresult);
796 
801 SHEAF_DLL_SPEC vd_value_type determinant(const st2_e3_lite& x0);
802 
803 #endif // ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
804 
805 // ===========================================================
806 // TEMPLATE SPECIALIZATIONS
807 // ===========================================================
808 
814 template <> SHEAF_DLL_SPEC void to_principal_axes(const st2_e3_lite& xlite, gl3_lite& xtransform, st2_e3_lite& xresult);
815 
816 } // namespace st2_algebra
817 
818 } // namespace fiber_bundle
819 
820 #endif // ifndef ST2_E3_H
static int d()
The dimension of the row dof components.
Definition: st2_e3.impl.h:70
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
Euclidean vector space of dimension 3 (volatile version).
Definition: e3.h:116
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: st2.h:56
static const std::string & static_class_name()
The name of this class.
Definition: st2_e3.impl.h:50
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...
SHEAF_DLL_SPEC void to_principal_axes(const st2_e3_lite &xlite, gl3_lite &xtransform, st2_e3_lite &xresult)
Computes the principal axes basis for xlite. Returns the diagonalization in xresult and the transform...
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
Row dofs type for class st2_e3.
Definition: st2_e3.h:53
virtual st2 * clone() const
Make a new handle, no state instance of current.
Definition: st2.cc:999
symmetric_matrix_3x3< T > matrix_type
The type of the associated matrix.
Definition: st2_e3.h:70
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
A general symmetric tensor of degree 2 over an abstract vector space (volatile version).
Definition: st2.h:43
T dof_type
The type of the dofs.
Definition: st2_e3.h:60
st2_e3_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: st2_e3.impl.h:157
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 3 (volatile version)...
Definition: st2_e3.h:148
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
st2_e3_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: st2_e3.h:65
virtual st2_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: st2_e3.h:380
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
The mathematical group GL(3, R). The group of all invertible, linear transformations on the R3...
Definition: gl3.h:183
void determinant(const S0 &x0, SR &xresult, bool xauto_access)
Definition: sec_st2.impl.h:131
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
st2_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: st2_e3.h:115
st2_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: st2_e3.h:709
e3_lite vector_space_type
Type of underlying vector space.
Definition: st2_e3.h:298
st2_e3_lite volatile_type
The associated volatile type.
Definition: st2_e3.h:497
An abstract client handle for a member of a poset.
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
st2_e3_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: st2_e3.h:167
T components[6]
The xx, xy, xz, yy, yz, zz dofs.
Definition: st2_e3.h:130
st2_e3_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: st2_e3.h:162
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.
e3 vector_space_type
Type of underlying vector space.
Definition: st2_e3.h:502
A general symmetric tensor of degree 2 over an abstract vector space (persistent version).
Definition: st2.h:234
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: st2_e3.impl.h:86
st2_e3_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: st2_e3.h:492
row_dofs_type _row_dofs
Row_dofs_type.
Definition: st2_e3.h:257
SHEAF_DLL_SPEC void transform_basis_by(st2_e3_lite &xv, const gl3_lite &xtransform, bool is_contravariant)
Transform the basis and components of xv by xtransform.
Definition: st2_e3.cc:1382
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: fiber_bundle.h:63
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 3 (persistent version)...
Definition: st2_e3.h:435
Symmetric matrix with 3 rows and 3 columns.