SheafSystem  0.0.0.0
section_pusher.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 
21 
22 #include "SheafSystem/assert_contract.h"
23 #include "SheafSystem/arg_list.h"
24 #include "SheafSystem/binary_section_space_schema_member.h"
25 #include "SheafSystem/block.impl.h"
26 #include "SheafSystem/constant_push_action.h"
27 #include "SheafSystem/copy_push_action.h"
28 #include "SheafSystem/discretization_context.h"
29 #include "SheafSystem/discretization_iterator.h"
30 #include "SheafSystem/discretization_pusher.h"
31 #include "SheafSystem/error_message.h"
32 #include "SheafSystem/eval_iterator.h"
33 #include "SheafSystem/field_vd.h"
34 #include "SheafSystem/fiber_bundles_namespace.h"
35 #include "SheafSystem/namespace_poset.h"
36 #include "SheafSystem/postorder_iterator.h"
37 #include "SheafSystem/preorder_iterator.h"
38 #include "SheafSystem/property_disc_iterator.h"
39 #include "SheafSystem/sec_at1_space.h"
40 #include "SheafSystem/sec_ed_invertible.h"
41 #include "SheafSystem/sec_rep_descriptor.h"
42 #include "SheafSystem/sec_vd_space.h"
43 #include "SheafSystem/section_evaluator.h"
44 #include "SheafSystem/section_pusher.h"
45 #include "SheafSystem/section_pusher_push_action.h"
46 #include "SheafSystem/stl_scoped_index.h"
47 #include "SheafSystem/std_iomanip.h"
48 #include "SheafSystem/field_vd.h"
49 
50 using namespace std;
51 using namespace fields; // Workaround for MS C++ bug.
52 
53 // #define DIAGNOSTIC_OUTPUT 1
54 
55 namespace fields
56 {
57 
58 void print_debug_info(scoped_index xeval_client_id,
59  sec_rep_space& xrange,
60  pullback_map::iterator& xitr,
61  block<sec_vd_dof_type>& xdst_dofs)
62 {
63  cout << "eval id: " << setw(5) << xeval_client_id;
64  index_space_handle& lspace = xrange.schema().discretization().id_space();
65  cout << " disc_id: " << setw(5) << lspace.pod(xitr->disc_id);
66  cout << " source point:";
67  int ldb = xitr->domain_pt.db();
68  for(size_type j=0; j<ldb; ++j)
69  {
70  cout << setw(12) << setprecision(3) << xitr->domain_pt.local_coord(j);
71  }
72  cout << setw(5) << xitr->domain_pt.chart_id();
73  cout << " dst value:";
74  int ldf = xdst_dofs.ct();
75  for(size_type j=0; j<ldf; ++j)
76  {
77  cout << setw(12) << setprecision(3) << xdst_dofs[j];
78  }
79  cout << endl;
80 };
81 
82 } // namespace fields
83 
84 // =============================================================================
85 // SECTION_PUSHER FACET
86 // =============================================================================
87 
88 // PUBLIC MEMBER FUNCTIONS
89 
91 section_pusher(const field_vd& xsrc, const field_vd& xdst, bool xauto_access)
92 {
93  // Preconditions:
94 
95  require(xauto_access || xsrc.state_is_read_accessible());
96  require(xauto_access || xdst.state_is_read_accessible());
97 
98  define_old_variable(int old_xsrc_access_request_depth = xsrc.access_request_depth());
99  define_old_variable(int old_xdst_access_request_depth = xdst.access_request_depth());
100 
101  if(xauto_access)
102  {
103  xsrc.get_read_access();
104  xdst.get_read_access();
105  }
106 
107  require(same_fiber(*xsrc.property().host(), *xdst.property().host()));
108  require(same_fiber(*xsrc.coordinates().host(), *xdst.coordinates().host()));
109 
110  // Currently only support binary schema, not ternary schema;
111  // see push_pa and discretizaion_pusher.
112 
113  require(dynamic_cast<binary_section_space_schema_member*>(&(xdst.coordinates().schema())));
114  require(dynamic_cast<binary_section_space_schema_member*>(&(xdst.property().schema())));
115 
116  // Body:
117 
118  _domain = xsrc.property().host();
119  _range = xdst.property().host();
120 
121  _domain_coords.attach_to_state(&xsrc.coordinates());
122  _range_coords.attach_to_state(&xdst.coordinates());
123 
124  // Perform common initialization.
125 
126  initialize();
127 
128  // Postconditions:
129 
130  ensure(invariant());
131  ensure(domain().is_same_state(xsrc.property().host()));
132  ensure(range().is_same_state(xdst.property().host()));
133 
134  if(xauto_access)
135  {
136  xsrc.release_access();
137  xdst.release_access();
138  }
139 
140  ensure(xsrc.access_request_depth() == old_xsrc_access_request_depth);
141  ensure(xdst.access_request_depth() == old_xdst_access_request_depth);
142 
143  // Exit:
144 
145  return;
146 }
147 
148 // fields::section_pusher::
149 // section_pusher(const field_vd& xsrc, const sec_ed& xdst_coords,
150 // bool xauto_access)
151 // {
152 // // Preconditions:
153 
154 // require(xauto_access || xsrc.state_is_read_accessible());
155 // require(xauto_access || xdst_coords.state_is_read_accessible());
156 // require(xauto_access || xdst_coords.name_space()->state_is_read_accessible());
157 
158 // define_old_variable(int old_xsrc_access_request_depth = xsrc.access_request_depth());
159 // define_old_variable(int old_xdst_coords_access_request_depth = xdst_coords.access_request_depth());
160 
161 // if(xauto_access)
162 // {
163 // xsrc.get_read_access();
164 // xdst_coords.get_read_access();
165 // xdst_coords.name_space()->get_read_access();
166 // }
167 
168 // require(!xsrc.name_space().contains_poset(sec_rep_space_member::standard_section_space_name(xsrc.property().schema().fiber_space().name(),
169 // xdst_coords.schema().base_space().host()->name()), false));
170 
171 // require(same_fiber(*xsrc.coordinates().host(), *xdst_coords.host()));
172 
173 // // Currently only support binary schema, not ternary schema;
174 // // see push_pa and discretizaion_pusher.
175 
176 // require(dynamic_cast<const binary_section_space_schema_member*>(&(xdst_coords.schema())));
177 
178 // // Body:
179 
180 // // Get the domain.
181 
182 // _domain = xsrc.property().host();
183 
184 // _domain_coords.attach_to_state(&xsrc.coordinates());
185 // _range_coords.attach_to_state(&xdst_coords);
186 
187 // section_space_schema_member& ldomain_schema = _domain->schema();
188 
189 // // Create the range.
190 
191 // string lrange_prop_fiber_name = ldomain_schema.fiber_space().name();
192 // string lrange_base_name = xdst_coords.schema().base_space().host()->name();
193 // string lrange_name =
194 // sec_rep_space_member::standard_section_space_name(lrange_prop_fiber_name,
195 // lrange_base_name);
196 
197 // fiber_bundles_namespace* lns = dynamic_cast<fiber_bundles_namespace*>(xdst_coords.name_space());
198 
199 // poset_path lsssp(ldomain_schema.fiber_space().path().poset_name() +
200 // "_on_" +
201 // xdst_coords.schema().base_space().path().poset_name() +
202 // "_" +
203 // ldomain_schema.rep().path().member_name() +
204 // "_schema",
205 // ldomain_schema.fiber_space().path().poset_name() +
206 // "_on_" +
207 // xdst_coords.schema().base_space().path().member_name());
208 
209 // poset_path lrange_schema_path =
210 // lns->new_section_space_schema(lsssp,
211 // ldomain_schema.rep().path(),
212 // xdst_coords.schema().base_space().path(),
213 // ldomain_schema.fiber_space().path(),
214 // true);
215 
216 // arg_list largs;
217 // largs << "factor_ct" << -1
218 // << "d" << -1
219 // << "scalar_space_path" << ""
220 // << "p" << -1
221 // << "dd" << -1
222 // <<"vector_space_path" << "";
223 
224 // _range =
225 // &lns->clone_section_space(_domain->path(), lrange_name, largs, lrange_schema_path, true);
226 
227 // _range->get_read_access();
228 
229 // // Perform common initialization.
230 
231 // initialize();
232 
233 // // Postconditions:
234 
235 // ensure(invariant());
236 // ensure(domain().is_same_state(xsrc.property().host()));
237 // ensure(same_fiber(range(), domain()));
238 
239 // _range->release_access();
240 
241 // if(xauto_access)
242 // {
243 // xdst_coords.name_space()->release_access();
244 // xdst_coords.release_access();
245 // xsrc.release_access();
246 // }
247 
248 // ensure(xsrc.access_request_depth() == old_xsrc_access_request_depth);
249 // ensure(xdst_coords.access_request_depth() == old_xdst_coords_access_request_depth);
250 
251 // // Exit:
252 
253 // return;
254 // }
255 
256 
259  const sec_rep_space& xrange,
260  const sec_ed& xdomain_coord,
261  const sec_ed& xrange_coord,
262  bool xauto_access)
263 {
264  // Preconditions:
265 
266  require(xauto_access || xdomain.state_is_read_accessible());
267  require(xauto_access || xdomain_coord.state_is_read_accessible());
268 
269  require(xauto_access || xrange.state_is_read_accessible());
270  require(xauto_access || xrange_coord.state_is_read_accessible());
271 
272  define_old_variable(int old_xdomain_access_request_depth =
273  xdomain.access_request_depth());
274  define_old_variable(int old_xdomain_coord_access_request_depth =
275  xdomain_coord.access_request_depth());
276  define_old_variable(int old_xrange_access_request_depth =
277  xrange.access_request_depth());
278  define_old_variable(int old_xrange_coord_access_request_depth =
279  xrange_coord.access_request_depth());
280 
281  if(xauto_access)
282  {
283  xdomain.get_read_access();
284  xdomain_coord.get_read_access();
285  xrange.get_read_access();
286  xrange_coord.get_read_access();
287  }
288 
289  require(same_base(xdomain_coord, xdomain));
290  require(same_base(xrange_coord, xrange));
291 
292  require(same_fiber(xdomain, xrange));
293  require(same_fiber(*xdomain_coord.host(), *xrange_coord.host()));
294 
295  // Currently only support binary schema, not ternary schema;
296  // see push_pa and discretizaion_pusher.
297 
298  require(dynamic_cast<const binary_section_space_schema_member*>(&(xrange.schema())));
299  require(dynamic_cast<const binary_section_space_schema_member*>(&(xrange_coord.schema())));
300 
301  // Body:
302 
305 
306  _domain = const_cast<sec_rep_space*>(&xdomain);
307  _range = const_cast<sec_rep_space*>(&xrange);
308 
309  _domain_coords.attach_to_state(&xdomain_coord);
310  _range_coords.attach_to_state(&xrange_coord);
311 
312  // Perform common initialization.
313 
314  initialize();
315 
316  // Postconditions:
317 
318  ensure(invariant());
319  ensure(domain().is_same_state(&xdomain));
320  ensure(range().is_same_state(&xrange));
321 
322  if(xauto_access)
323  {
324  xdomain.release_access();
325  xdomain_coord.release_access();
326  xrange.release_access();
327  xrange_coord.release_access();
328  }
329 
330  ensure(xdomain.access_request_depth() == old_xdomain_access_request_depth);
331  ensure(xdomain_coord.access_request_depth() == old_xdomain_coord_access_request_depth);
332  ensure(xrange.access_request_depth() == old_xrange_access_request_depth);
333  ensure(xrange_coord.access_request_depth() == old_xrange_coord_access_request_depth);
334 
335  // Exit:
336 }
337 
340 domain() const
341 {
342  // Preconditions:
343 
344  // Body:
345 
346  const sec_rep_space& result = *_domain;
347 
348  // Postconditions:
349 
350  // Exit
351 
352  return result;
353 }
354 
358 {
359  // Preconditions:
360 
361  // Body:
362 
363  const geometry::sec_ed_invertible& result = _domain_coords;
364 
365  // Postconditions:
366 
367  // Exit
368 
369  return result;
370 }
371 
374 range() const
375 {
376  // Preconditions:
377 
378  // Body:
379 
380  const sec_rep_space& result = *_range;
381 
382  // Postconditions:
383 
384  // Exit
385 
386  return result;
387 }
388 
392 {
393  // Preconditions:
394 
395  // Body:
396 
397  const sec_ed& result = _range_coords;
398 
399  // Postconditions:
400 
401  // Exit
402 
403  return result;
404 }
405 
408 push(const sec_vd& xinput, bool xauto_access)
409 {
410  sec_vd* result = 0;
411 
412  // Preconditions:
413 
414  require(precondition_of(push_pa(xinput, result, xauto_access)));
415  require(xauto_access || range().in_jim_edit_mode());
416 
418 
419  require(xauto_access || range().name_space()->state_is_read_accessible());
420 
421  // Body:
422 
423  result = xinput.clone();
424 
432 
433  sec_rep_space& lrange_host =
434  dynamic_cast<sec_rep_space&>(_range->name_space()->member_poset(_range->index()));
435 
436  result->new_jim_state(&lrange_host, 0, false, xauto_access);
437  push_pa(xinput, *result, xauto_access);
438 
439  // Postconditions:
440 
441  ensure(result != 0);
442  ensure(range().contains_member(result, xauto_access));
443  ensure(postcondition_of(push_pa));
444 
445  // Exit
446 
447  return result;
448 }
449 
450 void
452 push_pa(const sec_vd& xinput, sec_vd& xresult, bool xauto_access)
453 {
454 
455 #ifdef DIAGNOSTIC_OUTPUT
456  post_information_message("Entering push_pa:");
457 #endif
458 
459  // Preconditions:
460 
461  require(xauto_access || xinput.state_is_read_accessible());
462  require(xauto_access || xresult.state_is_read_write_accessible());
463 
464  require(domain().contains_member(&xinput, xauto_access));
465  require(range().contains_member(&xresult, xauto_access));
466 
467  require(xauto_access || domain_coords().state_is_read_accessible());
468  require(xauto_access || range_coords().state_is_read_accessible());
469 
470  define_old_variable(int old_xinput_access_request_depth =
471  xinput.access_request_depth());
472  define_old_variable(int old_result_access_request_depth =
473  xresult.access_request_depth());
474  define_old_variable(int old_domain_coord_access_request_depth =
475  domain_coords().access_request_depth());
476  define_old_variable(int old_range_coord_access_request_depth =
477  range_coords().access_request_depth());
478 
479 
480  if(xauto_access)
481  {
482  xinput.get_read_access();
483  xresult.get_read_write_access(true);
484  domain_coords().get_read_access();
485  range_coords().get_read_access();
486  }
487 
488  // Body:
489 
490  // Allocate the branch pullback maps and
491  // populate the chart to branch map.
492 
493  make_maps(xinput);
494 
495  // Populate the branch pullback maps.
496 
497  if(domain_coords().is_jim())
498  {
499  // The source coordinates is a monosection.
500 
501  if(xinput.is_jim())
502  {
503  // The source property is monosection.
504 
505  pull_back_range_disc_mono_mono();
506  }
507  else
508  {
509  // The source property is a multisection.
510 
511  pull_back_range_disc_mono_multi();
512  }
513  }
514  else
515  {
516  // The source coordinates is a multisection.
517 
518  if(xinput.is_jim())
519  {
520  // The source property is monosection.
521 
522  pull_back_range_disc_multi_mono();
523  }
524  else
525  {
526  // The source property is a multisection.
527 
528  post_fatal_error_message("Source coordinate multisection with source property multisection not supported");
529  }
530  }
531 
532  // Define the part of the dst that overlaps the src.
533 
534  define_overlap(xinput, xresult);
535 
536  // Define the part of the dst that does not overlap the src.
537 
538  define_extension(xresult);
539 
540  // Clean up.
541 
542  clear_maps();
543 
544  if(xauto_access)
545  {
546  range_coords().release_access();
547  domain_coords().release_access();
548  xresult.release_access();
549  xinput.release_access();
550  }
551 
552  // Postconditions:
553 
554  ensure(xinput.access_request_depth() == old_xinput_access_request_depth);
555  ensure(xresult.access_request_depth() == old_result_access_request_depth);
556  ensure(domain_coords().access_request_depth() == old_domain_coord_access_request_depth);
557  ensure(range_coords().access_request_depth() == old_range_coord_access_request_depth);
558 
559 #ifdef DIAGNOSTIC_OUTPUT
560 
561  post_information_message("Leaving push_pa:");
562 #endif
563 
564  // Exit
565 
566  return;
567 }
568 
569 
570 bool
572 same_base(const sec_ed& xcoord, const sec_rep_space& xspace) const
573 {
574  bool result;
575 
576  // Preconditions:
577 
578  require(xcoord.state_is_read_accessible());
579  require(xspace.state_is_read_accessible());
580 
581  // Body:
582 
583  result = xcoord.schema().base_space().is_same_state(&xspace.schema().base_space());
584 
585  // Postconditions:
586 
587  ensure(result == xcoord.schema().base_space().is_same_state(&xspace.schema().base_space()));
588 
589  // Exit:
590 
591  return result;
592 }
593 
594 
595 bool
597 same_discretization(const sec_ed& xcoord, const sec_rep_space& xspace) const
598 {
599  bool result;
600 
601  // Preconditions:
602 
603  require(xcoord.state_is_read_accessible());
604  require(xspace.state_is_read_accessible());
605 
606  // Body:
607 
608  result = xcoord.schema().discretization().is_same_state(&xspace.schema().discretization());
609 
610  // Postconditions:
611 
612  ensure(result == xcoord.schema().discretization().is_same_state(&xspace.schema().discretization()));
613 
614  // Exit:
615 
616  return result;
617 }
618 
619 bool
621 same_fiber(const sec_rep_space& xspace1, const sec_rep_space& xspace2) const
622 {
623  bool result;
624 
625  // Preconditions:
626 
627  require(xspace1.state_is_read_accessible());
628  require(xspace2.state_is_read_accessible());
629 
630  // Body:
631 
632  result =
633  xspace1.schema().fiber_schema().is_same_state(&xspace2.schema().fiber_schema())
634  && (xspace1.schema().df() == xspace2.schema().df());
635 
636  // Postconditions:
637 
638  ensure(result ==
639  (xspace1.schema().fiber_schema().is_same_state(&xspace2.schema().fiber_schema())
640  && (xspace1.schema().df() == xspace2.schema().df())));
641 
642  // Exit:
643 
644  return result;
645 }
646 
650 {
651  return *_overlap_action;
652 }
653 
657 {
658  return *_default_overlap_action;
659 }
660 
664 {
665  return *_extension_action;
666 }
667 
671 {
672  return *_default_extension_action;
673 }
674 
675 
676 void
679 {
680  // Preconditions:
681 
682 
683  // Body:
684 
685  _overlap_action = &xoverlap_action;
686 
687  // Postconditions:
688 
689  ensure(&overlap_action() == &xoverlap_action);
690 
691  // Exit:
692 
693  return;
694 }
695 
696 void
699 {
700  // Preconditions:
701 
702 
703  // Body:
704 
705  _extension_action = &xextension_action;
706 
707  // Postconditions:
708 
709  ensure(&extension_action() == &xextension_action);
710 
711  // Exit:
712 
713  return;
714 }
715 
716 
717 // PROTECTED MEMBER FUNCTIONS
718 
721 {
722  // Preconditions:
723 
724  // Body:
725 
726  not_implemented();
727 
728  // Postconditions:
729 
730  // Exit:
731 
732  return;
733 }
734 
735 
736 // PRIVATE MEMBER FUNCTIONS
737 
738 void
739 fields::section_pusher::
740 make_range_monovalent_subposet(bool xis_ext)
741 {
742  // Preconditions:
743 
744  require(domain().state_is_read_accessible());
745  require(range().state_is_read_accessible());
746  require(range().schema().base_space().state_is_read_write_accessible());
747 
748  // Body:
749 
750  not_implemented();
751 
752  // Postconditions:
753 
754  ensure(unexecutable(corresponding members of monovalent subposet in domain and range have same client id));
755 
756  // Exit:
757 }
758 
759 
760 void
761 fields::section_pusher::
762 pull_back_range_disc_mono_mono()
763 {
764 #ifdef DIAGNOSTIC_OUTPUT
765  post_information_message("Entering pull_back_range_disc_mono_mono:");
766 #endif
767 
768  // Preconditions:
769 
770  require(_domain_coords.state_is_read_accessible());
771  require(_range_coords.state_is_read_accessible());
772 
773  // Body:
774 
775 
776  if(!_domain_coords.is_invertible())
777  {
778  // Initialize inversion using defaults.
779 
780  _domain_coords.initialize_point_locator(false);
781  }
782 
783  // Allocate some useful local variables.
784 
785  pb_type lpb;
786 
787  // Iterate over the property disc.
788 
789  property_disc_iterator* ldisc_itr =
790  property_disc_iterator::new_property_disc_iterator(_range_coords.schema(),
791  _range->schema());
792  while(!ldisc_itr->is_done())
793  {
794  // Get the context for all the property disc members associated
795  // with the current iteration.
796 
797  ldisc_itr->get_prop_disc_values(_range_coords);
798 
799  // Iterate over all the property disc members.
800 
801  const block<discretization_context>& lprop_mbrs =
802  ldisc_itr->property_discretization_members();
803  size_type lct = lprop_mbrs.ct();
804  for(size_type i=0; i<lct; ++i)
805  {
806  // Get the context for this disc member.
807 
808  discretization_context& lcontext = lprop_mbrs[i];
809 
810  lpb.disc_id = lcontext.disc_id;
811 
812  // Invert the domain global coordinates to get the pull back of
813  // the range discretization point into domain local coordinates.
814 
815  _domain_coords.point_at_value_ua(lcontext.values,
816  lcontext.values_ub,
817  lpb.domain_pt);
818 
819 #ifdef DIAGNOSTIC_OUTPUT
820 
821  cout << "inserting pullback entry: " << lpb << endl;
822 #endif
823 
824  // _pb_maps index using internal id space.
825 
826  _pb_maps[_first_branch.pod()]->insert(lpb);
827  }
828 
829  ldisc_itr->next();
830  }
831 
832  delete ldisc_itr;
833 
834  // Postconditions:
835 
836 
837  // Exit:
838 
839 #ifdef DIAGNOSTIC_OUTPUT
840 
841  post_information_message("Leaving pull_back_range_disc_mono_mono:");
842 #endif
843 
844  return;
845 }
846 
847 void
848 fields::section_pusher::
849 pull_back_range_disc_mono_multi()
850 {
851 #ifdef DIAGNOSTIC_OUTPUT
852  post_information_message("Entering pull_back_range_disc_mono_multi:");
853 #endif
854 
855  // Preconditions:
856 
857  require(_domain_coords.state_is_read_accessible());
858  require(_range_coords.state_is_read_accessible());
859 
860  // Body:
861 
862 
863  if(!_domain_coords.is_invertible())
864  {
865  // Initialize inversion using defaults.
866 
867  _domain_coords.initialize_point_locator(false);
868  }
869 
870  // Allocate some useful local variables.
871 
872  pb_type lpb;
873  block<chart_point_3d> ldomain_pts(32); // Arbitrary size.
874  set< stl_scoped_index<> > lbranches;
875 
876  // Iterate over the property disc.
877 
878  property_disc_iterator* ldisc_itr =
879  property_disc_iterator::new_property_disc_iterator(_range_coords.schema(),
880  _range->schema());
881  while(!ldisc_itr->is_done())
882  {
883  // Get the context for all the property disc members associated
884  // with the current iteration.
885 
886  ldisc_itr->get_prop_disc_values(_range_coords);
887 
888  // Iterate over all the property disc members.
889 
890  const block<discretization_context>& lprop_mbrs =
891  ldisc_itr->property_discretization_members();
892  size_type lct = lprop_mbrs.ct();
893  for(size_type i=0; i<lct; ++i)
894  {
895  // Get the context for this disc member.
896 
897  discretization_context& lcontext = lprop_mbrs[i];
898 
899  lpb.disc_id = lcontext.disc_id;
900 
901  // Invert the domain global coordinates to get the pull back of
902  // the range discretization point into domain local coordinates.
903 
904  ldomain_pts.set_ct(0);
905  _domain_coords.all_points_at_value_ua(lcontext.values,
906  lcontext.values_ub,
907  ldomain_pts);
908 
909  if(ldomain_pts.ct() > 0)
910  {
911  // This range disc point has one or more pullbacks to the source.
912 
913  // Sort pullbacks into maps by branch so that there is
914  // exactly one chart point for each disc id in each branch
915  // that contains the disc point.
916 
917  // Clear the set of branches containing the current disc id.
918 
919  lbranches.clear();
920 
921  // Iterate over all the chart points for this disc id.
922 
923  for(int i=0; i<ldomain_pts.ct(); ++i)
924  {
925 
926 #ifdef DIAGNOSTIC_OUTPUT
927  cout << "i: " << i << " chart pt[i]: " << ldomain_pts[i] << endl;
928 #endif
929  // Iterate over all the branches containing the current chart.
930 
931  typedef chart_to_branch_map_type::iterator map_itr_type;
932  typedef pair<map_itr_type, map_itr_type> map_range_type;
933 
934  map_range_type lrange =
935  _chart_to_branch_map.equal_range(ldomain_pts[i].chart_id());
936 
937  map_itr_type lmap_itr = lrange.first;
938  while(lmap_itr != lrange.second)
939  {
940  scoped_index lbranch_id = lmap_itr->second;
941  if(lbranches.find(lbranch_id) == lbranches.end())
942  {
943  // We have not yet stored a chart point
944  // for this disc id in this branch pullback map.
945  // Insert the pullback in the pullback map.
946 
947  lpb.domain_pt = ldomain_pts[i];
948 
949 #ifdef DIAGNOSTIC_OUTPUT
950 
951  cout << "inserting pullback entry: " << lpb << endl;
952 #endif
953 
954  scoped_index lbranch_id = lmap_itr->second;
955 
956  _pb_maps[lbranch_id.pod()]->insert(lpb);
957 
958  // Add this branch to the set of branches for this disc.
959 
960  lbranches.insert(lbranch_id);
961  }
962  else
963  {
964  // We already have a chart point for this disc id in this branch
965  // and we only want one. Ignore this chart point.
966 
967 #ifdef DIAGNOSTIC_OUTPUT
968  cout << "Ignoring chart pt." << endl;
969 #endif
970 
971  }
972  ++lmap_itr;
973  } // end while branches
974  } // end for domain pts
975  } // end if domain pts
976  else
977  {
978  // This range disc point has no pullbacks to the source.
979  // Enter it as an invalid chart point in the map for branch 0.
980 
981  lpb.domain_pt.invalidate();
982 
983  _pb_maps[_first_branch.pod()]->insert(lpb);
984  }
985  } // end for current disc members
986 
987  ldisc_itr->next();
988  } // end while disc itr
989 
990  delete ldisc_itr;
991 
992  // Postconditions:
993 
994 
995  // Exit:
996 
997 #ifdef DIAGNOSTIC_OUTPUT
998 
999  post_information_message("Leaving pull_back_range_disc_mono_multi:");
1000 #endif
1001 
1002  return;
1003 }
1004 
1005 void
1006 fields::section_pusher::
1007 pull_back_range_disc_multi_mono()
1008 {
1009 #ifdef DIAGNOSTIC_OUTPUT
1010  post_information_message("Entering pull_back_range_disc_multi_mono:");
1011 #endif
1012 
1013  // Preconditions:
1014 
1015  require(_domain_coords.state_is_read_accessible());
1016  require(_range_coords.state_is_read_accessible());
1017 
1018  // Body:
1019 
1020 
1021  if(!_domain_coords.is_invertible())
1022  {
1023  // Initialize inversion using defaults.
1024 
1025  _domain_coords.initialize_point_locator(false);
1026  }
1027 
1028  // Allocate some useful local variables.
1029 
1030  pb_type lpb;
1031  block<branch_point_pair> ldomain_pts(32); // Arbitrary size.
1032 
1033  // Iterate over the property disc.
1034 
1035  property_disc_iterator* ldisc_itr =
1036  property_disc_iterator::new_property_disc_iterator(_range_coords.schema(),
1037  _range->schema());
1038  while(!ldisc_itr->is_done())
1039  {
1040  // Get the context for all the property disc members associated
1041  // with the current iteration.
1042 
1043  ldisc_itr->get_prop_disc_values(_range_coords);
1044 
1045  // Iterate over all the property disc members.
1046 
1047  const block<discretization_context>& lprop_mbrs =
1048  ldisc_itr->property_discretization_members();
1049  size_type lct = lprop_mbrs.ct();
1050  for(size_type i=0; i<lct; ++i)
1051  {
1052  // Get the context for this disc member.
1053 
1054  discretization_context& lcontext = lprop_mbrs[i];
1055 
1056  lpb.disc_id = lcontext.disc_id;
1057 
1058  // Invert the domain global coordinates to get the pull back of
1059  // the range discretization point into domain local coordinates.
1060 
1061  ldomain_pts.set_ct(0);
1062  _domain_coords.branch_points_at_value_ua(lcontext.values,
1063  lcontext.values_ub,
1064  ldomain_pts);
1065 
1066  if(ldomain_pts.ct() > 0)
1067  {
1068  // This range disc point has one or more pullbacks to the source.
1069  // Iterate over all the chart points for this disc id.
1070 
1071  for(int i=0; i<ldomain_pts.ct(); ++i)
1072  {
1073 
1074 #ifdef DIAGNOSTIC_OUTPUT
1075  cout << "i: " << i
1076  << " branch id: " << ldomain_pts[i].first
1077  << " chart pt[i]: " << ldomain_pts[i].second
1078  << endl;
1079 #endif
1080 
1081  lpb.domain_pt = ldomain_pts[i].second;
1082 
1083 #ifdef DIAGNOSTIC_OUTPUT
1084 
1085  cout << "inserting pullback entry: " << lpb << endl;
1086 #endif
1087 
1088  _pb_maps[_first_branch.pod()]->insert(lpb);
1089  }
1090  }
1091  else
1092  {
1093  // This range disc point has no pullbacks to the source.
1094  // Enter it as an invalid chart point in the map for branch 0.
1095 
1096  lpb.domain_pt.invalidate();
1097 
1098  _pb_maps[_first_branch.pod()]->insert(lpb);
1099  }
1100  }
1101 
1102  ldisc_itr->next();
1103  }
1104 
1105  delete ldisc_itr;
1106 
1107  // Postconditions:
1108 
1109 
1110  // Exit:
1111 
1112 #ifdef DIAGNOSTIC_OUTPUT
1113 
1114  post_information_message("Leaving pull_back_range_disc_multi_mono:");
1115 #endif
1116 
1117  return;
1118 }
1119 
1120 void
1121 fields::section_pusher::
1122 make_maps(const sec_vd& xinput)
1123 {
1124  // Preconditions:
1125 
1126 
1127  // Body:
1128 
1130 
1131  // Allocate the branch pullback maps and
1132  // populate the chart to branch map.
1133 
1134  // Use poset internal id space to index _pd_maps.
1135 
1136  _pb_maps.reserve(_domain->member_index_ub().pod());
1137 
1138  _pb_maps.set_ct(_pb_maps.ub());
1139  _pb_maps.assign(0);
1140 
1144 
1145  preorder_iterator leval_itr(xinput.schema().base_space(),
1146  xinput.schema().evaluation(),
1147  DOWN, NOT_STRICT);
1148  leval_itr.force_is_done();
1149  leval_itr.put_visit_once(false);
1150 
1151  // Iterate over the branches.
1152 
1153  sec_vd lbranch;
1154  preorder_iterator lbranch_itr(xinput, "jims", DOWN, NOT_STRICT);
1155  _first_branch = lbranch_itr.index();
1156 
1157  assertion(_first_branch.is_hub_scope());
1158 
1159  while(!lbranch_itr.is_done())
1160  {
1161  const scoped_index& lbranch_id = lbranch_itr.index();
1162 
1163  // Allocate the pullback map for this;
1164  // use poset internal scope.
1165 
1166  assertion(lbranch_id.is_hub_scope());
1167 
1168  _pb_maps[lbranch_id.pod()] = new pb_map_type;
1169 
1170  // Re-anchor the eval itr to this branch.
1171 
1172  lbranch.attach_to_state(xinput.host(), lbranch_id);
1173  leval_itr.put_anchor(lbranch.schema().base_space_id());
1174  lbranch.detach_from_state();
1175 
1176  leval_itr.reset(false);
1177 
1178  // Iterate over the eval members in this branch,
1179  // populating the chart to branch map.
1180 
1181  while(!leval_itr.is_done())
1182  {
1183  chart_to_branch_map_type::value_type lval(leval_itr.index().hub_pod(), lbranch_id);
1184  _chart_to_branch_map.insert(lval);
1185  leval_itr.truncate();
1186  }
1187 
1188  // Move on to the next branch.
1189 
1190  lbranch_itr.truncate();
1191  }
1192 
1193  // Postconditions:
1194 
1195 
1196  // Exit:
1197 
1198  return;
1199 }
1200 
1201 void
1202 fields::section_pusher::
1203 clear_maps()
1204 {
1205  // Preconditions:
1206 
1207 
1208  // Body:
1209 
1210  // Deallocate the pullback maps.
1211 
1212  for(int i=0; i<_pb_maps.ct(); ++i)
1213  {
1214  pb_map_type*& lpb_map = _pb_maps[i];
1215 
1216  if(lpb_map != 0)
1217  {
1218  delete lpb_map;
1219  lpb_map = 0;
1220  }
1221  }
1222 
1223  // Clear the first brnach id.
1224 
1225  _first_branch.invalidate();
1226 
1227  // Clear the chart to branch map.
1228 
1229  _chart_to_branch_map.clear();
1230 
1231  // Postconditions:
1232 
1233 
1234  // Exit:
1235 
1236  return;
1237 }
1238 
1239 
1240 void
1241 fields::section_pusher::
1242 define_overlap(const sec_vd& xinput, sec_vd& xresult)
1243 {
1244 #ifdef DIAGNOSTIC_OUTPUT
1245  post_information_message("Entering define_overlap:");
1246 #endif
1247 
1248  // Preconditions:
1249 
1250 
1251  // Body:
1252 
1253  // Do whatever preprocessing the overlap action wants.
1254 
1255  _overlap_action->initialize(xresult);
1256 
1257  // Create an eval iterator for use on each branch of xinput.
1258 
1262 
1263  eval_iterator leval_itr(xinput.schema(), false);
1264  leval_itr.force_is_done();
1265 
1266  // Iterate over the branches of xinput.
1267  // The branches of xinput are the maximal jims in its down set.
1268  // If xinput is not a multi-section, xinput itself is its only branch.
1269 
1270  sec_vd lbranch;
1271  preorder_iterator lbranch_itr(xinput, "jims", DOWN, NOT_STRICT);
1272  while(!lbranch_itr.is_done())
1273  {
1274  scoped_index branch_index = lbranch_itr.index();
1275 
1276  // Attach a handle to the current branch.
1277 
1278  lbranch.attach_to_state(xinput.host(), branch_index);
1279 
1280  // Iterate over the evaluation members of the input;
1281  // process all the pullbacks contained in each eval member.
1282 
1283  // Reanchor the eval itr to this branch without resetting bit vector.
1284 
1285  leval_itr.put_schema_anchor(lbranch.schema().index());
1286  leval_itr.reset(false);
1287 
1288  while(!leval_itr.is_done())
1289  {
1290  push_eval_mbr(leval_itr, lbranch, xresult);
1291  leval_itr.next();
1292  }
1293 
1294  // Don't need to go deeper.
1295 
1296  lbranch_itr.truncate();
1297  }
1298 
1299  // Do whatever postprocessing the overlap action wants.
1300 
1301  _overlap_action->finalize(xresult);
1302 
1303  // Clean up.
1304 
1305  lbranch.detach_from_state();
1306 
1307  // Postconditions:
1308 
1309 
1310  // Exit:
1311 
1312 #ifdef DIAGNOSTIC_OUTPUT
1313 
1314  post_information_message("Leaving define_overlap:");
1315 #endif
1316 
1317  return;
1318 }
1319 
1320 void
1321 fields::section_pusher::
1322 push_eval_mbr(const eval_iterator& xeval_itr, const sec_vd& xinput,
1323  sec_vd& xresult)
1324 {
1325  // Preconditions:
1326 
1327 
1328  // Body:
1329 
1330  // Try to get the list of pullbacks for this eval member in this branch.
1331 
1332  pb_map_range_type litr_range =
1333  _pb_maps[xinput.index().pod()]->equal_range(pb_type(xeval_itr.index()));
1334 
1335  if(litr_range.first != litr_range.second)
1336  {
1337  // The iterator range is not empty.
1338  // This eval member contains pullback points in its base space.
1339  // We will evaluate the input field for each pullback,
1340  // but first we'll need to gather the input dofs.
1341 
1342  _src_dofs.set_ct(0);
1343 
1344  eval_iterator& leval_itr = const_cast<eval_iterator&>(xeval_itr);
1345  leval_itr.gather_dofs(xinput, _src_dofs);
1346  //xeval_itr.gather_dofs(xinput, _src_dofs);
1347 
1348  // Get the evaluator for this eval member.
1349 
1350  const section_evaluator& levaluator = xeval_itr.evaluator();
1351 
1352  // Iterate over the pullback points, evaluating
1353  // the input at each point.
1354 
1355  for(pb_map_itr_type itr = litr_range.first; itr != litr_range.second; ++itr)
1356  {
1357  // Evaluate the input at the pullback point.
1358 
1359  levaluator.value_at_coord(_src_dofs.base(),
1360  _src_dofs.ct(),
1361  itr->domain_pt.local_coords(),
1362  _src_db,
1363  _dst_dofs.base(),
1364  _dst_dofs.ct());
1365 
1366  // Let the overlap action do what ever it wants.
1367 
1368  (*_overlap_action)(itr, xresult, _dst_dofs);
1369 
1370 
1371 #ifdef DIAGNOSTIC_OUTPUT
1372 
1373  print_debug_info(xeval_itr.client_id(), range(), itr, _dst_dofs);
1374 #endif
1375 
1376  // Scatter the dofs into the result.
1377 
1378  xresult.put_fiber(itr->disc_id, _dst_dofs.base(),
1379  _dst_dofs.ub()*sizeof(sec_vd_dof_type), false);
1380  }
1381 
1382  }
1383  else
1384  {
1385  // This eval member does not contain any pullback points;
1386  // do nothing, just skip it.
1387  }
1388 
1389  // Postconditions:
1390 
1391 
1392  // Exit:
1393 
1394  return;
1395 }
1396 
1397 void
1398 fields::section_pusher::
1399 define_extension(sec_vd& xresult)
1400 {
1401 #ifdef DIAGNOSTIC_OUTPUT
1402  post_information_message("Entering define_extension:");
1403 #endif
1404 
1405  // Preconditions:
1406 
1407 
1408  // Body:
1409 
1410  // Have evaluated the result for all discretization members that
1411  // have pullbacks. Still have to process the members that do not
1412  // have pullbacks.
1413 
1414  // Do whatever preprocessing the extension action wants.
1415 
1416  _extension_action->initialize(xresult);
1417 
1418  // Iterate over the disc members in the extension.
1419  // These are all in the pullback list of chart id that are invalid for branch 0.
1420 
1421  pb_map_type* lpb_map = _pb_maps[_first_branch.pod()];
1422 
1423  pb_map_range_type litr_range =
1424  lpb_map->equal_range(pb_type(invalid_pod_index()));
1425 
1426  for(pb_map_itr_type itr = litr_range.first; itr != litr_range.second; ++itr)
1427  {
1428  // There is no value of the input associated with this
1429  // discretization member, so define the dofs by extension.
1430 
1431  (*_extension_action)(itr, xresult, _dst_dofs);
1432 
1433 
1434 #ifdef DIAGNOSTIC_OUTPUT
1435 
1436  print_debug_info(invalid_pod_index(), range(), itr, _dst_dofs);
1437 #endif
1438 
1439  // Scatter the dofs into the result.
1440 
1441  xresult.put_fiber(itr->disc_id, _dst_dofs.base(),
1442  _dst_dofs.ub()*sizeof(sec_vd_dof_type), false);
1443  }
1444 
1445  // Do whatever postprocessing the extension action wants.
1446 
1447  _extension_action->finalize(xresult);
1448 
1449  // Postconditions:
1450 
1451 
1452  // Exit:
1453 
1454 #ifdef DIAGNOSTIC_OUTPUT
1455 
1456  post_information_message("Leaving define_extension:");
1457 #endif
1458 
1459  return;
1460 }
1461 
1462 void
1463 fields::section_pusher::
1464 initialize()
1465 {
1466  // Preconditions:
1467 
1468  require(domain().state_is_read_accessible());
1469 
1470  // Body:
1471 
1472  // Initialize some useful buffers.
1473 
1474  _prop_df = _domain->schema().df();
1475  _src_db = _domain->schema().db();
1476 
1477  _src_value.reserve(_prop_df);
1478  _src_value.set_ct(_prop_df);
1479 
1480  _dst_dofs.reserve(_prop_df);
1481  _dst_dofs.set_ct(_prop_df);
1482 
1483  // Initialize the push actions.
1484 
1485  _default_overlap_action = new copy_push_action(_prop_df);
1486  _overlap_action = _default_overlap_action;
1487 
1488  _default_extension_action = new constant_push_action(_prop_df, 0.0);
1489  _extension_action = _default_extension_action;
1490 
1491 
1492  // Allocate the pullback map buffer.
1493 
1494  _pb_maps.reserve(_domain->member_index_ub().pod());
1495 
1496  _pb_maps.set_ct(_pb_maps.ub());
1497  _pb_maps.assign(0);
1498 
1499  _first_branch.invalidate();
1500 
1501  // Postconditions:
1502 
1503 
1504  // Exit:
1505 
1506  return;
1507 }
1508 
1509 
1510 // =============================================================================
1511 // ANY FACET
1512 // =============================================================================
1513 
1514 // PUBLIC MEMBER FUNCTIONS
1515 
1518 {
1519  // Preconditions:
1520 
1521  // Body:
1522 
1523  not_implemented();
1524 
1525  // Postconditions:
1526 
1527  ensure(invariant());
1528 
1529  // Exit:
1530 }
1531 
1534 {
1535  // Preconditions:
1536 
1537  // Body:
1538 
1539  _domain_coords.detach_from_state();
1540  _range_coords.detach_from_state();
1541 
1542  // Postconditions:
1543 
1544  // Exit:
1545 }
1546 
1547 bool
1549 invariant() const
1550 {
1551  bool result = true;
1552 
1553  // Preconditions:
1554 
1555  // Body:
1556 
1557  invariance(any::invariant());
1558 
1559  if(invariant_check())
1560  {
1561  disable_invariant_check();
1562 
1563  // The domain and range fiber type and dimension should the same.
1565 
1566  invariance(unexecutable(same_fiber(domain(), range())));
1567 
1568  // Currently only support binary schema, not ternary schema.
1570 
1571  invariance(unexecutable(dynamic_cast<binary_section_space_schema_member*>(&(range().schema())) != 0));
1572 
1573  // Finished, turn invariant checking back on.
1574 
1575  enable_invariant_check();
1576  }
1577 
1578  // Postconditions:
1579 
1580  // Exit
1581 
1582  return result;
1583 }
1584 
1585 
1586 // ===========================================================
1587 // NONMEMBER FUNCTIONS
1588 // ===========================================================
1589 
1590 
A context for discretization members. Intended for implementing various iterators, especially concurrent iterations over multiple sections.
virtual void force_is_done()
Force the iterator to be done.
virtual bool is_jim(bool xin_current_version=true) const
True if this member is join irreducible in the current version of the host (xin_current_version == tr...
A client handle for a subposet.
Definition: subposet.h:86
scoped_index disc_id
The global index of the disc member.
void truncate()
Makes this the next member of the subset which is not less than old this, i.e. the depth-first descen...
host_type * host() const
The poset this is a member of.
Definition: sec_vd.cc:1353
Functor to compute the dofs at a destination discretization point by copying the source value to the ...
size_type ct() const
The number of items currently in use.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
Definition: scoped_index.h:672
virtual void get_prop_disc_values(const sec_vd &xsec)=0
The gets the values of xsec at the property discretization points.
section_evaluator & evaluator()
The section evaluator associated with the current evaluation member (mutable version).
schema_poset_member & fiber_schema()
The fiber schema component of this (mutable version).
Abstract functor to compute the dofs at a destination discretization point.
Namespace for fields component of sheaf system.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
virtual void get_read_access() const
Get read access to the state associated with this.
Definition: field_vd.cc:1516
virtual void force_is_done()
Force the iterator to be done.
An iterator over the members of the evaluation subposet contained in the downset of the base space of...
Definition: eval_iterator.h:66
subposet & evaluation()
The evaluation subposet for section spaces on this schema (mutable version).
STL namespace.
void put_overlap_action(section_pusher_push_action &xoverlap_action)
Sets the overlap action to xoverlap_action.
bool is_same_state(const poset_state_handle *xhost, pod_index_type xhub_id) const
True is this is attached to state with hub id xhub_id in host xhost.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
section_pusher_push_action & extension_action() const
Computes value of destination dofs where dst does not overlap src.
virtual bool invariant() const
Class invariant.
virtual void get_read_access() const
Get read access to the state associated with this.
host_type * host() const
The poset this is a member of.
Definition: sec_at1.cc:525
section_pusher()
Default constructor; protected to prevent default construction.
const scoped_index & index() const
The index of the component state this handle is attached to.
bool same_base(const sec_ed &xcoord, const sec_rep_space &xspace) const
True if and only if xcoord and xspace have the same base space.
virtual dof_type value_at_coord(const dof_type xdofs[], size_type xdofs_ub, const dof_type xlocal_coords[], size_type xlocal_coords_ub) const
Value at a specified local_coordinate. Single component version.
const geometry::sec_ed_invertible & domain_coords() const
The coordinates section for the domain.
void push_pa(const sec_vd &xinput, sec_vd &result, bool xauto_access)
Pushes field xinput from sec_rep_space domain() to sec_rep_space range(), pre-allocated.
bool is_hub_scope() const
True if and only if the id space of this is the hub id space.
Definition: scoped_index.h:575
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
A section of a fiber bundle with a d-dimensional Euclidean vector space fiber.
Definition: sec_ed.h:47
void invalidate()
Makes this invalid.
Definition: chart_point.cc:322
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
const bool NOT_STRICT
Iteration strictness control.
Definition: sheaf.h:102
const bool DOWN
Iteration directions.
Definition: sheaf.h:77
An abstract invertible section of a fiber bundle with a d-dimensional base space and a d-dimensional ...
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
bool same_discretization(const sec_ed &xcoord, const sec_rep_space &xspace) const
True if and only if xcoord and xspace have the same discretization.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
const sec_rep_space & domain() const
The domain of the push-forward map.
void put_extension_action(section_pusher_push_action &xextension_cction)
Sets the extension action to xextension_action.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
virtual ~section_pusher()
Destructor.
int access_request_depth() const
The number of times access has been requested and granted without being released. ...
Definition: field_vd.cc:1489
A vd-valued property as a function of global coordinates.
Definition: field_vd.h:69
sec_vd & property() const
The dependent variable of this field.
Definition: field_vd.cc:357
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
Definition: field_vd.cc:1594
section_pusher_push_action & default_overlap_action() const
Overlap action if none specified by clinet.
section_pusher_push_action & default_extension_action() const
Extension action if none specified by clinet.
scoped_index client_id() const
The client id of the current evaluation member.
void next()
Makes this the next member of the subset.
void attach_to_state(const poset_state_handle *xother)
Attach this handle to the same state as xother.
bool same_fiber(const sec_rep_space &xspace1, const sec_rep_space &xspace2) const
True if and only if xspace1 and xspace2 have the same fiber type and dimension.
subposet & discretization()
The discretization subposet for section spaces on this schema (mutable version).
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
An entry in a discretization map.
Definition: pullback_map.h:44
sec_vd_value_type values[values_ub]
The values of another section (typically the global coordinates) at this disc point.
virtual pod_type pod(pod_type xid) const =0
The pod index in this space equivalent to xid in the hub id space.
const block< discretization_context > & property_discretization_members() const
The property discretization members in the downset of the current evaluation member.
const sec_ed & range_coords() const
The coordinates section for the range.
chart_point_3d domain_pt
The location of the discretization member.
Definition: pullback_map.h:62
The general section push-forward operator; moves sections from one sec_rep_space to another using ext...
section_pusher_push_action & overlap_action() const
Computes value of destination dofs where dst overlaps src.
An abstract local section evaluator; a map from {local coordinates x dofs} to section value...
A section of a fiber bundle with a d-dimensional vector space fiber.
Definition: sec_vd.h:54
Abstract functor to compute the dofs at a destination discretization point.
bool is_done() const
True if iteration finished.
void detach_from_state()
Detaches field from state it is currently attached to.
Definition: sec_tuple.cc:603
const scattered_insertion_index_space_handle & id_space() const
The id space for the members of with this (const version).
Definition: subposet.cc:508
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
int access_request_depth() const
The number of times access has been requested and granted without being released. ...
total_poset_member & base_space()
The base space component of this (mutable version).
virtual section_space_schema_member & schema()
The restricted schema for this (mutable version).
void gather_dofs(const sec_vd &xsec, block< sec_vd::dof_type > &xdofs)
Gathers the dofs for the current evalaution member from section xsec and appends them to the back of ...
sec_ed_invertible & coordinates() const
The independent variable of this field.
Definition: field_vd.cc:339
bool state_is_read_accessible() const
True if this is attached and if the coordinates and property are accessible for read or access contro...
Definition: field_vd.cc:1380
virtual sec_vd * clone() const
Make a new handle, no state instance of current.
Definition: sec_vd.cc:1318
int df() const
The dimension of the fiber space component.
A map from members of a discretization subposet to points in a base space.
Definition: pullback_map.h:130
void new_jim_state(abstract_poset_member &xbase_mbr, int xbase_version=CURRENT_HOST_VERSION, bool xauto_access=true)
Creates a new jim state in host() and attaches this handle to the state. The state is a partial secti...
void attach_to_state(const namespace_poset *xns, const poset_path &xpath, bool xauto_access=true)
Attach to the state specified by path xpath in the namespace xns.
virtual void get_read_access() const
Get read access to the state associated with this.
double sec_vd_dof_type
The type of degree of freedom in the section space.
Definition: fiber_bundle.h:78
scoped_index disc_id
The id of a discretization member.
Definition: pullback_map.h:57
const sec_rep_space & range() const
The range of the push-forward map.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
Definition: pod_types.cc:31
Abstract iterator over the discretization of the property section of a field_vd. Concurrently travers...
sec_vd * push(const sec_vd &xinput, bool xauto_access)
Pushes field xinput from sec_rep_space domain() to sec_rep_space range(), auto-allocated.
const scoped_index & index() const
The index of the current member of the iteration.
pod_index_type base_space_id() const
The member id of the base space component of this.
A handle for a poset whose members are numerical representations of sections of a fiber bundle...
Definition: sec_rep_space.h:61