Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
#include <EntitySequence.hpp>
Public Member Functions | |
EntitySequence (EntityHandle start, EntityID count, SequenceData *dat) | |
virtual | ~EntitySequence () |
EntityType | type () const |
EntityHandle | start_handle () const |
EntityHandle | end_handle () const |
SequenceData * | data () const |
void | data (SequenceData *ptr) |
EntityID | size () const |
bool | using_entire_data () const |
True if SequenceData has no holes and is used only by this EntitySequence. | |
virtual int | values_per_entity () const |
Integer value used in finding appropriate SequenceData. | |
virtual EntitySequence * | split (EntityHandle here)=0 |
Split this sequence into two consecutive sequences. | |
virtual ErrorCode | merge (EntitySequence &other) |
Merge this sequence with another. | |
virtual ErrorCode | pop_back (EntityID count) |
Erase entities in range: (end_handle()-count, end_handle()]. | |
virtual ErrorCode | pop_front (EntityID count) |
Erase entities in range: [start_handle(), start_handle()+count) | |
virtual SequenceData * | create_data_subset (EntityHandle start_handle, EntityHandle end_handle) const =0 |
Create a new SequenceData that is a copy of a subset of the one referenced by this sequence. | |
virtual void | get_const_memory_use (unsigned long &bytes_per_entity, unsigned long &size_of_sequence) const =0 |
Get memory characteristcs that are the same for all entities. | |
virtual unsigned long | get_per_entity_memory_use (EntityHandle first, EntityHandle last) const |
Get portion of memory use that varies per entity. | |
Protected Member Functions | |
EntitySequence (EntityHandle h) | |
EntitySequence (EntitySequence &split_from, EntityHandle here) | |
SequenceData * | create_data_subset (EntityHandle start_handle, EntityHandle end_handle, int num_sequence_arrays, unsigned const *bytes_per_element) const |
ErrorCode | prepend_entities (EntityID count) |
ErrorCode | append_entities (EntityID count) |
Private Attributes | |
EntityHandle | startHandle |
EntityHandle | endHandle |
SequenceData * | sequenceData |
Definition at line 12 of file EntitySequence.hpp.
moab::EntitySequence::EntitySequence | ( | EntityHandle | h | ) | [inline, protected] |
Definition at line 19 of file EntitySequence.hpp.
: startHandle( h ), endHandle( h ), sequenceData( NULL ) {}
moab::EntitySequence::EntitySequence | ( | EntitySequence & | split_from, |
EntityHandle | here | ||
) | [inline, protected] |
Definition at line 21 of file EntitySequence.hpp.
References endHandle.
: startHandle( here ), endHandle( split_from.endHandle ), sequenceData( split_from.sequenceData ) { split_from.endHandle = here - 1; }
moab::EntitySequence::EntitySequence | ( | EntityHandle | start, |
EntityID | count, | ||
SequenceData * | dat | ||
) | [inline] |
Definition at line 36 of file EntitySequence.hpp.
: startHandle( start ), endHandle( start + count - 1 ), sequenceData( dat ) { }
virtual moab::EntitySequence::~EntitySequence | ( | ) | [inline, virtual] |
Definition at line 41 of file EntitySequence.hpp.
{}
ErrorCode moab::EntitySequence::append_entities | ( | EntityID | count | ) | [protected] |
Definition at line 44 of file EntitySequence.cpp.
References data(), end_handle(), endHandle, and MB_SUCCESS.
Referenced by moab::UnstructuredElemSeq::push_back(), moab::VertexSequence::push_back(), and moab::MeshSetSequence::push_back().
{ EntityHandle new_end = endHandle + count; if( new_end > data()->end_handle() ) return MB_FAILURE; endHandle = new_end; return MB_SUCCESS; }
SequenceData* moab::EntitySequence::create_data_subset | ( | EntityHandle | start_handle, |
EntityHandle | end_handle, | ||
int | num_sequence_arrays, | ||
unsigned const * | bytes_per_element | ||
) | const [protected] |
virtual SequenceData* moab::EntitySequence::create_data_subset | ( | EntityHandle | start_handle, |
EntityHandle | end_handle | ||
) | const [pure virtual] |
Create a new SequenceData that is a copy of a subset of the one referenced by this sequence.
Create a new SequenceData that is a copy of a subset of the SequenceData referenced by this EntitySequence. Do not make any changes to this EntitySequence or the current SequenceData.
Implemented in moab::StructuredElementSeq, moab::SweptElementSeq, moab::TypeSequenceManager::DummySequence, moab::MeshSetSequence, moab::VertexSequence, and moab::UnstructuredElemSeq.
SequenceData* moab::EntitySequence::data | ( | ) | const [inline] |
Definition at line 58 of file EntitySequence.hpp.
References sequenceData.
Referenced by moab::SequenceManager::add_vsequence(), moab::Core::adjacencies_iterate(), moab::SequenceManager::allocate_mesh_set(), append_entities(), moab::VertexSequence::array(), moab::MeshSetSequence::array(), moab::TypeSequenceManager::check_valid_data(), moab::HigherOrderFactory::convert_sequence(), moab::Core::coords_iterate(), moab::UnstructuredElemSeq::create_data_subset(), moab::VertexSequence::create_data_subset(), moab::SequenceManager::create_element(), moab::SequenceManager::create_entity_sequence(), moab::SequenceManager::create_mesh_set(), moab::SequenceManager::create_meshset_sequence(), moab::SequenceManager::create_scd_sequence(), moab::SequenceManager::create_sweep_sequence(), moab::SequenceManager::create_vertex(), moab::TypeSequenceManager::erase(), moab::AEntityFactory::get_adjacency_ptr(), moab::UnstructuredElemSeq::get_array(), moab::VarLenDenseTag::get_array(), moab::DenseTag::get_array_private(), moab::VertexSequence::get_coordinate_arrays(), moab::VertexSequence::get_coordinates(), moab::VertexSequence::get_coordinates_ref(), moab::MeshSetSequence::get_set(), moab::get_tagged(), moab::MeshSetSequence::initialize(), moab::TypeSequenceManager::insert_sequence(), moab::operator<<(), moab::MeshSetSequence::pop_back(), moab::MeshSetSequence::pop_front(), prepend_entities(), moab::Core::print_database(), moab::MeshSetSequence::push_back(), moab::MeshSetSequence::push_front(), moab::TypeSequenceManager::remove_sequence(), moab::TypeSequenceManager::replace_subsequence(), moab::ScdBox::ScdBox(), moab::SweptElementSeq::sdata(), moab::StructuredElementSeq::sdata(), moab::AEntityFactory::set_adjacency_ptr(), moab::VertexSequence::set_coordinates(), moab::UnstructuredElemSeq::UnstructuredElemSeq(), using_entire_data(), moab::VertexSequence::VertexSequence(), moab::MeshSetSequence::~MeshSetSequence(), and moab::TypeSequenceManager::~TypeSequenceManager().
{ return sequenceData; }
void moab::EntitySequence::data | ( | SequenceData * | ptr | ) | [inline] |
EntityHandle moab::EntitySequence::end_handle | ( | ) | const [inline] |
Definition at line 53 of file EntitySequence.hpp.
References endHandle.
Referenced by moab::SequenceManager::allocate_mesh_set(), append_entities(), moab::TypeSequenceManager::check_valid_data(), moab::Core::connect_iterate(), moab::HigherOrderFactory::convert(), moab::Core::coords_iterate(), moab::HigherOrderFactory::copy_nodes(), moab::SequenceManager::create_element(), moab::ReadUtil::create_entity_sets(), moab::SequenceManager::create_mesh_set(), moab::SequenceManager::create_vertex(), moab::TypeSequenceManager::erase(), moab::TypeSequenceManager::find(), moab::WriteUtil::gather_nodes_from_elements(), moab::Core::get_coords(), moab::ReadUtil::get_element_connect(), moab::ReorderTool::get_entities(), moab::ReadUtil::get_node_coords(), moab::MeshSetSequence::get_per_entity_memory_use(), moab::TypeSequenceManager::insert_sequence(), merge(), moab::operator<<(), moab::ParallelComm::pack_entities(), moab::MeshSetSequence::pop_back(), moab::Core::print_database(), moab::MeshSetSequence::push_back(), moab::HigherOrderFactory::remove_ho_nodes(), moab::TypeSequenceManager::replace_subsequence(), moab::UnstructuredElemSeq::split(), moab::HigherOrderFactory::tag_for_deletion(), moab::RangeSeqIntersectIter::update_entity_sequence(), and using_entire_data().
{ return endHandle; }
virtual void moab::EntitySequence::get_const_memory_use | ( | unsigned long & | bytes_per_entity, |
unsigned long & | size_of_sequence | ||
) | const [pure virtual] |
Get memory characteristcs that are the same for all entities.
Get charactersitic constant memory use for all entities in sequence.
bytes_per_entity | The total bytes consumed for each entity in the underlying SequenceData. It is assumed that the same amount of memory is consumed for unused portions of the SequenceData. |
size_of_sequence | The size of the leaf subclass of this class |
Implemented in moab::StructuredElementSeq, moab::SweptElementSeq, moab::MeshSetSequence, moab::TypeSequenceManager::DummySequence, moab::VertexSequence, and moab::UnstructuredElemSeq.
unsigned long moab::EntitySequence::get_per_entity_memory_use | ( | EntityHandle | first, |
EntityHandle | last | ||
) | const [virtual] |
Get portion of memory use that varies per entity.
Reimplemented in moab::MeshSetSequence, and moab::TypeSequenceManager::DummySequence.
Definition at line 71 of file EntitySequence.cpp.
{
return 0;
}
ErrorCode moab::EntitySequence::merge | ( | EntitySequence & | other | ) | [virtual] |
Merge this sequence with another.
Combine two adjacent sequences. Sequence handle blocks must be consective and sequences must share a common SequenceData.
Definition at line 53 of file EntitySequence.cpp.
References end_handle(), endHandle, MB_SUCCESS, sequenceData, start_handle(), and startHandle.
{ if( sequenceData != other.sequenceData ) return MB_FAILURE; if( end_handle() + 1 == other.start_handle() ) { endHandle = other.end_handle(); other.startHandle = other.end_handle() + 1; } else if( start_handle() == other.end_handle() + 1 ) { startHandle = other.start_handle(); other.endHandle = other.start_handle() - 1; } else return MB_FAILURE; return MB_SUCCESS; }
ErrorCode moab::EntitySequence::pop_back | ( | EntityID | count | ) | [virtual] |
Erase entities in range: (end_handle()-count, end_handle()].
Reimplemented in moab::MeshSetSequence.
Definition at line 17 of file EntitySequence.cpp.
References endHandle, MB_SUCCESS, and startHandle.
Referenced by moab::TypeSequenceManager::erase().
{ EntityHandle new_end = endHandle - count; if( new_end < startHandle ) return MB_FAILURE; endHandle = new_end; return MB_SUCCESS; }
ErrorCode moab::EntitySequence::pop_front | ( | EntityID | count | ) | [virtual] |
Erase entities in range: [start_handle(), start_handle()+count)
Reimplemented in moab::MeshSetSequence.
Definition at line 26 of file EntitySequence.cpp.
References endHandle, MB_SUCCESS, and startHandle.
Referenced by moab::TypeSequenceManager::erase().
{ EntityHandle new_start = startHandle + count; if( new_start > endHandle ) return MB_FAILURE; startHandle = new_start; return MB_SUCCESS; }
ErrorCode moab::EntitySequence::prepend_entities | ( | EntityID | count | ) | [protected] |
Definition at line 35 of file EntitySequence.cpp.
References data(), MB_SUCCESS, start_handle(), and startHandle.
Referenced by moab::UnstructuredElemSeq::push_front(), moab::VertexSequence::push_front(), and moab::MeshSetSequence::push_front().
{ EntityHandle new_start = startHandle - count; if( new_start < data()->start_handle() ) return MB_FAILURE; startHandle = new_start; return MB_SUCCESS; }
EntityID moab::EntitySequence::size | ( | ) | const [inline] |
Definition at line 68 of file EntitySequence.hpp.
References endHandle, and startHandle.
Referenced by moab::HigherOrderFactory::add_mid_edge_nodes(), moab::HigherOrderFactory::add_mid_face_nodes(), moab::HigherOrderFactory::add_mid_volume_nodes(), moab::HigherOrderFactory::copy_nodes(), moab::MeshSetSequence::initialize(), moab::TypeSequenceManager::replace_subsequence(), moab::HigherOrderFactory::zero_nodes(), and moab::MeshSetSequence::~MeshSetSequence().
{ return endHandle - startHandle + 1; }
virtual EntitySequence* moab::EntitySequence::split | ( | EntityHandle | here | ) | [pure virtual] |
Split this sequence into two consecutive sequences.
Split this sequence into two sequences.
here | New sequences should be [start_handle(),here) & [here,end_handle()] |
Implemented in moab::StructuredElementSeq, moab::SweptElementSeq, moab::MeshSetSequence, moab::TypeSequenceManager::DummySequence, moab::VertexSequence, moab::PolyElementSeq, and moab::UnstructuredElemSeq.
Referenced by moab::TypeSequenceManager::split_sequence().
EntityHandle moab::EntitySequence::start_handle | ( | ) | const [inline] |
Definition at line 48 of file EntitySequence.hpp.
References startHandle.
Referenced by moab::HigherOrderFactory::add_mid_edge_nodes(), moab::HigherOrderFactory::add_mid_face_nodes(), moab::HigherOrderFactory::add_mid_volume_nodes(), moab::SequenceManager::allocate_mesh_set(), moab::TypeSequenceManager::check_valid_data(), moab::Core::connect_iterate(), moab::HigherOrderFactory::copy_nodes(), moab::SequenceManager::create_element(), moab::ReadUtil::create_entity_sets(), moab::SequenceManager::create_mesh_set(), moab::SequenceManager::create_vertex(), moab::TypeSequenceManager::erase(), moab::TypeSequenceManager::find(), moab::WriteUtil::gather_nodes_from_elements(), moab::UnstructuredElemSeq::get_array(), moab::DenseTag::get_array_private(), moab::PolyElementSeq::get_connectivity(), moab::UnstructuredElemSeq::get_connectivity(), moab::VertexSequence::get_coordinate_arrays(), moab::Core::get_coords(), moab::ReadUtil::get_element_connect(), moab::ReorderTool::get_entities(), moab::TypeSequenceManager::get_memory_use(), moab::ReadUtil::get_node_coords(), moab::MeshSetSequence::get_per_entity_memory_use(), moab::MeshSetSequence::initialize(), moab::TypeSequenceManager::insert_sequence(), merge(), moab::operator<<(), moab::MeshSetSequence::pop_front(), prepend_entities(), moab::Core::print_database(), moab::MeshSetSequence::push_front(), moab::HigherOrderFactory::remove_ho_nodes(), moab::TypeSequenceManager::remove_sequence(), moab::SequenceManager::replace_subsequence(), moab::TypeSequenceManager::replace_subsequence(), moab::ScdBox::ScdBox(), moab::UnstructuredElemSeq::set_connectivity(), moab::UnstructuredElemSeq::split(), moab::HigherOrderFactory::tag_for_deletion(), type(), using_entire_data(), and moab::MeshSetSequence::~MeshSetSequence().
{ return startHandle; }
EntityType moab::EntitySequence::type | ( | ) | const [inline] |
Definition at line 43 of file EntitySequence.hpp.
References start_handle(), and moab::TYPE_FROM_HANDLE().
Referenced by moab::HigherOrderFactory::add_mid_edge_nodes(), moab::HigherOrderFactory::add_mid_face_nodes(), moab::HigherOrderFactory::add_mid_volume_nodes(), moab::HigherOrderFactory::convert(), moab::HigherOrderFactory::convert_sequence(), moab::HigherOrderFactory::copy_corner_nodes(), moab::HigherOrderFactory::copy_mid_edge_nodes(), moab::HigherOrderFactory::copy_mid_face_nodes(), moab::HigherOrderFactory::copy_mid_volume_nodes(), moab::HigherOrderFactory::copy_nodes(), moab::UnstructuredElemSeq::get_connectivity(), moab::ElementSequence::has_mid_edge_nodes(), moab::ElementSequence::has_mid_face_nodes(), moab::ElementSequence::has_mid_volume_nodes(), moab::ParallelComm::pack_entities(), moab::HigherOrderFactory::remove_mid_edge_nodes(), moab::HigherOrderFactory::remove_mid_face_nodes(), moab::HigherOrderFactory::remove_mid_volume_nodes(), moab::HigherOrderFactory::tag_for_deletion(), moab::HigherOrderFactory::zero_mid_edge_nodes(), moab::HigherOrderFactory::zero_mid_face_nodes(), and moab::HigherOrderFactory::zero_mid_volume_nodes().
{ return TYPE_FROM_HANDLE( start_handle() ); }
bool moab::EntitySequence::using_entire_data | ( | ) | const |
True if SequenceData has no holes and is used only by this EntitySequence.
Definition at line 7 of file EntitySequence.cpp.
References data(), moab::SequenceData::end_handle(), end_handle(), moab::SequenceData::start_handle(), and start_handle().
Referenced by moab::TypeSequenceManager::erase(), moab::TypeSequenceManager::insert_sequence(), moab::TypeSequenceManager::remove_sequence(), moab::TypeSequenceManager::replace_subsequence(), and moab::TypeSequenceManager::~TypeSequenceManager().
{ return start_handle() == data()->start_handle() && end_handle() == data()->end_handle(); }
int moab::EntitySequence::values_per_entity | ( | ) | const [virtual] |
Integer value used in finding appropriate SequenceData.
This value is matched to input values by TypeSequenceManager to determine if an available, unused portino of a SequenceData can be used for a specific entity allocation. For example, it is used to find a SequenceData with the appropriate number of vertices per element when allocating elements. The default value is zero.
Reimplemented in moab::StructuredElementSeq, moab::SweptElementSeq, and moab::UnstructuredElemSeq.
Definition at line 12 of file EntitySequence.cpp.
Referenced by moab::ReorderTool::get_entities(), moab::ReorderTool::handle_order_from_int_tag(), moab::ReorderTool::reorder_entities(), and moab::WriteDamsel::write_entities().
{
return 0;
}
EntityHandle moab::EntitySequence::endHandle [private] |
Definition at line 15 of file EntitySequence.hpp.
Referenced by append_entities(), end_handle(), EntitySequence(), merge(), pop_back(), pop_front(), and size().
SequenceData* moab::EntitySequence::sequenceData [private] |
Definition at line 16 of file EntitySequence.hpp.
Definition at line 15 of file EntitySequence.hpp.
Referenced by merge(), pop_back(), pop_front(), prepend_entities(), size(), and start_handle().