21 #include "SheafSystem/zone_centered_tet_refiner.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/base_space_poset.h" 25 #include "SheafSystem/block.impl.h" 26 #include "SheafSystem/error_message.h" 27 #include "SheafSystem/field_refinement_buffer.h" 28 #include "SheafSystem/section_evaluator.h" 29 #include "SheafSystem/sec_ed_invertible.h" 30 #include "SheafSystem/field_vd.h" 52 ensure(&
policy() == &xpolicy);
132 int lzone_depth = lbase->refinement_depth(lzone_id);
133 int lnew_depth = lzone_depth + 1;
135 assertion(lzone_id.
same_scope(lbase->member_hub_id_space(
false)));
148 while(!lbase->cover_is_empty(
LOWER, lzone_id))
150 lbegin = lbase->first_cover_member(
LOWER, lzone_id.
pod());
152 lbase->delete_link(lzone_id.
pod(), lbegin.pod());
159 static const size_type conn[REFINED_ZONE_CT][3] =
169 for(
size_type i=0; i<REFINED_ZONE_CT; ++i)
179 lbase->new_link(lnew_tet_id,
_vertex_ids[conn[i][j]]);
188 lbase->new_link(lzone_id, lnew_tet_id);
238 lelements_id_space->
remove(lzone_id,
true);
352 static const string result(
"triangle_nodes");
356 ensure(!result.empty());
374 result = REFINED_ZONE_CT;
548 require(xother != 0);
double chart_point_coord_type
The type of local coordinate in the base space; the scalar type for the local coordinate vector space...
virtual bool invariant() const
Class invariant.
A client handle for a subposet.
section_evaluator * coord_evaluator
The section evaluator for the coordinates section of the target.
const chart_point_coord_type * local_coordinates_map(size_type xi) const
The map from the local coordinates of refined zone xi the the local coordinates of the parent zone...
virtual bool is_ancestor_of(const any *xother) const
Conformance test; true if other conforms to this.
size_type ct() const
The number of items currently in use.
virtual int db() const
The base dimension; the dimension of the local coordinates (independent variable).
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
void modify_subposets(field_refinement_buffer &xbuffer)
Modifies subposets in the base space.
virtual const std::string & zone_type_name() const
The name of the type of zone this creates during refinement.
scattered_insertion_index_space_handle * coord_disc_seq_id_space
The discretization sequence id space of the target coordinates.
A buffer for data which is used by both a local_field_refiner object and its associated field_refinem...
Namespace for fields component of sheaf system.
block< scoped_index > _vertex_ids
The ids of the original vertices.
size_type remove(const scoped_index &xid, bool update_extrema)
Removes the equivalence associated with xid.hub_pod(). synonym for remove_hub(xid.hub_pod(), xupdate_extrema). Returns the number of entries actually removed, either 0 or 1.
pod_index_type create_vertex(base_space_poset &xbase, int xdepth)
Creates a new vertex at depth xdepth.
virtual void refine_coordinates(field_refinement_buffer &xbuffer)
Refines the coordinates of the target.
zone_centered_tet_refiner()
Default constructor; disabled.
block< sec_vd_value_type > coord_value
A buffer for computing coordinates at a point.
virtual bool invariant() const
Class invariant.
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.
virtual pod_type pod(pod_type xid) const
The pod index in this space equivalent to xid in the hub id space.
block< sec_vd_dof_type > coord_dofs
A buffer for gathering coordinate dofs.
bool same_scope(const scoped_index &xother) const
True if and only if this is in the same id space as xother.
const field_refinement_policy & policy() const
The refinement policy for this refiner.
Abstract base class with useful features for all objects.
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
void reserve_coord_fiber(const scoped_index &xdisc_id)
Ensures the coordinate dofs have enough capacity for discretization id xdisc.
void push_back(const_reference_type item)
Insert item at the end of the items in the auto_block.
virtual ~zone_centered_tet_refiner()
Destructor.
scoped_index zone_id
The id of the current zone.
virtual void refine_base_space(field_refinement_buffer &xbuffer)
Refines the base space or the target.
scattered_insertion_index_space_handle * elements_id_space
The sequence id space used by the elements subposet.
subposet & vertices()
The subposet containing all the vertices, that is, the cells of dimension 0 (mutable version)...
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.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
An abstract policy that determines the conditions under which a zone should be refined.
virtual void insert_member(pod_index_type xmbr_hub_id)
Inserts the member of host() with hub id xmbr_hub_id.
void insert(pod_type xid, const scoped_index &xhub_id)
Make id xid in this id space equivalent to xhub_id in the hub id space. synonym for insert(xid...
virtual void center(coord_type xresult[], size_type xresult_ub) const
The local coordinates at the center of the evaluator.
virtual zone_centered_tet_refiner * clone() const
Virtual constructor, creates a new instance of the same type as this.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
field_vd & target
The field being refined.
scattered_insertion_index_space_handle * vertices_id_space
The sequence id space used by the vertices subposet.
const bool LOWER
Selector for lower cover.
const scattered_insertion_index_space_handle & id_space() const
The id space for the members of with this (const version).
virtual zone_centered_tet_refiner & operator=(const local_field_refiner &xother)
Assignment operator.
scoped_index _zone_ctr_id
The index of the point added by the current base space refinement.
An abstract refiner for a field over a local region (primitive cell) in the base space.
bool invariant_check() const
True if invariant checking is enabled.
void put_fiber(pod_index_type xdisc_id, const vd_lite &xfiber)
Sets the fiber referred to by discretization id xdisc_id to xfiber.
virtual void remove_member(pod_index_type xmbr_hub_id)
Removes the member of host() with hub id xmbr_hub_id.
int_type pod_index_type
The plain old data index type.
A handle for a scattered_insertion_index_space_state.
virtual size_type refined_zone_ct() const
The number of refined zones created by this.
sec_ed_invertible & coordinates() const
The independent variable of this field.
void push_back(const scoped_index &xhub_id)
Make the next id in this space equivalent to xhub_id in the hub id space. synonym for push_back(xhub_...
subposet & elements()
The subposet containing the elements or zones, that is, the cells of maximal dimension.
block< chart_point_coord_type > local_coords
A buffer for the local coordinates of a point.
pod_index_type create_zone(base_space_poset &xbase, int xdepth)
Creates a new quadrangle in base space xbase, with refinement depth xdepth.
base_space_poset * base_space
The current base space.
double sec_vd_dof_type
The type of degree of freedom in the section space.
bool in_jim_edit_mode() const
True if editing jims and jim order relation is allowed.
A field refiner that subdivides a tet into 4 tets by introducing a new vertex in the center...
bool is_same_type(const any *other) const
True if other is the same type as this.
void enable_invariant_check() const
Enable invariant checking.
block< scoped_index > _refined_zone_ids
The member ids of the zones created by the most recent execution of refine().
void modify_crg(field_refinement_buffer &xbuffer)
Modifies the cover relation graph of the base space.