SheafSystem  0.0.0.0
t2_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 
22 #ifndef T2_E2_H
23 #define T2_E2_H
24 
25 #ifndef SHEAF_DLL_SPEC_H
26 #include "SheafSystem/sheaf_dll_spec.h"
27 #endif
28 
29 #ifndef T2_H
30 #include "SheafSystem/t2.h"
31 #endif
32 
33 #ifndef GENERAL_MATRIX_2X2_H
34 #include "SheafSystem/general_matrix_2x2.h"
35 #endif
36 
37 #ifndef E2_H
38 #include "SheafSystem/e2.h"
39 
40 #endif
41 
42 namespace fiber_bundle
43 {
44 
45 //==============================================================================
46 // CLASS T2_E2_ROW_DOFS_TYPE
47 //==============================================================================
48 
52 template <typename T>
53 class SHEAF_DLL_SPEC t2_e2_row_dofs_type
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 t2_e2_row_dofs_type<T>::matrix_type& ();
99 
104  operator const typename t2_e2_row_dofs_type<T>::matrix_type& () const;
105 
109  t2_e2_row_dofs_type<T>* clone() const;
110 
115  t2_e2_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
116  {
117  return clone();
118  }
119 
128  T components[4];
129 
130 protected:
131 private:
132 
133 };
134 
135 
136 //==============================================================================
137 // CLASS T2_E2_LITE
138 //==============================================================================
139 
140 class at2_e2_lite;
141 class e2_lite;
142 class st2_e2_lite;
143 
148 class SHEAF_DLL_SPEC t2_e2_lite : public t2_lite
149 {
150 
151  //============================================================================
153  //============================================================================
155 
156 public:
157 
158  // Typedefs:
159 
164 
169 
173  t2_e2_lite();
174 
178  t2_e2_lite(const t2_e2_lite& xother);
179 
183  t2_e2_lite& operator=(const t2_e2_lite& xother);
184 
188  virtual ~t2_e2_lite();
189 
193  t2_e2_lite(const at2_e2_lite& xother);
194 
198  t2_e2_lite& operator=(const at2_e2_lite& xother);
199 
203  t2_e2_lite(const st2_e2_lite& xother);
204 
208  t2_e2_lite& operator=(const st2_e2_lite& xother);
209 
214  t2_e2_lite(const row_dofs_type& xrow_dofs);
215 
219  t2_e2_lite& operator=(const row_dofs_type& xrow_dofs);
220 
224  t2_e2_lite(const matrix_type& xmatrix);
225 
229  t2_e2_lite& operator=(const matrix_type& xmatrix);
230 
235  operator matrix_type& ();
236 
241  operator const matrix_type& () const;
242 
247  operator row_dofs_type& ();
248 
253  operator const row_dofs_type& () const;
254 
259  t2_e2_lite(const value_type& xx_comp,
260  const value_type& xy_comp,
261  const value_type& yx_comp,
262  const value_type& yy_comp);
263 
265 
269  virtual void put_components(value_type xx_comp,
270  value_type xy_comp,
271  value_type yx_comp,
272  value_type yy_comp);
273 
274 protected:
275 
279  row_dofs_type _row_dofs;
280 
281 private:
282 
284 
285 
286  //============================================================================
288  //============================================================================
290 
291 public:
292 protected:
293 private:
294 
295  //============================================================================
297  //============================================================================
299 
300 public:
301 
306 
310  virtual int dd() const;
311 
312 protected:
313 private:
314 
316 
317 
318  //============================================================================
320  //============================================================================
322 
323 public:
324 
329  virtual const tp_lite& tp_prototype(int xp) const;
330 
335  virtual const atp_lite& atp_prototype(int xp) const;
336 
341  virtual const stp_lite& stp_prototype(int xp) const;
342 
343 protected:
344 private:
345 
347 
348 
349  //============================================================================
351  //============================================================================
353 
354 public:
355 protected:
356 private:
357 
359 
360 
361  //============================================================================
363  //============================================================================
365 
366 public:
367 
371  virtual const std::string& class_name() const;
372 
376  static const std::string& static_class_name();
377 
381  virtual t2_e2_lite* clone() const;
382 
387  virtual t2_e2_lite* clone(bool xnew_state, bool xauto_access) const
388  {
389  return clone();
390  }
391 
392 protected:
393 private:
394 
396 
397 
398  //============================================================================
400  //============================================================================
402 
403 public:
404 
408  virtual bool is_ancestor_of(const any_lite& xother) const;
409 
413  bool invariant() const;
414 
418  virtual void* row_dofs();
419 
423  virtual const void* row_dofs() const;
424 
425 protected:
426 private:
427 
429 };
430 
431 
432 //==============================================================================
433 // CLASS T2_E2
434 //==============================================================================
435 
436 class tp;
437 class atp;
438 class stp;
439 
444 class SHEAF_DLL_SPEC t2_e2 : public t2
445 {
446 
447  // ===========================================================
449  // ===========================================================
451 
452 public:
453 
457  static const poset_path& standard_schema_path();
458 
462  static void make_standard_schema(namespace_poset& xns);
463 
469  static host_type& new_host(namespace_type& xns,
470  const poset_path& xhost_path,
471  const poset_path& xschema_path,
472  const poset_path& xvector_space_path,
473  bool xauto_access);
474 
481  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
482 
483 protected:
484 
485 private:
486 
488 
489 
490  //============================================================================
492  //============================================================================
494 
495 public:
496 
497  // Typedefs:
498 
503 
508 
513 
517  t2_e2();
518 
522  t2_e2(const t2_e2& xother);
523 
527  virtual t2_e2& operator=(const abstract_poset_member& xother);
528 
532  t2_e2& operator=(const t2_e2& xother);
533 
537  virtual ~t2_e2();
538 
542  virtual const volatile_type& lite_prototype() const;
543 
547  virtual volatile_type* lite_type() const;
548 
552  t2_e2(poset* xhost, bool xauto_access = true);
553 
558  t2_e2(const poset* xhost, pod_index_type xhub_id);
559 
564  t2_e2(const poset* xhost, const scoped_index& xid);
565 
568 
572  t2_e2(poset_state_handle& xhost,
573  const row_dofs_type& xrdt,
574  bool xauto_access = true);
575 
579  t2_e2& operator=(const row_dofs_type& xrdt);
580 
585  t2_e2(const poset* xhost, const std::string& xname);
586 
587  using t2::put_components;
588 
592  virtual void put_components(dof_type xx_comp, dof_type xy_comp,
593  dof_type yx_comp, dof_type yy_comp);
594 
599  operator row_dofs_type& ();
600 
605  operator const row_dofs_type& () const;
606 
607  //============================================================================
609  //============================================================================
611 
612 public:
613 protected:
614 private:
615 
617 
618 
619  //============================================================================
621  //============================================================================
623 
624 public:
625 protected:
626 private:
627 
629 
630 
631 
632  //============================================================================
634  //============================================================================
636 
637 public:
638 protected:
639 private:
640 
642 
643 
644  //============================================================================
646  //============================================================================
648 
649 public:
650 
655  virtual tp* new_tp(int xp, bool xauto_access) const;
656 
661  virtual atp* new_atp(int xp, bool xauto_access) const;
662 
667  virtual stp* new_stp(int xp, bool xauto_access) const;
668 
669 protected:
670 private:
671 
673 
674 
675  //============================================================================
677  //============================================================================
679 
680 public:
681 
685  virtual const std::string& class_name() const;
686 
690  static const std::string& static_class_name();
691 
695  virtual t2_e2* clone() const;
696 
702  inline t2_e2* clone(bool xnew_state, bool xauto_access = true) const
703  {
704  return static_cast<t2_e2*>(t2::clone(xnew_state, xauto_access));
705  }
706 
707 protected:
708 private:
709 
711 
712 
713  //============================================================================
715  //============================================================================
717 
718 public:
719 
723  virtual bool invariant() const;
724 
728  virtual bool is_ancestor_of(const any* other) const;
729 
730 protected:
731 private:
732 
734 };
735 
736 //==============================================================================
737 // NON-MEMBER FUNCTIONS
738 //==============================================================================
739 
743 template <typename T>
744 SHEAF_DLL_SPEC
745 std::ostream& operator<<(std::ostream& xos, const t2_e2_row_dofs_type<T>& xrdt);
746 
747 
748 } // namespace fiber_bundle
749 
750 #endif // ifndef T2_E2_H
t2_e2_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: t2_e2.h:65
row_dofs_type _row_dofs
Row_dofs_type.
Definition: t2_e2.h:279
t2_e2_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: t2_e2.h:163
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 2 (persistent version).
Definition: e2.h:405
A tensor of degree 2 over a Euclidean vector space of dimension 2 (volatile version).
Definition: t2_e2.h:148
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 tensor of degree 2 over a Euclidean vector space of dimension 2 (persistent version).
Definition: t2_e2.h:444
A client handle for a general, abstract partially order set.
T dof_type
The type of the dofs.
Definition: t2_e2.h:60
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
General matrix with 2 rows and 2 columns.
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
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 2 (volatile version)...
Definition: at2_e2.h:146
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
virtual t2 * clone() const
Make a new handle, no state instance of current.
Definition: t2.cc:984
A tensor of degree 2 over an abstract vector space (volatile version).
Definition: t2.h:43
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
t2_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: t2_e2.h:702
Euclidean vector space of dimension 2 (volatile version).
Definition: e2.h:112
e2_lite vector_space_type
Type of underlying vector space.
Definition: t2_e2.h:305
A client handle for a mutable partially ordered set.
Definition: poset.h:40
Row dofs type for class t2_e2.
Definition: t2_e2.h:53
general_matrix_2x2< T > matrix_type
The type of the associated matrix.
Definition: t2_e2.h:70
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
t2_e2_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: t2_e2.h:168
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
virtual t2_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: t2_e2.h:387
e2 vector_space_type
Type of underlying vector space.
Definition: t2_e2.h:512
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
t2_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: t2_e2.h:115
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 2 (volatile version)...
Definition: st2_e2.h:150
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
t2_e2_lite volatile_type
The associated volatile type.
Definition: t2_e2.h:507
An abstract tensor space of degree p.
Definition: tp_space.h:47
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.
A tensor of degree 2 over an abstract vector space (persistent version).
Definition: t2.h:226
t2_e2_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: t2_e2.h:502