SheafSystem  0.0.0.0
at3_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 AT3_E3_H
22 #define AT3_E3_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef AT3_H
29 #include "SheafSystem/at3.h"
30 #endif
31 
32 #ifndef E3_H
33 #include "SheafSystem/e3.h"
34 #endif
35 
36 namespace fiber_bundle
37 {
38 
39 //==============================================================================
40 // CLASS AT3_E3_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  at3_e3_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
93  {
94  return clone();
95  }
96 
100 
103 
104 protected:
105 private:
106 
107 };
108 
109 
110 //==============================================================================
111 // CLASS AT3_E3_LITE
112 //==============================================================================
113 
114 class e3_lite;
115 
120 class SHEAF_DLL_SPEC at3_e3_lite : public at3_lite
121 {
122  //============================================================================
124  //============================================================================
126 
127 public:
128 
129  // Typedefs:
130 
135 
139  at3_e3_lite();
140 
144  at3_e3_lite(const at3_e3_lite& xother);
145 
149  at3_e3_lite& operator=(const at3_e3_lite& xother);
150 
154  virtual ~at3_e3_lite();
155 
159  at3_e3_lite(const row_dofs_type& xrow_dofs);
160 
164  at3_e3_lite& operator=(const row_dofs_type& xrow_dofs);
165 
170  operator row_dofs_type& ();
171 
176  operator const row_dofs_type& () const;
177 
181  at3_e3_lite(const value_type& xcomp);
182 
183 
185 
189  virtual void put_components(const value_type& xcomp);
190 
191 protected:
192 
196  row_dofs_type _row_dofs;
197 
198 private:
199 
201 
202 
203  //============================================================================
205  //============================================================================
207 
208 public:
209 protected:
210 private:
211 
213 
214 
215 
216  //============================================================================
218  //============================================================================
220 
221 public:
222 protected:
223 private:
224 
226 
227 
228  //============================================================================
230  //============================================================================
232 
233 public:
234 
239 
243  virtual int dd() const;
244 
245 protected:
246 private:
247 
249 
250 
251  //============================================================================
253  //============================================================================
255 
256 public:
257 
262  virtual const tp_lite& tp_prototype(int xp) const;
263 
268  virtual const atp_lite& atp_prototype(int xp) const;
269 
274  virtual const stp_lite& stp_prototype(int xp) const;
275 
276 protected:
277 private:
278 
280 
281 
282  //============================================================================
284  //============================================================================
286 
287 public:
288 protected:
289 private:
290 
292 
293 
294  //============================================================================
296  //============================================================================
298 
299 public:
300 
304  virtual const std::string& class_name() const;
305 
309  static const std::string& static_class_name();
310 
314  virtual at3_e3_lite* clone() const;
315 
320  virtual at3_e3_lite* clone(bool xnew_state, bool xauto_access) const
321  {
322  return clone();
323  }
324 
325 protected:
326 private:
327 
329 
330 
331  //============================================================================
333  //============================================================================
335 
336 public:
337 
341  virtual bool is_ancestor_of(const any_lite& xother) const;
342 
346  bool invariant() const;
347 
351  virtual void* row_dofs();
352 
356  virtual const void* row_dofs() const;
357 
358 protected:
359 private:
360 
362 };
363 
364 
365 //==============================================================================
366 // CLASS AT3_E3
367 //==============================================================================
368 
372 class SHEAF_DLL_SPEC at3_e3 : public at3
373 {
374  // ===========================================================
376  // ===========================================================
378 
379 public:
380 
384  static const poset_path& standard_schema_path();
385 
389  static void make_standard_schema(namespace_poset& xns);
390 
396  static host_type& new_host(namespace_type& xns,
397  const poset_path& xhost_path,
398  const poset_path& xschema_path,
399  const poset_path& xvector_space_path,
400  bool xauto_access);
401 
408  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
409 
410 protected:
411 
412 private:
413 
415 
416 
417  //============================================================================
419  //============================================================================
421 
422 public:
423 
424  // Typedefs:
425 
430 
435 
440 
444  at3_e3();
445 
450  at3_e3(const poset_state_handle* xhost, pod_index_type xhub_id);
451 
456  at3_e3(const poset_state_handle* xhost, const scoped_index& xid);
457 
462  at3_e3(const poset_state_handle* xhost, const std::string& xname);
463 
467  explicit at3_e3(abstract_poset_member* xother);
468 
472  at3_e3(poset_state_handle* xhost, bool xauto_access = true);
473 
477  at3_e3(poset_state_handle& xhost,
478  const row_dofs_type& xrdt,
479  bool xauto_access = true);
480 
484  at3_e3& operator=(const row_dofs_type& xrdt);
485 
489  virtual at3_e3& operator=(const abstract_poset_member& xother);
490 
494  at3_e3& operator=(const at3_e3& xother);
495 
499  ~at3_e3();
500 
504  virtual const volatile_type& lite_prototype() const;
505 
509  virtual volatile_type* lite_type() const;
510 
511  //============================================================================
512  // Row dof tuple related member functions
513  //============================================================================
514 
515  using at3::put_components;
516 
520  virtual void put_components(dof_type xcomp);
521 
526  operator row_dofs_type& ();
527 
532  operator const row_dofs_type& () const;
533 
534 protected:
535 private:
536 
538 
539 
540  //============================================================================
542  //============================================================================
544 
545 public:
546 protected:
547 private:
548 
550 
551 
552  //============================================================================
554  //============================================================================
556 
557 public:
558 protected:
559 private:
560 
562 
563 
564  //============================================================================
566  //============================================================================
568 
569 public:
570 protected:
571 private:
572 
574 
575 
576  //============================================================================
578  //============================================================================
580 
581 public:
582 protected:
583 private:
584 
586 
587 
588  //============================================================================
590  //============================================================================
592 
593 public:
594 
599  virtual tp* new_tp(int xp, bool xauto_access) const;
600 
605  virtual atp* new_atp(int xp, bool xauto_access) const;
606 
611  virtual stp* new_stp(int xp, bool xauto_access) const;
612 
613 protected:
614 private:
615 
617 
618 
619  //============================================================================
621  //============================================================================
623 
624 public:
625 
629  virtual const std::string& class_name() const;
630 
634  static const std::string& static_class_name();
635 
639  virtual at3_e3* clone() const;
640 
646  inline at3_e3* clone(bool xnew_state, bool xauto_access = true) const
647  {
648  return static_cast<at3_e3*>(at3::clone(xnew_state, xauto_access));
649  }
650 
651 protected:
652 private:
653 
655 
656 
657 
658  //============================================================================
660  //============================================================================
662 
663 public:
664 
668  bool is_ancestor_of(const any* xother) const;
669 
673  bool invariant() const;
674 
675 protected:
676 private:
677 
679 };
680 
681 //==============================================================================
682 // NON-MEMBER FUNCTIONS
683 //==============================================================================
684 
688 template <typename T>
689 SHEAF_DLL_SPEC
690 std::ostream& operator<<(std::ostream& xos, const at3_e3_row_dofs_type<T>& xrdt);
691 
692 //==============================================================================
693 
694 class at0;
695 class at0_lite;
696 class at2_e3;
697 class at2_e3_lite;
698 class e3;
699 class e3_lite;
700 
701 namespace atp_algebra
702 {
703 
708 SHEAF_DLL_SPEC void hook(const at3_e3& x0, const e3& x1, at2_e3& xresult, bool xauto_access);
709 
714 SHEAF_DLL_SPEC void hook(const at3_e3_lite& x0, const e3_lite& x1, at2_e3_lite& xresult);
715 
720 SHEAF_DLL_SPEC void star(const at3_e3& x0, at0& xresult, bool xauto_access);
721 
726 SHEAF_DLL_SPEC void star(const at3_e3_lite& x0, at0_lite& xresult);
727 
732 SHEAF_DLL_SPEC at0_lite* star(const at3_e3_lite& x0);
733 
738 SHEAF_DLL_SPEC void star(const at0& x0, at3_e3& xresult, bool xauto_access);
739 
744 SHEAF_DLL_SPEC void star(const at0_lite& x0, at3_e3_lite& xresult);
745 
750 SHEAF_DLL_SPEC void wedge(const at2_e3& x0, const e3& x1, at3_e3& xresult, bool xauto_access);
751 
756 SHEAF_DLL_SPEC void wedge(const at2_e3_lite& x0, const e3_lite& x1, at3_e3_lite& xresult);
757 
758 } // namespace atp_algebra
759 
760 } // namespace fiber_bundle
761 
762 #endif // ifndef AT3_E3_H
e3 vector_space_type
Type of underlying vector space.
Definition: at3_e3.h:439
An antisymmetric rank 3 tensor over an abstract vector space (volatile version).
Definition: at3.h:43
static const std::string & static_class_name()
The name of this class.
Definition: at3_e3.impl.h:42
A symmetric tensor of degree p over an abstract vector space.
Definition: stp.h:190
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: vd.h:129
An antisymmetric tensor of degree p.
Definition: atp.h:190
Euclidean vector space of dimension 3 (volatile version).
Definition: e3.h:116
virtual at3 * clone() const
Make a new handle, no state instance of current.
Definition: at3.cc:1045
T components[1]
There is only one component (dof) for at3_e3.
Definition: at3_e3.h:102
An antisymmetric rank 3 tensor over a Euclidean vector space of dimension 3. (volatile version)...
Definition: at3_e3.h:120
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (persistent version)...
Definition: at2_e3.h:424
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...
virtual at3_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: at3_e3.h:320
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
at3_e3_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: at3_e3.h:429
T dof_type
The type of the dofs.
Definition: at3_e3.h:54
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).
Row dofs type for class at3_e3.
Definition: at3_e3.h:47
at3_e3_lite volatile_type
The associated volatile type.
Definition: at3_e3.h:434
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
at3_e3_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: at3_e3.impl.h:121
at3_e3_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: at3_e3.h:59
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
An antisymmetric rank 3 tensor over a 3D Euclidean vector space.
Definition: at3_e3.h:372
Abstract base class with useful features for all objects.
Definition: any.h:39
static int d()
The dimension of the row dof components.
Definition: at3_e3.impl.h:62
An abstract antisymmetric tensor space of degree p.
Definition: atp_space.h:42
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
A scalar viewed as an antisymmetric tensor of degree 0. As the degree is 0 there is nothing to be sym...
Definition: at0.h:424
Antisymetric tensor of degree 0 (volatile version).
Definition: at0.h:127
e3_lite vector_space_type
Type of underlying vector space.
Definition: at3_e3.h:238
at3_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: at3_e3.h:92
SHEAF_DLL_SPEC tensor_variance hook(const tensor_variance &x0)
The variance of the hook of a tensor with variance x0.
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: at3_e3.impl.h:82
An antisymmetric rank 3 tensor over an abstract vector space (volatile version).
Definition: at3.h:230
row_dofs_type _row_dofs
Row_dofs_type.
Definition: at3_e3.h:196
at3_e3_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: at3_e3.h:134
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (volatile version)...
Definition: at2_e3.h:142
at3_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: at3_e3.h:646
SHEAF_DLL_SPEC tensor_variance wedge(const tensor_variance &x0, const tensor_variance &x1)
The variance of the wedge of a tensor with variance x0 with a tnesor with variance x1...
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
SHEAF_DLL_SPEC tensor_variance star(const tensor_variance &x0, int xdd)
The variance of the Hodge star of a tensor with variance x0 over a vector space of dimension xdd...
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
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.