moab
|
#include <UnstructuredElemSeq.hpp>
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. | |
virtual EntitySequence * | split (EntityHandle here) |
Split this sequence into two consecutive sequences. | |
SequenceData * | create_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. | |
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) |
EntityHandle * | get_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. | |
Protected Member Functions | |
EntityHandle const * | get_array () const |
EntityHandle * | get_array () |
UnstructuredElemSeq (UnstructuredElemSeq &split_from, EntityHandle here) |
Definition at line 9 of file UnstructuredElemSeq.hpp.
moab::UnstructuredElemSeq::UnstructuredElemSeq | ( | EntityHandle | start_handle, |
EntityID | entity_count, | ||
unsigned | nodes_per_entity, | ||
SequenceData * | data | ||
) |
Definition at line 7 of file UnstructuredElemSeq.cpp.
: ElementSequence( shandle, entity_count, nodes_per_entity, dat ) {}
moab::UnstructuredElemSeq::UnstructuredElemSeq | ( | EntityHandle | start_handle, |
EntityID | entity_count, | ||
unsigned | nodes_per_entity, | ||
EntityID | sequence_data_size | ||
) |
Definition at line 15 of file UnstructuredElemSeq.cpp.
: ElementSequence( shandle, entity_count, nodes_per_entity, new SequenceData( 1, shandle, shandle + data_size - 1)) { data()->create_sequence_data( 0, nodes_per_entity * sizeof(EntityHandle) ); }
moab::UnstructuredElemSeq::~UnstructuredElemSeq | ( | ) | [virtual] |
Definition at line 26 of file UnstructuredElemSeq.cpp.
{}
moab::UnstructuredElemSeq::UnstructuredElemSeq | ( | UnstructuredElemSeq & | split_from, |
EntityHandle | here | ||
) | [inline, protected] |
Definition at line 68 of file UnstructuredElemSeq.hpp.
: ElementSequence( split_from, here ) {}
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 45 of file UnstructuredElemSeq.cpp.
{ int esize = nodes_per_element() * sizeof(EntityHandle); return data()->subset(start, end, &esize ); }
EntityHandle const* moab::UnstructuredElemSeq::get_array | ( | ) | const [inline, protected] |
Definition at line 56 of file UnstructuredElemSeq.hpp.
{ return reinterpret_cast<EntityHandle const*>(data()->get_sequence_data(0)) + nodes_per_element() * (start_handle() - data()->start_handle()); }
EntityHandle* moab::UnstructuredElemSeq::get_array | ( | ) | [inline, protected] |
Definition at line 62 of file UnstructuredElemSeq.hpp.
{ return reinterpret_cast<EntityHandle*>(data()->get_sequence_data(0)) + nodes_per_element() * (start_handle() - data()->start_handle()); }
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 61 of file UnstructuredElemSeq.cpp.
{ EntityHandle const* conn = get_array() + nodes_per_element() * (handle - start_handle()); int len = topological ? CN::VerticesPerEntity(type()) : nodes_per_element(); connect.reserve( connect.size() + len ); std::copy( conn, conn+len, std::back_inserter( connect ) ); return MB_SUCCESS; }
ErrorCode moab::UnstructuredElemSeq::get_connectivity | ( | EntityHandle | handle, |
EntityHandle const *& | connect, | ||
int & | connect_length, | ||
bool | topological = false , |
||
std::vector< EntityHandle > * | storage = 0 |
||
) | const [virtual] |
Implements moab::ElementSequence.
Reimplemented in moab::PolyElementSeq.
Definition at line 74 of file UnstructuredElemSeq.cpp.
{ conn_ptr = get_array() + nodes_per_element() * (handle - start_handle()); len = topological ? CN::VerticesPerEntity(type()) : nodes_per_element(); return MB_SUCCESS; }
EntityHandle * moab::UnstructuredElemSeq::get_connectivity_array | ( | ) | [virtual] |
Implements moab::ElementSequence.
Definition at line 99 of file UnstructuredElemSeq.cpp.
{ return get_array(); }
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.
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 |
Implements moab::EntitySequence.
Definition at line 53 of file UnstructuredElemSeq.cpp.
{ bytes_per_entity = nodes_per_element() * sizeof(EntityHandle); size_of_sequence = sizeof(this); }
Definition at line 102 of file UnstructuredElemSeq.cpp.
{ return EntitySequence::append_entities(count); }
Definition at line 105 of file UnstructuredElemSeq.cpp.
{ return EntitySequence::prepend_entities(count); }
ErrorCode moab::UnstructuredElemSeq::set_connectivity | ( | EntityHandle | handle, |
EntityHandle const * | connect, | ||
int | connect_length | ||
) | [virtual] |
Implements moab::ElementSequence.
Definition at line 87 of file UnstructuredElemSeq.cpp.
{ if ((unsigned)connect_length != nodes_per_element()) return MB_INDEX_OUT_OF_RANGE; EntityHandle* conn_ptr = get_array() + nodes_per_element() * (handle - start_handle()); std::copy( connect, connect+connect_length, conn_ptr ); return MB_SUCCESS; }
EntitySequence * moab::UnstructuredElemSeq::split | ( | EntityHandle | here | ) | [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()] |
Implements moab::EntitySequence.
Reimplemented in moab::PolyElementSeq.
Definition at line 35 of file UnstructuredElemSeq.cpp.
{ if (here <= start_handle() || here > end_handle()) return 0; return new UnstructuredElemSeq( *this, here ); }
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.
{ return nodes_per_element(); }