21 #include "SheafSystem/visualization_iterator_4_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/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().rep().eval_is_above_disc() :
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);
182 _at.prop_disc = _prop_state.disc_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++;
208 _coord_state.set_and_attach_evaluation_member(_index);
209 _coord_state.discretization_members.set_ct(0);
210 _coord_state.gather_discretization_member(_index);
211 _coord_state.local_id++;
212 _coord_state.dofs.set_ct(0);
217 _prop_state.discretization_members.set_ct(0);
218 _prop_state.gather_discretization_member(_index);
222 else if(action() == POSTVISIT_ACTION)
224 _at.vis_eval = _vis_state.eval_sp.contains_member(_index);
231 _above.vis_eval =
true;
244 post_fatal_error_message(
"unrecognized action");
253 ensure(!is_done() ? action() == POSTVISIT_ACTION :
true);
270 vtkDoubleArray* xvtk_pt_coords,
271 vtkDoubleArray* xvtk_prop,
272 int xprop_tensor_rank,
276 vtkIdTypeArray* xvtk_pt_label_ids,
277 vtkIdTypeArray* xvtk_cell_label_ids)
284 require(has_property());
290 require(xcoords.
schema().
df() <= 3);
295 #ifdef DIAGNOSTIC_OUTPUT 297 cout <<
"id: " << index()
298 <<
" eval_id: " << _vis_state.eval_id
302 if(_coord_state.dofs.ct() == 0)
306 _coord_state.gather_dofs(xcoords);
309 typedef unordered_map<pod_index_type, pod_index_type> map_type;
310 typedef map_type::const_iterator iterator_type;
315 map_type* lmap = _vis_state.disc_to_seq_map;
327 xvtk_cell_label_ids->InsertNextValue(lvtk_cell_id);
331 xvtk_cell_types.
push_back(xvtk_cell_type_map[_vis_state.eval_type_id]);
335 xvtk_cell_connectivity.
push_back(ldisc_ct);
342 iterator_type lmap_itr = lmap->find(ldisc_pod);
344 #ifdef DIAGNOSTIC_OUTPUT 346 cout <<
"\tdisc_id: " << setw(6) << ldisc_id;
351 if(lmap_itr == lmap->end())
356 lseq_id = _vis_state.next_seq_id++;
357 (*lmap)[ldisc_pod] = lseq_id;
359 #ifdef DIAGNOSTIC_OUTPUT 361 cout <<
" seq_id:" << setw(6) << lseq_id;
372 _vis_state.eval->local_coordinates(ldisc_mbr.
local_id,
381 _coord_state.eval_mbr->unrefine_point_pa(ldisc_pt, ldisc_pt);
385 _coord_state.eval->value_at_coord(_coord_state.dofs.base(),
386 _coord_state.dofs.ct(),
392 xvtk_pt_coords->SetTuple(lseq_id, _coord_dofs);
398 ldisc_id.hub_pod() : ldisc_id_space.
pod(ldisc_id);
400 xvtk_pt_label_ids->SetValue(lseq_id, lvtk_pt_id);
402 #ifdef DIAGNOSTIC_OUTPUT 405 << setw(6) << _coord_dofs[0]
406 << setw(6) << _coord_dofs[1]
407 << setw(6) << _coord_dofs[2];
412 lseq_id = lmap_itr->second;
414 #ifdef DIAGNOSTIC_OUTPUT 416 cout <<
" seq_id:" << setw(6) << lseq_id;
421 #ifdef DIAGNOSTIC_OUTPUT 428 xvtk_cell_connectivity.
push_back(lseq_id);
434 scoped_index lprop_disc_id = _prop_state.discretization_members[0].disc_id;
436 using fiber_bundle::vd_algebra::operator*;
438 xprop.
get_fiber(lprop_disc_id, _prop_dofs,
441 #ifdef DIAGNOSTIC_OUTPUT 443 cout <<
"\tprop seq id: " << setw(6) << _cell_seq_id;
444 cout <<
" prop: " << setw(10) << _prop_dofs[0] << endl;
447 put_prop_dofs(_prop_dofs, lprop_df, xprop_tensor_rank, xvtk_prop, _cell_seq_id++);
449 assertion(_cell_seq_id == xvtk_cell_types.
ct());
463 vtkDoubleArray* xvtk_pt_coords,
467 vtkIdTypeArray* xvtk_pt_label_ids,
468 vtkIdTypeArray* xvtk_cell_label_ids)
477 require(xcoords.
schema().
df() <= 3);
482 #ifdef DIAGNOSTIC_OUTPUT 484 cout <<
"id: " << index()
485 <<
" eval_id: " << _vis_state.eval_id
489 if(_coord_state.dofs.ct() == 0)
493 _coord_state.gather_dofs(xcoords);
496 typedef unordered_map<pod_index_type, pod_index_type> map_type;
497 typedef map_type::const_iterator iterator_type;
501 map_type* lmap = _vis_state.disc_to_seq_map;
505 xvtk_cell_types.
push_back(xvtk_cell_type_map[_vis_state.eval_type_id]);
509 xvtk_cell_connectivity.
push_back(ldisc_ct);
516 iterator_type lmap_itr = lmap->find(ldisc_pod);
518 #ifdef DIAGNOSTIC_OUTPUT 520 cout <<
"\tdisc_id: " << setw(6) << ldisc_id;
525 if(lmap_itr == lmap->end())
530 lseq_id = _vis_state.next_seq_id++;
531 (*lmap)[ldisc_pod] = lseq_id;
533 #ifdef DIAGNOSTIC_OUTPUT 535 cout <<
" seq_id:" << setw(6) << lseq_id;
546 _vis_state.eval->local_coordinates(ldisc_mbr.
local_id,
555 _coord_state.eval_mbr->unrefine_point_pa(ldisc_pt, ldisc_pt);
559 _coord_state.eval->value_at_coord(_coord_state.dofs.base(),
560 _coord_state.dofs.ct(),
566 xvtk_pt_coords->SetTuple(lseq_id, _coord_dofs);
568 #ifdef DIAGNOSTIC_OUTPUT 571 << setw(6) << _coord_dofs[0]
572 << setw(6) << _coord_dofs[1]
573 << setw(6) << _coord_dofs[2];
578 lseq_id = lmap_itr->second;
580 #ifdef DIAGNOSTIC_OUTPUT 582 cout <<
" seq_id:" << setw(6) << lseq_id;
587 #ifdef DIAGNOSTIC_OUTPUT 594 xvtk_cell_connectivity.
push_back(lseq_id);
613 require(has_property());
619 #ifdef DIAGNOSTIC_OUTPUT 624 scoped_index lprop_disc_id = _prop_state.discretization_members[0].disc_id;
626 xprop.
get_fiber(lprop_disc_id, _prop_dofs,
629 #ifdef DIAGNOSTIC_OUTPUT 631 cout <<
"\tid: " << index() <<
" eval_id: " << _vis_state.eval_id;
632 cout <<
" prop seq id: " << setw(6) << _cell_seq_id;
633 cout <<
" prop: " << setw(10) << _prop_dofs[0] << endl;
637 put_prop_dofs(_prop_dofs, lprop_df, xprop_tensor_rank, xvtk_prop, _cell_seq_id++);
685 require(!(xcoordinates_schema.
rep().
path() ==
"sec_rep_descriptors/vertex_cells_dlinear"));
686 require(!(xproperty_schema.
rep().
path() ==
"sec_rep_descriptors/vertex_cells_dlinear"));
690 put_anchor(xcoordinates_schema, xproperty_schema);
706 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.
bool eval_is_above_disc() const
True is the evaluation subposet is strictly above the discretization subposet.
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.
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.