SheafSystem  0.0.0.0
jcb_e23.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 JCB_E23_H
22 #define JCB_E23_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef JCB_ED_H
29 #include "SheafSystem/jcb_ed.h"
30 #endif
31 
32 #ifndef GENERAL_MATRIX_3X2_H
33 #include "SheafSystem/general_matrix_3x2.h"
34 #endif
35 
36 namespace fiber_bundle
37 {
38  class e2;
39  class e3;
40 
41 //==============================================================================
42 // CLASS JCB_E23_ROW_DOFS_TYPE
43 //==============================================================================
44 
48 template <typename T>
50 {
51 public:
52 
56  typedef T dof_type;
57 
62 
67 
71  static const std::string& static_class_name();
72 
76  static int d();
77 
82  T& operator[] (int xindex);
83 
88  const T& operator[] (int xindex) const;
89 
94  operator typename jcb_e23_row_dofs_type<T>::matrix_type& ();
95 
100  operator const typename jcb_e23_row_dofs_type<T>::matrix_type& () const;
101 
106 
111  jcb_e23_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
112  {
113  return clone();
114  }
115 
126 
127 protected:
128 private:
129 
130 };
131 
132 
133 //==============================================================================
134 // CLASS JCB_E23_LITE
135 //==============================================================================
136 
142 class SHEAF_DLL_SPEC jcb_e23_lite : public jcb_ed_lite
143 {
144  //============================================================================
146  //============================================================================
148 
149 public:
150 
151  // Typedefs:
152 
157 
162 
166  jcb_e23_lite();
167 
171  jcb_e23_lite(const jcb_e23_lite& xother);
172 
176  jcb_e23_lite& operator=(const jcb_e23_lite& xother);
177 
181  virtual ~jcb_e23_lite();
182 
186  jcb_e23_lite(const row_dofs_type& xrow_dofs);
187 
191  jcb_e23_lite& operator=(const row_dofs_type& xrow_dofs);
192 
196  jcb_e23_lite(const matrix_type& xmatrix);
197 
201  jcb_e23_lite& operator=(const matrix_type& xmatrix);
202 
207  operator matrix_type& ();
208 
213  operator const matrix_type& () const;
214 
219  operator row_dofs_type& ();
220 
225  operator const row_dofs_type& () const;
226 
231  jcb_e23_lite(const value_type& dxdu, const value_type& dxdv,
232  const value_type& dydu, const value_type& dydv,
233  const value_type& dzdu, const value_type& dzdv);
234 
236 
240  virtual void put_components(const value_type& dxdu, const value_type& dxdv,
241  const value_type& dydu, const value_type& dydv,
242  const value_type& dzdu, const value_type& dzdv);
243 
244 protected:
245 
249  row_dofs_type _row_dofs;
250 
251 private:
252 
254 
255 
256  //============================================================================
258  //============================================================================
260 
261 public:
262 protected:
263 private:
264 
266 
267 
268  //============================================================================
270  //============================================================================
272 
273 public:
274 
278  virtual int dd() const;
279 
283  virtual int dr() const;
284 
285 protected:
286 private:
287 
289 
290 
291  //============================================================================
293  //============================================================================
295 
296 public:
297 
298 // ///
299 // /// Virtual constructor for general tensors
300 // /// of degree xp over this vector space.
301 // ///
302 // virtual tp_lite* new_tp_lite(int xp) const;
303 
304 // ///
305 // /// Virtual constructor for antisymmetric tensors
306 // /// of degree xp over this vector space.
307 // ///
308 // virtual atp_lite* new_atp_lite(int xp) const;
309 
310 // ///
311 // /// Virtual constructor for symmetric tensors
312 // /// of degree xp over this vector space.
313 // ///
314 // virtual stp_lite* new_stp_lite(int xp) const;
315 
316 // virtual const tp_lite& tp_prototype(int xp) const;
317 // virtual const atp_lite& atp_prototype(int xp) const;
318 // virtual const stp_lite& stp_prototype(int xp) const;
319 
320 
321 protected:
322 private:
323 
325 
326 
327  //============================================================================
329  //============================================================================
331 
332 public:
333 protected:
334 private:
335 
337 
338 
339  //============================================================================
341  //============================================================================
343 
344 public:
345 
349  virtual const std::string& class_name() const;
350 
354  static const std::string& static_class_name();
355 
359  virtual jcb_e23_lite* clone() const;
360 
365  virtual jcb_e23_lite* clone(bool xnew_state, bool xauto_access) const
366  {
367  return clone();
368  }
369 
370 protected:
371 private:
372 
374 
375 
376  //============================================================================
378  //============================================================================
380 
381 public:
382 
386  virtual bool is_ancestor_of(const any_lite& xother) const;
387 
391  bool invariant() const;
392 
396  virtual void* row_dofs();
397 
401  virtual const void* row_dofs() const;
402 
403 protected:
404 private:
405 
407 };
408 
409 
410 //==============================================================================
411 // CLASS JCB_E23
412 //==============================================================================
413 
414 
416 
421 class SHEAF_DLL_SPEC jcb_e23 : public jcb_ed
422 {
423  // ===========================================================
425  // ===========================================================
427 
428 public:
429 
433  static const poset_path& standard_schema_path();
434 
438  static void make_standard_schema(namespace_poset& xns);
439 
446  static host_type& new_host(namespace_type& xns,
447  const poset_path& xhost_path,
448  const poset_path& xschema_path,
449  const poset_path& xdomain_path,
450  const poset_path& xrange_path,
451  bool xauto_access);
452 
459  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
460 
461 protected:
462 
463 private:
464 
466 
467 
468  //============================================================================
470  //============================================================================
472 
473 public:
474 
475  // Typedefs:
476 
480  typedef e2 domain_type;
481 
485  typedef e3 range_type;
486 
491 
496 
500  jcb_e23();
501 
503 
508  jcb_e23(const poset_state_handle* xhost, pod_index_type xhub_id);
509 
514  jcb_e23(const poset_state_handle* xhost, const scoped_index& xid);
515 
520  jcb_e23(const poset_state_handle* xhost, const std::string& xname);
521 
525  explicit jcb_e23(abstract_poset_member* xother);
526 
530  jcb_e23(poset_state_handle* xhost, bool xauto_access = true);
531 
536  const row_dofs_type& xrdt,
537  bool xauto_access = true);
538 
542  jcb_e23& operator=(const row_dofs_type& xrdt);
543 
547  virtual jcb_e23& operator=(const abstract_poset_member& xother);
548 
552  jcb_e23& operator=(const jcb_e23& xother);
553 
557  ~jcb_e23();
558 
562  virtual const volatile_type& lite_prototype() const;
563 
567  virtual volatile_type* lite_type() const;
568 
573  operator row_dofs_type& ();
574 
579  operator const row_dofs_type& () const;
580 
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 
630 protected:
631 
632 private:
633 
635 
636 
637  //============================================================================
639  //============================================================================
641 
642 public:
643 
647  virtual const std::string& class_name() const;
648 
652  static const std::string& static_class_name();
653 
657  virtual jcb_e23* clone() const;
658 
664  inline jcb_e23* clone(bool xnew_state, bool xauto_access = true) const
665  {
666  return static_cast<jcb_e23*>(jcb_ed::clone(xnew_state, xauto_access));
667  }
668 
669 protected:
670 private:
671 
673 
674 
675  //============================================================================
677  //============================================================================
679 
680 public:
681 
685  bool is_ancestor_of(const any* xother) const;
686 
690  bool invariant() const;
691 
692 protected:
693 private:
694 
696 };
697 
698 //==============================================================================
699 // NON-MEMBER FUNCTIONS
700 //==============================================================================
701 
705 template <typename T>
706 SHEAF_DLL_SPEC
707 std::ostream& operator<<(std::ostream& xos, const jcb_e23_row_dofs_type<T>& xrdt);
708 
709 
710 class e2;
711 class e2_lite;
712 class e3;
713 class e3_lite;
714 class st2_e2_lite;
715 
716 //==============================================================================
717 // JCB FACET
718 //==============================================================================
719 
720 namespace jcb_algebra
721 {
722 
723 #ifndef DOXYGEN_SKIP_UNKNOWN
724 
728 SHEAF_DLL_SPEC void push(const jcb_e23& xjcb,
729  const e2& xvector,
730  e3& xresult,
731  bool xauto_access);
732 
736 SHEAF_DLL_SPEC void push(const jcb_e23_lite& xjcb,
737  const e2_lite& xvector,
738  e3_lite& xresult);
739 
743 SHEAF_DLL_SPEC e3_lite* push(const jcb_e23_lite& xjcb, const e2_lite& xvector);
744 
745 #endif // ifndef DOXYGEN_SKIP_UNKNOWN
746 
750 SHEAF_DLL_SPEC void pull(const jcb_e23& xjcb,
751  const e3& xcovector,
752  e2& xresult,
753  bool xauto_access);
754 
758 SHEAF_DLL_SPEC void pull(const jcb_e23_lite& xjcb,
759  const e3_lite& xcovector,
760  e2_lite& xresult);
761 
765 SHEAF_DLL_SPEC e2_lite* pull(const jcb_e23_lite& xjcb, const e3_lite& xcovector);
766 
767 
768 //==============================================================================
769 
773 SHEAF_DLL_SPEC void metric(const jcb_e23_lite& xjcb, st2_e2_lite& xresult);
774 
775 
779 SHEAF_DLL_SPEC void symmetric_dot_push(const jcb_e23_lite& xjcb,
780  const jcb_e23_lite& xother_jcb,
781  st2_e2_lite& xresult);
782 
783 } // namespace jcb_algebra
784 
785 } // namespace fiber_bundle
786 
787 
788 #endif // ifndef JCB_E23_H
jcb_e23_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: jcb_e23.impl.h:156
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: vd.h:129
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: jcb_e23.impl.h:82
Euclidean vector space of dimension 3 (volatile version).
Definition: e3.h:116
row_dofs_type _row_dofs
Row_dofs_type.
Definition: jcb_e23.h:249
Euclidean vector space of dimension 2 (persistent version).
Definition: e2.h:405
Jacobian of a map from a 2 dimensional domain (u, v) to a 3 dimensional Euclidean space (x...
Definition: jcb_e23.h:421
Abstract jacobian for d dimensional Euclidean space (volatile version).
Definition: jcb_ed.h:44
jcb_e23_lite volatile_type
The associated volatile type.
Definition: jcb_e23.h:495
The default name space; a poset which contains other posets as members.
void pull(const SJCB &xjcb, const SCOVECTOR &xcovector, SR &xresult, bool xauto_access)
Definition: sec_jcb.impl.h:95
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
T components[6]
The dofs in the following order: components[0] => dx/du components[1] => dx/dv components[2] => dy/du...
Definition: jcb_e23.h:125
jcb_e23_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: jcb_e23.h:161
A client handle for a general, abstract partially order set.
SHEAF_DLL_SPEC void symmetric_dot_push(const jcb_e23_lite &xjcb, const jcb_e23_lite &xother_jcb, st2_e2_lite &xresult)
Transpose of xjcb times xother_jcb, symmetric part.
Definition: jcb_e23.cc:1541
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 jcb_e23.
Definition: jcb_e23.h:49
virtual jcb_ed * clone() const
Make a new handle, no state instance of current.
Definition: jcb_ed.cc:725
static const std::string & static_class_name()
The name of this class.
Definition: jcb_e23.impl.h:42
e3 range_type
The type of range vector space.
Definition: jcb_e23.h:485
General matrix with 3 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
void push(const SJCB &xjcb, const SVECTOR &xvector, SR &xresult, bool xauto_access)
Definition: sec_jcb.impl.h:143
jcb_e23_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: jcb_e23.h:156
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).
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
T dof_type
The type of the dofs.
Definition: jcb_e23.h:56
Euclidean vector space of dimension 2 (volatile version).
Definition: e2.h:112
virtual jcb_e23_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: jcb_e23.h:365
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
jcb_e23_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: jcb_e23.h:490
jcb_e23_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: jcb_e23.h:111
SHEAF_DLL_SPEC void metric(const jcb_e23_lite &xjcb, st2_e2_lite &xresult)
Compute surface metric.
Definition: jcb_e23.cc:1522
static int d()
The dimension of the row dof components.
Definition: jcb_e23.impl.h:62
Jacobian of a map from a 2 dimensional domain (u, v) to a 3 dimensional Euclidean space (x...
Definition: jcb_e23.h:142
general_matrix_3x2< T > matrix_type
The type of the associated matrix.
Definition: jcb_e23.h:66
jcb_e23_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: jcb_e23.h:61
jcb_e23 * 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: jcb_e23.h:664
An abstract space of Jacobians.
Definition: jcb_space.h:46
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 2 (volatile version)...
Definition: st2_e2.h:150
Abstract jacobian for d dimensional Euclidean space (persistent version).
Definition: jcb_ed.h:185
An abstract client handle for a member of a poset.
Namespace for the fiber_bundles component of the sheaf system.
e2 domain_type
The type of domain vector space.
Definition: jcb_e23.h:480