SheafSystem  0.0.0.0
sec_at2_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_at2_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/at2_e3.h"
38 
39 using namespace std;
40 using namespace fiber_bundle; // Workaround for MS C++ bug.
41 
42 //==============================================================================
43 // CLASS SEC_AT2_E3
44 //==============================================================================
45 
46 // ===========================================================
47 // HOST FACTORY FACET OF CLASS SEC_AT2_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_at2_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) == 2);
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_at2_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_at2_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_at2_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_at2_e3>(xns, xbase_path, xrep_path, xfiber_suffix, xauto_access));
131 
132  // Body:
133 
134  poset_path lstd_path = standard_host_path<sec_at2_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_at2_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_at2_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_at2_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) == 2);
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_at2_e3::new_host." << endl;
190  return result;
191 }
192 
193 // PROTECTED MEMBER FUNCTIONS
194 
195 // PRIVATE MEMBER FUNCTIONS
196 
197 
198 //==============================================================================
199 // AT2_E3 FACET OF CLASS SEC_AT2_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_at2_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_at2_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_at2_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_at2_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_at2_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 at2_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 at2_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 // AT2 FACET OF CLASS SEC_AT2_E3
494 //==============================================================================
495 
496 // PUBLIC MEMBER FUNCTIONS
497 
498 // PROTECTED MEMBER FUNCTIONS
499 
500 // PRIVATE MEMBER FUNCTIONS
501 
502 
503 //==============================================================================
504 // TP FACET OF CLASS SEC_AT2_E3
505 //==============================================================================
506 
507 // PUBLIC MEMBER FUNCTIONS
508 
509 // PROTECTED MEMBER FUNCTIONS
510 
511 // PRIVATE MEMBER FUNCTIONS
512 
513 
514 //==============================================================================
515 // VD FACET OF CLASS SEC_AT2_E3
516 //==============================================================================
517 
518 // PUBLIC MEMBER FUNCTIONS
519 
520 // PROTECTED MEMBER FUNCTIONS
521 
522 // PRIVATE MEMBER FUNCTIONS
523 
524 
525 //==============================================================================
526 // TUPLE FACET OF CLASS SEC_AT2_E3
527 //==============================================================================
528 
529 // PUBLIC MEMBER FUNCTIONS
530 
531 // PROTECTED MEMBER FUNCTIONS
532 
533 // PRIVATE MEMBER FUNCTIONS
534 
535 
536 //==============================================================================
537 // ABSTRACT POSET MEMBER FACET OF CLASS SEC_AT2_E3
538 //==============================================================================
539 
540 // PUBLIC MEMBER FUNCTIONS
541 
542 const std::string&
544 class_name() const
545 {
546  // Preconditions:
547 
548  // Body:
549 
550  const string& result = static_class_name();
551 
552  // Postconditions:
553 
554  ensure(!result.empty());
555 
556  // Exit:
557 
558  return result;
559 }
560 
561 const std::string&
564 {
565  // Preconditions:
566 
567  // Body:
568 
569  static const string result("sec_at2_e3");
570 
571  // Postconditions:
572 
573  ensure(!result.empty());
574 
575  // Exit:
576 
577  return result;
578 }
579 
580 
583 clone() const
584 {
585 
586  // Preconditions:
587 
588  // Body:
589 
590  // create new handle of the current class.
591 
592  sec_at2_e3 *result = new sec_at2_e3();
593 
594  // Postconditions:
595 
596  ensure(result != 0);
597  ensure(result->invariant());
598 
599  // Exit:
600 
601  return result;
602 
603 }
604 
605 // PROTECTED MEMBER FUNCTIONS
606 
607 // PRIVATE MEMBER FUNCTIONS
608 
609 
610 //==============================================================================
611 // ANY FACET OF CLASS SEC_AT2_E3
612 //==============================================================================
613 
614 // PUBLIC MEMBER FUNCTIONS
615 
616 bool
618 fiber_is_ancestor_of(const any* xother) const
619 {
620 
621  // Preconditions:
622 
623  require(xother != 0);
624 
625  // Body:
626 
627  bool result = dynamic_cast<const at2_e3*>(xother) != 0;
628 
629  // Postconditions:
630 
631  ensure(invariant());
632  ensure(xother->invariant());
633 
634  // Exit:
635 
636  return result;
637 
638 }
639 
640 bool
642 is_ancestor_of(const any* xother) const
643 {
644 
645  // Preconditions:
646 
647  require(xother != 0);
648 
649  // Body:
650 
651  bool result = dynamic_cast<const sec_at2_e3*>(xother) != 0;
652 
653  // Postconditions:
654 
655  //ensure(invariant());
656 
657  // Exit:
658 
659  return result;
660 
661 }
662 
663 bool
665 invariant() const
666 {
667  bool result = true;
668 
669  // Body:
670 
671  if (invariant_check())
672  {
673  // Prevent recursive calls to invariant
674 
675  disable_invariant_check();
676 
677  // Must satisfy base class invariant
678 
679  invariance(sec_atp::invariant());
680 
681  // Invariances for this class:
682 
683  invariance(state_is_read_accessible() ? dd() == 3 : true);
684 
685  // Finished, turn invariant checking back on.
686 
687  enable_invariant_check();
688  }
689 
690  // Exit:
691 
692  return result;
693 }
694 
695 // PROTECTED MEMBER FUNCTIONS
696 
697 // PRIVATE MEMBER FUNCTIONS
698 
699 
700 //==============================================================================
701 // NON-MEMBER FUNCTIONS
702 //==============================================================================
703 
704 namespace
705 {
706  using namespace fiber_bundle::atp_algebra;
707 
708  class hook_functor
709  {
710  public:
711  void operator()(const e3_lite& x0, const e3_lite& x1,
712  at0_lite& xresult) const
713  {
714  hook(x0, x1, xresult);
715  }
716 
717  void operator()(const at2_e3_lite& x0, const e3_lite& x1,
718  e3_lite& xresult) const
719  {
720  hook(x0, x1, xresult);
721  }
722  };
723 
724  class star_functor
725  {
726  public:
727  void operator()(const at2_e3_lite& x0, e3_lite& xresult) const
728  {
729  star(x0, xresult);
730  }
731 
732  void operator()(const e3_lite& x0, at2_e3_lite& xresult) const
733  {
734  star(x0, xresult);
735  }
736  };
737 
738  class wedge_functor
739  {
740  public:
741  void operator()(const e3_lite& x0, const e3_lite& x1,
742  at2_e3_lite& xresult) const
743  {
744  wedge(x0, x1, xresult);
745  }
746  };
747 
748 } //end unnamed namespace
749 
750 //==============================================================================
751 
752 #include "SheafSystem/sec_vd.impl.h"
753 #include "SheafSystem/sec_e3.h"
754 #include "SheafSystem/sec_at0.h"
755 
756 using namespace fiber_bundle::sec_vd_algebra;
757 
758 void
760 hook(const sec_e3& x0, const sec_e3& x1, sec_at0& xresult,
761  bool xauto_access)
762 {
763  // Preconditions:
764 
765  require(x0.state_is_auto_read_accessible(xauto_access));
766  require(x1.state_is_auto_read_accessible(xauto_access));
767  require(xresult.state_is_auto_read_write_accessible(xauto_access));
768  require(x1.dd(xauto_access) == x0.dd(xauto_access));
769  require(x0.is_p_form(xauto_access) == x1.is_p_form(xauto_access));
770  require(xresult.p(xauto_access) == x0.p(xauto_access) - 1);
771 
772  // Body:
773 
774  binary_op(x0, x1, xresult, hook_functor(), xauto_access);
775 
776  // Set the variance of the result.
777 
778  xresult.put_variance(hook(x0.variance(xauto_access)), xauto_access);
779 
780  // Postconditions:
781 
782  ensure(xresult.variance(xauto_access) == hook(x0.variance(xauto_access)));
783 
784  // Exit:
785 
786  return;
787 }
788 
789 void
791 hook(const sec_at2_e3& x0, const sec_e3& x1, sec_e3& xresult,
792  bool xauto_access)
793 {
794  // Preconditions:
795 
796  require(x0.state_is_auto_read_accessible(xauto_access));
797  require(x1.state_is_auto_read_accessible(xauto_access));
798  require(xresult.state_is_auto_read_write_accessible(xauto_access));
799  require(x1.dd(xauto_access) == x0.dd(xauto_access));
800  require(x0.is_p_form(xauto_access) == x1.is_p_form(xauto_access));
801  require(xresult.p(xauto_access) == x0.p(xauto_access) - 1);
802 
803  // Body:
804 
805  binary_op(x0, x1, xresult, hook_functor(), xauto_access);
806 
807  // Set the variance of the result.
808 
809  xresult.put_variance(hook(x0.variance(xauto_access)), xauto_access);
810 
811  // Postconditions:
812 
813  ensure(xresult.variance(xauto_access) == hook(x0.variance(xauto_access)));
814 
815  // Exit:
816 
817  return;
818 }
819 
820 
821 void
823 star(const sec_at2_e3& x0, sec_e3& xresult, bool xauto_access)
824 {
825  // Preconditions:
826 
827  require(x0.state_is_auto_read_accessible(xauto_access));
828  require(xresult.state_is_auto_read_write_accessible(xauto_access));
829 
830  // Body:
831 
832  unary_op(x0, xresult, star_functor(), xauto_access);
833 
834  // Set the variance of the result.
835 
836  // If the x0.p() == 0 then x0 is a sec_at0 which is both a p_form
837  // and a p_vector. In that case we do no need to set the variance
838  // of the result because it does not change.
839 
840  define_old_variable(\
841  bool old_xresult_is_p_form = xresult.is_p_form(xauto_access));
842 
843  if(x0.p(xauto_access) > 0)
844  {
845  xresult.put_variance(star(x0.variance(xauto_access), x0.dd(xauto_access)),
846  xauto_access);
847  }
848 
849  // Postconditions:
850 
851  ensure((x0.p(xauto_access)>0) \
852  ? (xresult.is_p_form(xauto_access) == x0.is_p_form(xauto_access)) : true);
853  ensure((x0.p(xauto_access)==0) \
854  ? (xresult.is_p_form(xauto_access) == old_xresult_is_p_form): true );
855 
856  // Exit:
857 
858  return;
859 }
860 
861 void
863 star(const sec_e3& x0, sec_at2_e3& xresult, bool xauto_access)
864 {
865  // Preconditions:
866 
867  require(x0.state_is_auto_read_accessible(xauto_access));
868  require(xresult.state_is_auto_read_write_accessible(xauto_access));
869 
870  // Body:
871 
872  unary_op(x0, xresult, star_functor(), xauto_access);
873 
874  // Set the variance of the result.
875 
876  // If the x0.p() == 0 then x0 is a sec_at0 which is both a p_form
877  // and a p_vector. In that case we do no need to set the variance
878  // of the result because it does not change.
879 
880  define_old_variable(\
881  bool old_xresult_is_p_form = xresult.is_p_form(xauto_access));
882 
883  if(x0.p(xauto_access) > 0)
884  {
885  xresult.put_variance(star(x0.variance(xauto_access), x0.dd(xauto_access)),
886  xauto_access);
887  }
888 
889  // Postconditions:
890 
891  ensure((x0.p(xauto_access)>0) \
892  ? (xresult.is_p_form(xauto_access) == x0.is_p_form(xauto_access)) : true);
893  ensure((x0.p(xauto_access)==0) \
894  ? (xresult.is_p_form(xauto_access) == old_xresult_is_p_form): true );
895 
896  // Exit:
897 
898  return;
899 }
900 
901 void
903 wedge(const sec_e3& x0, const sec_e3& x1, sec_at2_e3& xresult,
904  bool xauto_access)
905 {
906  // Preconditions:
907 
908  require(x0.state_is_auto_read_accessible(xauto_access));
909  require(x1.state_is_auto_read_accessible(xauto_access));
910  require(xresult.state_is_auto_read_write_accessible(xauto_access));
911 
912  require(x0.dd(xauto_access) >= xresult.dd(xauto_access));
913  require(x1.dd(xauto_access) >= xresult.dd(xauto_access));
914  require(xresult.p(xauto_access) == x0.p(xauto_access) + x1.p(xauto_access));
915  require(x0.is_p_form(xauto_access) == x1.is_p_form(xauto_access));
916 
917  // Body:
918 
919  binary_op(x0, x1, xresult, wedge_functor(), xauto_access);
920 
921  // Set the variance of the result.
922 
923  xresult.put_variance(wedge(x0.variance(xauto_access),
924  x1.variance(xauto_access)), xauto_access);
925 
926  // Postconditions:
927 
928  ensure(xresult.variance(xauto_access) == \
929  wedge(x0.variance(xauto_access), x1.variance(xauto_access)));
930 
931  // Exit:
932 
933  return;
934 }
935 
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 ...
static const std::string & static_class_name()
The name of this class.
Definition: sec_at2_e3.cc:563
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
The abstract map from section dof ids to section dof values of heterogeneous type.
A space of scalars viewed as an antisymmetric tensor section space of degree 1.
Definition: sec_at1_space.h:48
poset_path path(bool xauto_access=true) const
A path to this component.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (persistent version)...
Definition: at2_e3.h:424
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...
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.
virtual const std::string & class_name() const
The name of this class.
Definition: sec_at2_e3.cc:544
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
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_at2_e3.cc:54
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.
~sec_at2_e3()
Destructor.
Definition: sec_at2_e3.cc:460
virtual int p() const
The degree of the tensors in host(); the sum of the contravariant and covariant degrees.
Definition: sec_tp.cc:391
sec_at2_e3()
Default constructor; creates an unattached handle.
Definition: sec_at2_e3.cc:205
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
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
virtual const fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
Definition: sec_at2_e3.cc:472
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.
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.
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
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
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_at2_e3.cc:105
virtual sec_at2_e3 * clone() const
Make a new handle, no state instance of current.
Definition: sec_at2_e3.cc:583
virtual sec_at2_e3 & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
Definition: sec_at2_e3.cc:376
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.
std::string path() const
The full path as a string.
Definition: poset_path.cc:450
bool fiber_is_ancestor_of(const any *xother) const
True if xother conforms to an instance of the fiber of current.
Definition: sec_at2_e3.cc:618
Namespace for the fiber_bundles component of the sheaf system.
bool is_ancestor_of(const any *other) const
True if other conforms to current.
Definition: sec_at2_e3.cc:642
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
A general antisymmetric tensor of degree 2 over an abstract vector space.
Definition: at2.h:233
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...
bool invariant() const
Class invariant.
Definition: sec_at2_e3.cc:665
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