21 #include "SheafSystem/visualization_iterator_1_1.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().is_same_state(&coordinates_schema().rep()) :
118 enable_invariant_check();
147 bool ltruncate = xtruncate;
158 #ifdef DIAGNOSTIC_OUTPUT 159 cout <<
"vis_itr_1_1: current item: " << _index <<
" name: " << anchor().host()->member_name(_index) << endl;
162 if(action() == PREVISIT_ACTION)
168 _at.vis_eval = _vis_state.eval_sp.contains_member(_index);
169 _at.vis_disc = _vis_state.disc_sp.contains_member(_index);
171 if(!_maximal_eval_id.is_valid() && _at.vis_eval)
173 _above.vis_eval =
false;
174 _maximal_eval_id = _index;
178 put_visit_once(
false);
180 _vis_state.set_evaluation_member(_index);
181 _vis_state.initialize_order_correction();
182 _vis_state.discretization_members.set_ct(0);
187 _above.vis_disc =
false;
195 int lid = _index.hub_pod();
198 lvisited.insert(lid);
199 _vis_state.gather_discretization_member(_index, greater_index());
200 _vis_state.local_id++;
206 else if(action() == POSTVISIT_ACTION)
208 if(_maximal_eval_id ==~ index())
210 _maximal_eval_id.invalidate();
214 put_visit_once(
true);
216 _above.vis_eval =
true;
230 post_fatal_error_message(
"unrecognized action");
240 ensure(!is_done() ? action() == POSTVISIT_ACTION :
true);
255 vtkDoubleArray* xvtk_pt_coords,
256 vtkDoubleArray* xvtk_prop,
257 int xprop_tensor_rank,
261 vtkIdTypeArray* xvtk_pt_label_ids,
262 vtkIdTypeArray* xvtk_cell_label_ids)
269 require(has_property());
275 require(xcoords.
schema().
df() <= 3);
280 #ifdef DIAGNOSTIC_OUTPUT 281 cout <<
"id: " << index()
282 <<
" eval_id: " << _vis_state.eval_id
286 typedef unordered_map<pod_index_type, pod_index_type> map_type;
287 typedef map_type::const_iterator iterator_type;
292 map_type* lmap = _vis_state.disc_to_seq_map;
304 xvtk_cell_label_ids->InsertNextValue(lvtk_cell_id);
308 xvtk_cell_types.
push_back(xvtk_cell_type_map[_vis_state.eval_type_id]);
312 xvtk_cell_connectivity.
push_back(ldisc_ct);
318 iterator_type lmap_itr = lmap->find(ldisc_pod);
320 #ifdef DIAGNOSTIC_OUTPUT 321 cout <<
"\tdisc_id: " << setw(6) << ldisc_id;
326 if(lmap_itr == lmap->end())
331 lseq_id = _vis_state.next_seq_id++;
332 (*lmap)[ldisc_pod] = lseq_id;
334 #ifdef DIAGNOSTIC_OUTPUT 335 cout <<
" seq_id:" << setw(6) << lseq_id;
343 xvtk_pt_coords->SetTuple(lseq_id, _coord_dofs);
349 ldisc_id.hub_pod() : ldisc_id_space.
pod(ldisc_id);
351 xvtk_pt_label_ids->SetValue(lseq_id, lvtk_pt_id);
354 #ifdef DIAGNOSTIC_OUTPUT 356 << setw(6) << _coord_dofs[0]
357 << setw(6) << _coord_dofs[1]
358 << setw(6) << _coord_dofs[2];
366 put_prop_dofs(_prop_dofs, lprop_df, xprop_tensor_rank, xvtk_prop, lseq_id);
368 #ifdef DIAGNOSTIC_OUTPUT 369 cout <<
" prop: " << setw(10) << _prop_dofs[0];
374 lseq_id = lmap_itr->second;
376 #ifdef DIAGNOSTIC_OUTPUT 378 cout <<
" seq_id:" << setw(6) << lseq_id;
385 xvtk_cell_connectivity.
push_back(lseq_id);
387 #ifdef DIAGNOSTIC_OUTPUT 404 vtkDoubleArray* xvtk_pt_coords,
408 vtkIdTypeArray* xvtk_pt_label_ids,
409 vtkIdTypeArray* xvtk_cell_label_ids)
419 require(xcoords.
schema().
df() <= 3);
424 #ifdef DIAGNOSTIC_OUTPUT 425 cout <<
"id: " << index()
426 <<
" eval_id: " << _vis_state.eval_id
430 typedef unordered_map<pod_index_type, pod_index_type> map_type;
431 typedef map_type::const_iterator iterator_type;
435 map_type* lmap = _vis_state.disc_to_seq_map;
447 xvtk_cell_label_ids->InsertNextValue(lvtk_cell_id);
451 xvtk_cell_types.
push_back(xvtk_cell_type_map[_vis_state.eval_type_id]);
455 xvtk_cell_connectivity.
push_back(ldisc_ct);
461 iterator_type lmap_itr = lmap->find(ldisc_pod);
463 #ifdef DIAGNOSTIC_OUTPUT 464 cout <<
"\tdisc_id: " << setw(6) << ldisc_id;
469 if(lmap_itr == lmap->end())
474 lseq_id = _vis_state.next_seq_id++;
475 (*lmap)[ldisc_pod] = lseq_id;
477 #ifdef DIAGNOSTIC_OUTPUT 478 cout <<
" seq_id:" << setw(6) << lseq_id;
486 xvtk_pt_coords->SetTuple(lseq_id, _coord_dofs);
492 ldisc_id.hub_pod() : ldisc_id_space.
pod(ldisc_id);
494 xvtk_pt_label_ids->SetValue(lseq_id, lvtk_pt_id);
496 #ifdef DIAGNOSTIC_OUTPUT 498 << setw(6) << _coord_dofs[0]
499 << setw(6) << _coord_dofs[1]
500 << setw(6) << _coord_dofs[2];
505 lseq_id = lmap_itr->second;
507 #ifdef DIAGNOSTIC_OUTPUT 508 cout <<
" seq_id:" << setw(6) << lseq_id;
515 xvtk_cell_connectivity.
push_back(lseq_id);
517 #ifdef DIAGNOSTIC_OUTPUT 534 vtkDoubleArray* xvtk_prop,
535 int xprop_tensor_rank)
539 require(has_property());
546 #ifdef DIAGNOSTIC_OUTPUT 547 cout <<
"id: " << index() <<
" eval_id: " << _vis_state.eval_id << endl;
559 #ifdef DIAGNOSTIC_OUTPUT 560 cout <<
"\tdisc_id: " << setw(6) << ldisc_id;
563 if(!_vis_state.visited[ldisc_pod])
571 #ifdef DIAGNOSTIC_OUTPUT 572 cout <<
" seq_id:" << setw(6) << _pt_seq_id;
573 cout <<
" prop: " << setw(10) << _prop_dofs[0];
576 put_prop_dofs(_prop_dofs, lprop_df, xprop_tensor_rank, xvtk_prop,
579 _vis_state.visited.put(ldisc_pod,
true);
582 #ifdef DIAGNOSTIC_OUTPUT 632 put_anchor(xcoordinates_schema, xproperty_schema);
648 ensure(unexecutable(!
is_done() implies
this is
first member));
681 ensure(unexecutable(!
is_done() implies
this is
first member));
709 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.
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.
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.