SheafSystem  0.0.0.0
sec_at3_e3.cc
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 #include "SheafSystem/sec_at3_e3.h"
23 
24 #include "SheafSystem/assert_contract.h"
25 #include "SheafSystem/base_space_poset.h"
26 #include "SheafSystem/binary_section_space_schema_member.impl.h"
27 #include "SheafSystem/at1_space.h"
28 #include "SheafSystem/fiber_bundles_namespace.h"
29 #include "SheafSystem/index_space_iterator.h"
30 #include "SheafSystem/sec_at0.h"
31 #include "SheafSystem/sec_at0_space.h"
32 #include "SheafSystem/sec_at1_space.h"
33 #include "SheafSystem/sec_e3.h"
34 #include "SheafSystem/sec_tuple.impl.h"
35 #include "SheafSystem/sec_tuple_space.impl.h"
36 #include "SheafSystem/sec_vd.impl.h"
37 #include "SheafSystem/at3_e3.h"
38 
39 using namespace std;
40 using namespace fiber_bundle; // Workaround for MS C++ bug.
41 
42 //==============================================================================
43 // CLASS SEC_AT3_E3
44 //==============================================================================
45 
46 // ===========================================================
47 // HOST FACTORY FACET OF CLASS SEC_AT3_E3
48 // ===========================================================
49 
50 // PUBLIC MEMBER FUNCTIONS
51 
55  const poset_path& xhost_path,
56  const poset_path& xschema_path,
57  const poset_path& xvector_space_path,
58  bool xauto_access)
59 {
60  // cout << endl << "Entering sec_at3_e3::new_host." << endl;
61 
62  // Preconditions:
63 
64  require(xns.state_is_auto_read_write_accessible(xauto_access));
65 
66  require(!xhost_path.empty());
67  require(!xns.contains_path(xhost_path, xauto_access));
68 
69  require(xschema_path.full());
70  require(xns.path_is_auto_read_accessible<schema_type::host_type>(xschema_path, xauto_access));
71  require(host_type::fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
72 
73  require(xns.path_is_auto_read_accessible<vector_space_type::host_type>(xvector_space_path, xauto_access));
74 
75  require(host_type::same_vector_fiber_space(xns, xschema_path, xvector_space_path, xauto_access));
76 
77  // Body:
78 
79  host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xvector_space_path, xauto_access);
80 
81  // Postconditions:
82 
83  ensure(xns.owns(result, xauto_access));
84  ensure(result.path(true) == xhost_path);
85  ensure(result.state_is_not_read_accessible());
86  ensure(result.schema(true).path(xauto_access) == xschema_path);
87 
88  ensure(result.factor_ct(true) == result.schema(true).fiber_space<fiber_type::host_type>().factor_ct(xauto_access));
89  ensure(result.d(true) == result.schema(true).fiber_space<fiber_type::host_type>().d(xauto_access));
90  ensure(result.scalar_space_path(true) ==
91  xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).scalar_space_path(xauto_access));
92  ensure(result.p(true) == result.schema(true).fiber_space<fiber_type::host_type>().p(xauto_access));
93  ensure(result.p(true) == 3);
94  ensure(result.dd(true) == result.schema(true).fiber_space<fiber_type::host_type>().dd(xauto_access));
95  ensure(result.vector_space_path(true) == xvector_space_path);
96 
97  // Exit:
98 
99  // cout << "Leaving sec_at3_e3::new_host." << endl;
100  return result;
101 }
102 
106  const poset_path& xbase_path,
107  const poset_path& xrep_path,
108  const std::string& xsection_suffix,
109  const std::string& xfiber_suffix,
110  bool xauto_access)
111 {
112  // cout << endl << "Entering sec_at3_e3::new_host." << endl;
113 
114  // Preconditions:
115 
116  require(xns.state_is_auto_read_write_accessible(xauto_access));
117 
118  require(xbase_path.full());
119  require(xns.path_is_auto_read_accessible<base_space_poset>(xbase_path, xauto_access));
120 
121  require(xrep_path.empty() || xrep_path.full());
122  require(xrep_path.empty() || xns.path_is_auto_read_accessible<sec_rep_descriptor_poset>(xrep_path, xauto_access));
123 
124  require(xsection_suffix.empty() || poset_path::is_valid_name(xsection_suffix));
125 
126  require(xfiber_suffix.empty() || poset_path::is_valid_name(xfiber_suffix));
127 
128  require(standard_host_is_available<sec_at3_e3>(xns, xbase_path, xrep_path, xsection_suffix, xfiber_suffix, xauto_access));
129  require(fiber_type::standard_host_is_available<fiber_type>(xns, xfiber_suffix, xauto_access));
130  require(schema_type::standard_host_is_available<sec_at3_e3>(xns, xbase_path, xrep_path, xfiber_suffix, xauto_access));
131 
132  // Body:
133 
134  poset_path lstd_path = standard_host_path<sec_at3_e3>(xbase_path, xrep_path, xsection_suffix, xfiber_suffix);
135 
136  host_type* lresult_ptr;
137 
138  if(xns.contains_path(lstd_path, xauto_access))
139  {
140  // Standard host already exists, just return it.
141 
142  lresult_ptr = &xns.member_poset<host_type>(lstd_path, xauto_access);
143  }
144  else
145  {
146  // Standard host doesn't exist, have to create it.
147 
148  // Apply default for rep path if needed.
149 
150  poset_path lrep_path = (!xrep_path.empty() ? xrep_path : standard_rep_path());
151 
152  // Find or create the standard schema member.
153 
154  poset_path lstd_schema_path =
155  schema_type::standard_member<sec_at3_e3>(xns, xbase_path, lrep_path, xfiber_suffix, xauto_access);
156 
157  // Find or create the standard vector space.
158 
159  poset_path lvector_space_path =
160  vector_space_type::standard_host(xns, xbase_path, lrep_path, xsection_suffix, xfiber_suffix, xauto_access).path(xauto_access);
161 
162  // Create the standard host.
163 
164  lresult_ptr = &new_host(xns, lstd_path, lstd_schema_path, lvector_space_path, xauto_access);
165  }
166 
167  host_type& result = *lresult_ptr;
168 
169  // Postconditions:
170 
171  ensure(xns.owns(result, xauto_access));
172  ensure(result.path(true) == standard_host_path<sec_at3_e3>(xbase_path, xrep_path, xsection_suffix, xfiber_suffix));
173  ensure(result.state_is_not_read_accessible());
174  ensure(result.schema(true).path(xauto_access) ==
175  schema_type::standard_member_path<sec_at3_e3>(xbase_path, xrep_path, xfiber_suffix));
176 
177  ensure(result.factor_ct(true) == result.schema(true).fiber_space<fiber_type::host_type>().factor_ct(xauto_access));
178  ensure(result.d(true) == result.schema(true).fiber_space<fiber_type::host_type>().d(xauto_access));
179  ensure(result.scalar_space_path(true) ==
180  scalar_type::standard_host_path<scalar_type>(xbase_path, result.rep().path(xauto_access), xsection_suffix, xfiber_suffix));
181  ensure(result.p(true) == result.schema(true).fiber_space<fiber_type::host_type>().p(xauto_access));
182  ensure(result.p(true) == 3);
183  ensure(result.dd(true) == result.schema(true).fiber_space<fiber_type::host_type>().dd(xauto_access));
184  ensure(result.vector_space_path(true) ==
185  vector_space_type::standard_host_path<vector_space_type>(xbase_path, result.rep().path(xauto_access), xsection_suffix, xfiber_suffix));
186 
187  // Exit:
188 
189  // cout << "Leaving sec_at3_e3::new_host." << endl;
190  return result;
191 }
192 
193 // PROTECTED MEMBER FUNCTIONS
194 
195 // PRIVATE MEMBER FUNCTIONS
196 
197 
198 //==============================================================================
199 // AT3_E3 FACET OF CLASS SEC_AT3_E3
200 //==============================================================================
201 
202 // PUBLIC MEMBER FUNCTIONS
203 
206 {
207 
208  // Preconditions:
209 
210  // Body:
211 
212  // Postconditions:
213 
214  ensure(invariant());
215 }
216 
219 {
220 
221  // Preconditions:
222 
223  require(xother.is_attached() ? xother.state_is_read_accessible() : true);
224 
225  // Body:
226 
227  attach_to_state(&xother);
228 
229  // Postconditions:
230 
231  ensure(invariant());
232  ensure(is_attached() == xother.is_attached());
233  ensure(is_same_state(&xother));
234  ensure(is_same_restriction(&xother));
235 
236 }
237 
240  abstract_poset_member& xbase_mbr,
241  int xbase_version, bool xauto_access)
242 {
243 
244  // Preconditions:
245 
246  require(precondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
247 
248  // Body:
249 
250  new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access);
251 
252  // Postconditions:
253 
254  ensure(postcondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
255 
256  // Exit:
257 
258  return;
259 }
260 
262 sec_at3_e3(sec_rep_space* xhost, section_dof_map* xdof_map, bool xauto_access)
263 {
264 
265  // Preconditions:
266 
267  require(precondition_of(new_jim_state(xhost, xdof_map, false, xauto_access)));
268 
269  // Body:
270 
271  new_jim_state(xhost, xdof_map, false, xauto_access);
272 
273  // Postconditions:
274 
275  ensure(postcondition_of(new_jim_state(xhost, xdof_map, false, xauto_access)));
276 
277  // Exit:
278 
279  return;
280 }
281 
284 {
285  // Preconditions:
286 
287  require(xhost != 0);
288  require(xhost->state_is_read_accessible());
289  require(xhost->contains_member(xhub_id));
290 
291  // Body:
292 
293  attach_to_state(xhost, xhub_id);
294 
295  // Postconditions:
296 
297  ensure(invariant());
298  //ensure(host() == xhost);
299  ensure(index() == xhub_id);
300  ensure(is_attached());
301  ensure(!is_restricted());
302 }
303 
305 sec_at3_e3(const sec_rep_space* xhost, const scoped_index& xid)
306 {
307  // Preconditions:
308 
309  require(xhost != 0);
310  require(xhost->state_is_read_accessible());
311  require(xhost->contains_member(xid));
312 
313  // Body:
314 
315  attach_to_state(xhost, xid.hub_pod());
316 
317  // Postconditions:
318 
319  ensure(invariant());
320  //ensure(host() == xhost);
321  ensure(index() ==~ xid);
322  ensure(is_attached());
323  ensure(!is_restricted());
324 }
325 
327 sec_at3_e3(const sec_rep_space* xhost, const std::string& xname)
328 {
329 
330  // Preconditions:
331 
332  require(xhost != 0);
333  require(xhost->state_is_read_accessible());
334  require(!xname.empty());
335  require(xhost->contains_member(xname));
336 
337  // Body:
338 
339  attach_to_state(xhost, xname);
340 
341  // Postconditions:
342 
343  ensure(invariant());
344  //ensure(host() == xhost);
345  ensure(name() == xname);
346  ensure(is_attached());
347  ensure(!is_restricted());
348 
349 }
350 
352 sec_at3_e3(const namespace_poset* xnamespace,
353  const poset_path& xpath,
354  bool xauto_access)
355 {
356 
357  // Preconditions:
358 
359  require(precondition_of(attach_to_state(same args)));
360 
361  // Body:
362 
363  attach_to_state(xnamespace, xpath, xauto_access);
364 
365  // Postconditions:
366 
367  ensure(postcondition_of(attach_to_state(same args)));
368 
369  // Exit:
370 
371  return;
372 }
373 
377 {
378  // Preconditions:
379 
380  require(is_ancestor_of(&xother));
381  require(precondition_of(attach_to_state(&xother)));
382 
383  // Body:
384 
385  attach_to_state(&xother);
386 
387  // Postconditions:
388 
389  ensure(postcondition_of(attach_to_state(&xother)));
390 
391  // Exit:
392 
393  return *this;
394 }
395 
398 operator=(const sec_at3_e3& xother)
399 {
400  // Preconditions:
401 
402  require(precondition_of(attach_to_state(&xother)));
403 
404  // Body:
405 
406  attach_to_state(&xother);
407 
408  // Postconditions:
409 
410  ensure(postcondition_of(attach_to_state(&xother)));
411 
412  // Exit:
413 
414  return *this;
415 }
416 
419 operator=(const at3_e3& xfiber)
420 {
421  // Preconditions:
422 
423  require(precondition_of(sec_vd::operator=(xfiber)));
424 
425  // Body:
426 
427  sec_vd::operator=(xfiber);
428 
429  // Postconditions:
430 
431  ensure(postcondition_of(sec_vd::operator=(xfiber)));
432 
433  // Exit:
434 
435  return *this;
436 }
437 
440 operator=(const at3_e3_lite& xfiber)
441 {
442  // Preconditions:
443 
444  require(precondition_of(sec_vd::operator=(xfiber)));
445 
446  // Body:
447 
448  sec_vd::operator=(xfiber);
449 
450  // Postconditions:
451 
452  ensure(postcondition_of(sec_vd::operator=(xfiber)));
453 
454  // Exit:
455 
456  return *this;
457 }
458 
461 {
462  // Preconditions:
463 
464  // Body:
465 
466  // Postconditions:
467 
468 }
469 
473 {
474  // Preconditions:
475 
476  // Body:
477 
478  static const fiber_type result;
479 
480  // Postconditions:
481 
482  // Exit:
483 
484  return result;
485 }
486 
487 // PROTECTED MEMBER FUNCTIONS
488 
489 // PRIVATE MEMBER FUNCTIONS
490 
491 
492 //==============================================================================
493 // AT3 FACET OF CLASS SEC_AT3_E3
494 //==============================================================================
495 
496 // PUBLIC MEMBER FUNCTIONS
497 
498 // PROTECTED MEMBER FUNCTIONS
499 
500 // PRIVATE MEMBER FUNCTIONS
501 
502 
503 //==============================================================================
504 // ATP FACET OF CLASS SEC_AT3_E3
505 //==============================================================================
506 
507 // PUBLIC MEMBER FUNCTIONS
508 
509 // PROTECTED MEMBER FUNCTIONS
510 
511 // PRIVATE MEMBER FUNCTIONS
512 
513 
514 //==============================================================================
515 // TP FACET OF CLASS SEC_AT3_E3
516 //==============================================================================
517 
518 // PUBLIC MEMBER FUNCTIONS
519 
520 // PROTECTED MEMBER FUNCTIONS
521 
522 // PRIVATE MEMBER FUNCTIONS
523 
524 
525 //==============================================================================
526 // VD FACET OF CLASS SEC_AT3_E3
527 //==============================================================================
528 
529 // PUBLIC MEMBER FUNCTIONS
530 
531 // PROTECTED MEMBER FUNCTIONS
532 
533 // PRIVATE MEMBER FUNCTIONS
534 
535 
536 //==============================================================================
537 // TUPLE FACET OF CLASS SEC_AT3_E3
538 //==============================================================================
539 
540 // PUBLIC MEMBER FUNCTIONS
541 
542 // PROTECTED MEMBER FUNCTIONS
543 
544 // PRIVATE MEMBER FUNCTIONS
545 
546 
547 //==============================================================================
548 // ABSTRACT POSET MEMBER FACET OF CLASS SEC_AT3_E3
549 //==============================================================================
550 
551 // PUBLIC MEMBER FUNCTIONS
552 
553 const std::string&
555 class_name() const
556 {
557  // Preconditions:
558 
559  // Body:
560 
561  const string& result = static_class_name();
562 
563  // Postconditions:
564 
565  ensure(!result.empty());
566 
567  // Exit:
568 
569  return result;
570 }
571 
572 const std::string&
575 {
576  // Preconditions:
577 
578  // Body:
579 
580  static const string result("sec_at3_e3");
581 
582  // Postconditions:
583 
584  ensure(!result.empty());
585 
586  // Exit:
587 
588  return result;
589 }
590 
593 clone() const
594 {
595 
596  // Preconditions:
597 
598  // Body:
599 
600  // create new handle of the current class.
601 
602  sec_at3_e3 *result = new sec_at3_e3();
603 
604  // Postconditions:
605 
606  ensure(result != 0);
607  ensure(result->invariant());
608 
609  // Exit:
610 
611  return result;
612 
613 }
614 
615 // PROTECTED MEMBER FUNCTIONS
616 
617 // PRIVATE MEMBER FUNCTIONS
618 
619 
620 //==============================================================================
621 // ANY FACET OF CLASS SEC_AT3_E3
622 //==============================================================================
623 
624 // PUBLIC MEMBER FUNCTIONS
625 
626 bool
628 fiber_is_ancestor_of(const any* xother) const
629 {
630 
631  // Preconditions:
632 
633  require(xother != 0);
634 
635  // Body:
636 
637  bool result = dynamic_cast<const at3_e3*>(xother) != 0;
638 
639  // Postconditions:
640 
641  ensure(invariant());
642  ensure(xother->invariant());
643 
644  // Exit:
645 
646  return result;
647 
648 }
649 
650 bool
652 is_ancestor_of(const any* xother) const
653 {
654 
655  // Preconditions:
656 
657  require(xother != 0);
658 
659  // Body:
660 
661  bool result = dynamic_cast<const sec_at3_e3*>(xother) != 0;
662 
663  // Postconditions:
664 
665  //ensure(invariant());
666 
667  // Exit:
668 
669  return result;
670 
671 }
672 
673 bool
675 invariant() const
676 {
677  bool result = true;
678 
679  // Body:
680 
681  if (invariant_check())
682  {
683  // Prevent recursive calls to invariant
684 
685  disable_invariant_check();
686 
687  // Must satisfy base class invariant
688 
689  invariance(sec_atp::invariant());
690 
691  // Invariances for this class:
692 
693  invariance(state_is_read_accessible() ? dd() == 3 : true);
694 
695  // Finished, turn invariant checking back on.
696 
697  enable_invariant_check();
698  }
699 
700  // Exit:
701 
702  return result;
703 }
704 
705 // PROTECTED MEMBER FUNCTIONS
706 
707 // PRIVATE MEMBER FUNCTIONS
708 
709 
710 //==============================================================================
711 // NON-MEMBER FUNCTIONS
712 //==============================================================================
713 
714 namespace
715 {
716  using namespace fiber_bundle::atp_algebra;
717 
718  class hook_functor
719  {
720  public:
721  void operator()(const at3_e3_lite& x0, const e3_lite& x1,
722  at2_e3_lite& xresult) const
723  {
724  hook(x0, x1, xresult);
725  }
726  };
727 
728  class star_functor
729  {
730  public:
731  void operator()(const at3_e3_lite& x0, at0_lite& xresult) const
732  {
733  star(x0, xresult);
734  }
735 
736  void operator()(const at0_lite& x0, at3_e3_lite& xresult) const
737  {
738  star(x0, xresult);
739  }
740  };
741 
742  class wedge_functor
743  {
744  public:
745  void operator()(const at2_e3_lite& x0, const e3_lite& x1,
746  at3_e3_lite& xresult) const
747  {
748  wedge(x0, x1, xresult);
749  }
750  };
751 
752 } //end unnamed namespace
753 
754 //==============================================================================
755 
756 #include "SheafSystem/sec_vd.impl.h"
757 #include "SheafSystem/sec_at2_e3.h"
758 #include "SheafSystem/sec_e3.h"
759 #include "SheafSystem/sec_at0.h"
760 
761 using namespace fiber_bundle::sec_vd_algebra;
762 
763 void
765 hook(const sec_at3_e3& x0, const sec_e3& x1, sec_at2_e3& xresult,
766  bool xauto_access)
767 {
768  // Preconditions:
769 
770  require(x0.state_is_auto_read_accessible(xauto_access));
771  require(x1.state_is_auto_read_accessible(xauto_access));
772  require(xresult.state_is_auto_read_write_accessible(xauto_access));
773  require(x1.dd(xauto_access) == x0.dd(xauto_access));
774  require(x0.is_p_form(xauto_access) == x1.is_p_form(xauto_access));
775  require(xresult.p(xauto_access) == x0.p(xauto_access) - 1);
776 
777  // Body:
778 
779  binary_op(x0, x1, xresult, hook_functor(), xauto_access);
780 
781  // Set the variance of the result.
782 
783  xresult.put_variance(hook(x0.variance(xauto_access)), xauto_access);
784 
785  // Postconditions:
786 
787  ensure(xresult.variance(xauto_access) == hook(x0.variance(xauto_access)));
788 
789  // Exit:
790 
791  return;
792 }
793 
794 void
796 star(const sec_at3_e3& x0, sec_at0& xresult, bool xauto_access)
797 {
798  // Preconditions:
799 
800  require(x0.state_is_auto_read_accessible(xauto_access));
801  require(xresult.state_is_auto_read_write_accessible(xauto_access));
802 
803  // Body:
804 
805  unary_op(x0, xresult, star_functor(), xauto_access);
806 
807  // Set the variance of the result.
808 
809  // If the x0.p() == 0 then x0 is a sec_at0 which is both a p_form
810  // and a p_vector. In that case we do not need to set the variance
811  // of the result because it does not change.
812 
813  define_old_variable(\
814  bool old_xresult_is_p_form = xresult.is_p_form(xauto_access));
815 
816  if(x0.p(xauto_access) > 0)
817  {
818  xresult.put_variance(star(x0.variance(xauto_access), x0.dd(xauto_access)),
819  xauto_access);
820  }
821 
822  // Postconditions:
823 
824  ensure((x0.p(xauto_access)>0) \
825  ? (xresult.is_p_form(xauto_access) == x0.is_p_form(xauto_access)) : true);
826  ensure((x0.p(xauto_access)==0) \
827  ? (xresult.is_p_form(xauto_access) == old_xresult_is_p_form): true );
828 
829  // Exit:
830 
831  return;
832 }
833 
834 void
836 star(const sec_at0& x0, sec_at3_e3& xresult, bool xauto_access)
837 {
838  // Preconditions:
839 
840  require(x0.state_is_auto_read_accessible(xauto_access));
841  require(xresult.state_is_auto_read_write_accessible(xauto_access));
842 
843  // Body:
844 
845  unary_op(x0, xresult, star_functor(), xauto_access);
846 
847  // Set the variance of the result.
848 
849  // If the x0.p() == 0 then x0 is a sec_at0 which is both a p_form
850  // and a p_vector. In that case we do not need to set the variance
851  // of the result because it does not change.
852 
853  define_old_variable(\
854  bool old_xresult_is_p_form = xresult.is_p_form(xauto_access));
855 
856  if(x0.p(xauto_access) > 0)
857  {
858  xresult.put_variance(star(x0.variance(xauto_access), x0.dd(xauto_access)),
859  xauto_access);
860  }
861 
862  // Postconditions:
863 
864  ensure((x0.p(xauto_access)>0) \
865  ? (xresult.is_p_form(xauto_access) == x0.is_p_form(xauto_access)) : true);
866  ensure((x0.p(xauto_access)==0) \
867  ? (xresult.is_p_form(xauto_access) == old_xresult_is_p_form): true );
868 
869  // Exit:
870 
871  return;
872 }
873 
874 void
876 wedge(const sec_at2_e3& x0, const sec_e3& x1, sec_at3_e3& xresult,
877  bool xauto_access)
878 {
879  // Preconditions:
880 
881  require(x0.state_is_auto_read_accessible(xauto_access));
882  require(x1.state_is_auto_read_accessible(xauto_access));
883  require(xresult.state_is_auto_read_write_accessible(xauto_access));
884 
885  require(x0.dd(xauto_access) >= xresult.dd(xauto_access));
886  require(x1.dd(xauto_access) >= xresult.dd(xauto_access));
887  require(xresult.p(xauto_access) == x0.p(xauto_access) + x1.p(xauto_access));
888  require(x0.is_p_form(xauto_access) == x1.is_p_form(xauto_access));
889 
890  // Body:
891 
892  binary_op(x0, x1, xresult, wedge_functor(), xauto_access);
893 
894  // Set the variance of the result.
895 
896  xresult.put_variance(wedge(x0.variance(xauto_access),
897  x1.variance(xauto_access)), xauto_access);
898 
899  // Postconditions:
900 
901  ensure(xresult.variance(xauto_access) == \
902  wedge(x0.variance(xauto_access), x1.variance(xauto_access)));
903 
904  // Exit:
905 
906  return;
907 }
908 
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
Definition: any.cc:153
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
virtual poset_path path(bool xauto_access=true) const
The path of this poset.
bool state_is_auto_read_write_accessible(bool xauto_access) const
True if state is auto accessible for read and write, that is, if the state is already accessible for ...
A section of a bundle with fiber type at2_e3.
Definition: sec_at2_e3.h:48
SHEAF_DLL_SPEC void wedge(const sec_e2 &x0, const sec_e2 &x1, sec_at2_e2 &xresult, bool xauto_access)
The exterior (wedge) product of two antisymmetric tensors (pre-allocated version).
Definition: sec_at2_e2.cc:950
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
Euclidean vector space of dimension 3 (volatile version).
Definition: e3.h:116
bool is_ancestor_of(const any *other) const
True if other conforms to current.
Definition: sec_at3_e3.cc:652
The abstract map from section dof ids to section dof values of heterogeneous type.
A section of a bundle with fiber type at3_e3.
Definition: sec_at3_e3.h:48
A space of scalars viewed as an antisymmetric tensor section space of degree 1.
Definition: sec_at1_space.h:48
An antisymmetric rank 3 tensor over a Euclidean vector space of dimension 3. (volatile version)...
Definition: at3_e3.h:120
poset_path path(bool xauto_access=true) const
A path to this component.
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
void unary_op(const S0 &x0, SR &xresult, F xfunctor, bool xauto_access)
Unary operator.
Definition: sec_vd.impl.h:224
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
bool state_is_auto_read_accessible(bool xauto_access) const
True if the state is auto accessible for read, that is, if the state is already accessible for read o...
virtual const std::string & class_name() const
The name of this class.
Definition: sec_at3_e3.cc:555
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
A member of a sec_rep_space; a section.
poset_path vector_space_path() const
The path of the underlying vector space.
STL namespace.
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
poset_state_handle & member_poset(pod_index_type xhub_id, bool xauto_access=true) const
The poset_state_handle object referred to by hub id xhub_id.
virtual tensor_variance variance(bool xauto_access) const
The variance.
Definition: sec_tp.cc:589
void put_variance(const tensor_variance &xvariance, bool xauto_access)
Sets the variance to xvariance.
Definition: sec_tp.cc:627
The poset for sec_rep_descriptors.
static host_type & standard_host(namespace_type &xns, const poset_path &xbase_path, const poset_path &xrep_path, const std::string &xsection_suffix, const std::string &xfiber_suffix, bool xauto_access)
The standard host for sections of this type with base space xbase_path, representation xrep_path...
Definition: sec_at3_e3.cc:105
virtual int p() const
The degree of the tensors in host(); the sum of the contravariant and covariant degrees.
Definition: sec_tp.cc:391
An antisymmetric rank 3 tensor over a 3D Euclidean vector space.
Definition: at3_e3.h:372
Abstract base class with useful features for all objects.
Definition: any.h:39
int p() const
The tensor degree of this space.
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
sec_rep_descriptor & rep()
A representation descriptor for this sec rep space (mutable version).
SHEAF_DLL_SPEC void wedge(const e2 &x0, const e2 &x1, at2_e2 &xresult, bool xauto_access)
The exterior (wedge) product of two antisymmetric tensors (pre-allocated version for persistent types...
Definition: at2_e2.cc:1779
An abstract antisymmetric tensor section space of degree p.
Definition: sec_atp_space.h:47
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
SHEAF_DLL_SPEC void hook(const e2 &x0, const e2 &x1, at0 &xresult, bool xauto_access)
The interior (hook) product of two antisymmetric tensors (pre-allocated version for persistent types)...
Definition: at2_e2.cc:1328
virtual const fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
Definition: sec_at3_e3.cc:472
An abstract antisymmetric tensor space of degree p.
Definition: atp_space.h:42
void binary_op(const S0 &x0, const S1 &x1, SR &xresult, F xfunctor, bool xauto_access)
Binary operator.
Definition: sec_vd.impl.h:48
bool owns(const poset_state_handle &xposet, bool xauto_access) const
True if and only if this contains the poset xposet. synonym for contains_poset(xposet.poset_path(true), xauto_access)
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
SHEAF_DLL_SPEC void star(const sec_at2_e2 &x0, sec_at0 &xresult, bool xauto_access)
The Hodge star operator for antisymmetric tensors (pre-allocated version).
Definition: sec_at2_e2.cc:830
virtual bool is_attached() const
True if this handle is attached to a non-void state.
Namespace containing the antisymmetric tensor algrebra functions for the fiber_bundles component of t...
Definition: at2_e2.h:737
virtual int dd() const
Dimension of the underlying vector space.
Definition: sec_tp.cc:433
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
static const std::string & static_class_name()
The name of this class.
Definition: sec_at3_e3.cc:574
virtual sec_at3_e3 * clone() const
Make a new handle, no state instance of current.
Definition: sec_at3_e3.cc:593
Antisymetric tensor of degree 0 (volatile version).
Definition: at0.h:127
virtual bool contains_member(pod_index_type xmbr_hub_id, bool xauto_access=true) const
True if some version of this poset contains poset member with hub id xmbr_hub_id. ...
int dd() const
The dimension of the underlying ("domain") vector space.
An antisymmetric rank 3 tensor over an abstract vector space (volatile version).
Definition: at3.h:230
bool is_p_form(bool xauto_access) const
True if this is a p-form.
Definition: sec_atp.cc:396
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
A section of a fiber bundle with a 3-dimensional Euclidean vector space fiber.
Definition: sec_e3.h:47
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xvector_space_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
Definition: sec_at3_e3.cc:54
bool invariant() const
Class invariant.
Definition: sec_at3_e3.cc:675
SHEAF_DLL_SPEC void hook(const sec_e2 &x0, const sec_e2 &x1, sec_at0 &xresult, bool xauto_access)
The interior (hook) product of two antisymmetric tensors (pre-allocated version for persistent types)...
Definition: sec_at2_e2.cc:767
bool fiber_is_ancestor_of(const any *xother) const
True if xother conforms to an instance of the fiber of current.
Definition: sec_at3_e3.cc:628
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
poset_path scalar_space_path() const
The path of the underlying space of scalars.
poset & fiber_space()
The fiber space for section spaces on this schema (mutable version).
Namespace containing the algrebra functions for a a section of a fiber bundle with a d-dimensional ve...
Definition: sec_vd.h:691
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (volatile version)...
Definition: at2_e3.h:142
An abstract client handle for a member of a poset.
virtual sec_at3_e3 & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
Definition: sec_at3_e3.cc:376
std::string path() const
The full path as a string.
Definition: poset_path.cc:450
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC void star(const at2_e2 &x0, at0 &xresult, bool xauto_access)
The Hodge star operator for antisymmetric tensors (pre-allocated version persistent types)...
Definition: at2_e2.cc:1518
Antisymetric tensor of degree 0. As the degree is 0 there is nothing to be symmetric or antisymmetric...
Definition: sec_at0.h:51
sec_at3_e3()
Default constructor; creates an unattached handle.
Definition: sec_at3_e3.cc:205
virtual int d(int xp, int xdd) const
Dimension d() as a function of degree xp and domain dimension xdd.
bool state_is_not_read_accessible() const
True if this is attached and if the state is accessible for read or if access control is disabled...
~sec_at3_e3()
Destructor.
Definition: sec_at3_e3.cc:460
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
A handle for a poset whose members are numerical representations of sections of a fiber bundle...
Definition: sec_rep_space.h:61