Mesh Oriented datABase  (version 5.5.0)
An array-based unstructured mesh library
moab::EntitySequence Class Referenceabstract

#include <EntitySequence.hpp>

+ Inheritance diagram for moab::EntitySequence:
+ Collaboration diagram for moab::EntitySequence:

Public Member Functions

 EntitySequence (EntityHandle start, EntityID count, SequenceData *dat)
 
virtual ~EntitySequence ()
 
EntityType type () const
 
EntityHandle start_handle () const
 
EntityHandle end_handle () const
 
SequenceDatadata () 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. More...
 
virtual int values_per_entity () const
 Integer value used in finding appropriate SequenceData. More...
 
virtual EntitySequencesplit (EntityHandle here)=0
 Split this sequence into two consecutive sequences. More...
 
virtual ErrorCode merge (EntitySequence &other)
 Merge this sequence with another. More...
 
virtual ErrorCode pop_back (EntityID count)
 Erase entities in range: (end_handle()-count, end_handle()]. More...
 
virtual ErrorCode pop_front (EntityID count)
 Erase entities in range: [start_handle(), start_handle()+count) More...
 
virtual SequenceDatacreate_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. More...
 
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. More...
 
virtual unsigned long get_per_entity_memory_use (EntityHandle first, EntityHandle last) const
 Get portion of memory use that varies per entity. More...
 

Protected Member Functions

 EntitySequence (EntityHandle h)
 
 EntitySequence (EntitySequence &split_from, EntityHandle here)
 
SequenceDatacreate_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
 
SequenceDatasequenceData
 

Detailed Description

Definition at line 12 of file EntitySequence.hpp.

Constructor & Destructor Documentation

◆ EntitySequence() [1/3]

moab::EntitySequence::EntitySequence ( EntityHandle  h)
inlineprotected

Definition at line 19 of file EntitySequence.hpp.

19 : startHandle( h ), endHandle( h ), sequenceData( NULL ) {}

◆ EntitySequence() [2/3]

moab::EntitySequence::EntitySequence ( EntitySequence split_from,
EntityHandle  here 
)
inlineprotected

Definition at line 21 of file EntitySequence.hpp.

22  : startHandle( here ), endHandle( split_from.endHandle ), sequenceData( split_from.sequenceData )
23  {
24  split_from.endHandle = here - 1;
25  }

References endHandle.

◆ EntitySequence() [3/3]

moab::EntitySequence::EntitySequence ( EntityHandle  start,
EntityID  count,
SequenceData dat 
)
inline

Definition at line 36 of file EntitySequence.hpp.

37  : startHandle( start ), endHandle( start + count - 1 ), sequenceData( dat )
38  {
39  }

◆ ~EntitySequence()

virtual moab::EntitySequence::~EntitySequence ( )
inlinevirtual

Definition at line 41 of file EntitySequence.hpp.

41 {}

Member Function Documentation

◆ append_entities()

ErrorCode moab::EntitySequence::append_entities ( EntityID  count)
protected

Definition at line 44 of file EntitySequence.cpp.

45 {
46  EntityHandle new_end = endHandle + count;
47  if( new_end > data()->end_handle() ) return MB_FAILURE;
48 
49  endHandle = new_end;
50  return MB_SUCCESS;
51 }

References data(), end_handle(), endHandle, and MB_SUCCESS.

Referenced by moab::UnstructuredElemSeq::push_back(), moab::VertexSequence::push_back(), and moab::MeshSetSequence::push_back().

◆ create_data_subset() [1/2]

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::TypeSequenceManager::DummySequence, moab::MeshSetSequence, moab::SweptElementSeq, moab::StructuredElementSeq, moab::VertexSequence, and moab::UnstructuredElemSeq.

◆ create_data_subset() [2/2]

SequenceData* moab::EntitySequence::create_data_subset ( EntityHandle  start_handle,
EntityHandle  end_handle,
int  num_sequence_arrays,
unsigned const *  bytes_per_element 
) const
protected

◆ data() [1/2]

SequenceData* moab::EntitySequence::data ( ) const
inline

Definition at line 58 of file EntitySequence.hpp.

59  {
60  return sequenceData;
61  }

References sequenceData.

Referenced by moab::SequenceManager::add_vsequence(), moab::Core::adjacencies_iterate(), moab::SequenceManager::allocate_mesh_set(), append_entities(), moab::MeshSetSequence::array(), moab::VertexSequence::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::AEntityFactory::get_memory_use(), 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::StructuredElementSeq::sdata(), moab::SweptElementSeq::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().

◆ data() [2/2]

void moab::EntitySequence::data ( SequenceData ptr)
inline

Definition at line 63 of file EntitySequence.hpp.

64  {
65  sequenceData = ptr;
66  }

References sequenceData.

◆ end_handle()

◆ get_const_memory_use()

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.

Parameters
bytes_per_entityThe 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_sequenceThe size of the leaf subclass of this class

Implemented in moab::VertexSequence, moab::UnstructuredElemSeq, moab::SweptElementSeq, moab::StructuredElementSeq, moab::MeshSetSequence, and moab::TypeSequenceManager::DummySequence.

◆ get_per_entity_memory_use()

unsigned long moab::EntitySequence::get_per_entity_memory_use ( EntityHandle  first,
EntityHandle  last 
) const
virtual

Get portion of memory use that varies per entity.

Returns
Any per-entity memory use not accounted for in the results of get_const_memory_use.

Reimplemented in moab::TypeSequenceManager::DummySequence, and moab::MeshSetSequence.

Definition at line 71 of file EntitySequence.cpp.

72 {
73  return 0;
74 }

◆ merge()

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.

54 {
55  if( sequenceData != other.sequenceData ) return MB_FAILURE;
56  if( end_handle() + 1 == other.start_handle() )
57  {
58  endHandle = other.end_handle();
59  other.startHandle = other.end_handle() + 1;
60  }
61  else if( start_handle() == other.end_handle() + 1 )
62  {
63  startHandle = other.start_handle();
64  other.endHandle = other.start_handle() - 1;
65  }
66  else
67  return MB_FAILURE;
68  return MB_SUCCESS;
69 }

References end_handle(), endHandle, MB_SUCCESS, sequenceData, start_handle(), and startHandle.

◆ pop_back()

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.

18 {
19  EntityHandle new_end = endHandle - count;
20  if( new_end < startHandle ) return MB_FAILURE;
21 
22  endHandle = new_end;
23  return MB_SUCCESS;
24 }

References endHandle, MB_SUCCESS, and startHandle.

Referenced by moab::TypeSequenceManager::erase(), and moab::MeshSetSequence::pop_back().

◆ pop_front()

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.

27 {
28  EntityHandle new_start = startHandle + count;
29  if( new_start > endHandle ) return MB_FAILURE;
30 
31  startHandle = new_start;
32  return MB_SUCCESS;
33 }

References endHandle, MB_SUCCESS, and startHandle.

Referenced by moab::TypeSequenceManager::erase(), and moab::MeshSetSequence::pop_front().

◆ prepend_entities()

ErrorCode moab::EntitySequence::prepend_entities ( EntityID  count)
protected

Definition at line 35 of file EntitySequence.cpp.

36 {
37  EntityHandle new_start = startHandle - count;
38  if( new_start < data()->start_handle() ) return MB_FAILURE;
39 
40  startHandle = new_start;
41  return MB_SUCCESS;
42 }

References data(), MB_SUCCESS, start_handle(), and startHandle.

Referenced by moab::UnstructuredElemSeq::push_front(), moab::VertexSequence::push_front(), and moab::MeshSetSequence::push_front().

◆ size()

◆ split()

virtual EntitySequence* moab::EntitySequence::split ( EntityHandle  here)
pure virtual

Split this sequence into two consecutive sequences.

Split this sequence into two sequences.

Parameters
hereNew sequences should be [start_handle(),here) & [here,end_handle()]
Returns
New sequence containing [here,end_handle()]

Implemented in moab::TypeSequenceManager::DummySequence, moab::VertexSequence, moab::UnstructuredElemSeq, moab::SweptElementSeq, moab::StructuredElementSeq, moab::PolyElementSeq, and moab::MeshSetSequence.

Referenced by moab::TypeSequenceManager::split_sequence().

◆ start_handle()

EntityHandle moab::EntitySequence::start_handle ( ) const
inline

Definition at line 48 of file EntitySequence.hpp.

49  {
50  return startHandle;
51  }

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().

◆ type()

◆ using_entire_data()

◆ values_per_entity()

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::UnstructuredElemSeq, moab::SweptElementSeq, and moab::StructuredElementSeq.

Definition at line 12 of file EntitySequence.cpp.

13 {
14  return 0;
15 }

Referenced by moab::ReorderTool::get_entities(), moab::ReorderTool::handle_order_from_int_tag(), moab::ReorderTool::reorder_entities(), and moab::WriteDamsel::write_entities().

Member Data Documentation

◆ endHandle

EntityHandle moab::EntitySequence::endHandle
private

◆ sequenceData

SequenceData* moab::EntitySequence::sequenceData
private

Definition at line 16 of file EntitySequence.hpp.

Referenced by data(), and merge().

◆ startHandle

EntityHandle moab::EntitySequence::startHandle
private

Definition at line 15 of file EntitySequence.hpp.

Referenced by merge(), pop_back(), pop_front(), prepend_entities(), size(), and start_handle().


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