SheafSystem  0.0.0.0
jcb.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_H
22 #define JCB_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef VD_H
29 #include "SheafSystem/vd.h"
30 #endif
31 
32 #ifndef JCB_TABLE_DOFS_TYPE_H
33 #include "SheafSystem/jcb_table_dofs_type.h"
34 #endif
35 
36 
37 namespace fiber_bundle
38 {
39  //
40  // Forward declarations
41  //
42 
43  class at1;
44  class jcb_space;
45 
46 //==============================================================================
47 // CLASS JCB_LITE
48 //==============================================================================
49 
54 class SHEAF_DLL_SPEC jcb_lite : public vd_lite
55 {
56  //============================================================================
58  //============================================================================
60 
61 public:
62 
67 
71  jcb_lite();
72 
76  jcb_lite(const jcb_lite& xother);
77 
81  jcb_lite& operator=(const jcb_lite& xother);
82 
86  virtual ~jcb_lite();
87 
91  jcb_lite(const row_dofs_type& xrow_dofs);
92 
96  jcb_lite& operator=(const row_dofs_type& xrow_dofs);
97 
101  virtual int dd() const;
102 
106  virtual int dr() const;
107 
111  table_dofs_type table_dofs() const;
112 
113  using vd_lite::component;
114  using vd_lite::put_component;
115 
120  value_type component(int xrow, int xcolumn) const;
121 
125  void put_component(int xrow, int xcolumn, value_type xcomp);
126 
131  virtual int index_for_row_column(int xrow, int xcolumn) const;
132 
133 protected:
134 private:
135 
137 
138 
139  //============================================================================
141  //============================================================================
143 
144 public:
145 
149  virtual int d() const;
150 
151 protected:
152 private:
153 
155 
156 
157  //============================================================================
159  //============================================================================
161 
162 public:
163 protected:
164 private:
165 
167 
168 
169  //============================================================================
171  //============================================================================
173 
174 public:
175 
179  virtual const std::string& class_name() const;
180 
184  static const std::string& static_class_name();
185 
189  virtual jcb_lite* clone() const;
190 
191 protected:
192 private:
193 
195 
196 
197  //============================================================================
199  //============================================================================
201 
202 public:
203 
207  virtual bool is_ancestor_of(const any_lite& xother) const;
208 
213  bool invariant() const;
214 
215 protected:
216 private:
217 
219 };
220 
221 
222 //==============================================================================
223 // CLASS JCB
224 //==============================================================================
225 
229 class SHEAF_DLL_SPEC jcb : public vd
230 {
231 
232  // ===========================================================
234  // ===========================================================
236 
237 public:
238 
243 
247  static const poset_path& standard_schema_path();
248 
252  static void make_standard_schema(namespace_poset& xns);
253 
260  static host_type& new_host(namespace_type& xns,
261  const poset_path& xhost_path,
262  const poset_path& xschema_path,
263  const poset_path& xdomain_path,
264  const poset_path& xrange_path,
265  bool xauto_access);
266 
267 protected:
268 
269 private:
270 
272 
273 
274  //============================================================================
276  //============================================================================
278 
279 public:
280 
281  // Typedefs:
282 
286  typedef at1 domain_type;
287 
288 // ///
289 // /// The type of vector space; synonym for domain_type.
290 // /// @hack Just to make jcb consistent with namespace
291 // /// factory queries designed for tensor spaces.
292 // ///
293 // typedef domain_type vector_space_type;
294 
298  typedef at1 range_type;
299 
304 
309 
313  jcb();
314 
319  jcb(const poset_state_handle* xhost, pod_index_type xhub_id);
320 
325  jcb(const poset_state_handle* xhost, const scoped_index& xid);
326 
331  jcb(const poset_state_handle* xhost, const std::string& xname);
332 
336  explicit jcb(abstract_poset_member* xother);
337 
341  jcb(poset_state_handle* xhost, bool xauto_access = true);
342 
346  virtual jcb& operator=(const abstract_poset_member& xother);
347 
351  jcb& operator=(const jcb& xother);
352 
356  ~jcb();
357 
361  virtual const volatile_type& lite_prototype() const;
362 
366  virtual volatile_type* lite_type() const;
367 
371  virtual int dd() const;
372 
376  int dd(bool xauto_access) const;
377 
381  poset_path domain_path() const;
382 
386  poset_path domain_path(bool xauto_access) const;
387 
391  virtual int dr() const;
392 
396  int dr(bool xauto_access) const;
397 
401  poset_path range_path() const;
402 
406  poset_path range_path(bool xauto_access) const;
407 
412  virtual int index_for_row_column(int xrow, int xcolumn) const;
413 
414 protected:
415 private:
416 
418 
419 
420  //============================================================================
422  //============================================================================
424 
425 public:
426 
427  using vd::component;
428  using vd::put_component;
429 
433  value_type component(int xrow, int xcolumn) const;
434 
438  value_type component(int xrow, int xcolumn, bool xauto_access) const;
439 
443  void put_component(int xrow, int xcolumn, value_type xvalue);
444 
448  void put_component(int xrow, int xcolumn, value_type xvalue, bool xauto_access);
449 
450 protected:
451 private:
452 
454 
455 
456  //============================================================================
458  //============================================================================
460 
461 public:
462 
463 protected:
464 
465 private:
466 
468 
469 
470  //============================================================================
472  //============================================================================
474 
475 public:
476 
480  virtual const std::string& class_name() const;
481 
485  static const std::string& static_class_name();
486 
492  inline jcb* clone(bool xnew_state, bool xauto_access = true) const
493  {
494  return static_cast<jcb*>(vd::clone(xnew_state, xauto_access));
495  }
496 
497 protected:
498 private:
499 
501 
502 
503  // ===========================================================
505  // ===========================================================
507 
508 public:
509 
513  host_type* host() const;
514 
518  virtual bool host_is_ancestor_of(const poset_state_handle* other) const;
519 
520 protected:
521 
522 private:
523 
525 
526  //============================================================================
528  //============================================================================
530 
531 public:
532 
536  bool is_ancestor_of(const any* xother) const;
537 
541  virtual jcb* clone() const; // = 0;
542 
546  bool invariant() const;
547 
548 protected:
549 private:
550 
552 };
553 
554 //==============================================================================
555 // NON-MEMBER FUNCTIONS
556 //==============================================================================
557 
558 #ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
559 
563 SHEAF_DLL_SPEC std::ostream& operator<<(std::ostream& xos, jcb_lite::table_dofs_type& xt);
564 
565 #endif // ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
566 
567 class at1;
568 class at1_lite;
569 
570 //==============================================================================
571 // JCB FACET:
572 //==============================================================================
573 
578 namespace jcb_algebra
579 {
580 
581 #ifndef DOXYGEN_SKIP_UNKNOWN
582 
586 SHEAF_DLL_SPEC void push(const jcb& xjcb,
587  const at1& xvector,
588  at1& xresult,
589  bool xauto_access);
590 
594 SHEAF_DLL_SPEC void push(const jcb_lite& xjcb,
595  const at1_lite& xvector,
596  at1_lite& xresult);
597 
601 SHEAF_DLL_SPEC at1_lite* push(const jcb_lite& xjcb, const at1_lite& xvector);
602 
603 #endif // ifndef DOXYGEN_SKIP_UNKNOWN
604 
605 //==============================================================================
606 
610 SHEAF_DLL_SPEC void pull(const jcb& xjcb,
611  const at1& xcovector,
612  at1& xresult,
613  bool xauto_access);
614 
618 SHEAF_DLL_SPEC void pull(const jcb_lite& xjcb,
619  const at1_lite& xcovector,
620  at1_lite& xresult);
621 
625 SHEAF_DLL_SPEC at1_lite* pull(const jcb_lite& xjcb, const at1_lite& xvector);
626 
627 } // namespace jcb_algebra
628 
629 } // namespace fiber_bundle
630 
631 
632 #endif // ifndef JCB_H
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: vd.h:129
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
at1 range_type
The type of range vector space.
Definition: jcb.h:298
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 general antisymmetric tensor of degree 1 over an abstract vector space (volatile version)...
Definition: at1.h:44
A client handle for a general, abstract partially order set.
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
jcb_table_dofs_type table_dofs_type
The type of the table dofs.
Definition: jcb.h:308
value_type component(int xindex) const
The xindex-th component.
Definition: vd.cc:209
void push(const SJCB &xjcb, const SVECTOR &xvector, SR &xresult, bool xauto_access)
Definition: sec_jcb.impl.h:143
jcb_space host_type
The type of host poset.
Definition: jcb.h:242
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
Abstract vector space over dof_type (volatile version).
Definition: vd.h:111
jcb_lite volatile_type
The associated volatile type.
Definition: jcb.h:303
Table dofs type for class jcb.
Abstract jacobian class (volatile version).
Definition: jcb.h:54
jcb_table_dofs_type table_dofs_type
The type of the table dofs.
Definition: jcb.h:66
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
jcb * 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.h:492
virtual value_type component(int xindex) const
The value of the xi-th component.
Definition: vd.cc:1115
Abstract jacobian class.
Definition: jcb.h:229
void put_component(int xindex, value_type xcomp)
Set the xindex-th component to xcomp.
Definition: vd.cc:230
An abstract space of Jacobians.
Definition: jcb_space.h:46
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
vd_value_type value_type
The POD ("plain old data") type of scalar in the vector space of this.
Definition: vd.h:423
virtual vd * clone() const
Make a new handle, no state instance of current.
Definition: vd.cc:1543
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
at1 domain_type
The type of domain vector space.
Definition: jcb.h:286
Namespace for the fiber_bundles component of the sheaf system.
Abstract vector space over dof_type.
Definition: vd.h:350
Row dofs type for class vd.
Definition: vd.h:61
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