MOAB: Mesh Oriented datABase  (version 5.4.1)
TestExtraData Class Reference
+ Inheritance diagram for TestExtraData:
+ Collaboration diagram for TestExtraData:

Public Types

enum  EventType { NONE = 0, DESTROYED, NEW, SUB }

Public Member Functions

 TestExtraData (PatchData &patch)
void clear ()
EventType get_last_event () const
PatchDataget_sub_patch_ptr () const
virtual void notify_patch_destroyed ()
 Notify that the owning PatchData is being destroyed.
virtual void notify_new_patch ()
 Notify that the patch (mesh) in the PatchData is changing.
virtual void notify_sub_patch (PatchData &sub_patch, const size_t *vertex_map, const size_t *element_map, MsqError &err)
 Nofity that a subpatch is being created from this patch.

Public Attributes

std::vector< size_t > vertexMap
std::vector< size_t > elementMap

Private Attributes

EventType lastEvent
PatchDatasubPatchPtr

Detailed Description

Definition at line 67 of file ExtraDataTest.cpp.


Member Enumeration Documentation

Enumerator:
NONE 
DESTROYED 
NEW 
SUB 

Definition at line 70 of file ExtraDataTest.cpp.

    {
        NONE = 0,
        DESTROYED,
        NEW,
        SUB
    };

Constructor & Destructor Documentation

TestExtraData::TestExtraData ( PatchData patch) [inline]

Definition at line 83 of file ExtraDataTest.cpp.

                                      : ExtraData( patch )
    {
        clear();
    }

Member Function Documentation

void TestExtraData::clear ( ) [inline]

Definition at line 88 of file ExtraDataTest.cpp.

References MBMesquite::NONE.

Referenced by ExtraDataTest::test_notify_new_patch_fill().

    {
        lastEvent   = NONE;
        subPatchPtr = 0;
    }

Definition at line 97 of file ExtraDataTest.cpp.

Referenced by ExtraDataTest::test_notify_subpatch().

    {
        return subPatchPtr;
    }
void TestExtraData::notify_new_patch ( ) [virtual]

Notify that the patch (mesh) in the PatchData is changing.

Notify attached ExtraData that the PatchData is being changed to contain an new patch (set of mesh entities.)

Implements MBMesquite::ExtraData.

Definition at line 116 of file ExtraDataTest.cpp.

{
    lastEvent = NEW;
}

Notify that the owning PatchData is being destroyed.

Notify an ExtraData object that the patch it is attached to is being destroyed. The ExtraData will have been removed from the PatchData before being notified. Therefore this->get_patch_data() will return NULL.

ExtraData instances will also be notified via this method and removed and removed from the PatchData if the attached MBMesquite::Mesh or MBMesquite::MeshDomain instance is changed.

Implements MBMesquite::ExtraData.

Definition at line 112 of file ExtraDataTest.cpp.

void TestExtraData::notify_sub_patch ( PatchData sub_patch,
const size_t *  vertex_index_map,
const size_t *  element_index_map,
MsqError err 
) [virtual]

Nofity that a subpatch is being created from this patch.

Parameters:
sub_patchThe new, populated subpatch
vertex_index_mapThe indices in the original patch for each vertex in the subpatch.
element_index_mapThe indices in the original patch for each element in the subpatch.

Implements MBMesquite::ExtraData.

Definition at line 120 of file ExtraDataTest.cpp.

References MBMesquite::PatchData::num_elements(), and MBMesquite::PatchData::num_nodes().

{
    lastEvent   = SUB;
    subPatchPtr = &p;
    vertexMap.resize( p.num_nodes() );
    elementMap.resize( p.num_elements() );
    std::copy( vertex_map, vertex_map + p.num_nodes(), vertexMap.begin() );
    std::copy( element_map, element_map + p.num_elements(), elementMap.begin() );
}

Member Data Documentation

std::vector< size_t > TestExtraData::elementMap

Definition at line 109 of file ExtraDataTest.cpp.

Referenced by ExtraDataTest::test_notify_subpatch().

Definition at line 79 of file ExtraDataTest.cpp.

Definition at line 80 of file ExtraDataTest.cpp.

std::vector< size_t > TestExtraData::vertexMap

Definition at line 109 of file ExtraDataTest.cpp.

Referenced by ExtraDataTest::test_notify_subpatch().

List of all members.


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