SheafSystem  0.0.0.0
t3.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 T3_H
23 #define T3_H
24 
25 #ifndef SHEAF_DLL_SPEC_H
26 #include "SheafSystem/sheaf_dll_spec.h"
27 #endif
28 
29 #ifndef TP_H
30 #include "SheafSystem/tp.h"
31 #endif
32 
33 namespace fiber_bundle
34 {
35 
36 //==============================================================================
37 // CLASS T3_LITE
38 //==============================================================================
39 
43 class SHEAF_DLL_SPEC t3_lite : public tp_lite
44 {
45 
46  //============================================================================
48  //============================================================================
50 
51 public:
52 
56  t3_lite();
57 
61  t3_lite(const t3_lite& xother);
62 
66  t3_lite& operator=(const t3_lite& xother);
67 
71  virtual ~t3_lite();
72 
76  t3_lite(const row_dofs_type& xrow_dofs);
77 
81  t3_lite& operator=(const row_dofs_type& xrow_dofs);
82 
83 protected:
84 private:
85 
87 
88 
89  //============================================================================
91  //============================================================================
93 
94 public:
95 
101  enum static_const_int {P = 3};
102 
106  virtual int p() const;
107 
108 protected:
109 private:
110 
112 
113 
114  //============================================================================
116  //============================================================================
118 
119 public:
120 
124  virtual int d() const;
125 
126  using tp_lite::component;
128 
132  virtual value_type component(int xi, int xj, int xk) const;
133 
137  virtual void put_component(int xi, int xj, int xk, value_type xvalue);
138 
143  virtual int index_for_ijk(int xi, int xj, int xk) const;
144 
145 
146 protected:
147 private:
148 
150 
151 
152  //============================================================================
154  //============================================================================
156 
157 public:
158 protected:
159 private:
160 
162 
163 
164  //============================================================================
166  //============================================================================
168 
169 public:
170 
174  virtual const std::string& class_name() const;
175 
179  static const std::string& static_class_name();
180 
184  virtual t3_lite* clone() const;
185 
186 protected:
187 private:
188 
190 
191 
192  //============================================================================
194  //============================================================================
196 
197 public:
198 
202  virtual bool is_ancestor_of(const any_lite& xother) const;
203 
207  bool invariant() const;
208 
209 protected:
210 private:
211 
213 };
214 
215 //==============================================================================
216 // CLASS T3
217 //==============================================================================
218 
222 class SHEAF_DLL_SPEC t3 : public tp
223 {
224 
225  // ===========================================================
227  // ===========================================================
229 
230 public:
231 
235  static const poset_path& standard_schema_path();
236 
240  static void make_standard_schema(namespace_poset& xns);
241 
247  static host_type& new_host(namespace_type& xns,
248  const poset_path& xhost_path,
249  const poset_path& xschema_path,
250  const poset_path& xvector_space_path,
251  bool xauto_access);
252 
253 protected:
254 
255 private:
256 
258 
259 
260  //============================================================================
262  //============================================================================
264 
265 public:
266 
271 
275  t3();
276 
280  t3(const t3& xother);
281 
285  virtual t3& operator=(const abstract_poset_member& xother);
286 
290  t3& operator=(const t3& xother);
291 
295  virtual ~t3();
296 
300  virtual const volatile_type& lite_prototype() const;
301 
305  virtual volatile_type* lite_type() const;
306 
310  t3(poset* xhost, bool xauto_access = true);
311 
316  t3(const poset* xhost, pod_index_type xhub_id);
317 
322  t3(const poset* xhost, const scoped_index& xid);
323 
328  t3(const poset* xhost, const std::string& xname);
329 
330 protected:
331 private:
332 
334 
335 
336  //============================================================================
338  //============================================================================
340 
341 public:
342 
348  enum static_const_int {P = 3};
349 
350 protected:
351 
352 private:
353 
355 
356 
357  //============================================================================
359  //============================================================================
361 
362 public:
363 
364  using tp::component;
365  using tp::put_component;
366 
370  virtual value_type component(int xi, int xj, int xk) const;
371 
375  value_type component(int xi, int xj, int xk, bool xauto_access) const;
376 
380  virtual void put_component(int xi, int xj, int xk, value_type xvalue);
381 
385  void put_component(int xi, int xj, int xk, value_type xvalue, bool xauto_access);
386 
391  virtual int index_for_ijk(int xi, int xj, int xk) const;
392 
393 protected:
394 private:
395 
397 
398 
399  //============================================================================
401  //============================================================================
403 
404 public:
405 
406 protected:
407 
408 private:
409 
411 
412 
413  //============================================================================
415  //============================================================================
417 
418 public:
419 
423  virtual const std::string& class_name() const;
424 
428  static const std::string& static_class_name();
429 
433  virtual t3* clone() const;
434 
440  inline t3* clone(bool xnew_state, bool xauto_access = true) const
441  {
442  return static_cast<t3*>(tp::clone(xnew_state, xauto_access));
443  }
444 
445 protected:
446 private:
447 
449 
450 
451  //============================================================================
453  //============================================================================
455 
456 public:
457 
461  virtual bool invariant() const;
462 
466  virtual bool is_ancestor_of(const any* other) const;
467 
468 protected:
469 private:
470 
472 };
473 
474 //==============================================================================
475 // NON-MEMBER FUNCTIONS
476 //==============================================================================
477 
478 class at1;
479 class at1_lite;
480 class at2;
481 class at2_lite;
482 class at3;
483 class at3_lite;
484 
485 class st2;
486 class st2_lite;
487 class st3;
488 class st3_lite;
489 
490 class t2;
491 class t2_lite;
492 
493 //==============================================================================
494 // TP FACET
495 //==============================================================================
496 
497 namespace tp_algebra
498 {
499 
504 SHEAF_DLL_SPEC void contract(const t3_lite& x0, int xp, int xq, at1_lite& xresult);
505 
510 SHEAF_DLL_SPEC void contract(const t3& x0, int xp, int xq, at1& xresult,
511  bool xauto_access);
512 
513 //==============================================================================
514 
519 SHEAF_DLL_SPEC void alt(const t3_lite& x0, t3_lite& xresult);
520 
525 SHEAF_DLL_SPEC void alt(const t3_lite& x0, at3_lite& xresult);
526 
531 SHEAF_DLL_SPEC void alt(const t3& x0, at3& xresult, bool xauto_access);
532 
533 
534 //==============================================================================
539 SHEAF_DLL_SPEC void sym(const t3_lite& x0, t3_lite& xresult);
540 
545 SHEAF_DLL_SPEC void sym(const t3_lite& x0, st3_lite& xresult);
546 
551 SHEAF_DLL_SPEC void sym(const t3& x0, st3& xresult, bool xauto_access);
552 
553 //==============================================================================
558 SHEAF_DLL_SPEC void tensor(const t2_lite& x0, const at1_lite& x1, t3_lite& xresult);
559 
564 SHEAF_DLL_SPEC void tensor(const t2& x0, const at1& x1, t3& xresult, bool xauto_access);
565 
570 SHEAF_DLL_SPEC void tensor(const at1_lite& x0, const t2_lite& x1, t3_lite& xresult);
571 
576 SHEAF_DLL_SPEC void tensor(const at1& x0, const t2& x1, t3& xresult, bool xauto_access);
577 
578 //==============================================================================
579 
584 SHEAF_DLL_SPEC void tensor(const at2_lite& x0, const at1_lite& x1, t3_lite& xresult);
585 
590 SHEAF_DLL_SPEC void tensor(const at2& x0, const at1& x1, t3& xresult, bool xauto_access);
591 
596 SHEAF_DLL_SPEC void tensor(const at1_lite& x0, const at2_lite& x1, t3_lite& xresult);
597 
602 SHEAF_DLL_SPEC void tensor(const at1& x0, const at2& x1, t3& xresult, bool xauto_access);
603 
604 //========================================================================
605 
610 SHEAF_DLL_SPEC void tensor(const st2_lite& x0, const at1_lite& x1, t3_lite& xresult);
611 
616 SHEAF_DLL_SPEC void tensor(const st2& x0, const at1& x1, t3& xresult, bool xauto_access);
617 
622 SHEAF_DLL_SPEC void tensor(const at1_lite& x0, const st2_lite& x1, t3_lite& xresult);
623 
628 SHEAF_DLL_SPEC void tensor(const at1& x0, const st2& x1, t3& xresult, bool xauto_access);
629 
630 //==============================================================================
631 
632 } // namespace tp_algebra
633 
634 
635 } // end namespace fiber_bundle
636 
637 
638 #endif // ifndef T3_H
A tensor of degree 3 over an abstract vector space (volatile version).
Definition: t3.h:43
An antisymmetric rank 3 tensor over an abstract vector space (volatile version).
Definition: at3.h:43
void alt(const GT &x0, AT &xresult, bool xauto_access)
Definition: sec_tp.impl.h:140
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: vd.h:129
void sym(const GT &x0, ST &xresult, bool xauto_access)
Definition: sec_tp.impl.h:184
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 tensor of degree 3 over an abstract vector space (persistent version).
Definition: t3.h:222
A general antisymmetric tensor of degree 1 over an abstract vector space (volatile version)...
Definition: at1.h:44
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
value_type component(int xindex) const
The xindex-th component.
Definition: vd.cc:209
static_const_int
The tensor degree (static version)
Definition: t3.h:348
A tensor of degree 2 over an abstract vector space (volatile version).
Definition: t2.h:43
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
A general symmetric tensor of degree 2 over an abstract vector space (volatile version).
Definition: st2.h:43
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
A symmetric rank 3 tensor over an abstract vector space (persistent version).
Definition: st3.h:230
virtual value_type component(int xindex) const
The value of the xi-th component.
Definition: vd.cc:1115
A symmetric rank 3 tensor over an abstract vector space. (volatile version).
Definition: st3.h:43
An antisymmetric rank 3 tensor over an abstract vector space (volatile version).
Definition: at3.h:230
SHEAF_DLL_SPEC tensor_variance contract(const tensor_variance &x0, int xp, int xq)
The variance of the contration of a tensor with variance x0 on indices xp and xq. ...
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
t3 * 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: t3.h:440
void put_component(int xindex, value_type xcomp)
Set the xindex-th component to xcomp.
Definition: vd.cc:230
static_const_int
The tensor degree (static version)
Definition: t3.h:101
virtual tp * clone() const
Make a new handle, no state instance of current.
Definition: tp.cc:1363
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
vd_value_type value_type
The POD ("plain old data") type of scalar in the vector space of this.
Definition: vd.h:423
t3_lite volatile_type
The associated volatile type.
Definition: t3.h:270
A general antisymmetric tensor of degree 2 over an abstract vector space (volatile version)...
Definition: at2.h:43
An abstract client handle for a member of a poset.
virtual void put_component(int xindex, value_type xvalue)
Sets the value of the xindex-th component to xvalue.
Definition: vd.cc:1169
An abstract tensor space of degree p.
Definition: tp_space.h:47
Namespace for the fiber_bundles component of the sheaf system.
A general symmetric tensor of degree 2 over an abstract vector space (persistent version).
Definition: st2.h:234
Row dofs type for class vd.
Definition: vd.h:61
A general antisymmetric tensor of degree 2 over an abstract vector space.
Definition: at2.h:233
void tensor(const S0 &x0, const S1 &x1, SR &xresult, bool xauto_access)
Definition: sec_tp.impl.h:228
A tensor of degree 2 over an abstract vector space (persistent version).
Definition: t2.h:226