Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
moab::EntitySequence Class Reference

#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.
virtual int values_per_entity () const
 Integer value used in finding appropriate SequenceData.
virtual EntitySequencesplit (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 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.
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)
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

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.

{}

Member Function Documentation

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.

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]

Definition at line 63 of file EntitySequence.hpp.

References sequenceData.

    {
        sequenceData = ptr;
    }
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::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.

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

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

Definition at line 71 of file EntitySequence.cpp.

{
    return 0;
}

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;
}

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;
}

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;
}

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

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

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;
    }
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;
}

Member Data Documentation

Definition at line 16 of file EntitySequence.hpp.

Referenced by data(), and merge().

List of all members.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines