SheafSystem  0.0.0.0
met_e1.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_E1_H
22 #define MET_E1_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 E1_H
33 #include "SheafSystem/e1.h"
34 #endif
35 
36 namespace fiber_bundle
37 {
38 
39 //==============================================================================
40 // CLASS MET_E1_ROW_DOFS_TYPE
41 //==============================================================================
42 
46 template <typename T>
48 {
49 public:
50 
54  typedef T dof_type;
55 
60 
64  static const std::string& static_class_name();
65 
69  static int d();
70 
75  T& operator[] (int xindex);
76 
81  const T& operator[] (int xindex) const;
82 
87 
92  met_e1_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
93  {
94  return clone();
95  }
96 
101 
102 protected:
103 private:
104 
105 };
106 
107 
108 //==============================================================================
109 // CLASS MET_E1_LITE
110 //==============================================================================
111 
116 class SHEAF_DLL_SPEC met_e1_lite : public met_ed_lite
117 {
118  //============================================================================
120  //============================================================================
122 
123 public:
124 
125  // Typedefs:
126 
131 
136 
140  met_e1_lite();
141 
145  met_e1_lite(const met_e1_lite& xother);
146 
150  met_e1_lite& operator=(const met_e1_lite& xother);
151 
155  virtual ~met_e1_lite();
156 
160  met_e1_lite(const row_dofs_type& xrow_dofs);
161 
165  met_e1_lite& operator=(const row_dofs_type& xrow_dofs);
166 
171  operator row_dofs_type& ();
172 
177  operator const row_dofs_type& () const;
178 
182  met_e1_lite(const value_type& xx_comp);
183 
186 
190  value_type component() const;
191 
195  void put_component(const value_type& x_comp);
196 
197 protected:
198 
202  row_dofs_type _row_dofs;
203 
204 private:
205 
207 
208 
209  //============================================================================
211  //============================================================================
213 
214 public:
215 protected:
216 private:
217 
219 
220 
221  //============================================================================
223  //============================================================================
225 
226 public:
227 protected:
228 private:
229 
231 
232 
233  //============================================================================
235  //============================================================================
237 
238 public:
239 protected:
240 private:
241 
243 
244 
245  //============================================================================
247  //============================================================================
249 
250 public:
251 protected:
252 private:
253 
255 
256 
257  //============================================================================
259  //============================================================================
261 
262 public:
263 
267  virtual int dd() const;
268 
269 protected:
270 private:
271 
273 
274 
275  //============================================================================
277  //============================================================================
279 
280 public:
281 
286  virtual const tp_lite& tp_prototype(int xp) const;
287 
292  virtual const atp_lite& atp_prototype(int xp) const;
293 
298  virtual const stp_lite& stp_prototype(int xp) const;
299 
300 protected:
301 private:
302 
304 
305 
306  //============================================================================
308  //============================================================================
310 
311 public:
312 protected:
313 private:
314 
316 
317 
318  //============================================================================
320  //============================================================================
322 
323 public:
324 
328  virtual const std::string& class_name() const;
329 
333  static const std::string& static_class_name();
334 
338  virtual met_e1_lite* clone() const;
339 
344  virtual met_e1_lite* clone(bool xnew_state, bool xauto_access) const
345  {
346  return clone();
347  }
348 
349 protected:
350 private:
351 
353 
354 
355  //============================================================================
357  //============================================================================
359 
360 public:
361 
365  virtual bool is_ancestor_of(const any_lite& xother) const;
366 
370  bool invariant() const;
371 
375  virtual void* row_dofs();
376 
380  virtual const void* row_dofs() const;
381 
382 protected:
383 private:
384 
386 };
387 
388 
389 //==============================================================================
390 // CLASS MET_E1
391 //==============================================================================
392 
396 class SHEAF_DLL_SPEC met_e1 : public met_ed
397 {
398  // ===========================================================
400  // ===========================================================
402 
403 public:
404 
408  static const poset_path& standard_schema_path();
409 
413  static void make_standard_schema(namespace_poset& xns);
414 
420  static host_type& new_host(namespace_type& xns,
421  const poset_path& xhost_path,
422  const poset_path& xschema_path,
423  const poset_path& xvector_space_path,
424  bool xauto_access);
425 
432  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
433 
434 protected:
435 
436 private:
437 
439 
440 
441  //============================================================================
443  //============================================================================
445 
446 public:
447 
448  // Typedefs:
449 
454 
459 
464 
468  met_e1();
469 
470  // New handle/old state constructors.
471 
476  met_e1(const poset_state_handle* xhost, pod_index_type xhub_id);
477 
482  met_e1(const poset_state_handle* xhost, const scoped_index& xid);
483 
488  met_e1(const poset_state_handle* xhost, const std::string& xname);
489 
493  explicit met_e1(abstract_poset_member* xother);
494 
498  met_e1(poset_state_handle* xhost, bool xauto_access = true);
499 
503  met_e1(poset_state_handle& xhost,
504  const row_dofs_type& xrdt,
505  bool xauto_access = true);
506 
510  met_e1& operator=(const row_dofs_type& xrdt);
511 
515  virtual met_e1& operator=(const abstract_poset_member& xother);
516 
520  met_e1& operator=(const met_e1& xother);
521 
525  ~met_e1();
526 
530  virtual const volatile_type& lite_prototype() const;
531 
535  virtual volatile_type* lite_type() const;
536 
537 
542  operator row_dofs_type& ();
543 
548  operator const row_dofs_type& () const;
549 
550  //============================================================================
552  //============================================================================
554 
555 public:
556 protected:
557 private:
558 
560 
561 
562  //============================================================================
564  //============================================================================
566 
567 public:
568 protected:
569 private:
570 
572 
573 
574  //============================================================================
576  //============================================================================
577 
579 
580 public:
581 protected:
582 private:
583 
585 
586 
587  //============================================================================
589  //============================================================================
591 
592 public:
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 
634  virtual tp* new_tp(int xp, bool xauto_access) const;
635 
640  virtual atp* new_atp(int xp, bool xauto_access) const;
641 
646  virtual stp* new_stp(int xp, bool xauto_access) const;
647 
648 protected:
649 private:
650 
652 
653 
654  //============================================================================
656  //============================================================================
658 
659 public:
660 
664  virtual const std::string& class_name() const;
665 
669  static const std::string& static_class_name();
670 
674  virtual met_e1* clone() const;
675 
681  inline met_e1* clone(bool xnew_state, bool xauto_access = true) const
682  {
683  return static_cast<met_e1*>(met_ed::clone(xnew_state, xauto_access));
684  }
685 
686 protected:
687 private:
688 
690 
691 
692  //============================================================================
694  //============================================================================
696 
697 public:
698 
702  bool is_ancestor_of(const any* other) const;
703 
707  bool invariant() const;
708 
709 protected:
710 private:
711 
713 };
714 
715 //==============================================================================
716 // NON-MEMBER FUNCTIONS
717 //==============================================================================
718 
722 template <typename T>
723 std::ostream& operator<<(std::ostream& xos, const met_e1_row_dofs_type<T>& xrdt);
724 
725 namespace met_algebra
726 {
727 
731 SHEAF_DLL_SPEC void raise(const met_e1& xmetric, const e1& xcovector, e1& xresult,
732  bool xauto_access);
733 
737 SHEAF_DLL_SPEC void lower(const met_e1& xmetric, const e1& xvector, e1& xresult,
738  bool xauto_access);
739 
743 SHEAF_DLL_SPEC void raise(const met_e1_lite& xmetric, const e1_lite& xcovector,
744  e1_lite& xresult);
745 
749 SHEAF_DLL_SPEC e1_lite* raise(const met_e1_lite& xmetric, const e1_lite& xcovector);
750 
754 SHEAF_DLL_SPEC void lower(const met_e1_lite& xmetric, const e1_lite& xvector,
755  e1_lite& xresult);
756 
760 SHEAF_DLL_SPEC e1_lite* lower(const met_e1_lite& xmetric, const e1_lite& xvector);
761 
762 } // namespace met_algebra
763 
764 } // namespace fiber_bundle
765 
766 #endif // ifndef MET_E1_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
met_e1_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: met_e1.h:130
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
static const std::string & static_class_name()
The name of this class.
Definition: met_e1.impl.h:42
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...
met_e1_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: met_e1.h:453
A client handle for a general, abstract partially order set.
A metric tensor over a 1 dimensional Euclidean vector space.
Definition: met_e1.h:396
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
Row dofs type for class met_e1.
Definition: met_e1.h:47
met_e1 * 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_e1.h:681
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
Definition: st2.cc:145
A metric tensor over a d-dimensional Euclidean vector space (volatile version).
Definition: met_ed.h:43
e1 vector_space_type
Type of underlying vector space.
Definition: met_e1.h:463
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
Euclidean vector space of dimension 1 (persistent version).
Definition: e1.h:400
virtual void put_component(int xrow, int xcolumn, value_type xcomp)
Sets value of a component in a specified row and column.
Definition: st2.cc:167
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 components[1]
The components (row_dofs).
Definition: met_e1.h:100
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
met_e1_lite volatile_type
The associated volatile type.
Definition: met_e1.h:458
met_e1_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_e1.h:92
A metric tensor over a 1 dimensional Euclidean vector space (volatile version).
Definition: met_e1.h:116
met_e1_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: met_e1.h:59
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
e1_lite vector_space_type
Type of underlying vector space.
Definition: met_e1.h:135
met_e1_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: met_e1.impl.h:121
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: met_e1.impl.h:82
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
Euclidean vector space of dimension 1 (volatile version).
Definition: e1.h:113
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 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.
static int d()
The dimension of the row dof components.
Definition: met_e1.impl.h:62
virtual met_e1_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_e1.h:344
row_dofs_type _row_dofs
Row_dofs_type.
Definition: met_e1.h:202
T dof_type
The type of the dofs.
Definition: met_e1.h:54