21 #include "SheafSystem/visualization_iterator_1_3.h" 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/eval_family.h" 27 #include "SheafSystem/int_set.h" 28 #include "SheafSystem/sec_rep_descriptor.h" 29 #include "SheafSystem/sec_vd.h" 30 #include "SheafSystem/section_evaluator.h" 31 #include "SheafSystem/section_space_schema_member.h" 32 #include "SheafSystem/std_limits.h" 33 #include "SheafSystem/structured_block_1d.h" 34 #include "SheafSystem/structured_block_2d.h" 35 #include "SheafSystem/structured_block_3d.h" 36 #include "SheafSystem/subposet_member_iterator.h" 37 #include "SheafSystem/uniform_eval_family.h" 38 #include "vtkDoubleArray.h" 39 #include "vtkIdTypeArray.h" 104 if(invariant_check())
108 disable_invariant_check();
110 invariance(order() == BIORDER);
112 invariance((is_initialized() && has_property()) ?
113 !property_schema().rep().eval_is_above_disc() :
118 enable_invariant_check();
147 bool ltruncate = xtruncate;
157 if(action() == PREVISIT_ACTION)
163 _at.vis_eval = _vis_state.eval_sp.contains_member(_index);
164 _at.vis_disc = _vis_state.disc_sp.contains_member(_index);
165 _at.prop_disc = _prop_state.disc_sp.contains_member(_index);
167 if(!_maximal_eval_id.is_valid() && _at.vis_eval)
169 _above.vis_eval =
false;
170 _maximal_eval_id = _index;
174 put_visit_once(
false);
176 _vis_state.set_evaluation_member(_index);
177 _vis_state.initialize_order_correction();
178 _vis_state.discretization_members.set_ct(0);
180 _prop_state.set_evaluation_member(_index);
185 _above.vis_disc =
false;
187 int lid = _index.hub_pod();
190 lvisited.insert(lid);
191 _vis_state.gather_discretization_member(_index, greater_index());
192 _vis_state.local_id++;
200 _prop_state.discretization_members.set_ct(0);
201 _prop_state.gather_discretization_member(_index);
205 else if(action() == POSTVISIT_ACTION)
207 if(_maximal_eval_id ==~ index())
209 _maximal_eval_id.invalidate();
213 put_visit_once(
true);
215 _above.vis_eval =
true;
229 post_fatal_error_message(
"unrecognized action");
239 ensure(!is_done() ? action() == POSTVISIT_ACTION :
true);
254 vtkDoubleArray* xvtk_pt_coords,
255 vtkDoubleArray* xvtk_prop,
256 int xprop_tensor_rank,
260 vtkIdTypeArray* xvtk_pt_label_ids,
261 vtkIdTypeArray* xvtk_cell_label_ids)
274 require(xcoords.
schema().
df() <= 3);
278 #ifdef DIAGNOSTIC_OUTPUT 279 cout <<
"id: " << index()
280 <<
" eval_id: " << _vis_state.eval_id
284 typedef unordered_map<pod_index_type, pod_index_type> map_type;
285 typedef map_type::const_iterator iterator_type;
290 map_type* lmap = _vis_state.disc_to_seq_map;
302 xvtk_cell_label_ids->InsertNextValue(lvtk_cell_id);
306 xvtk_cell_types.
push_back(xvtk_cell_type_map[_vis_state.eval_type_id]);
310 xvtk_cell_connectivity.
push_back(ldisc_ct);
316 iterator_type lmap_itr = lmap->find(ldisc_pod);
318 #ifdef DIAGNOSTIC_OUTPUT 319 cout <<
"\tdisc_id: " << setw(6) << ldisc_id;
324 if(lmap_itr == lmap->end())
329 lseq_id = _vis_state.next_seq_id++;
330 (*lmap)[ldisc_pod] = lseq_id;
332 #ifdef DIAGNOSTIC_OUTPUT 333 cout <<
" seq_id:" << setw(6) << lseq_id;
341 xvtk_pt_coords->SetTuple(lseq_id, _coord_dofs);
347 ldisc_id.hub_pod() : ldisc_id_space.
pod(ldisc_id);
349 xvtk_pt_label_ids->SetValue(lseq_id, lvtk_pt_id);
351 #ifdef DIAGNOSTIC_OUTPUT 353 << setw(6) << _coord_dofs[0]
354 << setw(6) << _coord_dofs[1]
355 << setw(6) << _coord_dofs[2];
360 lseq_id = lmap_itr->second;
362 #ifdef DIAGNOSTIC_OUTPUT 363 cout <<
" seq_id:" << setw(6) << lseq_id;
368 #ifdef DIAGNOSTIC_OUTPUT 374 xvtk_cell_connectivity.
push_back(lseq_id);
379 scoped_index lprop_disc_id = _prop_state.discretization_members[0].disc_id;
381 xprop.
get_fiber(lprop_disc_id, _prop_dofs,
384 put_prop_dofs(_prop_dofs, lprop_df, xprop_tensor_rank, xvtk_prop, _cell_seq_id++);
386 assertion(_cell_seq_id == xvtk_cell_types.
ct());
388 #ifdef DIAGNOSTIC_OUTPUT 389 cout <<
"\tprop seq id: " << setw(6) << (_vis_state.eval_id - 1);
390 cout <<
" prop: " << setw(10) << _prop_dofs[0] << endl;
403 vtkDoubleArray* xvtk_pt_coords,
407 vtkIdTypeArray* xvtk_pt_label_ids,
408 vtkIdTypeArray* xvtk_cell_label_ids)
418 require(xcoords.
schema().
df() <= 3);
422 #ifdef DIAGNOSTIC_OUTPUT 423 cout <<
"id: " << index()
424 <<
" eval_id: " << _vis_state.eval_id
428 typedef unordered_map<pod_index_type, pod_index_type> map_type;
429 typedef map_type::const_iterator iterator_type;
433 map_type* lmap = _vis_state.disc_to_seq_map;
445 xvtk_cell_label_ids->InsertNextValue(lvtk_cell_id);
449 xvtk_cell_types.
push_back(xvtk_cell_type_map[_vis_state.eval_type_id]);
453 xvtk_cell_connectivity.
push_back(ldisc_ct);
459 iterator_type lmap_itr = lmap->find(ldisc_pod);
461 #ifdef DIAGNOSTIC_OUTPUT 462 cout <<
"\tdisc_id: " << setw(6) << ldisc_id;
467 if(lmap_itr == lmap->end())
472 lseq_id = _vis_state.next_seq_id++;
473 (*lmap)[ldisc_pod] = lseq_id;
475 #ifdef DIAGNOSTIC_OUTPUT 476 cout <<
" seq_id:" << setw(6) << lseq_id;
484 xvtk_pt_coords->SetTuple(lseq_id, _coord_dofs);
490 ldisc_id.hub_pod() : ldisc_id_space.
pod(ldisc_id);
492 xvtk_pt_label_ids->SetValue(lseq_id, lvtk_pt_id);
494 #ifdef DIAGNOSTIC_OUTPUT 496 << setw(6) << _coord_dofs[0]
497 << setw(6) << _coord_dofs[1]
498 << setw(6) << _coord_dofs[2];
503 lseq_id = lmap_itr->second;
505 #ifdef DIAGNOSTIC_OUTPUT 506 cout <<
" seq_id:" << setw(6) << lseq_id;
511 #ifdef DIAGNOSTIC_OUTPUT 517 xvtk_cell_connectivity.
push_back(lseq_id);
530 vtkDoubleArray* xvtk_prop,
531 int xprop_tensor_rank)
542 scoped_index lprop_disc_id = _prop_state.discretization_members[0].disc_id;
544 xprop.
get_fiber(lprop_disc_id, _prop_dofs,
547 #ifdef DIAGNOSTIC_OUTPUT 548 cout <<
"\tid: " << index() <<
" eval_id: " << _vis_state.eval_id;
549 cout <<
" prop seq id: " << setw(6) << _cell_seq_id;
550 cout <<
" prop: " << setw(10) << _prop_dofs[0] << endl;
554 put_prop_dofs(_prop_dofs, lprop_df, xprop_tensor_rank, xvtk_prop,
601 put_anchor(xcoordinates_schema, xproperty_schema);
617 ensure(unexecutable(!
is_done() implies
this is
first member));
646 An STL set representation for a set of integers.
bool contains(int xindex) const
True if this set contains xindex Deprecated - use contains_member(int xindex)
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.
virtual bool is_initialized() const
True if this has been initialized for iteration with respect to a specific anchor.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
void get_fiber(pod_index_type xdisc_id, vd_lite &xfiber) const
Sets xfiber to the fiber referred to by discretization id xdisc_id.
subposet & evaluation()
The evaluation subposet for section spaces on this schema (mutable version).
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 pod_type pod(pod_type xid) const
The pod index in this space equivalent to xid in the hub id space.
Abstract base class with useful features for all objects.
void push_back(const_reference_type item)
Insert item at the end of the items in the auto_block.
bool eval_is_above_disc() const
True is the evaluation subposet is strictly above the discretization subposet.
An index within the external ("client") scope of a given id space.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
bool descending() const
True if iterating over down set of anchor.
bool le(pod_index_type xother_index) const
True if this is less than or equal to the member with index xother_index.
void next()
Makes this the next member of the subset.
virtual pod_type pod(pod_type xid) const =0
The pod index in this space equivalent to xid in the hub id space.
A section of a fiber bundle with a d-dimensional vector space fiber.
bool is_done() const
True if iteration finished.
const scattered_insertion_index_space_handle & id_space() const
The id space for the members of with this (const version).
static const poset_path & standard_schema_path()
The path of the schema required by this class.
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 first()
Moves this to the first member of the iteration.
total_poset_member & base_space()
The base space component of this (mutable version).
const index_space_handle & discretization_id_space() const
The id space for the discretization members in the down set of the base space of this (const version)...
virtual section_space_schema_member & schema()
The restricted schema for this (mutable version).
int_type pod_index_type
The plain old data index type.
A client handle for a poset member which has been prepared for use as a schema for a section space...
int df() const
The dimension of the fiber space component.
double sec_vd_dof_type
The type of degree of freedom in the section space.
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 is_same_type(const any *other) const
True if other is the same type as this.
bool strict() const
True if iterating over xstrict up/down set of anchor.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.