21 #include "SheafSystem/visualization_iterator_4_2.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/sec_rep_descriptor.h" 28 #include "SheafSystem/section_evaluator.h" 29 #include "SheafSystem/section_space_schema_member.h" 30 #include "SheafSystem/sec_vd.h" 31 #include "SheafSystem/std_limits.h" 32 #include "SheafSystem/structured_block_1d.h" 33 #include "SheafSystem/structured_block_2d.h" 34 #include "SheafSystem/structured_block_3d.h" 35 #include "SheafSystem/subposet_member_iterator.h" 36 #include "SheafSystem/uniform_eval_family.h" 37 #include "vtkDoubleArray.h" 38 #include "vtkIdTypeArray.h" 107 if(invariant_check())
111 disable_invariant_check();
113 invariance(order() == BIORDER);
114 invariance(is_initialized() ?
115 coordinates_schema().rep().evaluator_family_name() ==
"uniform" :
117 invariance((is_initialized() && has_property()) ?
118 property_schema().discretization().name() ==
"__vertices" :
123 enable_invariant_check();
149 bool ltruncate = xtruncate;
159 if(action() == PREVISIT_ACTION)
169 _coord_state.down_set.push_back(_index);
176 _vis_state.down_set.push_back(_index);
179 _at.vis_eval = _vis_state.eval_sp.contains_member(_index);
180 _at.vis_disc = _vis_state.disc_sp.contains_member(_index);
181 _at.coord_eval = _coord_state.eval_sp.contains_member(_index);
188 _above.vis_eval =
false;
190 _vis_state.set_evaluation_member(_index);
191 _vis_state.initialize_order_correction();
192 _vis_state.discretization_members.set_ct(0);
193 _vis_state.down_set.set_ct(0);
198 _vis_state.gather_discretization_member(_index, greater_index());
199 _vis_state.local_id++;
211 _coord_state.set_and_attach_evaluation_member(_index);
212 _coord_state.discretization_members.set_ct(0);
213 _coord_state.gather_discretization_member(_index);
214 _coord_state.local_id++;
215 _coord_state.dofs.set_ct(0);
219 else if(action() == POSTVISIT_ACTION)
221 _at.vis_eval = _vis_state.eval_sp.contains_member(_index);
229 _above.vis_eval =
true;
242 post_fatal_error_message(
"unrecognized action");
251 ensure(!is_done() ? action() == POSTVISIT_ACTION :
true);
267 vtkDoubleArray* xvtk_pt_coords,
268 vtkDoubleArray* xvtk_prop,
269 int xprop_tensor_rank,
273 vtkIdTypeArray* xvtk_pt_label_ids,
274 vtkIdTypeArray* xvtk_cell_label_ids)
281 require(has_property());
287 require(xcoords.
schema().
df() <= 3);
292 #ifdef DIAGNOSTIC_OUTPUT 294 cout <<
"id: " << index()
295 <<
" eval_id: " << _vis_state.eval_id
299 if(_coord_state.dofs.ct() == 0)
303 _coord_state.gather_dofs(xcoords);
306 typedef unordered_map<pod_index_type, pod_index_type> map_type;
307 typedef map_type::const_iterator iterator_type;
312 map_type* lmap = _vis_state.disc_to_seq_map;
324 xvtk_cell_label_ids->InsertNextValue(lvtk_cell_id);
328 xvtk_cell_types.
push_back(xvtk_cell_type_map[_vis_state.eval_type_id]);
332 xvtk_cell_connectivity.
push_back(ldisc_ct);
339 iterator_type lmap_itr = lmap->find(ldisc_pod);
341 #ifdef DIAGNOSTIC_OUTPUT 343 cout <<
"\tdisc_id: " << setw(6) << ldisc_id;
348 if(lmap_itr == lmap->end())
353 lseq_id = _vis_state.next_seq_id++;
354 (*lmap)[ldisc_pod] = lseq_id;
356 #ifdef DIAGNOSTIC_OUTPUT 358 cout <<
" seq_id:" << setw(6) << lseq_id;
369 _vis_state.eval->local_coordinates(ldisc_mbr.
local_id,
378 _coord_state.eval_mbr->unrefine_point_pa(ldisc_pt, ldisc_pt);
382 _coord_state.eval->value_at_coord(_coord_state.dofs.base(),
383 _coord_state.dofs.ct(),
389 xvtk_pt_coords->SetTuple(lseq_id, _coord_dofs);
395 ldisc_id.hub_pod() : ldisc_id_space.
pod(ldisc_id);
397 xvtk_pt_label_ids->SetValue(lseq_id, lvtk_pt_id);
399 #ifdef DIAGNOSTIC_OUTPUT 402 << setw(6) << _coord_dofs[0]
403 << setw(6) << _coord_dofs[1]
404 << setw(6) << _coord_dofs[2];
412 put_prop_dofs(_prop_dofs, lprop_df, xprop_tensor_rank, xvtk_prop, lseq_id);
414 #ifdef DIAGNOSTIC_OUTPUT 416 cout <<
" prop: " << setw(10) << _prop_dofs[0];
421 lseq_id = lmap_itr->second;
423 #ifdef DIAGNOSTIC_OUTPUT 425 cout <<
" seq_id:" << setw(6) << lseq_id;
432 xvtk_cell_connectivity.
push_back(lseq_id);
434 #ifdef DIAGNOSTIC_OUTPUT 453 vtkDoubleArray* xvtk_pt_coords,
457 vtkIdTypeArray* xvtk_pt_label_ids,
458 vtkIdTypeArray* xvtk_cell_label_ids)
467 require(xcoords.
schema().
df() <= 3);
472 #ifdef DIAGNOSTIC_OUTPUT 474 cout <<
"id: " << index()
475 <<
" eval_id: " << _vis_state.eval_id
479 if(_coord_state.dofs.ct() == 0)
483 _coord_state.gather_dofs(xcoords);
486 typedef unordered_map<pod_index_type, pod_index_type> map_type;
487 typedef map_type::const_iterator iterator_type;
491 map_type* lmap = _vis_state.disc_to_seq_map;
503 xvtk_cell_label_ids->InsertNextValue(lvtk_cell_id);
507 xvtk_cell_types.
push_back(xvtk_cell_type_map[_vis_state.eval_type_id]);
511 xvtk_cell_connectivity.
push_back(ldisc_ct);
518 iterator_type lmap_itr = lmap->find(ldisc_pod);
520 #ifdef DIAGNOSTIC_OUTPUT 522 cout <<
"\tdisc_id: " << setw(6) << ldisc_id;
527 if(lmap_itr == lmap->end())
532 lseq_id = _vis_state.next_seq_id++;
533 (*lmap)[ldisc_pod] = lseq_id;
535 #ifdef DIAGNOSTIC_OUTPUT 537 cout <<
" seq_id:" << setw(6) << lseq_id;
548 _vis_state.eval->local_coordinates(ldisc_mbr.
local_id,
557 _coord_state.eval_mbr->unrefine_point_pa(ldisc_pt, ldisc_pt);
561 _coord_state.eval->value_at_coord(_coord_state.dofs.base(),
562 _coord_state.dofs.ct(),
568 xvtk_pt_coords->SetTuple(lseq_id, _coord_dofs);
574 ldisc_id.hub_pod() : ldisc_id_space.
pod(ldisc_id);
576 xvtk_pt_label_ids->SetValue(lseq_id, lvtk_pt_id);
578 #ifdef DIAGNOSTIC_OUTPUT 581 << setw(6) << _coord_dofs[0]
582 << setw(6) << _coord_dofs[1]
583 << setw(6) << _coord_dofs[2];
588 lseq_id = lmap_itr->second;
590 #ifdef DIAGNOSTIC_OUTPUT 592 cout <<
" seq_id:" << setw(6) << lseq_id;
599 xvtk_cell_connectivity.
push_back(lseq_id);
601 #ifdef DIAGNOSTIC_OUTPUT 623 require(has_property());
629 #ifdef DIAGNOSTIC_OUTPUT 631 cout <<
"id: " << index() <<
" eval_id: " << _vis_state.eval_id << endl;
644 #ifdef DIAGNOSTIC_OUTPUT 646 cout <<
"\tdisc_id: " << setw(6) << ldisc_id;
649 if(!_vis_state.visited[ldisc_pod])
658 #ifdef DIAGNOSTIC_OUTPUT 660 cout <<
" seq_id:" << setw(6) << _pt_seq_id;
661 cout <<
" prop: " << setw(10) << _prop_dofs[0];
664 put_prop_dofs(_prop_dofs, lprop_df, xprop_tensor_rank, xvtk_prop, _pt_seq_id++);
666 _vis_state.visited.put(ldisc_pod,
true);
669 #ifdef DIAGNOSTIC_OUTPUT 722 require(!(xcoordinates_schema.
rep().
path() ==
"sec_rep_descriptors/vertex_cells_dlinear"));
723 require(!(xproperty_schema.
rep().
path() ==
"sec_rep_descriptors/vertex_cells_dlinear"));
727 put_anchor(xcoordinates_schema, xproperty_schema);
743 ensure(unexecutable(!
is_done() implies
this is
first member));
760 require(!(xcoordinates_schema.
rep().
path() ==
"sec_rep_descriptors/vertex_cells_dlinear"));
777 ensure(unexecutable(!
is_done() implies
this is
first member));
scoped_index eval_id
The eval member the disc member is contained in.
A context for discretization members. Intended for implementing various iterators, especially concurrent iterations over multiple sections.
scoped_index disc_id
The global index of the disc member.
std::string evaluator_family_name() const
The name of the evaluator family.
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.
A point in a 3D chart space.
poset_path path(bool xauto_access=true) const
A path to this component.
bool conforms_to(const schema_poset_member &xother) const
True if the dofs defined by this agree in type and in order with the dofs defined by xother...
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.
void put_chart_id(pod_index_type xchart)
Sets chart_id() to xchart_id.
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.
int local_id
The local index of the disc member with respect to the eval member.
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.
subposet & discretization()
The discretization subposet for section spaces on this schema (mutable version).
virtual pod_type pod(pod_type xid) const =0
The pod index in this space equivalent to xid in the hub id space.
coord_type * local_coords()
The array of local coordinates.
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.