22 #include "SheafSystem/discretization_pusher.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/chart_point.h" 26 #include "SheafSystem/binary_section_space_schema_member.h" 27 #include "SheafSystem/discretization_iterator.h" 28 #include "SheafSystem/discretization_push_action.h" 29 #include "SheafSystem/error_message.h" 30 #include "SheafSystem/eval_family.h" 31 #include "SheafSystem/eval_iterator.h" 32 #include "SheafSystem/postorder_iterator.h" 33 #include "SheafSystem/field_eval_iterator.h" 34 #include "SheafSystem/sec_vd.h" 35 #include "SheafSystem/sec_rep_descriptor.h" 36 #include "SheafSystem/section_evaluator.h" 37 #include "SheafSystem/structured_block_1d.h" 38 #include "SheafSystem/structured_block_2d.h" 39 #include "SheafSystem/structured_block_3d.h" 82 const sec_vd& xglobal_coord,
98 require(dynamic_cast<const binary_section_space_schema_member*>\
99 (&xglobal_coord.
schema()));
133 bool lmust_gather = must_gather(xsrc, xglobal_coord.
schema());
134 bool lmust_map = must_map(xsrc, xglobal_coord.
schema());
135 bool lmust_evaluate = must_evaluate(xsrc, xglobal_coord.
schema());
140 if(lmust_gather && lmust_map && lmust_evaluate)
142 post_fatal_error_message(
"(lmust_gather && lmust_map && lmust_evaluate) is not implemented");
144 else if(lmust_gather && lmust_map && !lmust_evaluate)
146 post_fatal_error_message(
"(lmust_gather && lmust_map && !lmust_evaluate) is not implemented");
148 else if(lmust_gather && !lmust_map && lmust_evaluate)
150 push_gather_no_map_evaluate(xsrc, xglobal_coord, xpush_action);
152 else if(lmust_gather && !lmust_map && !lmust_evaluate)
154 push_gather_no_map_no_evaluate(xsrc, xglobal_coord, xpush_action);
156 else if(!lmust_gather && lmust_map && lmust_evaluate)
158 push_no_gather_map_evaluate(xsrc, xglobal_coord, xpush_action);
160 else if(!lmust_gather && lmust_map && !lmust_evaluate)
162 post_fatal_error_message(
"(!lmust_gather && lmust_map && !lmust_evaluate) is not implemented");
164 else if(!lmust_gather && !lmust_map && lmust_evaluate)
166 post_fatal_error_message(
"(!lmust_gather && !lmust_map && lmust_evaluate) is not implemented");
168 else if(!lmust_gather && !lmust_map && !lmust_evaluate)
170 post_fatal_error_message(
"(!lmust_gather && !lmust_map && !lmust_evaluate) is not implemented");
188 fields::discretization_pusher::
211 fields::discretization_pusher::
240 fields::discretization_pusher::
265 fields::discretization_pusher::
267 const sec_vd& xglobal_coord,
271 #ifdef DIAGNOSTIC_OUTPUT 272 post_information_message(
"push_gather_no_map_no_evaluate:");
279 require(dynamic_cast<const binary_section_space_schema_member*>(&xglobal_coord.
schema()));
290 int ldc = xglobal_coord.
schema().
df();
295 while(!lsrc_disc_itr.
is_done())
308 xpush_action(ldisc_id, lcoord_dofs);
312 lsrc_disc_itr.
next();
323 fields::discretization_pusher::
325 const sec_vd& xglobal_coord,
329 #ifdef DIAGNOSTIC_OUTPUT 330 post_information_message(
"push_gather_no_map_evaluate:");
359 while(!litr.is_done())
368 litr.gather_coordinate_dofs(xglobal_coord, lcoord_dofs);
373 litr.property_discretization_members();
380 if(!litr.property_has_been_visited(ldisc_id))
398 xpush_action(ldisc_id, lsrc_gc);
414 fields::discretization_pusher::
416 const sec_vd& xglobal_coord,
420 #ifdef DIAGNOSTIC_OUTPUT 421 post_information_message(
"push_no_gather_map_evaluate:");
445 chart_point* lref_prop_lc = chart_point::new_chart_point(ldb);
446 chart_point* lunref_prop_lc = chart_point::new_chart_point(ldb);
453 lprop_gc.
set_ct(lprop_gc.ub());
458 lprop_dofs.
set_ct(lprop_dofs.ub());
476 post_fatal_error_message(
"Unsupported base space dimension");
484 eval_family::new_family(lfamily_name, *xglobal_coord.
name_space());
491 lcoords_dofs.
set_ct(lcoords_dofs.ub());
492 xglobal_coord.
dof_tuple(lcoords_dofs.base(), lcoords_dofs.ct());
494 #ifdef DIAGNOSTIC_OUTPUT 496 cout <<
" global coords dofs:";
497 for(
size_type c=0; c<lcoords_dofs.ub(); ++c)
499 cout << setw(6) << lcoords_dofs[c];
509 while(!lprop_eval_itr.is_done())
522 lprop_eval_itr.discretization_members();
529 if(!lvisited[ldisc_id.
pod()])
546 lcoords_evlr->value_at_coord(lcoords_dofs.base(),
549 lunref_prop_lc->
db(),
555 xpush_action(ldisc_id, lprop_gc);
560 lvisited.put(ldisc_id.
pod(),
true);
562 #ifdef DIAGNOSTIC_OUTPUT 566 <<
" disc_id: " << setw(5) << ldisc_space.
pod(ldisc_id)
569 cout <<
" refined property point:" << *lref_prop_lc << endl;
570 cout <<
" unrefined property point:" << *lunref_prop_lc << endl;
572 cout <<
" disc mbr global coords:";
575 cout << setw(6) << lprop_gc[c];
585 lprop_eval_itr.next();
617 invariance(any::invariant());
619 if(invariant_check())
621 disable_invariant_check();
627 enable_invariant_check();
poset_state_handle * host() const
The poset which this is a handle to a component of.
A client handle for a subposet.
std::string evaluator_family_name() const
The name of the evaluator family.
index_type ub() const
The upper bound on the storage array. The number of items current allocated in the storage array...
size_type ct() const
The number of items currently in use.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
A homogeneous collection of connected quads arranged in an i_size() x j_size() array.
discretization_pusher()
Default constructor.
Namespace for fields component of sheaf system.
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.
An iterator which concurrently traverses the schema of both the coordinates and property sections of ...
An iterator over the members of the evaluation subposet contained in the downset of the base space of...
subposet & evaluation()
The evaluation subposet for section spaces on this schema (mutable version).
virtual int db() const =0
The dimension of this chart.
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...
void next()
Makes this the next member of the subset.
virtual void get_read_access() const
Get read access to the state associated with this.
virtual namespace_poset * name_space() const
The namespace of host()
const pod_index_type & type_id() const
The cell type id of this. The id of the prototype of this in the "cell_types" id space of the prototy...
The action to executed by discretization_pusher::push on each member of a discretization subposet...
A homogeneous collection of connected segments arranged in an i_size() array.
virtual dof_type value_at_coord(const dof_type xdofs[], size_type xdofs_ub, const dof_type xlocal_coords[], size_type xlocal_coords_ub) const
Value at a specified local_coordinate. Single component version.
A client handle for a base space member which represents a homgeneous collection of local cells...
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
void dof_tuple(dof_type *xbuf, int xbuflen) const
Copies the entire dof tuple into xbuf.
virtual coord_type * local_coords()=0
The array of local coordinates.
pointer_type base() const
The underlying storage array.
void set_ct(size_type xct)
Sets ct() == xct.
An index within the external ("client") scope of a given id space.
A family of compatible section evaluators, one for each member of some family of cell types; a map fr...
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
void push(const section_space_schema_member &xsrc, const sec_vd &xglobal_coord, discretization_push_action &xpush_action, bool xauto_access)
Pushes each member of the discretization of xsrc into the fiber space of xglobal_coord and then execu...
Iterator over the discretization subposet associated with a section_space_schema_member anchor...
static int row_dof_ct(const namespace_poset &xns, const poset_path &xpath, bool xauto_access=true)
The number of row dofs defined by the schema specified by xns and xpath. Synonym for dof_ct(xns...
subposet & discretization()
The discretization subposet for section spaces on this schema (mutable version).
int member_ct() const
The number of members of this subposet.
virtual pod_type pod(pod_type xid) const =0
The pod index in this space equivalent to xid in the hub id space.
const scoped_index & discretization_member_index() const
The current discretization member index.
An abstract local section evaluator; a map from {local coordinates x dofs} to section value...
A section of a fiber bundle with a d-dimensional vector space fiber.
A homogeneous collection of connected hexahedra arranged in an i_size() x j_size() x k_size() array...
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).
virtual void detach_from_state()
Detach this handle from its state, if any.
virtual bool invariant() const
Class invariant.
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).
virtual scoped_index member_index_ub() const
The upper bound on the member_index;.
A client handle for a poset member which has been prepared for use as a schema for a section space...
virtual void unrefine_point_pa(const chart_point &xpt, chart_point &result) const =0
The point in this which is the same as xpt in the direct refinement of this; pre-allocated version...
int db() const
The dimension of the base space component.
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.
virtual void local_coordinates(pod_index_type xindex, coord_type xresult[], size_type xresult_ub) const =0
The local coordinates of the dof with local index xindex.
sec_rep_descriptor & rep()
The representation for section spaces on this schema (mutable version).
virtual ~discretization_pusher()
Destructor.