SheafSystem  0.0.0.0
met_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 MET_E3_H
22 #define MET_E3_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef MET_ED_H
29 #include "SheafSystem/met_ed.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 //==============================================================================
44 // CLASS MET_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 met_e3_row_dofs_type<T>::matrix_type& ();
97 
102  operator const typename met_e3_row_dofs_type<T>::matrix_type& () const;
103 
108 
113  met_e3_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
114  {
115  return clone();
116  }
117 
130 
131 protected:
132 private:
133 
134 };
135 
136 
137 //==============================================================================
138 // CLASS MET_E3_LITE
139 //==============================================================================
140 
145 class SHEAF_DLL_SPEC met_e3_lite : public met_ed_lite
146 {
147  //============================================================================
149  //============================================================================
151 
152 public:
153 
154  // Typedefs:
155 
160 
165 
170 
174  met_e3_lite();
175 
179  met_e3_lite(const met_e3_lite& xother);
180 
184  met_e3_lite& operator=(const met_e3_lite& xother);
185 
189  virtual ~met_e3_lite();
190 
194  met_e3_lite(const row_dofs_type& xrow_dofs);
195 
199  met_e3_lite& operator=(const row_dofs_type& xrow_dofs);
200 
204  met_e3_lite(const matrix_type& xmatrix);
205 
209  met_e3_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 
239  met_e3_lite(const value_type& xx_comp,
240  const value_type& xy_comp,
241  const value_type& xz_comp,
242  const value_type& yy_comp,
243  const value_type& yz_comp,
244  const value_type& zz_comp);
245 
247 
251  virtual void put_components(const value_type& xx_comp,
252  const value_type& xy_comp,
253  const value_type& xz_comp,
254  const value_type& yy_comp,
255  const value_type& yz_comp,
256  const value_type& zz_comp);
257 
258 protected:
259 
263  row_dofs_type _row_dofs;
264 
265 private:
266 
268 
269 
270  //============================================================================
272  //============================================================================
274 
275 public:
276 protected:
277 private:
278 
280 
281 
283 
284 
285  //============================================================================
287  //============================================================================
289 
290 public:
291 protected:
292 private:
293 
295 
296 
297  //============================================================================
299  //============================================================================
301 
302 public:
303 protected:
304 private:
305 
307 
308 
309  //============================================================================
311  //============================================================================
313 
314 public:
315 protected:
316 private:
317 
319 
320 
321  //============================================================================
323  //============================================================================
325 
326 public:
327 
331  virtual int dd() const;
332 
333 protected:
334 private:
335 
337 
338 
339  //============================================================================
341  //============================================================================
343 
344 public:
345 
350  virtual const tp_lite& tp_prototype(int xp) const;
351 
356  virtual const atp_lite& atp_prototype(int xp) const;
357 
362  virtual const stp_lite& stp_prototype(int xp) const;
363 
364 protected:
365 private:
366 
368 
369 
370  //============================================================================
372  //============================================================================
374 
375 public:
376 protected:
377 private:
378 
380 
381 
382  //============================================================================
384  //============================================================================
386 
387 public:
388 
392  virtual const std::string& class_name() const;
393 
397  static const std::string& static_class_name();
398 
402  virtual met_e3_lite* clone() const;
403 
408  virtual met_e3_lite* clone(bool xnew_state, bool xauto_access) const
409  {
410  return clone();
411  }
412 
413 protected:
414 private:
415 
417 
418 
419  //============================================================================
421  //============================================================================
423 
424 public:
425 
429  virtual bool is_ancestor_of(const any_lite& xother) const;
430 
434  bool invariant() const;
435 
439  virtual void* row_dofs();
440 
444  virtual const void* row_dofs() const;
445 
446 protected:
447 private:
448 
450 };
451 
452 
453 //==============================================================================
454 // CLASS MET_E3
455 //==============================================================================
456 
461 class SHEAF_DLL_SPEC met_e3 : public met_ed
462 {
463 
464  // ===========================================================
466  // ===========================================================
468 
469 public:
470 
474  static const poset_path& standard_schema_path();
475 
479  static void make_standard_schema(namespace_poset& xns);
480 
486  static host_type& new_host(namespace_type& xns,
487  const poset_path& xhost_path,
488  const poset_path& xschema_path,
489  const poset_path& xvector_space_path,
490  bool xauto_access);
491 
498  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
499 
500 protected:
501 
502 private:
503 
505 
506 
507  //============================================================================
509  //============================================================================
511 
512 public:
513 
514  // Typedefs:
515 
520 
525 
530 
534  met_e3();
535 
536  // New handle/old state constructors.
537 
542  met_e3(const poset_state_handle* xhost, pod_index_type xhub_id);
543 
548  met_e3(const poset_state_handle* xhost, const scoped_index& xid);
549 
554  met_e3(const poset_state_handle* xhost, const std::string& xname);
555 
559  explicit met_e3(abstract_poset_member* xother);
560 
564  met_e3(poset_state_handle* xhost, bool xauto_access = true);
565 
569  met_e3(poset_state_handle& xhost,
570  const row_dofs_type& xrdt,
571  bool xauto_access = true);
572 
576  met_e3& operator=(const row_dofs_type& xrdt);
577 
581  virtual met_e3& operator=(const abstract_poset_member& xother);
582 
586  met_e3& operator=(const met_e3& xother);
587 
591  ~met_e3();
592 
596  virtual const volatile_type& lite_prototype() const;
597 
601  virtual volatile_type* lite_type() const;
602 
607  operator row_dofs_type& ();
608 
613  operator const row_dofs_type& () const;
614 
615 protected:
616 private:
617 
619 
620 
621  //============================================================================
623  //============================================================================
625 
626 public:
627 protected:
628 private:
629 
631 
632 
633 
634  //============================================================================
636  //============================================================================
638 
639 public:
640 protected:
641 private:
642 
644 
645 
646  //============================================================================
648  //============================================================================
650 
651 public:
652 protected:
653 private:
654 
656 
657 
658  //============================================================================
660  //============================================================================
662 
663 public:
664 protected:
665 private:
666 
668 
669 
670  //============================================================================
672  //============================================================================
674 
675 public:
676 protected:
677 private:
678 
680 
681 
682  //============================================================================
684  //============================================================================
686 
687 public:
688 protected:
689 private:
690 
692 
693 
694  //============================================================================
696  //============================================================================
698 
699 public:
700 
705  virtual tp* new_tp(int xp, bool xauto_access) const;
706 
711  virtual atp* new_atp(int xp, bool xauto_access) const;
712 
717  virtual stp* new_stp(int xp, bool xauto_access) const;
718 
719 protected:
720 private:
721 
723 
724 
725  //============================================================================
727  //============================================================================
729 
730 public:
731 
735  virtual const std::string& class_name() const;
736 
740  static const std::string& static_class_name();
741 
745  virtual met_e3* clone() const;
746 
752  inline met_e3* clone(bool xnew_state, bool xauto_access = true) const
753  {
754  return static_cast<met_e3*>(met_ed::clone(xnew_state, xauto_access));
755  }
756 
757 protected:
758 private:
759 
761 
762 
763 
764  //============================================================================
766  //============================================================================
768 
769 public:
770 
774  bool is_ancestor_of(const any* xother) const;
775 
779  bool invariant() const;
780 
781 protected:
782 private:
783 
785 };
786 
787 //==============================================================================
788 // NON-MEMBER FUNCTIONS
789 //==============================================================================
790 
794 template <typename T>
795 std::ostream& operator<<(std::ostream& xos, const met_e3_row_dofs_type<T>& xrdt);
796 
797 namespace met_algebra
798 {
799 
803 SHEAF_DLL_SPEC void raise(const met_e3& xmetric, const e3& xcovector, e3& xresult,
804  bool xauto_access);
805 
809 SHEAF_DLL_SPEC void lower(const met_e3& xmetric, const e3& xvector, e3& xresult,
810  bool xauto_access);
811 
815 SHEAF_DLL_SPEC void raise(const met_e3_lite& xmetric, const e3_lite& xcovector,
816  e3_lite& xresult);
817 
821 SHEAF_DLL_SPEC e3_lite* raise(const met_e3_lite& xmetric, const e3_lite& xcovector);
822 
826 SHEAF_DLL_SPEC void lower(const met_e3_lite& xmetric, const e3_lite& xvector,
827  e3_lite& xresult);
828 
832 SHEAF_DLL_SPEC e3_lite* lower(const met_e3_lite& xmetric, const e3_lite& xvector);
833 
834 } // namespace met_algebra
835 
836 } // namespace fiber_bundle
837 
838 
839 #endif // ifndef MET_E3_H
SHEAF_DLL_SPEC tensor_variance lower(const tensor_variance &x0, int xi)
The variance of the lower of a tensor with variance x0 on index xi.
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
row_dofs_type _row_dofs
Row_dofs_type.
Definition: met_e3.h:263
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: st2.h:56
A metric tensor over a 1 dimensional Euclidean vector space (volatile version).
Definition: met_e3.h:145
virtual met_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: met_e3.h:408
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.
e3_lite vector_space_type
Type of underlying vector space.
Definition: met_e3.h:164
A metric tensor over a d-dimensional Euclidean vector space (persistent version). ...
Definition: met_ed.h:215
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
T components[6]
The xx, xy and yy dofs.
Definition: met_e3.h:129
static const std::string & static_class_name()
The name of this class.
Definition: met_e3.impl.h:42
A metric tensor over a d-dimensional Euclidean vector space (volatile version).
Definition: met_ed.h:43
met_e3_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: met_e3.h:63
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
e3 vector_space_type
Type of underlying vector space.
Definition: met_e3.h:529
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).
met_e3_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: met_e3.impl.h:156
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
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: met_e3.impl.h:82
T dof_type
The type of the dofs.
Definition: met_e3.h:58
Row dofs type for class met_e3.
Definition: met_e3.h:51
met_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: met_e3.h:113
met_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: met_e3.h:752
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
A metric tensor over a 3 dimensional Euclidean vector space (persistent version). ...
Definition: met_e3.h:461
static int d()
The dimension of the row dof components.
Definition: met_e3.impl.h:62
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
symmetric_matrix_3x3< T > matrix_type
The type of the associated matrix.
Definition: met_e3.h:68
An abstract client handle for a member of a poset.
met_e3_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: met_e3.h:519
virtual met_ed * clone() const
Make a new handle, no state instance of current.
Definition: met_ed.cc:777
met_e3_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: met_e3.h:159
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
Namespace for the fiber_bundles component of the sheaf system.
met_e3_lite volatile_type
The associated volatile type.
Definition: met_e3.h:524
met_e3_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: met_e3.h:169
Symmetric matrix with 3 rows and 3 columns.