SheafSystem  0.0.0.0
met_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 MET_E2_H
22 #define MET_E2_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_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 //==============================================================================
44 // CLASS MET_E2_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_e2_row_dofs_type<T>::matrix_type& ();
97 
102  operator const typename met_e2_row_dofs_type<T>::matrix_type& () const;
103 
108 
113  met_e2_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 //==============================================================================
134 // CLASS MET_E2_LITE
135 //==============================================================================
136 
137 
142 class SHEAF_DLL_SPEC met_e2_lite : public met_ed_lite
143 {
144  //============================================================================
146  //============================================================================
148 
149 public:
150 
151  // Typedefs:
152 
157 
162 
167 
171  met_e2_lite();
172 
176  met_e2_lite(const met_e2_lite& xother);
177 
181  met_e2_lite& operator=(const met_e2_lite& xother);
182 
186  virtual ~met_e2_lite();
187 
191  met_e2_lite(const row_dofs_type& xrow_dofs);
192 
196  met_e2_lite& operator=(const row_dofs_type& xrow_dofs);
197 
201  met_e2_lite(const matrix_type& xmatrix);
202 
206  met_e2_lite& operator=(const matrix_type& xmatrix);
207 
212  operator matrix_type& ();
213 
218  operator const matrix_type& () const;
219 
224  operator row_dofs_type& ();
225 
230  operator const row_dofs_type& () const;
231 
235  met_e2_lite(const value_type& xx_comp,
236  const value_type& xy_comp,
237  const value_type& yy_comp);
238 
240 
244  virtual void put_components(const value_type& xx_comp,
245  const value_type& xy_comp,
246  const value_type& yy_comp);
247 
248 protected:
249 
253  row_dofs_type _row_dofs;
254 
255 private:
256 
258 
259 
260  //============================================================================
262  //============================================================================
264 
265 public:
266 protected:
267 private:
268 
270 
271 
272  //============================================================================
274  //============================================================================
276 
277 public:
278 protected:
279 private:
280 
282 
283 
284  //============================================================================
286  //============================================================================
288 
289 public:
290 protected:
291 private:
292 
294 
295 
296  //============================================================================
298  //============================================================================
300 
301 public:
302 protected:
303 private:
304 
306 
307 
308  //============================================================================
310  //============================================================================
312 
313 public:
314 
318  virtual int dd() const;
319 
320 protected:
321 private:
322 
324 
325 
326  //============================================================================
328  //============================================================================
330 
331 public:
332 
337  virtual const tp_lite& tp_prototype(int xp) const;
338 
343  virtual const atp_lite& atp_prototype(int xp) const;
344 
349  virtual const stp_lite& stp_prototype(int xp) const;
350 
351 protected:
352 private:
353 
355 
356 
357  //============================================================================
359  //============================================================================
361 
362 public:
363 protected:
364 private:
365 
367 
368 
369  //============================================================================
371  //============================================================================
373 
374 public:
375 
379  virtual const std::string& class_name() const;
380 
384  static const std::string& static_class_name();
385 
389  virtual met_e2_lite* clone() const;
390 
395  virtual met_e2_lite* clone(bool xnew_state, bool xauto_access) const
396  {
397  return clone();
398  }
399 
400 protected:
401 private:
402 
404 
405 
406  //============================================================================
408  //============================================================================
410 
411 public:
412 
416  virtual bool is_ancestor_of(const any_lite& xother) const;
417 
421  bool invariant() const;
422 
426  virtual void* row_dofs();
427 
431  virtual const void* row_dofs() const;
432 
433 protected:
434 private:
435 
437 };
438 
439 
440 //==============================================================================
441 // CLASS MET_E2
442 //==============================================================================
443 
448 class SHEAF_DLL_SPEC met_e2 : public met_ed
449 {
450  // ===========================================================
452  // ===========================================================
454 
455 public:
456 
460  static const poset_path& standard_schema_path();
461 
465  static void make_standard_schema(namespace_poset& xns);
466 
472  static host_type& new_host(namespace_type& xns,
473  const poset_path& xhost_path,
474  const poset_path& xschema_path,
475  const poset_path& xvector_space_path,
476  bool xauto_access);
477 
484  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
485 
486 protected:
487 
488 private:
489 
491 
492 
493  //============================================================================
495  //============================================================================
497 
498 public:
499 
500  // Typedefs:
501 
506 
511 
516 
520  met_e2();
521 
526  met_e2(const poset_state_handle* xhost, pod_index_type xhub_id);
527 
532  met_e2(const poset_state_handle* xhost, const scoped_index& xid);
533 
538  met_e2(const poset_state_handle* xhost, const std::string& xname);
539 
543  explicit met_e2(abstract_poset_member* xother);
544 
548  met_e2(poset_state_handle* xhost, bool xauto_access = true);
549 
553  met_e2(poset_state_handle& xhost,
554  const row_dofs_type& xrdt,
555  bool xauto_access = true);
556 
560  met_e2& operator=(const row_dofs_type& xrdt);
561 
565  virtual met_e2& operator=(const abstract_poset_member& xother);
566 
570  met_e2& operator=(const met_e2& xother);
571 
575  ~met_e2();
576 
580  virtual const volatile_type& lite_prototype() const;
581 
585  virtual volatile_type* lite_type() const;
586 
587 
592  operator row_dofs_type& ();
593 
598  operator const row_dofs_type& () const;
599 
600 protected:
601 private:
602 
604 
605 
606  //============================================================================
608  //============================================================================
610 
611 public:
612 protected:
613 private:
614 
616 
617 
618  //============================================================================
620  //============================================================================
622 
623 public:
624 protected:
625 private:
626 
628 
629 
630  //============================================================================
632  //============================================================================
634 
635 public:
636 protected:
637 private:
638 
640 
641 
642  //============================================================================
644  //============================================================================
646 
647 public:
648 protected:
649 private:
650 
652 
653 
654  //============================================================================
656  //============================================================================
658 
659 public:
660 protected:
661 private:
662 
664 
665 
666  //============================================================================
668  //============================================================================
670 
671 public:
672 protected:
673 private:
674 
676 
677 
678  //============================================================================
680  //============================================================================
682 
683 public:
684 
689  virtual tp* new_tp(int xp, bool xauto_access) const;
690 
695  virtual atp* new_atp(int xp, bool xauto_access) const;
696 
701  virtual stp* new_stp(int xp, bool xauto_access) const;
702 
703 protected:
704 private:
705 
707 
708 
709  //============================================================================
711  //============================================================================
713 
714 public:
715 
719  virtual const std::string& class_name() const;
720 
724  static const std::string& static_class_name();
725 
729  virtual met_e2* clone() const;
730 
736  inline met_e2* clone(bool xnew_state, bool xauto_access = true) const
737  {
738  return static_cast<met_e2*>(met_ed::clone(xnew_state, xauto_access));
739  }
740 
741 protected:
742 private:
743 
745 
746 
747  //============================================================================
749  //============================================================================
751 
752 public:
753 
757  bool is_ancestor_of(const any* xother) const;
758 
762  bool invariant() const;
763 
764 protected:
765 private:
766 
768 };
769 
770 //==============================================================================
771 // NON-MEMBER FUNCTIONS
772 //==============================================================================
773 
777 template <typename T>
778 std::ostream& operator<<(std::ostream& xos, const met_e2_row_dofs_type<T>& xrdt);
779 
780 namespace met_algebra
781 {
782 
786 SHEAF_DLL_SPEC void raise(const met_e2& xmetric, const e2& xcovector, e2& xresult,
787  bool xauto_access);
788 
792 SHEAF_DLL_SPEC void lower(const met_e2& xmetric, const e2& xvector, e2& xresult,
793  bool xauto_access);
794 
798 SHEAF_DLL_SPEC void raise(const met_e2_lite& xmetric, const e2_lite& xcovector,
799  e2_lite& xresult);
800 
804 SHEAF_DLL_SPEC e2_lite* raise(const met_e2_lite& xmetric, const e2_lite& xcovector);
805 
809 SHEAF_DLL_SPEC void lower(const met_e2_lite& xmetric, const e2_lite& xvector,
810  e2_lite& xresult);
811 
815 SHEAF_DLL_SPEC e2_lite* lower(const met_e2_lite& xmetric, const e2_lite& xvector);
816 
817 } // namespace met_algebra
818 
819 } // namespace fiber_bundle
820 
821 #endif // ifndef MET_E2_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
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
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.
A metric tensor over a d-dimensional Euclidean vector space (persistent version). ...
Definition: met_ed.h:215
met_e2_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: met_e2.h:156
static const std::string & static_class_name()
The name of this class.
Definition: met_e2.impl.h:42
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
met_e2_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: met_e2.h:505
A metric tensor over a d-dimensional Euclidean vector space (volatile version).
Definition: met_ed.h:43
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
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
e2_lite vector_space_type
Type of underlying vector space.
Definition: met_e2.h:161
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Definition: atp.h:44
e2 vector_space_type
Type of underlying vector space.
Definition: met_e2.h:515
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 metric tensor over a 2 dimensional Euclidean vector space (persistent version). ...
Definition: met_e2.h:448
row_dofs_type _row_dofs
Row_dofs_type.
Definition: met_e2.h:253
met_e2_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: met_e2.h:166
Euclidean vector space of dimension 2 (volatile version).
Definition: e2.h:112
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]
The xx, xy and yy dofs.
Definition: met_e2.h:125
met_e2_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: met_e2.impl.h:156
met_e2_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: met_e2.h:63
met_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: met_e2.h:113
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
met_e2_lite volatile_type
The associated volatile type.
Definition: met_e2.h:510
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: met_e2.impl.h:82
static int d()
The dimension of the row dof components.
Definition: met_e2.impl.h:62
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
met_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: met_e2.h:736
virtual met_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: met_e2.h:395
symmetric_matrix_2x2< T > matrix_type
The type of the associated matrix.
Definition: met_e2.h:68
An abstract client handle for a member of a poset.
virtual met_ed * clone() const
Make a new handle, no state instance of current.
Definition: met_ed.cc:777
A metric tensor over a 2 dimensional Euclidean vector space (volatile version).
Definition: met_e2.h:142
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
T dof_type
The type of the dofs.
Definition: met_e2.h:58
An abstract symmetric tensor space of degree p.
Definition: stp_space.h:42
Namespace for the fiber_bundles component of the sheaf system.
Row dofs type for class met_e2.
Definition: met_e2.h:51