SheafSystem  0.0.0.0
gl3.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 GL3_H
22 #define GL3_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef GLN_H
29 #include "SheafSystem/gln.h"
30 #endif
31 
32 #ifndef GENERAL_MATRIX_3X3_H
33 #include "SheafSystem/general_matrix_3x3.h"
34 #endif
35 
36 
37 namespace fiber_bundle
38 {
39 
40  class e3;
41 
42 //==============================================================================
43 // CLASS GL3_ROW_DOFS_TYPE
44 //==============================================================================
45 
49 template <typename T>
51 {
52 public:
53 
57  typedef T dof_type;
58 
63 
68 
72  static const std::string& static_class_name();
73 
77  static int d();
78 
83  T& operator[] (int xindex);
84 
89  const T& operator[] (int xindex) const;
90 
95  operator typename gl3_row_dofs_type<T>::matrix_type& ();
96 
101  operator const typename gl3_row_dofs_type<T>::matrix_type& () const;
102 
106  matrix_type& basis_matrix();
107 
111  const matrix_type& basis_matrix() const;
112 
116  matrix_type& component_matrix();
117 
121  const matrix_type& component_matrix() const;
122 
126  gl3_row_dofs_type<T>* clone() const;
127 
132  gl3_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
133  {
134  return clone();
135  }
136 
164  T components[18];
165 
166 protected:
167 private:
168 
169 };
170 
171 
172 //==============================================================================
173 // CLASS GL3_LITE
174 //==============================================================================
175 
183 class SHEAF_DLL_SPEC gl3_lite : public gln_lite
184 {
185  //============================================================================
187  //============================================================================
189 
190 public:
191 
192  // Typedefs:
193 
198 
203 
207  gl3_lite();
208 
212  gl3_lite(const gl3_lite& xother);
213 
217  gl3_lite& operator=(const gl3_lite& xother);
218 
222  virtual ~gl3_lite();
223 
228  gl3_lite(const row_dofs_type& xrow_dofs);
229 
233  gl3_lite& operator=(const row_dofs_type& xrow_dofs);
234 
238  gl3_lite(const matrix_type& xmatrix);
239 
243  gl3_lite& operator=(const matrix_type& xmatrix);
244 
249  operator matrix_type& ();
250 
255  operator const matrix_type& () const;
256 
261  operator row_dofs_type& ();
262 
267  operator const row_dofs_type& () const;
268 
272  matrix_type& basis_matrix();
273 
277  const matrix_type& basis_matrix() const;
278 
282  matrix_type& component_matrix();
283 
287  const matrix_type& component_matrix() const;
288 
293  void rescale(const value_type& xscale,
294  const value_type& yscale,
295  const value_type& zscale);
296 
313  void rotate_x(const value_type& xangle);
314 
322  void rotate_y(const value_type& xangle);
323 
331  void rotate_z(const value_type& xangle);
332 
342  void rotate_euler(const value_type& xalpha,
343  const value_type& xbeta,
344  const value_type& xgamma);
345 
350  void basis(value_type xb0[],
351  value_type xb1[],
352  value_type xb2[]) const;
353 
360  void put_basis(const value_type xb0[],
361  const value_type xb1[],
362  const value_type xb2[]);
363 
367  void get_matrix(row_dofs_type& xmatrix) const;
368 
374  void put_matrix(row_dofs_type& xmatrix);
375 
376 protected:
377 
381  row_dofs_type _row_dofs;
382 
383 private:
384 
386 
387 
388  //============================================================================
390  //============================================================================
392 
393 public:
394 
395  using gln_lite::n;
396 
400  virtual int n() const;
401 
402 protected:
403 private:
404 
406 
407 
408  //============================================================================
410  //============================================================================
412 
413 public:
414 protected:
415 private:
416 
418 
419 
420  //============================================================================
422  //============================================================================
424 
425 public:
426 
430  virtual const std::string& class_name() const;
431 
435  static const std::string& static_class_name();
436 
440  virtual gl3_lite* clone() const;
441 
446  virtual gl3_lite* clone(bool xnew_state, bool xauto_access) const
447  {
448  return clone();
449  }
450 
451 protected:
452 private:
453 
455 
456 
457 
458  //============================================================================
460  //============================================================================
462 
463 public:
464 
468  virtual bool is_ancestor_of(const any_lite& xother) const;
469 
473  bool invariant() const;
474 
478  virtual void* row_dofs();
479 
483  virtual const void* row_dofs() const;
484 
485 protected:
486 private:
487 
489 };
490 
491 
492 //==============================================================================
493 // CLASS GL3
494 //==============================================================================
495 
502 
503 class SHEAF_DLL_SPEC gl3 : public gln
504 {
505 
506  // ===========================================================
508  // ===========================================================
510 
511 public:
512 
516  static const poset_path& standard_schema_path();
517 
521  static void make_standard_schema(namespace_poset& xns);
522 
528  static host_type& new_host(namespace_type& xns,
529  const poset_path& xhost_path,
530  const poset_path& xschema_path,
531  const poset_path& xvector_space_path,
532  bool xauto_access);
533 
540  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
541 
542 protected:
543 
544 private:
545 
547 
548 
549  //============================================================================
551  //============================================================================
553 
554 public:
555 
556  // Typedefs:
557 
562 
567 
574 
578  gl3();
579 
583  gl3(const gl3& xother, bool xnew_jem);
584 
588  virtual gl3& operator=(const abstract_poset_member& xother);
589 
593  gl3& operator=(const gl3& xother);
594 
598  virtual ~gl3();
599 
603  gl3(poset* xhost, bool xauto_access = true);
604 
607 
611  gl3(poset_state_handle& xhost,
612  const row_dofs_type& xrdt,
613  bool xauto_access = true);
614 
618  gl3& operator=(const row_dofs_type& xrdt);
619 
624  gl3(const poset* xhost, pod_index_type xhub_id);
625 
630  gl3(const poset* xhost, const scoped_index& xid);
631 
636  gl3(const poset* xhost, const std::string& xname);
637 
641  explicit gl3(gl3* xother);
642 
647  operator row_dofs_type& ();
648 
653  operator const row_dofs_type& () const;
654 
658  void get_matrix(row_dofs_type& xmatrix) const;
659 
665  void put_matrix(row_dofs_type& xmatrix);
666 
670  virtual volatile_type* lite_type() const;
671 
672 
673 protected:
674 private:
675 
677 
678 
679  //============================================================================
681  //============================================================================
683 
684 public:
685 protected:
686 private:
687 
689 
690 
691  //============================================================================
693  //============================================================================
695 
696 public:
697 
698 protected:
699 
700 private:
701 
703 
704 
705  //============================================================================
707  //============================================================================
709 
710 public:
711 
715  virtual const std::string& class_name() const;
716 
720  static const std::string& static_class_name();
721 
725  virtual gl3* clone() const;
726 
727 
728 
734  inline gl3* clone(bool xnew_state, bool xauto_access = true) const
735  {
736  return static_cast<gl3*>(gln::clone(xnew_state, xauto_access));
737  }
738 
739 protected:
740 private:
741 
743 
744 
745  //============================================================================
747  //============================================================================
749 
750 public:
751 
755  virtual bool invariant() const;
756 
760  virtual bool is_ancestor_of(const any* xother) const;
761 
762 protected:
763 private:
764 
766 };
767 
768 //==============================================================================
769 // NON-MEMBER FUNCTIONS
770 //==============================================================================
771 
775 template <typename T>
776 std::ostream& operator<<(std::ostream& xos, const gl3_row_dofs_type<T>& xrdt);
777 
778 #ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
779 
783 SHEAF_DLL_SPEC std::ostream& operator<<(std::ostream& xos, const gl3_lite& xlite);
784 
788 SHEAF_DLL_SPEC std::ostream& operator<<(std::ostream& xos, const gl3& xpersistent);
789 
793 SHEAF_DLL_SPEC void inverse(const gl3_lite& xlite, gl3_lite& xresult);
794 
798 SHEAF_DLL_SPEC void inverse(const gl3& xgl, gl3& xresult);
799 
800 #endif // ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
801 
802 } // namespace fiber_bundle
803 
804 
805 #endif // ifndef GL3_H
gl3_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: gl3.impl.h:239
gl3_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: gl3.h:132
row_dofs_type _row_dofs
Row_dofs_type.
Definition: gl3.h:381
The mathematical group GL(n, R). GL(n,R) is the group of general, invertible, linear transformations ...
Definition: gln.h:103
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.
gl3_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: gl3.h:62
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
static int d()
The dimension of the row dof components.
Definition: gl3.impl.h:62
The mathematical group GL(n, R). GL(n,R) is the group of general, invertible, linear transformations ...
Definition: gln.h:289
gl3_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: gl3.h:561
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: gl3.impl.h:82
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).
general_matrix_3x3< T > matrix_type
The type of the associated matrix.
Definition: gl3.h:67
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 client handle for a mutable partially ordered set.
Definition: poset.h:40
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: gln.h:121
gl3_lite volatile_type
The associated volatile type.
Definition: gl3.h:566
T dof_type
The type of the dofs.
Definition: gl3.h:57
gl3_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: gl3.h:202
virtual int n() const
Dimension of the representation space; n in GL(n, R).
Definition: gln.cc:193
Row dofs type for class gl3.
Definition: gl3.h:50
The mathematical group GL(3, R). The group of all invertible, linear transformations on the R3...
Definition: gl3.h:183
A Cartesian product space.
Definition: gln_space.h:52
matrix_type & basis_matrix()
The associated basis transformation matrix (non const version).
Definition: gl3.impl.h:160
virtual gl3_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: gl3.h:446
gl3 * 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: gl3.h:734
matrix_type & component_matrix()
The associated component transformation matrix (non const version).
Definition: gl3.impl.h:198
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
General matrix with 3 rows and 3 columns.
virtual gln * clone() const
Make a new handle, no state instance of current.
Definition: gln.cc:1439
gl3_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: gl3.h:197
An abstract client handle for a member of a poset.
e3 vector_space_type
Type of underlying vector space.
Definition: gl3.h:573
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC void inverse(const gl2_lite &xlite, gl2_lite &xresult)
Inverse (pre-allocated version for volatile type).
Definition: gl2.cc:1484
static const std::string & static_class_name()
The name of this class.
Definition: gl3.impl.h:42
The mathematical group GL(3, R). The group of all invertible, linear transformations on the R3...
Definition: gl3.h:503
T components[18]
The dofs in the following order:
Definition: gl3.h:164
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const binary_index &xbi)
Insert binary_index& xbi into ostream& os.
Definition: binary_index.cc:35