SheafSystem  0.0.0.0
fiber_bundle::unstructured_block_builder Class Reference

OBSOLETE: use zone_nodes_block or point_block_*d. A builder object for constructing unstructured blocks given a local cell template and atomic equivalences ("connectivity"). More...

#include <unstructured_block_builder.h>

Public Types

typedef std::list< pod_index_typelist_type
 The type of the temporary cover set lists. More...
 
typedef unordered::unordered_map< int, int > glue_map_type
 The type of the glue map. More...
 

Public Member Functions

virtual bool invariant () const
 Class invariant. More...
 
 unstructured_block_builder ()
 Default constructor. More...
 
 ~unstructured_block_builder ()
 Destructor. More...
 
void build_block_pa (const base_space_member *xtemplate, const int *xglue, size_type xglue_ub, unstructured_block *result, bool xcompute_upper_cover, bool xauto_access)
 Build the unstructured block result using local cell template xtemplate and the atomic equivalences ("connectivity") in xglue. If xcompute_upper_cover, compute the join of the block members to ensure the upper cover is correct, otherwise use the existing upper cover. More...
 
void build_block_pa (const base_space_member *xtemplate, const scoped_index *xglue, size_type xglue_ub, unstructured_block *result, bool xcompute_upper_cover, bool xauto_access)
 Build the unstructured block result using local cell template xtemplate and the atomic equivalences ("connectivity") in xglue. If xcompute_upper_cover, compute the join of the block members to ensure the upper cover is correct, otherwise use the existing upper cover. More...
 

Static Public Member Functions

static void build_block_decomposition (base_space_poset *xmesh, const block< int > &xblock_ids, const block< int > &xblock_dbs, const block< poset_path > &xblock_local_cell_paths, const ragged_array< int > &xblock_nbrs, bool xauto_access)
 Creates in xmesh the unrefined blocks and block neighborhoods described by the client ids in xblock_ids, the dimensions in xblock_dbs, the templates in xblock_local_cell_paths, and xblock_nbrs. More...
 
static void build_block_decomposition (base_space_poset *xmesh, const block< int > &xblock_ids, int xblock_db, const poset_path &xblock_local_cell_path, const ragged_array< int > &xblock_nbrs, bool xauto_access)
 Creates in xmesh the unrefined blocks and block neighborhoods described by the client ids in xblock_ids and xblock_nbrs. All blocks have dimension xblock_db and template xblock_local_cell_path. More...
 
static bool name_mode ()
 True if cells should be given unique names. More...
 
static void put_name_mode (bool xmode)
 Sets name_mode to xmode. Warning: creating meshes with large numbers of names may exceed limits imposed by storage in HDF files. Intended for debugging use only. More...
 

Detailed Description

OBSOLETE: use zone_nodes_block or point_block_*d. A builder object for constructing unstructured blocks given a local cell template and atomic equivalences ("connectivity").

Definition at line 83 of file unstructured_block_builder.h.

Member Typedef Documentation

◆ glue_map_type

typedef unordered::unordered_map<int, int> fiber_bundle::unstructured_block_builder::glue_map_type

The type of the glue map.

Definition at line 113 of file unstructured_block_builder.h.

◆ list_type

The type of the temporary cover set lists.

Definition at line 106 of file unstructured_block_builder.h.

Constructor & Destructor Documentation

◆ unstructured_block_builder()

fiber_bundle::unstructured_block_builder::unstructured_block_builder ( )

Default constructor.

Postcondition

Definition at line 107 of file unstructured_block_builder.cc.

References sheaf::invalid_pod_index(), and ~unstructured_block_builder().

Referenced by invariant().

◆ ~unstructured_block_builder()

fiber_bundle::unstructured_block_builder::~unstructured_block_builder ( )

Destructor.

Definition at line 131 of file unstructured_block_builder.cc.

References build_block_pa().

Referenced by unstructured_block_builder().

Member Function Documentation

◆ build_block_decomposition() [1/2]

void fiber_bundle::unstructured_block_builder::build_block_decomposition ( base_space_poset xmesh,
const block< int > &  xblock_ids,
const block< int > &  xblock_dbs,
const block< poset_path > &  xblock_local_cell_paths,
const ragged_array< int > &  xblock_nbrs,
bool  xauto_access 
)
static

Creates in xmesh the unrefined blocks and block neighborhoods described by the client ids in xblock_ids, the dimensions in xblock_dbs, the templates in xblock_local_cell_paths, and xblock_nbrs.

Precondition
  • xmesh != 0
  • xauto_access ? xmesh->is_attached() : xmesh->state_is_read_write_accessible()
  • xauto_access || xmesh->name_space()->state_is_read_accessible()
  • xblock_dbs.ct() == xblock_ids.ct()
  • xblock_local_cell_paths.ct() == xblock_ids.ct()
  • for(int i = ( 0 ); i < ( xblock_dbs.ct() ); ++ i ) xblock_dbs[i] >= 0
  • for(int i = ( 0 ); i < ( xblock_local_cell_paths.ct() ); ++ i ) xmesh->name_space()->contains_poset_member(xblock_local_cell_paths[i])
  • for(int i = ( 0 ); i < ( xblock_local_cell_paths.ct() ); ++ i ) xauto_access || xmesh->name_space()->member_poset(xblock_local_cell_paths[i], true).state_is_read_accessible()
Postcondition
  • xmesh->includes_subposet("__neighborhoods")

Definition at line 343 of file unstructured_block_builder.cc.

References sheaf::poset::begin_jim_edit_mode(), fiber_bundle::base_space_poset::blocks(), sheaf::namespace_poset::contains_poset_member(), sheaf::auto_block< T, S >::ct(), sheaf::auto_block< T, un_block_initialization_policy< T > >::ct(), sheaf::poset::end_jim_edit_mode(), sheaf::poset_state_handle::get_read_access(), sheaf::poset_state_handle::includes_subposet(), sheaf::poset_state_handle::is_attached(), sheaf::namespace_poset::member_poset(), sheaf::poset_state_handle::name_space(), sheaf::poset_state_handle::release_access(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and sheaf::read_write_monitor_handle::state_is_read_write_accessible().

Referenced by build_block_pa().

◆ build_block_decomposition() [2/2]

void fiber_bundle::unstructured_block_builder::build_block_decomposition ( base_space_poset xmesh,
const block< int > &  xblock_ids,
int  xblock_db,
const poset_path xblock_local_cell_path,
const ragged_array< int > &  xblock_nbrs,
bool  xauto_access 
)
static

Creates in xmesh the unrefined blocks and block neighborhoods described by the client ids in xblock_ids and xblock_nbrs. All blocks have dimension xblock_db and template xblock_local_cell_path.

Precondition
  • xmesh != 0
  • xauto_access ? xmesh->is_attached() : xmesh->state_is_read_write_accessible()
  • xblock_db >= 0
  • xauto_access || xmesh->name_space()->state_is_read_accessible()
  • xmesh->name_space()->contains_poset_member(xblock_local_cell_path, true)
  • xauto_access || xmesh->name_space()->member_poset(xblock_local_cell_path, true).state_is_read_accessible()
Postcondition
  • xmesh->includes_subposet("__neighborhoods")

Definition at line 425 of file unstructured_block_builder.cc.

References sheaf::poset::begin_jim_edit_mode(), fiber_bundle::base_space_poset::blocks(), sheaf::namespace_poset::contains_poset_member(), sheaf::auto_block< T, S >::ct(), sheaf::poset_component::detach_from_state(), sheaf::abstract_poset_member::dof_tuple_id(), sheaf::poset::end_jim_edit_mode(), sheaf::poset_state_handle::get_read_access(), sheaf::namespace_poset::get_read_access(), sheaf::poset_state_handle::get_read_write_access(), sheaf::subposet::id_space(), sheaf::poset_state_handle::includes_subposet(), sheaf::poset_component::index(), sheaf::scattered_insertion_index_space_handle::insert(), sheaf::subposet::insert_member(), sheaf::poset_state_handle::is_attached(), sheaf::poset_path::member_name(), sheaf::namespace_poset::member_poset(), name_mode(), sheaf::poset_state_handle::name_space(), sheaf::abstract_poset_member::new_jim_state(), fiber_bundle::unstructured_block::new_state(), sheaf::abstract_poset_member::put_name(), sheaf::poset_state_handle::release_access(), sheaf::namespace_poset::release_access(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and sheaf::read_write_monitor_handle::state_is_read_write_accessible().

◆ build_block_pa() [1/2]

void fiber_bundle::unstructured_block_builder::build_block_pa ( const base_space_member xtemplate,
const int *  xglue,
size_type  xglue_ub,
unstructured_block result,
bool  xcompute_upper_cover,
bool  xauto_access 
)

Build the unstructured block result using local cell template xtemplate and the atomic equivalences ("connectivity") in xglue. If xcompute_upper_cover, compute the join of the block members to ensure the upper cover is correct, otherwise use the existing upper cover.

Precondition
  • xtemplate != 0
  • xtemplate->state_is_read_accessible()
  • xtemplate->name_space()->state_is_read_accessible()
  • xtemplate->is_jim()
  • xtemplate->schema().row_conforms_to(result->schema())
  • xtemplate->atom_ct() > 0
  • xglue != 0
  • xglue_ub > 0
  • (xglue_ub % xtemplate->atom_ct()) == 0
  • result != 0
  • xauto_access || result->host()->in_jim_edit_mode()
Hack:
make sure the base space contains the blocks and d_cells subposets. The following can be removed when base_space_member::host() is base_space_poset.
Precondition
  • -unexecutable( "result host is base space poset" )
  • result->schema().row_conforms_to(unstructured_block::standard_schema_path())
Issue:
Order relation for block member. The there 2 major steps in building a block:
  1. Create all the cells implied by the template and the glue, making sure to identify and use equivalent existing members.
  2. Properly link the cells and the block member to existing members making sure to satsify the ordering relation implied by the expansion of the block. This algorithm should operate in two modes:
  1. Computed; the proper linkage is automatically computed by joining the cells.
  2. Assumed ("trust me"); the upper cover of the block member is assumed to already be correct and the lower cover is assumed to be the collection of cells.

The existing code is a confused attempt to implement the above semantics. In addition, the matter is further complicated by computing the boundary at the same time.Constructing the block requires jim_edit_mode, but computing the boundary is a join which requires !jim_edit_mode. This routine thus is going to changes jim edit mode no matter which state it is in and we have no way of stating this as a precondition. Furthermore, these conflict because of the expense end_jim_edit_mode. A client may want to enter jim_edit_mode and create multiple blocks before leaving.

Recommendations:

  1. Added a switch to control computed vs assumed ordering.
  2. Implement computed mode using join.
  3. Add a switch to compute just the _boundary_jims sp or both it and the boundary.
  4. Make a separate operation to compute the boundary.
Hack:
instead of resolving the above issue, just insist that we have a jim and atom and we are not in jim_edit_mode. This forces end_jim_edit_mode for each block, but also resolves the conflict with making the boundary.
Precondition
  • result->is_jim()
  • result->is_atom()
Postcondition
  • -unexecutable( "result->host()->blocks().contains_member(result)" )
  • !result->name().empty()
  • !result->is_jim()

Definition at line 163 of file unstructured_block_builder.cc.

References sheaf::abstract_poset_member::atom_ct(), sheaf::poset::begin_jim_edit_mode(), sheaf::poset::end_jim_edit_mode(), sheaf::poset_component::get_read_write_access(), fiber_bundle::base_space_member::host(), sheaf::poset_state_handle::in_jim_edit_mode(), sheaf::abstract_poset_member::is_atom(), sheaf::abstract_poset_member::is_jim(), sheaf::abstract_poset_member::name(), sheaf::poset_component::name_space(), sheaf::poset_component::release_access(), sheaf::schema_poset_member::row_conforms_to(), sheaf::total_poset_member::schema(), and sheaf::read_write_monitor_handle::state_is_read_accessible().

Referenced by fiber_bundle::unstructured_block::new_state(), fiber_bundle::unstructured_block::refine(), and ~unstructured_block_builder().

◆ build_block_pa() [2/2]

void fiber_bundle::unstructured_block_builder::build_block_pa ( const base_space_member xtemplate,
const scoped_index xglue,
size_type  xglue_ub,
unstructured_block result,
bool  xcompute_upper_cover,
bool  xauto_access 
)

Build the unstructured block result using local cell template xtemplate and the atomic equivalences ("connectivity") in xglue. If xcompute_upper_cover, compute the join of the block members to ensure the upper cover is correct, otherwise use the existing upper cover.

Definition at line 300 of file unstructured_block_builder.cc.

References build_block_decomposition(), and sheaf::scoped_index::pod().

◆ invariant()

bool fiber_bundle::unstructured_block_builder::invariant ( ) const
virtual

Class invariant.

Definition at line 94 of file unstructured_block_builder.cc.

References unstructured_block_builder().

◆ name_mode()

bool fiber_bundle::unstructured_block_builder::name_mode ( )
static

True if cells should be given unique names.

Definition at line 521 of file unstructured_block_builder.cc.

References put_name_mode().

Referenced by build_block_decomposition().

◆ put_name_mode()

void fiber_bundle::unstructured_block_builder::put_name_mode ( bool  xmode)
static

Sets name_mode to xmode. Warning: creating meshes with large numbers of names may exceed limits imposed by storage in HDF files. Intended for debugging use only.

Postcondition

Definition at line 543 of file unstructured_block_builder.cc.

References sheaf::depth_first_iterator::action(), sheaf::abstract_poset_member::attach_to_state(), sheaf::auto_block< T, S >::base(), sheaf::ragged_array< T >::col_ct(), sheaf::subposet::contains_member(), sheaf::auto_block< T, S >::ct(), sheaf::abstract_poset_member::delete_cover_link(), sheaf::poset_component::detach_from_state(), sheaf::poset_dof_map::dof_tuple(), sheaf::poset_state_handle::dof_tuple_id(), sheaf::poset_dof_map::dof_tuple_ub(), sheaf::DOWN, sheaf::poset_dof_map::host(), sheaf::poset_state_handle::host(), fiber_bundle::base_space_member::host(), sheaf::index_space_iterator::hub_pod(), sheaf::index_space_handle::hub_pod(), sheaf::scoped_index::hub_pod(), sheaf::subposet::id_space(), sheaf::poset_state_handle::in_jim_edit_mode(), sheaf::poset_state_handle::includes_subposet(), sheaf::depth_first_iterator::index(), sheaf::scattered_insertion_index_space_handle::insert(), sheaf::subposet::insert_member(), sheaf::invalid_pod_index(), sheaf::scoped_index::invalidate(), sheaf::abstract_poset_member::is_atom(), sheaf::depth_first_iterator::is_done(), sheaf::abstract_poset_member::is_jim(), sheaf::is_valid(), sheaf::scoped_index::is_valid(), sheaf::depth_first_iterator::lesser_index(), sheaf::LOWER, sheaf::poset_state_handle::member_hub_id_space(), sheaf::namespace_poset::member_poset(), sheaf::poset_state_handle::name_space(), sheaf::poset_state_handle::new_link(), sheaf::depth_first_iterator::next(), sheaf::NOT_STRICT, sheaf::explicit_index_space_handle::pod(), sheaf::scoped_index::pod(), sheaf::gathered_insertion_index_space_handle::push_back(), sheaf::auto_block< T, S >::push_back(), sheaf::poset_dof_map::put_dof_tuple(), sheaf::subposet::put_name(), sheaf::abstract_poset_member::put_name(), sheaf::depth_first_iterator::reset(), sheaf::schema_poset_member::row_conforms_to(), sheaf::ragged_array< T >::row_ct(), sheaf::poset_state_handle::row_dof_map(), sheaf::total_poset_member::schema(), sheaf::auto_block< T, S >::set_ct(), sheaf::read_write_monitor_handle::state_is_read_accessible(), sheaf::read_write_monitor_handle::state_is_read_write_accessible(), sheaf::depth_first_iterator::truncate(), fiber_bundle::base_space_member_row_dof_tuple_type::type_id, and sheaf::UPPER.

Referenced by name_mode().


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