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

#include <UnstructuredElemSeq.hpp>

+ Inheritance diagram for moab::UnstructuredElemSeq:
+ Collaboration diagram for moab::UnstructuredElemSeq:

Public Member Functions

 UnstructuredElemSeq (EntityHandle start_handle, EntityID entity_count, unsigned nodes_per_entity, SequenceData *data)
 
 UnstructuredElemSeq (EntityHandle start_handle, EntityID entity_count, unsigned nodes_per_entity, EntityID sequence_data_size)
 
virtual ~UnstructuredElemSeq ()
 
int values_per_entity () const
 Integer value used in finding appropriate SequenceData. More...
 
virtual EntitySequencesplit (EntityHandle here)
 Split this sequence into two consecutive sequences. More...
 
SequenceDatacreate_data_subset (EntityHandle start, EntityHandle end) const
 Create a new SequenceData that is a copy of a subset of the one referenced by this sequence. More...
 
virtual ErrorCode get_connectivity (EntityHandle handle, std::vector< EntityHandle > &connect, bool topological=false) const
 
virtual ErrorCode get_connectivity (EntityHandle handle, EntityHandle const *&connect, int &connect_length, bool topological=false, std::vector< EntityHandle > *storage=0) const
 
ErrorCode set_connectivity (EntityHandle handle, EntityHandle const *connect, int connect_length)
 
EntityHandleget_connectivity_array ()
 
ErrorCode push_front (EntityID count)
 
ErrorCode push_back (EntityID count)
 
void get_const_memory_use (unsigned long &bytes_per_entity, unsigned long &size_of_sequence) const
 Get memory characteristcs that are the same for all entities. More...
 
- Public Member Functions inherited from moab::ElementSequence
 ElementSequence (EntityHandle start, EntityID count, unsigned int nodes_per_elem, SequenceData *dat)
 
virtual ~ElementSequence ()
 
unsigned int nodes_per_element () const
 
EntityHandle const * get_connectivity_array () const
 
bool has_mid_edge_nodes () const
 
bool has_mid_face_nodes () const
 
bool has_mid_volume_nodes () const
 
- Public Member Functions inherited from moab::EntitySequence
 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 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 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

EntityHandle const * get_array () const
 
EntityHandleget_array ()
 
 UnstructuredElemSeq (UnstructuredElemSeq &split_from, EntityHandle here)
 
- Protected Member Functions inherited from moab::ElementSequence
 ElementSequence (ElementSequence &split_from, EntityHandle here)
 
- Protected Member Functions inherited from moab::EntitySequence
 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)
 

Detailed Description

Definition at line 10 of file UnstructuredElemSeq.hpp.

Constructor & Destructor Documentation

◆ UnstructuredElemSeq() [1/3]

moab::UnstructuredElemSeq::UnstructuredElemSeq ( EntityHandle  start_handle,
EntityID  entity_count,
unsigned  nodes_per_entity,
SequenceData data 
)

Definition at line 8 of file UnstructuredElemSeq.cpp.

12  : ElementSequence( shandle, entity_count, nodes_per_entity, dat )
13 {
14 }

Referenced by split().

◆ UnstructuredElemSeq() [2/3]

moab::UnstructuredElemSeq::UnstructuredElemSeq ( EntityHandle  start_handle,
EntityID  entity_count,
unsigned  nodes_per_entity,
EntityID  sequence_data_size 
)

Definition at line 16 of file UnstructuredElemSeq.cpp.

20  : ElementSequence( shandle,
21  entity_count,
22  nodes_per_entity,
23  new SequenceData( 1, shandle, shandle + data_size - 1 ) )
24 {
25  data()->create_sequence_data( 0, nodes_per_entity * sizeof( EntityHandle ) );
26 }

References moab::SequenceData::create_sequence_data(), and moab::EntitySequence::data().

◆ ~UnstructuredElemSeq()

moab::UnstructuredElemSeq::~UnstructuredElemSeq ( )
virtual

Definition at line 28 of file UnstructuredElemSeq.cpp.

28 {}

◆ UnstructuredElemSeq() [3/3]

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

Definition at line 63 of file UnstructuredElemSeq.hpp.

63 : ElementSequence( split_from, here ) {}

Member Function Documentation

◆ create_data_subset()

SequenceData * moab::UnstructuredElemSeq::create_data_subset ( EntityHandle  start_handle,
EntityHandle  end_handle 
) const
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.

Implements moab::EntitySequence.

Definition at line 42 of file UnstructuredElemSeq.cpp.

43 {
44  int esize = nodes_per_element() * sizeof( EntityHandle );
45  return data()->subset( start, end, &esize );
46 }

References moab::EntitySequence::data(), moab::ElementSequence::nodes_per_element(), and moab::SequenceData::subset().

◆ get_array() [1/2]

EntityHandle* moab::UnstructuredElemSeq::get_array ( )
inlineprotected

◆ get_array() [2/2]

◆ get_connectivity() [1/2]

ErrorCode moab::UnstructuredElemSeq::get_connectivity ( EntityHandle  handle,
EntityHandle const *&  connect,
int &  connect_length,
bool  topological = false,
std::vector< EntityHandle > *  storage = 0 
) const
virtual

◆ get_connectivity() [2/2]

ErrorCode moab::UnstructuredElemSeq::get_connectivity ( EntityHandle  handle,
std::vector< EntityHandle > &  connect,
bool  topological = false 
) const
virtual

Implements moab::ElementSequence.

Reimplemented in moab::PolyElementSeq.

Definition at line 54 of file UnstructuredElemSeq.cpp.

57 {
58  EntityHandle const* conn = get_array() + nodes_per_element() * ( handle - start_handle() );
59  int len = topological ? CN::VerticesPerEntity( type() ) : nodes_per_element();
60  connect.reserve( connect.size() + len );
61  std::copy( conn, conn + len, std::back_inserter( connect ) );
62  return MB_SUCCESS;
63 }

References get_array(), MB_SUCCESS, moab::ElementSequence::nodes_per_element(), moab::EntitySequence::start_handle(), moab::EntitySequence::type(), and moab::CN::VerticesPerEntity().

◆ get_connectivity_array()

EntityHandle * moab::UnstructuredElemSeq::get_connectivity_array ( )
virtual

Implements moab::ElementSequence.

Definition at line 84 of file UnstructuredElemSeq.cpp.

85 {
86  return get_array();
87 }

References get_array().

◆ get_const_memory_use()

void moab::UnstructuredElemSeq::get_const_memory_use ( unsigned long &  bytes_per_entity,
unsigned long &  size_of_sequence 
) const
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

Implements moab::EntitySequence.

Definition at line 48 of file UnstructuredElemSeq.cpp.

49 {
50  bytes_per_entity = nodes_per_element() * sizeof( EntityHandle );
51  size_of_sequence = sizeof( *this );
52 }

References moab::ElementSequence::nodes_per_element().

◆ push_back()

ErrorCode moab::UnstructuredElemSeq::push_back ( EntityID  count)

Definition at line 89 of file UnstructuredElemSeq.cpp.

90 {
91  return EntitySequence::append_entities( count );
92 }

References moab::EntitySequence::append_entities().

Referenced by moab::SequenceManager::create_element().

◆ push_front()

ErrorCode moab::UnstructuredElemSeq::push_front ( EntityID  count)

Definition at line 94 of file UnstructuredElemSeq.cpp.

95 {
96  return EntitySequence::prepend_entities( count );
97 }

References moab::EntitySequence::prepend_entities().

Referenced by moab::SequenceManager::create_element().

◆ set_connectivity()

ErrorCode moab::UnstructuredElemSeq::set_connectivity ( EntityHandle  handle,
EntityHandle const *  connect,
int  connect_length 
)
virtual

Implements moab::ElementSequence.

Definition at line 76 of file UnstructuredElemSeq.cpp.

77 {
78  if( (unsigned)connect_length != nodes_per_element() ) return MB_INDEX_OUT_OF_RANGE;
79  EntityHandle* conn_ptr = get_array() + nodes_per_element() * ( handle - start_handle() );
80  std::copy( connect, connect + connect_length, conn_ptr );
81  return MB_SUCCESS;
82 }

References get_array(), MB_INDEX_OUT_OF_RANGE, MB_SUCCESS, moab::ElementSequence::nodes_per_element(), and moab::EntitySequence::start_handle().

Referenced by moab::SequenceManager::create_element().

◆ split()

EntitySequence * moab::UnstructuredElemSeq::split ( EntityHandle  here)
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()]

Implements moab::EntitySequence.

Reimplemented in moab::PolyElementSeq.

Definition at line 35 of file UnstructuredElemSeq.cpp.

36 {
37  if( here <= start_handle() || here > end_handle() ) return 0;
38 
39  return new UnstructuredElemSeq( *this, here );
40 }

References moab::EntitySequence::end_handle(), moab::EntitySequence::start_handle(), and UnstructuredElemSeq().

◆ values_per_entity()

int moab::UnstructuredElemSeq::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 from moab::EntitySequence.

Definition at line 30 of file UnstructuredElemSeq.cpp.

31 {
32  return nodes_per_element();
33 }

References moab::ElementSequence::nodes_per_element().


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