Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
moab::AdjSides< CORNERS > Class Template Reference
+ Collaboration diagram for moab::AdjSides< CORNERS >:

Classes

struct  Side

Public Types

typedef std::vector< Side >
::iterator 
iterator
typedef std::vector< Side >
::const_iterator 
const_iterator

Public Member Functions

const_iterator begin () const
const_iterator end () const
void clear ()
bool empty () const
 AdjSides ()
size_t num_skin () const
void insert (const EntityHandle *handles, int skip_idx, EntityHandle adj_elem, unsigned short elem_side)
 insert side, specifying side connectivity
void insert (const EntityHandle *handles, int skip_idx, EntityHandle adj_elem, unsigned short elem_side, const short *indices)
 insert side, specifying list of indices into parent element connectivity.
bool find_and_unmark (const EntityHandle *other, int skip_index, EntityHandle &elem_out)
 Search list for a given side, and if found, mark as not skin.

Private Attributes

std::vector< Sidedata
 List of sides.
size_t skin_count
 Cached count of sides that are skin.

Detailed Description

template<unsigned CORNERS>
class moab::AdjSides< CORNERS >

Definition at line 1144 of file Skinner.cpp.


Member Typedef Documentation

template<unsigned CORNERS>
typedef std::vector< Side >::const_iterator moab::AdjSides< CORNERS >::const_iterator

Definition at line 1252 of file Skinner.cpp.

template<unsigned CORNERS>
typedef std::vector< Side >::iterator moab::AdjSides< CORNERS >::iterator

Definition at line 1251 of file Skinner.cpp.


Constructor & Destructor Documentation

template<unsigned CORNERS>
moab::AdjSides< CORNERS >::AdjSides ( ) [inline]

Definition at line 1272 of file Skinner.cpp.

: skin_count( 0 ) {}

Member Function Documentation

template<unsigned CORNERS>
const_iterator moab::AdjSides< CORNERS >::begin ( ) const [inline]

Definition at line 1253 of file Skinner.cpp.

References moab::AdjSides< CORNERS >::data.

Referenced by moab::Skinner::find_skin_vertices_2D(), and moab::Skinner::find_skin_vertices_3D().

    {
        return data.begin();
    }
template<unsigned CORNERS>
void moab::AdjSides< CORNERS >::clear ( ) [inline]
template<unsigned CORNERS>
bool moab::AdjSides< CORNERS >::empty ( ) const [inline]

Definition at line 1267 of file Skinner.cpp.

References moab::AdjSides< CORNERS >::data.

    {
        return data.empty();
    }
template<unsigned CORNERS>
const_iterator moab::AdjSides< CORNERS >::end ( ) const [inline]

Definition at line 1257 of file Skinner.cpp.

References moab::AdjSides< CORNERS >::data.

Referenced by moab::Skinner::find_skin_vertices_2D(), and moab::Skinner::find_skin_vertices_3D().

    {
        return data.end();
    }
template<unsigned CORNERS>
bool moab::AdjSides< CORNERS >::find_and_unmark ( const EntityHandle other,
int  skip_index,
EntityHandle elem_out 
) [inline]

Search list for a given side, and if found, mark as not skin.

Parameters:
otherConnectivity of side
skip_indexIndex in 'other' at which implicit vertex occurs.
elem_outIf return value is true, the element that the side is a side of. If return value is false, not set.
Returns:
true if found and marked not-skin, false if not found.

Given the connectivity of some existing element, check if it occurs in the list. If it does, clear the "is skin" state of the side so that we know that we don't need to later create the side element.

Definition at line 1355 of file Skinner.cpp.

References moab::AdjSides< CORNERS >::data, and moab::AdjSides< CORNERS >::skin_count.

Referenced by moab::Skinner::find_skin_vertices_2D(), and moab::Skinner::find_skin_vertices_3D().

    {
        Side s( other, skip_index, 0, 0 );
        iterator p = std::find( data.begin(), data.end(), s );
        if( p == data.end() || !p->adj_elem )
            return false;
        else
        {
            elem_out    = p->adj_elem;
            p->adj_elem = 0;  // clear "is skin" state for side
            --skin_count;     // decrement cached count of skin sides
            return true;
        }
    }
template<unsigned CORNERS>
void moab::AdjSides< CORNERS >::insert ( const EntityHandle handles,
int  skip_idx,
EntityHandle  adj_elem,
unsigned short  elem_side 
) [inline]

insert side, specifying side connectivity

Either insert a new side, or if the side is already in the list, mark it as not on the skin.

Parameters:
handlesThe connectivity of the element side.
skip_idxThe index of the implicit vertex (contained in all sides in the list.)
adj_elemThe element that this is a side of.
elem_sideWhich side of adj_elem are we storing (CN side number.)

Definition at line 1291 of file Skinner.cpp.

References moab::AdjSides< CORNERS >::data, and moab::AdjSides< CORNERS >::skin_count.

Referenced by moab::Skinner::find_skin_vertices_2D(), and moab::Skinner::find_skin_vertices_3D().

    {
        Side side( handles, skip_idx, adj_elem, elem_side );
        iterator p = std::find( data.begin(), data.end(), side );
        if( p == data.end() )
        {
            data.push_back( side );
            ++skin_count;  // not in list yet, so skin side (so far)
        }
        else if( p->adj_elem )
        {
            p->adj_elem = 0;  // mark as not on skin
            --skin_count;     // decrement cached count of skin elements
        }
    }
template<unsigned CORNERS>
void moab::AdjSides< CORNERS >::insert ( const EntityHandle handles,
int  skip_idx,
EntityHandle  adj_elem,
unsigned short  elem_side,
const short *  indices 
) [inline]

insert side, specifying list of indices into parent element connectivity.

Either insert a new side, or if the side is already in the list, mark it as not on the skin.

Parameters:
handlesThe connectivity of the parent element
skip_idxThe index of the implicit vertex (contained in all sides in the list.) This is an index into 'indices', not 'handles'.
adj_elemThe element that this is a side of (parent handle).
indicesThe indices into 'handles' at which the vertices representing the side occur.
elem_sideWhich side of adj_elem are we storing (CN side number.)

Definition at line 1323 of file Skinner.cpp.

References moab::AdjSides< CORNERS >::data, and moab::AdjSides< CORNERS >::skin_count.

    {
        Side side( handles, skip_idx, adj_elem, elem_side, indices );
        iterator p = std::find( data.begin(), data.end(), side );
        if( p == data.end() )
        {
            data.push_back( side );
            ++skin_count;  // not in list yet, so skin side (so far)
        }
        else if( p->adj_elem )
        {
            p->adj_elem = 0;  // mark as not on skin
            --skin_count;     // decrement cached count of skin elements
        }
    }
template<unsigned CORNERS>
size_t moab::AdjSides< CORNERS >::num_skin ( ) const [inline]

Member Data Documentation

template<unsigned CORNERS>
size_t moab::AdjSides< CORNERS >::skin_count [private]

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