SheafSystem  0.0.0.0
gln.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 GLN_H
22 #define GLN_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef GROUP_H
29 #include "SheafSystem/group.h"
30 #endif
31 
32 #ifndef GLN_TABLE_DOFS_TYPE_H
33 #include "SheafSystem/gln_table_dofs_type.h"
34 #endif
35 
36 namespace fiber_bundle
37 {
38  //
39  // Forward declarations
40  //
41 
42  class at0;
43  class at1;
44  class gln_space;
45 
46 //==============================================================================
47 // CLASS GLN_ROW_DOFS_TYPE
48 //==============================================================================
49 
53 template <typename T>
55 {
56 public:
57 
61  typedef T dof_type;
62 
67 
71  static const std::string& static_class_name();
72 
77  T& operator[] (int xindex);
78 
83  const T& operator[] (int xindex) const;
84 
88  row_dofs_type* clone() const;
89 };
90 
91 
92 //==============================================================================
93 // CLASS GLN_LITE
94 //==============================================================================
95 
96 
103 class SHEAF_DLL_SPEC gln_lite : public group_lite
104 {
105  //============================================================================
107  //============================================================================
109 
110 public:
111 
116 
122 
127 
132 
136  gln_lite();
137 
141  gln_lite(const gln_lite& xother);
142 
146  gln_lite& operator=(const gln_lite& xother);
147 
151  virtual ~gln_lite();
152 
156  gln_lite(const row_dofs_type& xrow_dofs);
157 
161  gln_lite& operator=(const row_dofs_type& xrow_dofs);
162 
166  //virtual int n() const = 0;
167  virtual int n() const;
168 
172  virtual int d() const;
173 
177  value_type component(int xindex) const;
178 
182  void put_component(int xindex, value_type xcomp);
183 
187  void components(dof_type xcomps[], int xcomps_dimension) const;
188 
192  void put_components(const dof_type xcomps[], int xcomps_dimension);
193 
198  value_type& operator[] (int xindex);
199 
204  const value_type& operator[] (int xindex) const;
205 
206 protected:
207 private:
208 
210 
211 
212  //============================================================================
214  //============================================================================
216 
217 public:
218 protected:
219 private:
220 
222 
223 
224  //============================================================================
226  //============================================================================
228 
229 public:
230 
234  virtual const std::string& class_name() const;
235 
239  static const std::string& static_class_name();
240 
244  virtual gln_lite* clone() const;
245 
249  table_dofs_type table_dofs() const;
250 
251 protected:
252 private:
253 
255 
256 
257  //============================================================================
259  //============================================================================
261 
262 public:
263 
267  virtual bool is_ancestor_of(const any_lite& xother) const;
268 
272  bool invariant() const;
273 
274 protected:
275 private:
276 
278 };
279 
280 //==============================================================================
281 // CLASS GLN
282 //==============================================================================
283 
289 class SHEAF_DLL_SPEC gln : public group
290 {
291 
292  // ===========================================================
294  // ===========================================================
296 
297 public:
298 
303 
307  static const std::string& standard_schema_poset_name();
308 
312  static const poset_path& standard_schema_path();
313 
317  static void make_standard_schema(namespace_poset& xns);
318 
324  static host_type& new_host(namespace_type& xns,
325  const poset_path& xhost_path,
326  const poset_path& xschema_path,
327  const poset_path& xvector_space_path,
328  bool xauto_access);
329 
330 protected:
331 
332 private:
333 
335 
336 
337  //============================================================================
339  //============================================================================
341 
342 public:
343 
344  // Typedefs:
345 
350 
354  typedef at0 scalar_type;
355 
360 
365 
370 
375 
382 
386  gln();
387 
391  gln(const gln& xother, bool xnew_jem);
392 
396  virtual gln& operator=(const abstract_poset_member& xother);
397 
401  gln& operator=(const gln& xother);
402 
406  virtual ~gln();
407 
411  gln(poset* xhost, bool xauto_access = true);
412 
417  gln(const poset* xhost, pod_index_type xhub_id);
418 
423  gln(const poset* xhost, const scoped_index& xid);
424 
429  gln(const poset* xhost, const std::string& xname);
430 
434  explicit gln(gln* xother);
435 
439  int n() const;
440 
444  int n(bool xauto_access) const;
445 
449  poset_path scalar_space_path() const;
450 
454  poset_path scalar_space_path(bool xauto_access) const;
455 
459  poset_path vector_space_path() const;
460 
464  poset_path vector_space_path(bool xauto_access) const;
465 
469  virtual int d() const;
470 
474  int d(bool xauto_access) const;
475 
479  virtual value_type component(int xindex) const;
480 
484  value_type component(int xindex, bool xauto_access) const;
485 
489  virtual void put_component(int xi, value_type xvalue);
490 
494  void put_component(int xindex, value_type xvalue, bool xauto_access);
495 
499  void components(dof_type xcomps[], int xcomps_dimension) const;
500 
504  void put_components(const dof_type xcomps[], int xcomps_dimension);
505 
510  dof_type& operator[] (int xindex);
511 
516  const dof_type& operator[] (int xindex) const;
517 
521  virtual volatile_type* lite_type() const;
522 
523 
524 protected:
525 private:
526 
528 
529 
530  //============================================================================
532  //============================================================================
534 
535 public:
536 protected:
537 private:
538 
540 
541 
542  //============================================================================
544  //============================================================================
546 
547 public:
548 
552  virtual const std::string& class_name() const;
553 
557  static const std::string& static_class_name();
558 
564  inline gln* clone(bool xnew_state, bool xauto_access = true) const
565  {
566  return static_cast<gln*>(group::clone(xnew_state, xauto_access));
567  }
568 
569 protected:
570 private:
571 
573 
574 
575  // ===========================================================
577  // ===========================================================
579 
580 public:
581 
585  host_type* host() const;
586 
590  virtual bool host_is_ancestor_of(const poset_state_handle* other) const;
591 
592 protected:
593 
594 private:
595 
597 
598 
599  //===========================================================================
601  //===========================================================================
603 
604 public:
605 
609  virtual bool invariant() const;
610 
614  virtual gln* clone() const;
615 
619  virtual bool is_ancestor_of(const any* xother) const;
620 
621 protected:
622 private:
623 
625 };
626 
627 //==============================================================================
628 // NON-MEMBER FUNCTIONS
629 //==============================================================================
630 
635 SHEAF_DLL_SPEC double rad(double degrees);
636 
637 #ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
638 
642 SHEAF_DLL_SPEC std::ostream& operator<<(std::ostream& xos, gln_lite& xv);
643 
647 SHEAF_DLL_SPEC std::ostream& operator<<(std::ostream& xos, gln_lite::table_dofs_type& xt);
648 
649 #endif // ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
650 
651 } // namespace fiber_bundle
652 
653 #endif // ifndef GLN_H
654 
655 
656 
657 
658 
659 
SHEAF_DLL_SPEC double rad(double degrees)
Converts degress to radians. Convenience function for use with rotation routines. ...
Definition: gln.cc:1494
at1 vector_space_type
The type of the underlying vector space.
Definition: gln.h:349
The general, abstract mathematical group (volatile version).
Definition: group.h:64
gln_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: gln.h:66
row_dofs_type * clone() const
Creates a new instance of the same type as this.
Definition: gln.impl.h:106
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.
A general antisymmetric tensor of degree 1 over an abstract vector space (persistent version)...
Definition: at1.h:211
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.
static const std::string & static_class_name()
The name of this class.
Definition: gln.impl.h:47
virtual group * clone() const =0
Make a new handle, no state instance of current.
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
The mathematical group GL(n, R). GL(n,R) is the group of general, invertible, linear transformations ...
Definition: gln.h:289
vd_value_type value_type
The POD ("plain old data") type of scalar in the vector space of this.
Definition: gln.h:374
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
gln_table_dofs_type table_dofs_type
The type of the table dofs.
Definition: gln.h:126
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
gln_table_dofs_type table_dofs_type
The type of the table dofs.
Definition: gln.h:359
gln_space host_type
The type of host poset.
Definition: gln.h:302
double vd_dof_type
The type of degree of freedom in the fiber space.
Definition: fiber_bundle.h:68
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
vd_dof_type dof_type
The type of the degrees of freedom.
Definition: gln.h:115
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: gln.h:121
The general, abstract mathematical group (persistent version)
Definition: group.h:158
gln_lite volatile_type
The associated volatile type.
Definition: gln.h:369
gln_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: gln.h:364
gln_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: gln.h:131
T dof_type
The type of the dofs.
Definition: gln.h:61
A Cartesian product space.
Definition: gln_space.h:52
T::table_dofs_type & table_dofs(T &x0)
The table dofs pod type for x0 (mutable version).
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
at0 scalar_type
The type of the underlying scalar space.
Definition: gln.h:354
vd_dof_type dof_type
The type of the degrees of freedom. Note that although dof_type == value_type in this implementation...
Definition: gln.h:381
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: gln.impl.h:67
An abstract client handle for a member of a poset.
Row dofs type for class gln.
Definition: gln.h:54
Namespace for the fiber_bundles component of the sheaf system.
gln * 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: gln.h:564
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: fiber_bundle.h:63
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