SheafSystem  0.0.0.0
visualization_iterator.cc
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 
18 // Implementation for class visualization_iterator
19 
20 
21 #include "SheafSystem/visualization_iterator.h"
22 
23 #include "SheafSystem/assert_contract.h"
24 #include "SheafSystem/base_space_member.h"
25 #include "SheafSystem/binary_section_space_schema_member.h"
26 #include "SheafSystem/error_message.h"
27 #include "SheafSystem/eval_family.h"
28 #include "SheafSystem/visualization_iterator_1_1.h"
29 // #include "SheafSystem/visualization_iterator_1_2.h"
30 #include "SheafSystem/visualization_iterator_1_3.h"
31 #include "SheafSystem/visualization_iterator_4_2.h"
32 #include "SheafSystem/visualization_iterator_4_3.h"
33 #include "SheafSystem/sec_rep_descriptor.h"
34 #include "SheafSystem/section_evaluator.h"
35 #include "SheafSystem/section_space_schema_member.h"
36 #include "SheafSystem/section_space_schema_poset.h"
37 #include "SheafSystem/sec_vd.h"
38 #include "SheafSystem/std_limits.h"
39 #include "SheafSystem/structured_block_1d.h"
40 #include "SheafSystem/structured_block_2d.h"
41 #include "SheafSystem/structured_block_3d.h"
42 #include "SheafSystem/subposet_member_iterator.h"
43 #include "SheafSystem/uniform_eval_family.h"
44 #include "vtkDoubleArray.h"
45 #include "vtkIdTypeArray.h"
46 
47 //#define DIAGNOSTIC_OUTPUT 1
48 
49 // Workaround for MS Visual C++
50 using namespace tool;
51 using namespace std;
52 
53 // ===========================================================
54 // ANY FACET
55 // ===========================================================
56 
57 bool
59 is_ancestor_of(const any* xother) const
60 {
61  // Preconditions:
62 
63  // Body:
64 
65  bool result = dynamic_cast<const visualization_iterator*>(xother) != 0;
66 
67  // Postconditions:
68 
69  // Exit:
70 
71  return result;
72 }
73 
76 clone() const
77 {
78  // Preconditions:
79 
80  // Body:
81 
82  visualization_iterator* result = 0; // Just to silence compiler.
83 
84  is_abstract();
85 
86  // Postconditions:
87 
88  // ensure(invariant());
89  ensure(result != 0);
90 
91  // Exit:
92 
93  return result;
94 }
95 
96 bool
98 invariant() const
99 {
100  bool result = true;
101 
102  // Preconditions:
103 
104  // Body:
105 
106 
107  if(invariant_check())
108  {
110 
111  disable_invariant_check();
112 
113  // The following is disabled because it can not be implemented
114  // with our current invaraint machinery. It is true at client scope,
115  // but not true in force_is_done called from put_anchor, i.e. it
116  // is not true between the the we reset _coord_state and the time we
117  // reset the anchor.
118 
119  // invariance(is_initialized() ?
120  // anchor().is_same_state(&min(coordinates_schema().base_space(),
121  // property_schema().base_space())) :
122  // true);
123 
124  invariance(is_initialized() ? coordinates_schema().df() <= 3 : true);
125 
126  invariance((is_initialized() && has_property()) ?
127  property_schema().df() <= 16 :
128  true);
129 
130  // Finished, turn invariant checking back on.
131 
132  enable_invariant_check();
133  }
134 
135  // Postconditions:
136 
137  // Exit:
138 
139  return result;
140 }
141 
142 
143 // ===========================================================
144 // DEPTH_FIRST_ITERATOR FACET
145 // ===========================================================
146 
147 void
150 {
151  // Preconditions:
152 
153  // Body:
154 
155  _prop_state.down_set.set_ct(0);
156  _prop_state.discretization_members.set_ct(0);
157 
160  _coord_state.discretization_members.set_ct(0);
161 
162  _vis_state.down_set.set_ct(0);
163  _vis_state.discretization_members.set_ct(0);
164 
165  _above = true;
166  _at = false;
167 
168  _maximal_eval_id.invalidate();
169 
171 
172  // Postconditions:
173 
174  ensure(invariant());
175  ensure(is_done());
176 
177  // Exit:
178 
179  return;
180 }
181 
182 void
185  const section_space_schema_member& xprop_schema)
186 {
187  // Preconditions:
188 
189  require(is_initialized() ? xcoords_schema.host()->is_same_state(coordinates_schema().host()) : true);
190  require(is_initialized() ?xprop_schema.host()->is_same_state(property_schema().host()) : true);
191 
192  // Body:
193 
194  _has_property = true;
195 
196  initialize_states(xcoords_schema, xprop_schema);
197 
198  const abstract_poset_member& lsmaller =
199  min(xcoords_schema.base_space(), xprop_schema.base_space());
200 
201  if(is_initialized())
202  {
203  put_anchor(lsmaller.index());
204  }
205  else
206  {
207  put_anchor(&lsmaller);
208  }
209 
210 
211  // Postconditions:
212 
213  ensure(coordinates_schema().is_same_state(&xcoords_schema));
214  ensure(property_schema().is_same_state(&xprop_schema));
215  ensure(is_done());
216 
217  // Exit:
218 
219  return;
220 }
221 
222 void
225 {
226  // Preconditions:
227 
228  require(is_initialized() ? xcoords_schema.host()->is_same_state(coordinates_schema().host()) : true);
229 
230  // Body:
231 
232  _has_property = false;
233 
234  initialize_states(xcoords_schema);
235 
236  if(is_initialized())
237  {
238  put_anchor(xcoords_schema.base_space().index());
239  }
240  else
241  {
242  put_anchor(&xcoords_schema.base_space());
243  }
244 
245 
246  // Postconditions:
247 
248  ensure(coordinates_schema().is_same_state(&xcoords_schema));
249  ensure(is_done());
250 
251  // Exit:
252 
253  return;
254 }
255 
256 void
258 reset(bool xreset_markers)
259 {
260  // Preconditions:
261 
262  require(is_initialized());
263  require(anchor().state_is_read_accessible());
264 
265  // Body:
266 
267  define_old_variable(bool old_descending = _descending);
268  define_old_variable(bool old_strict = _strict);
269 
270  _cell_seq_id = 0;
271  _pt_seq_id = 0;
272 
275 
276  filtered_depth_first_iterator::reset(xreset_markers);
277 
278  // Postconditions:
279 
280  ensure(invariant());
281  ensure(descending() == old_descending);
282  ensure(strict() == old_strict);
283 
284  // Exit:
285 
286  return;
287 }
288 
289 // ===========================================================
290 // VISUALIZATION_ITERATOR FACET
291 // ===========================================================
292 
296  const section_space_schema_member& xprop_schema,
297  bool xinitialize)
298 {
299  visualization_iterator* result;
300 
301  // Preconditions:
302 
303  require(xcoords_schema.state_is_read_accessible());
304  require(xprop_schema.state_is_read_accessible());
305 
306  // Body:
307 
308  if(xcoords_schema.evaluator_family_name() == "uniform")
309  {
310  // Uniform coordinates.
311 
312  if(xprop_schema.rep().eval_is_above_disc())
313  {
314  if(xinitialize)
315  {
316  result = new visualization_iterator_4_2(xcoords_schema, xprop_schema);
317  }
318  else
319  {
320  result = new visualization_iterator_4_2();
321  }
322  }
323  else
324  {
325  if(xinitialize)
326  {
327  result = new visualization_iterator_4_3(xcoords_schema, xprop_schema);
328  }
329  else
330  {
331  result = new visualization_iterator_4_3();
332  }
333  }
334  }
335  else if(xcoords_schema.evaluator_family_name() == "dlinear")
336  {
337  // Vertex element dlinear coordinates
338 
339  if(xprop_schema.evaluator_family_name() == "dlinear")
340  {
341  // Vertex element dlinear property.
342 
343  if(xinitialize)
344  {
345  result = new visualization_iterator_1_1(xcoords_schema, xprop_schema);
346  }
347  else
348  {
349  result = new visualization_iterator_1_1();
350  }
351  }
352  else if(xprop_schema.evaluation().name() == "__elements")
353  {
354  // Property eval same as coordinates eval.
355 
356  if(xprop_schema.rep().eval_is_above_disc())
357  {
358  // Property disc is below elements, but not just vertices.
359  // Ignore dofs not at vertices.
360 
361  if(xinitialize)
362  {
363  result = new visualization_iterator_1_1(xcoords_schema, xprop_schema);
364  }
365  else
366  {
367  result = new visualization_iterator_1_1();
368  }
369  }
370  else
371  {
372  // Property disc is at or above elements
373  // (typically element element constant).
374 
375  if(xinitialize)
376  {
377  result = new visualization_iterator_1_3(xcoords_schema, xprop_schema);
378  }
379  else
380  {
381  result = new visualization_iterator_1_3();
382  }
383  }
384  }
385  else
386  {
387  // Property eval is not same as coordinates;
388  // we don't support this yet.
389 
390  post_fatal_error_message("Property rep not supported with this coordinates rep.");
391  }
392  }
393  else if(xcoords_schema.rep().name() == "vertex_vertex_constant")
394  {
395  // Vertex_vertex_constant coordinates
396 
397  if(xprop_schema.rep().name() == "vertex_vertex_constant")
398  {
399  // Vertex_vertex_constant property.
400 
401  if(xinitialize)
402  {
403  result = new visualization_iterator_1_1(xcoords_schema, xprop_schema);
404  }
405  else
406  {
407  result = new visualization_iterator_1_1();
408  }
409  }
410  else
411  {
412  // Property rep is not same as coordinates;
413  // we don't support this yet.
414 
415  post_fatal_error_message("Property rep not supported with this coordinates rep.");
416  }
417  }
418  else
419  {
420  // Unsupported coordinates rep.
421 
422  post_fatal_error_message("Coordinates rep not supported.");
423  }
424 
425  // Postconditions:
426 
427  ensure(result != 0);
428  ensure(xinitialize ?
429  result->coordinates_schema().is_same_state(&xcoords_schema) :
430  true);
431  ensure(xinitialize ?
432  result->property_schema().is_same_state(&xprop_schema) :
433  true);
434 
435  // Exit:
436 
437  return result;
438 }
439 
443  bool xinitialize)
444 {
445  visualization_iterator* result;
446 
447  // Preconditions:
448 
449  require(xcoords_schema.state_is_read_accessible());
450 
451  // Body:
452 
453  if(xcoords_schema.evaluator_family_name() == "uniform")
454  {
455  // Uniform coordinates.
456 
457  if(xinitialize)
458  {
459  result = new visualization_iterator_4_2(xcoords_schema);
460  }
461  else
462  {
463  result = new visualization_iterator_4_2();
464  }
465  }
466  else if(xcoords_schema.evaluator_family_name() == "dlinear")
467  {
468  // Vertex element dlinear coordinates
469 
470  if(xinitialize)
471  {
472  result = new visualization_iterator_1_1(xcoords_schema);
473  }
474  else
475  {
476  result = new visualization_iterator_1_1();
477  }
478  }
479  else if(xcoords_schema.rep().name() == "vertex_vertex_constant")
480  {
481  // Vertex_vertex_constant coordinates
482 
483  if(xinitialize)
484  {
485  result = new visualization_iterator_1_1(xcoords_schema);
486  }
487  else
488  {
489  result = new visualization_iterator_1_1();
490  }
491  }
492  else
493  {
494  // Unsupported coordinates rep.
495 
496  post_fatal_error_message("Coordinates rep not supported.");
497  }
498 
499  // Postconditions:
500 
501  ensure(result != 0);
502  ensure(xinitialize ?
503  result->coordinates_schema().is_same_state(&xcoords_schema) :
504  true);
505 
506  // Exit:
507 
508  return result;
509 }
510 
511 
512 
515 {
516  // Preconditions:
517 
518  // Body:
519 
520  // Postconditions:
521 
522  // Exit:
523 
524 }
525 
529 {
530  // Preconditions:
531 
532  require(is_initialized());
533 
534  // Body:
535 
536  // Invariant ensures cast is appropriate.
537 
538  const section_space_schema_member& result = *_coord_state.schema;
539 
540  // Postconditions:
541 
542  // Exit:
543 
544  return result;
545 }
546 
547 
548 bool
551 {
552  return _has_property;
553 }
554 
558 {
559  // Preconditions:
560 
561  require(is_initialized());
562  require(has_property());
563 
564  // Body:
565 
566  // Invariant ensures cast is appropriate.
567 
568  const section_space_schema_member& result = *_prop_state.schema;
569 
570  // Postconditions:
571 
572  // Exit:
573 
574  return result;
575 }
576 
577 bool
580 {
581  return _use_point_top_ids;
582 }
583 
584 void
587 {
588  _use_point_top_ids = xvalue;
589 
590  ensure(use_point_top_ids() == xvalue);
591 
592  return;
593 }
594 
595 bool
598 {
599  return _use_cell_top_ids;
600 }
601 
602 void
605 {
606  _use_cell_top_ids = xvalue;
607 
608  ensure(use_cell_top_ids() == xvalue);
609 
610  return;
611 }
612 
613 void
615 set_vtk_data(const sec_vd& xcoords,
616  const sec_vd& xprop,
617  vtkDoubleArray* xvtk_pt_coords,
618  vtkDoubleArray* xvtk_prop,
619  int xprop_tensor_rank,
620  block<int>& xvtk_cell_types,
621  block<vtkIdType>& xvtk_cell_connectivity,
622  block<int>& xvtk_cell_type_map,
623  vtkIdTypeArray* xvtk_pt_label_ids,
624  vtkIdTypeArray* xvtk_cell_label_ids)
625 {
626  // Preconditions:
627 
628  require(xcoords.state_is_read_accessible());
629  require(xcoords.schema().is_same_state(&coordinates_schema()));
630 
631  require(has_property());
632  require(xprop.state_is_read_accessible());
633  require(xprop.schema().is_same_state(&property_schema()));
634 
637 
638  require(xcoords.schema().df() <= 3);
639 
640  // Body:
641 
642  is_abstract();
643 
644  // Postconditions:
645 
646  // Exit:
647 
648  return;
649 }
650 
651 void
653 set_vtk_data(const sec_vd& xcoords,
654  vtkDoubleArray* xvtk_pt_coords,
655  block<int>& xvtk_cell_types,
656  block<vtkIdType>& xvtk_cell_connectivity,
657  block<int>& xvtk_cell_type_map,
658  vtkIdTypeArray* xvtk_pt_label_ids,
659  vtkIdTypeArray* xvtk_cell_label_ids)
660 {
661  // Preconditions:
662 
663  require(xcoords.state_is_read_accessible());
664  require(xcoords.schema().is_same_state(&coordinates_schema()));
665 
668 
669  require(xcoords.schema().df() <= 3);
670 
671  // Body:
672 
673  is_abstract();
674 
675  // Postconditions:
676 
677 
678  // Exit:
679 
680  return;
681 }
682 
683 void
685 set_vtk_data(const sec_vd& xprop,
686  vtkDoubleArray* xvtk_prop,
687  int xprop_tensor_rank)
688 {
689  // Preconditions:
690 
691  require(has_property());
692  require(xprop.state_is_read_accessible());
693  require(xprop.schema().is_same_state(&property_schema()));
694 
695  // Body:
696 
697  is_abstract();
698 
699  // Postconditions:
700 
701  // Exit:
702 
703  return;
704 }
705 
706 
707 // ===========================================================
708 // PROTECTED MEMBER FUNCTIONS
709 // ===========================================================
710 
713 {
714  // Preconditions:
715 
716 
717  // Body:
718 
719  disable_invariant_check();
720 
721  initialize_buffers();
722  initialize_order(BIORDER);
723 
724  for(int i=0; i<3; ++i)
725  {
726  for(int j=0; j<3; ++j)
727  {
728  _st2_e2[i][j] = 0.0;
729  _st2_e3[i][j] = 0.0;
730  }
731  }
732 
733  _use_point_top_ids = true;
734  _use_cell_top_ids = true;
735 
736 
737  enable_invariant_check();
738 
739  // Postconditions:
740 
741 
742  // Exit:
743 
744  return;
745 }
746 
747 void
750  const section_space_schema_member& xproperty_schema)
751 {
752 
753  // Preconditions:
754 
755  require(xcoordinates_schema.state_is_read_accessible());
756  require(xcoordinates_schema.base_space().schema().\ conforms_to(base_space_member::standard_schema_path()));
757  require(xproperty_schema.state_is_read_accessible());
758  require(xproperty_schema.base_space().le(&xcoordinates_schema.base_space()));
759 
760  // Body:
761 
762  disable_invariant_check();
763 
764  put_anchor(xcoordinates_schema, xproperty_schema);
765 
766  reset();
767 
768  enable_invariant_check();
769 
770  // Postconditions:
771 
772  ensure(invariant());
773  ensure(is_initialized());
774  ensure(coordinates_schema().is_same_state(&xcoordinates_schema));
775  ensure(coordinates_schema().is_same_type(&xcoordinates_schema));
776  ensure(coordinates_schema().version() == xcoordinates_schema.version());
777  ensure(has_property());
778  ensure(property_schema().is_same_state(&xproperty_schema));
779  ensure(property_schema().is_same_type(&xproperty_schema));
780  ensure(property_schema().version() == xproperty_schema.version());
781  ensure(descending());
782  ensure(!strict());
783  ensure(unexecutable(!is_done() implies this is first member));
784 
785  return;
786 }
787 
788 
789 void
791 initialize_iteration(const section_space_schema_member& xcoordinates_schema)
792 {
793 
794  // Preconditions:
795 
796  require(xcoordinates_schema.state_is_read_accessible());
797  require(xcoordinates_schema.base_space().schema().\ conforms_to(base_space_member::standard_schema_path()));
798 
799  // Body:
800 
801  disable_invariant_check();
802 
804 
805  initialize_states(xcoordinates_schema);
806  put_anchor(xcoordinates_schema);
807 
808  reset();
809 
810  enable_invariant_check();
811 
812  // Postconditions:
813 
814  ensure(invariant());
815  ensure(is_initialized());
816  ensure(coordinates_schema().is_same_state(&xcoordinates_schema));
817  ensure(coordinates_schema().is_same_type(&xcoordinates_schema));
818  ensure(coordinates_schema().version() == xcoordinates_schema.version());
819  ensure(!has_property());
820  ensure(descending());
821  ensure(!strict());
822  ensure(unexecutable(!is_done() implies this is first member));
823 
824  return;
825 }
826 
827 
828 //const sheaf::size_type
829 //tool::visualization_iterator::
830 //_coord_dofs_ub;
831 
832 //const sheaf::size_type
833 //tool::visualization_iterator::
834 //_prop_dofs_ub;
835 
836 void
839 {
840  // Preconditions:
841 
842 
843  // Body:
844 
845  for(int i=0; i<COORD_DOFS_UB; ++i)
846  {
847  _coord_dofs[i] = 0.0;
848  }
849 
850  for(int i=0; i<PROP_DOFS_UB; ++i)
851  {
852  _prop_dofs[i] = 0.0;
853  }
854 
855  // Postconditions:
856 
857 
858  // Exit:
859 
860  return;
861 }
862 
863 void
866 {
867  // Preconditions:
868 
869  // Body:
870 
871  block<scoped_index>& ldown_set = _vis_state.down_set;
872  size_type lct = ldown_set.ct();
873  for(size_type i=0; i<lct; ++i)
874  {
875  put_has_visited(ldown_set[i], false);
876  }
877  ldown_set.set_ct(0);
878 
879  // Postconditions:
880 
881 
882  // Exit:
883 
884  return;
885 }
886 
889 min(const abstract_poset_member& x1, const abstract_poset_member& x2) const
890 {
891  // Preconditions:
892 
893  require(x1.host()->is_same_state(x2.host()));
894 
895  // Body:
896 
897  const abstract_poset_member& result = x1.le(&x2) ? x1 : x2;
898 
899  // Postconditions:
900 
901 
902  // Exit:
903 
904  return result;
905 }
906 
907 void
909 initialize_states(const section_space_schema_member& xcoordinates_schema,
910  const section_space_schema_member& xproperty_schema)
911 {
912  // Preconditions:
913 
914  // Body:
915 
916  _coord_state.initialize(xcoordinates_schema);
917  _prop_state.initialize(xproperty_schema);
918 
923  //_vis_state.initialize(xcoordinates_schema.host()->base_space());
924  _vis_state.initialize(xcoordinates_schema);
925 
926  // Postconditions:
927 
928  // Exit:
929 
930  return;
931 }
932 
933 void
935 initialize_states(const section_space_schema_member& xcoordinates_schema)
936 {
937  // Preconditions:
938 
939  // Body:
940 
941  _coord_state.initialize(xcoordinates_schema);
942 
947  //_vis_state.initialize(xcoordinates_schema.host()->base_space());
948  _vis_state.initialize(xcoordinates_schema);
949 
950  // Postconditions:
951 
952  // Exit:
953 
954  return;
955 }
956 
957 void
959 put_prop_dofs(sec_vd_dof_type* xprop_dofs,
960  size_type xprop_df,
961  int xprop_tensor_rank,
962  vtkDoubleArray* xvtk_prop,
963  int xvtk_tuple_id)
964 {
965  // Preconditions:
966 
967  // Body:
968 
969  if(xprop_tensor_rank < 2)
970  {
971  // This is a scalar or vector property,
972  // just put the dofs.
973 
974  xvtk_prop->SetTuple(xvtk_tuple_id, xprop_dofs);
975  }
976  else
977  {
978  // This is a tensor property.
979  // VTK only supports st2_e3 directly,
980  // but we can treat st2_e2 as a subspace.
981 
982  if(xprop_df == 3)
983  {
984  // This is an st2_e2.
985 
986  _st2_e2[0][0] = xprop_dofs[0]; // xx
987  _st2_e2[0][1] = xprop_dofs[1]; // xy
988  _st2_e2[1][1] = xprop_dofs[2]; // yy
989 
990  _st2_e2[1][0] = _st2_e2[0][1]; // yx = xy
991 
992  // All others remain 0.0
993 
994  xvtk_prop->SetTuple(xvtk_tuple_id, &_st2_e2[0][0]);
995  }
996  else
997  {
998  // This is an st2_e3.
999 
1000  _st2_e3[0][0] = xprop_dofs[0]; // xx
1001  _st2_e3[0][1] = xprop_dofs[1]; // xy
1002  _st2_e3[1][1] = xprop_dofs[2]; // yy
1003  _st2_e3[0][2] = xprop_dofs[3]; // xz
1004  _st2_e3[1][2] = xprop_dofs[4]; // yz
1005  _st2_e3[2][2] = xprop_dofs[5]; // zz
1006 
1007  _st2_e3[1][0] = _st2_e3[0][1]; // yx = xy
1008  _st2_e3[2][0] = _st2_e3[0][2]; // zx = xz
1009  _st2_e3[2][1] = _st2_e3[1][2]; // zy = yz
1010 
1011  xvtk_prop->SetTuple(xvtk_tuple_id, &_st2_e3[0][0]);
1012  }
1013  }
1014 
1015  // Postconditions:
1016 
1017  // Exit:
1018 
1019  return;
1020 }
1021 
poset_state_handle * host() const
The poset which this is a handle to a component of.
std::string name() const
Definition: subposet.h:796
virtual void force_is_done()
Force the iterator to be done.
section_space_schema_poset * host() const
The poset which this is a handle to a component of.
void put_use_point_top_ids(bool xvalue)
Sets use_point_top_ids() to xvalue.
int version(bool xunalias=true) const
The (possibly aliased) version of this component. The version of the host used when evaluating proper...
size_type ct() const
The number of items currently in use.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
subposet & evaluation()
The evaluation subposet for section spaces on this schema (mutable version).
bool has_property() const
True if this visualization has a property section.
STL namespace.
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.
const scoped_index & index() const
The index of the component state this handle is attached to.
std::string name() const
A name for this.
bool use_cell_top_ids() const
If true use top ids to label cells; otherwise, use evaluation ids.
const abstract_poset_member & min(const abstract_poset_member &x1, const abstract_poset_member &x2) const
x1 if x1 <= x2, otherwise x2.
Namespace for the tools component of the sheaf system.
Abstract base class with useful features for all objects.
Definition: any.h:39
A visualization iterator for coordinate and property section representations both having discretizati...
virtual visualization_iterator * clone() const =0
Make a new instance of the same type as this.
bool eval_is_above_disc() const
True is the evaluation subposet is strictly above the discretization subposet.
void put_prop_dofs(sec_vd_dof_type *xprop_dofs, size_type xprop_df, int xprop_tensor_rank, vtkDoubleArray *xvtk_prop, int xvtk_tuple_id)
Converts xprop_dofs as needed depending on xprop_tenosr_rank and puts them into xvtk_prop_dofs at xvt...
const section_space_schema_member & coordinates_schema() const
The coordinates field schema member which is being iterated over.
void set_ct(size_type xct)
Sets ct() == xct.
static visualization_iterator * new_visualization_iterator(const section_space_schema_member &xcoords_schema, const section_space_schema_member &xprop_schema, bool xinitialize=true)
Creates an iterator appropriate for xcoords and xprop.
void initialize_iteration(const section_space_schema_member &xcoordinates_schema, const section_space_schema_member &xproperty_schema)
Initializes this for iteration of type xorder over xcoordinates_schema and xproperty_schema.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
void put_use_cell_top_ids(bool xvalue)
Sets use_cell_top_ids() to xvalue.
bool le(pod_index_type xother_index) const
True if this is less than or equal to the member with index xother_index.
A visualization iterator for a coordinate section with discretization equal to vertices and property ...
A visualization iterator for uniform coordinates and property section with discretization equal to ve...
bool invariant() const
The class invariant.
std::string evaluator_family_name() const
The name of the evaluator family for section spaces on schemae hosted by this.
void clear_down_set()
Unmarks the down set and clears the dow set buffer.
A section of a fiber bundle with a d-dimensional vector space fiber.
Definition: sec_vd.h:54
void initialize_states(const section_space_schema_member &xcoordinates_schema, const section_space_schema_member &xproperty_schema)
Initializes _coord_state, _prop_state, and _vis_state.
SHEAF_DLL_SPEC void min(const vd &x0, vd_value_type &xresult, bool xauto_access)
Minimum component of x0, pre-allocated version.
Definition: vd.cc:2161
static const poset_path & standard_schema_path()
The path of the schema required by this class.
Abstract iterator over the schema of both the coordinates and property sections of a visualization...
virtual void put_anchor(const section_space_schema_member &xcoords_schema, const section_space_schema_member &xprop_schema)
Reinitializes anchor() to iterate over xcoord_schema and xprop_schema.
virtual void reset(bool xreset_markers=true)
Restarts the iteration over the down set of anchor().
void initialize_buffers()
Initializes the coord dofs and prop dofs buffers.
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).
A client handle for a poset member which has been prepared for use as a schema for a section space...
virtual void force_is_done()
Force the iterator to be done.
virtual void reset(bool xreset_markers=true)
Restarts the iteration over the down set of anchor().
const section_space_schema_member & property_schema() const
The property field schema member which is being iterated over.
int df() const
The dimension of the fiber space component.
bool is_same_state(const poset_state_handle *xother) const
True if this is attached to the same state as xother.
virtual void set_vtk_data(const sec_vd &xcoords, const sec_vd &xprop, vtkDoubleArray *xvtk_pt_coords, vtkDoubleArray *xvtk_prop, int xprop_tensor_rank, block< int > &xvtk_cell_types, block< vtkIdType > &xvtk_cell_connectivity, block< int > &xvtk_cell_type_map, vtkIdTypeArray *xvtk_pt_label_ids, vtkIdTypeArray *xvtk_cell_label_ids)
Transfers coordinate and property data to vtk data structures.
visualization_iterator()
Default constructor.
An abstract client handle for a member of a poset.
double sec_vd_dof_type
The type of degree of freedom in the section space.
Definition: fiber_bundle.h:78
sec_rep_descriptor & rep()
The representation for section spaces on this schema (mutable version).
virtual schema_poset_member & schema()
The schema for this member (mutable version).
bool use_point_top_ids() const
If true use top ids to label points; otherwise, use discretization ids.
A visualization iterator for uniform coordinates and property section with evaluation at elements and...
virtual bool is_ancestor_of(const any *xother) const
True if other conforms to this.