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