SheafSystem  0.0.0.0
fields::field_refinement_buffer Class Reference

A buffer for data which is used by both a local_field_refiner object and its associated field_refinement_policy object. More...

#include <field_refinement_buffer.h>

CANONICAL FACET

bool invariant () const
 Class invariant. More...
 

FIELD_REFINEMENT_BUFFER FACET

const field_vdsource
 The reference field. More...
 
field_vdtarget
 The field being refined. More...
 
const block< scoped_index > & coord_disc_ids
 A buffer for gathering the coordinate discretization members for the current zone. More...
 
const block< scoped_index > & prop_disc_ids
 A buffer for gathering the property discretization members for the current zone. More...
 
zn_to_bool has_been_pushed
 True if i-th member has been pused. More...
 
base_space_posetbase_space
 The current base space. More...
 
scattered_insertion_index_space_handlevertices_id_space
 The sequence id space used by the vertices subposet. More...
 
scattered_insertion_index_space_handlecoord_disc_seq_id_space
 The discretization sequence id space of the target coordinates. More...
 
scattered_insertion_index_space_handleelements_id_space
 The sequence id space used by the elements subposet. More...
 
subposetevaluation
 The evaluation subposet used by both the coordinates and property sections of the target. More...
 
subposetcoord_discretization
 The discretization subposet of the coordinate section of the target. More...
 
subposetprop_discretization
 The discretization subposet of the property section of the target. More...
 
scattered_insertion_index_space_handleprop_disc_seq_id_space
 The discretization sequence id space of the target coordinates. More...
 
block< sec_vd_dof_typecoord_dofs
 A buffer for gathering coordinate dofs. More...
 
block< sec_vd_value_typecoord_value
 A buffer for computing coordinates at a point. More...
 
block< sec_vd_dof_typeprop_dofs
 A buffer for gathering property dofs. More...
 
block< sec_vd_value_typeprop_value
 A buffer for computing target property at a point. More...
 
block< sec_vd_value_typesource_prop_value
 A buffer for computing source property at a point. More...
 
block< chart_point_coord_typelocal_coords
 A buffer for the local coordinates of a point. More...
 
block< chart_point_coord_typelocal_coords2
 Another buffer for the local coordinates of a point. More...
 
bool same_discretization
 True if target property uses same discretization as target coordinates. More...
 
scoped_index zone_id
 The id of the current zone. More...
 
int depth
 The refinement depth of the current zone. More...
 
int depth_ub
 The upper bound for the refinement depth. More...
 
section_evaluatorcoord_evaluator
 The section evaluator for the coordinates section of the target. More...
 
section_evaluatorprop_evaluator
 The section evaluator for the property section of the target. More...
 
block< sec_vd_dof_type > * parent_prop_dofs
 A buffer for property dofs of the parent zones. More...
 
section_evaluator ** parent_prop_evaluator
 The property section evaluators for the parent zones. More...
 
int * parent_subzone_id
 The index of the current subzone of the parent zones. More...
 
 field_refinement_buffer (const field_vd &xsource, field_vd &xtarget, const block< scoped_index > &xcoord_disc_ids, const block< scoped_index > &xprop_disc_ids, int xdepth_ub)
 Creates an instance for refining xtarget using xsource as the reference field. More...
 
 field_refinement_buffer (field_vd &xtarget, const block< scoped_index > &xcoord_disc_ids, const block< scoped_index > &xprop_disc_ids, int xdepth_ub)
 Creates an instance for refining xtarget using the unrefined version of itself as the reference field. More...
 
 ~field_refinement_buffer ()
 Destructor; not virtual, this can not be used as a base class. More...
 
void gather_coordinate_dofs ()
 Gathers the coordinate dofs from the target for the current zone. More...
 
void gather_property_dofs ()
 Gathers the property dofs from the target for the current zone. More...
 
void push_prop_dofs ()
 Pushes the source property dofs to the target for any discretization members that have not already been pushed. More...
 
void refine_prop_dofs (local_field_refiner *xrefiner)
 Evaluates the property dofs of the target in the parent zone for any discretization members that have not already been pushed. More...
 
void evaluate_at_center ()
 Evaluates the property, the coordinates, and the source property at the center of the zone. More...
 
void evaluate_source_at_disc (size_type xi)
 Evaluates the coordinates and the source property at the position of the xi-th (local indexing) property discretization member. More...
 
void save_parent ()
 Saves the prop_dofs and prop_evaluator of the current zone into the parent buffers. More...
 
void reserve_coord_fiber (const scoped_index &xdisc_id)
 Ensures the coordinate dofs have enough capacity for discretization id xdisc. More...
 
void reserve_prop_fiber (const scoped_index &xdisc_id)
 Ensures the property dofs have enough capacity for discretization id xdisc. More...
 

Detailed Description

A buffer for data which is used by both a local_field_refiner object and its associated field_refinement_policy object.

Definition at line 71 of file field_refinement_buffer.h.

Constructor & Destructor Documentation

◆ field_refinement_buffer() [1/2]

fields::field_refinement_buffer::field_refinement_buffer ( const field_vd xsource,
field_vd xtarget,
const block< scoped_index > &  xcoord_disc_ids,
const block< scoped_index > &  xprop_disc_ids,
int  xdepth_ub 
)

Creates an instance for refining xtarget using xsource as the reference field.

Precondition
  • xsource.state_is_read_accessible()
  • xtarget.state_is_read_accessible()
  • xtarget.name_space().state_is_read_accessible()
  • xsource.dc() == xtarget.dc()
  • xsource.dp() == xtarget.dp()
  • xtarget.same_evaluation()
Issue:
Assuming that the discretization id space is a scattered_insertion_index_space. This is true because refinement is currently only implemented on unstructured blocks (or potentially zone node blocks). Once zone node blocks support binary id spaces, this assumption is not true. See bug 0000381.
Postcondition

Definition at line 64 of file field_refinement_buffer.cc.

References base_space, coord_disc_seq_id_space, coord_value, fields::field_vd::coordinates(), fields::field_vd::dc(), depth_ub, fiber_bundle::section_space_schema_member::discretization_id_space(), fields::field_vd::dp(), fiber_bundle::base_space_poset::elements(), elements_id_space, sheaf::subposet::id_space(), invariant(), fields::field_vd::name_space(), parent_prop_dofs, prop_disc_seq_id_space, prop_dofs, prop_value, fields::field_vd::property(), sheaf::auto_block< T, S >::reserve(), fields::field_vd::same_evaluation(), fiber_bundle::sec_rep_space_member::schema(), sheaf::auto_block< T, S >::set_ct(), sheaf::read_write_monitor_handle::state_is_read_accessible(), fields::field_vd::state_is_read_accessible(), sheaf::auto_block< T, S >::ub(), fiber_bundle::base_space_poset::vertices(), and vertices_id_space.

◆ field_refinement_buffer() [2/2]

fields::field_refinement_buffer::field_refinement_buffer ( field_vd xtarget,
const block< scoped_index > &  xcoord_disc_ids,
const block< scoped_index > &  xprop_disc_ids,
int  xdepth_ub 
)

Creates an instance for refining xtarget using the unrefined version of itself as the reference field.

Precondition
  • xtarget.state_is_read_accessible()
  • xtarget.name_space().state_is_read_accessible()
  • xtarget.same_evaluation()
Issue:
Assuming that the discretization id map is a scattered_insertion_index_map. This is true because refinement is currently only implemented on unstructured blocks (or potentially zone node blocks). Once zone node blocks support binary id spaces, this assumption is not true. See bug 0000381.
Postcondition

Definition at line 131 of file field_refinement_buffer.cc.

References fields::field_vd::base_space(), base_space, coord_disc_seq_id_space, coord_value, fields::field_vd::coordinates(), fields::field_vd::dc(), depth_ub, fiber_bundle::section_space_schema_member::discretization_id_space(), sheaf::DOWN, fields::field_vd::dp(), fiber_bundle::base_space_poset::elements(), elements_id_space, has_been_pushed, sheaf::subposet::id_space(), invariant(), fields::field_vd::name_space(), sheaf::NOT_STRICT, parent_prop_dofs, prop_disc_seq_id_space, prop_discretization, prop_dofs, prop_value, fields::field_vd::property(), sheaf::zn_to_bool::put(), sheaf::auto_block< T, S >::reserve(), fields::field_vd::same_evaluation(), fiber_bundle::sec_rep_space_member::schema(), sheaf::auto_block< T, S >::set_ct(), sheaf::read_write_monitor_handle::state_is_read_accessible(), fields::field_vd::state_is_read_accessible(), target, sheaf::auto_block< T, S >::ub(), fiber_bundle::base_space_poset::vertices(), vertices_id_space, and ~field_refinement_buffer().

◆ ~field_refinement_buffer()

fields::field_refinement_buffer::~field_refinement_buffer ( )

Destructor; not virtual, this can not be used as a base class.

Definition at line 205 of file field_refinement_buffer.cc.

References gather_coordinate_dofs(), parent_prop_dofs, parent_prop_evaluator, and parent_subzone_id.

Referenced by field_refinement_buffer().

Member Function Documentation

◆ evaluate_at_center()

void fields::field_refinement_buffer::evaluate_at_center ( )

◆ evaluate_source_at_disc()

void fields::field_refinement_buffer::evaluate_source_at_disc ( size_type  xi)

Evaluates the coordinates and the source property at the position of the xi-th (local indexing) property discretization member.

Precondition
  • target.state_is_read_accessible()
  • -unexecutable( "dofs have been gathered for this zone" )
Issue:
requires coord dofs are coord values.
Issue:
requires same evaluation subposet.

Definition at line 497 of file field_refinement_buffer.cc.

References coord_dofs, coord_evaluator, coord_value, fields::field_vd::dc(), fiber_bundle::section_evaluator::local_coordinates(), local_coords, prop_evaluator, fields::field_vd::property_at_coordinates(), same_discretization, save_parent(), sheaf::auto_block< T, S >::set_ct(), source, source_prop_value, fields::field_vd::state_is_read_accessible(), target, and fiber_bundle::section_evaluator::value_at_coord().

Referenced by evaluate_at_center(), and push_prop_dofs().

◆ gather_coordinate_dofs()

void fields::field_refinement_buffer::gather_coordinate_dofs ( )

Gathers the coordinate dofs from the target for the current zone.

Precondition
  • target.state_is_read_accessible()
Todo:
revise when ternary schema are supported.
Precondition
  • dynamic_cast<binary_section_space_schema_member*>(&target.coordinates().schema()) != 0
Postcondition
  • coord_dofs.ct() == coord_disc_ids.ct()*target.dc()

Definition at line 226 of file field_refinement_buffer.cc.

References sheaf::auto_block< T, S >::base(), coord_disc_ids, coord_dofs, fields::field_vd::coordinates(), sheaf::auto_block< T, S >::ct(), fields::field_vd::dc(), gather_property_dofs(), fiber_bundle::sec_vd::get_fiber(), sheaf::auto_block< T, S >::reserve(), fiber_bundle::sec_rep_space_member::schema(), sheaf::auto_block< T, S >::set_ct(), fields::field_vd::state_is_read_accessible(), and target.

Referenced by ~field_refinement_buffer().

◆ gather_property_dofs()

void fields::field_refinement_buffer::gather_property_dofs ( )

Gathers the property dofs from the target for the current zone.

Precondition
  • target.state_is_read_accessible()
Todo:
revise when ternary schema are supported.
Precondition
  • dynamic_cast<binary_section_space_schema_member*>(&target.property().schema()) != 0
Postcondition
  • prop_dofs.ct() == prop_disc_ids.ct()*target.dp()

Definition at line 272 of file field_refinement_buffer.cc.

References sheaf::auto_block< T, S >::base(), sheaf::auto_block< T, S >::ct(), fields::field_vd::dp(), fiber_bundle::sec_vd::get_fiber(), prop_disc_ids, prop_dofs, fields::field_vd::property(), push_prop_dofs(), sheaf::auto_block< T, S >::reserve(), fiber_bundle::sec_rep_space_member::schema(), sheaf::auto_block< T, S >::set_ct(), fields::field_vd::state_is_read_accessible(), and target.

Referenced by gather_coordinate_dofs().

◆ invariant()

bool fields::field_refinement_buffer::invariant ( ) const

Class invariant.

Invariant
  • target.same_evaluation()

Definition at line 45 of file field_refinement_buffer.cc.

Referenced by field_refinement_buffer(), and reserve_prop_fiber().

◆ push_prop_dofs()

void fields::field_refinement_buffer::push_prop_dofs ( )

Pushes the source property dofs to the target for any discretization members that have not already been pushed.

Precondition
  • target.same_evaluation()
  • coord_value.ub() >= target.dc()
Postcondition
  • for(int i = ( 0 ); i < ( prop_disc_ids.ct() ); ++ i ) has_been_pushed[prop_disc_ids[i].pod()]

Definition at line 317 of file field_refinement_buffer.cc.

References sheaf::auto_block< T, S >::base(), base_space, coord_value, sheaf::auto_block< T, S >::ct(), fields::field_vd::dc(), evaluate_source_at_disc(), sheaf::zn_to_bool::extend_to(), has_been_pushed, sheaf::poset_state_handle::member_index_ub(), sheaf::scoped_index::pod(), prop_disc_ids, fields::field_vd::property(), sheaf::zn_to_bool::put(), fiber_bundle::sec_vd::put_fiber(), refine_prop_dofs(), reserve_prop_fiber(), fields::field_vd::same_evaluation(), source_prop_value, target, and sheaf::auto_block< T, S >::ub().

Referenced by gather_property_dofs().

◆ refine_prop_dofs()

void fields::field_refinement_buffer::refine_prop_dofs ( local_field_refiner xrefiner)

◆ reserve_coord_fiber()

void fields::field_refinement_buffer::reserve_coord_fiber ( const scoped_index xdisc_id)

Ensures the coordinate dofs have enough capacity for discretization id xdisc.

Precondition
  • dynamic_cast<array_section_dof_map*>(&target.coordinates().dof_map(true)) != 0
  • coord_disc_seq_id_space->contains(xdisc_id)
Postcondition
  • -unexecutable( "coord dof map has enough capacity for the fiber associated with xdisc_id" )

Definition at line 578 of file field_refinement_buffer.cc.

References sheaf::explicit_index_space_handle::contains(), coord_disc_seq_id_space, fields::field_vd::coordinates(), fiber_bundle::sec_rep_space_member::dof_map(), sheaf::explicit_index_space_handle::pod(), fiber_bundle::array_section_dof_map::reserve_fiber(), reserve_prop_fiber(), and target.

Referenced by fields::zone_centered_tet_refiner::refine_coordinates(), fields::zone_centered_segment_refiner::refine_coordinates(), fields::zone_centered_triangle_refiner::refine_coordinates(), fields::edge_centered_polygon_refiner::refine_coordinates(), and save_parent().

◆ reserve_prop_fiber()

void fields::field_refinement_buffer::reserve_prop_fiber ( const scoped_index xdisc_id)

Ensures the property dofs have enough capacity for discretization id xdisc.

Precondition
  • dynamic_cast<array_section_dof_map*>(&target.property().dof_map(true)) != 0
  • prop_disc_seq_id_space->contains(xdisc_id)
Postcondition
  • -unexecutable( "coord dof map has enough capacity for the fiber associated with xdisc_id" )

Definition at line 605 of file field_refinement_buffer.cc.

References base_space, sheaf::explicit_index_space_handle::contains(), coord_disc_ids, coord_discretization, fiber_bundle::sec_rep_space_member::dof_map(), evaluation, has_been_pushed, invariant(), sheaf::explicit_index_space_handle::pod(), prop_disc_ids, prop_disc_seq_id_space, prop_discretization, fields::field_vd::property(), fiber_bundle::array_section_dof_map::reserve_fiber(), source, and target.

Referenced by push_prop_dofs(), refine_prop_dofs(), and reserve_coord_fiber().

◆ save_parent()

void fields::field_refinement_buffer::save_parent ( )

Saves the prop_dofs and prop_evaluator of the current zone into the parent buffers.

Precondition
  • depth < depth_ub
Postcondition
  • -unexecutable( parent_prop_dofs[depth] == prop_dofs )
  • parent_prop_evaluator[depth] == prop_evaluator
  • parent_subzone_id[depth] == 0

Definition at line 553 of file field_refinement_buffer.cc.

References depth, depth_ub, parent_prop_dofs, parent_prop_evaluator, parent_subzone_id, prop_dofs, prop_evaluator, and reserve_coord_fiber().

Referenced by evaluate_source_at_disc().

Member Data Documentation

◆ base_space

◆ coord_disc_ids

const block<scoped_index>& fields::field_refinement_buffer::coord_disc_ids

A buffer for gathering the coordinate discretization members for the current zone.

Definition at line 133 of file field_refinement_buffer.h.

Referenced by gather_coordinate_dofs(), and reserve_prop_fiber().

◆ coord_disc_seq_id_space

◆ coord_discretization

subposet& fields::field_refinement_buffer::coord_discretization

The discretization subposet of the coordinate section of the target.

Definition at line 175 of file field_refinement_buffer.h.

Referenced by reserve_prop_fiber().

◆ coord_dofs

◆ coord_evaluator

◆ coord_value

◆ depth

int fields::field_refinement_buffer::depth

The refinement depth of the current zone.

Definition at line 236 of file field_refinement_buffer.h.

Referenced by refine_prop_dofs(), and save_parent().

◆ depth_ub

int fields::field_refinement_buffer::depth_ub

The upper bound for the refinement depth.

Definition at line 241 of file field_refinement_buffer.h.

Referenced by field_refinement_buffer(), and save_parent().

◆ elements_id_space

◆ evaluation

subposet& fields::field_refinement_buffer::evaluation

The evaluation subposet used by both the coordinates and property sections of the target.

Definition at line 170 of file field_refinement_buffer.h.

Referenced by reserve_prop_fiber().

◆ has_been_pushed

zn_to_bool fields::field_refinement_buffer::has_been_pushed

True if i-th member has been pused.

Definition at line 144 of file field_refinement_buffer.h.

Referenced by field_refinement_buffer(), push_prop_dofs(), refine_prop_dofs(), and reserve_prop_fiber().

◆ local_coords

◆ local_coords2

block<chart_point_coord_type> fields::field_refinement_buffer::local_coords2

Another buffer for the local coordinates of a point.

Definition at line 220 of file field_refinement_buffer.h.

Referenced by refine_prop_dofs().

◆ parent_prop_dofs

block<sec_vd_dof_type>* fields::field_refinement_buffer::parent_prop_dofs

A buffer for property dofs of the parent zones.

Definition at line 256 of file field_refinement_buffer.h.

Referenced by field_refinement_buffer(), refine_prop_dofs(), save_parent(), and ~field_refinement_buffer().

◆ parent_prop_evaluator

section_evaluator** fields::field_refinement_buffer::parent_prop_evaluator

The property section evaluators for the parent zones.

Definition at line 261 of file field_refinement_buffer.h.

Referenced by refine_prop_dofs(), save_parent(), and ~field_refinement_buffer().

◆ parent_subzone_id

int* fields::field_refinement_buffer::parent_subzone_id

The index of the current subzone of the parent zones.

Definition at line 266 of file field_refinement_buffer.h.

Referenced by refine_prop_dofs(), save_parent(), and ~field_refinement_buffer().

◆ prop_disc_ids

const block<scoped_index>& fields::field_refinement_buffer::prop_disc_ids

A buffer for gathering the property discretization members for the current zone.

Definition at line 139 of file field_refinement_buffer.h.

Referenced by gather_property_dofs(), push_prop_dofs(), refine_prop_dofs(), reserve_prop_fiber(), and fields::variance_bound_refinement_policy::should_refine().

◆ prop_disc_seq_id_space

scattered_insertion_index_space_handle* fields::field_refinement_buffer::prop_disc_seq_id_space

The discretization sequence id space of the target coordinates.

Definition at line 185 of file field_refinement_buffer.h.

Referenced by field_refinement_buffer(), and reserve_prop_fiber().

◆ prop_discretization

subposet& fields::field_refinement_buffer::prop_discretization

The discretization subposet of the property section of the target.

Definition at line 180 of file field_refinement_buffer.h.

Referenced by field_refinement_buffer(), and reserve_prop_fiber().

◆ prop_dofs

block<sec_vd_dof_type> fields::field_refinement_buffer::prop_dofs

◆ prop_evaluator

section_evaluator* fields::field_refinement_buffer::prop_evaluator

The section evaluator for the property section of the target.

Definition at line 251 of file field_refinement_buffer.h.

Referenced by evaluate_at_center(), evaluate_source_at_disc(), refine_prop_dofs(), and save_parent().

◆ prop_value

◆ same_discretization

bool fields::field_refinement_buffer::same_discretization

True if target property uses same discretization as target coordinates.

Definition at line 226 of file field_refinement_buffer.h.

Referenced by evaluate_source_at_disc().

◆ source

◆ source_prop_value

block<sec_vd_value_type> fields::field_refinement_buffer::source_prop_value

A buffer for computing source property at a point.

Definition at line 210 of file field_refinement_buffer.h.

Referenced by evaluate_at_center(), evaluate_source_at_disc(), push_prop_dofs(), and fields::zone_centered_error_bound_refinement_policy::should_refine().

◆ target

◆ vertices_id_space

◆ zone_id


The documentation for this class was generated from the following files: