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

#include <ScdVertexData.hpp>

+ Inheritance diagram for moab::ScdVertexData:
+ Collaboration diagram for moab::ScdVertexData:

Public Member Functions

 ScdVertexData (const EntityHandle start_vertex, const int imin, const int jmin, const int kmin, const int imax, const int jmax, const int kmax)
 constructor
virtual ~ScdVertexData ()
EntityHandle get_vertex (const int i, const int j, const int k) const
 get handle of vertex at i, j, k
EntityHandle get_vertex (const HomCoord &coords) const
 get handle of vertex at homogeneous coordinates
ErrorCode get_params (const EntityHandle vhandle, int &i, int &j, int &k) const
 get the parameters of a given handle; return MB_FAILURE if vhandle not in this sequence
void min_params (int &i, int &j, int &k) const
 get min params for this vertex
void max_params (int &i, int &j, int &k) const
 get max params for this vertex
const HomCoordmin_params () const
 get the min params
const HomCoordmax_params () const
 get the max params
void param_extents (int &di, int &dj, int &dk) const
 get the number of vertices in each direction, inclusive
int i_min () const
 convenience functions for parameter extents
int j_min () const
int k_min () const
int i_max () const
int j_max () const
int k_max () const
bool contains (const HomCoord &coords) const
 return whether this vseq's parameter space contains these parameters
bool contains (const int i, const int j, const int k) const
SequenceDatasubset (EntityHandle start, EntityHandle end, const int *sequence_data_sizes, const int *tag_data_sizes) const

Private Attributes

HomCoord vertexParams [3]
 parameter min/max, in homogeneous coords ijkh (extra row for stride eventually)
int dIJK [3]
 difference between max and min params plus one (i.e. # VERTICES in each parametric direction)
int dIJKm1 [3]
 difference between max and min params (i.e. # VERTEXS in each parametric direction)

Detailed Description

Definition at line 33 of file ScdVertexData.hpp.


Constructor & Destructor Documentation

moab::ScdVertexData::ScdVertexData ( const EntityHandle  start_vertex,
const int  imin,
const int  jmin,
const int  kmin,
const int  imax,
const int  jmax,
const int  kmax 
)

constructor

Definition at line 23 of file ScdVertexData.cpp.

References moab::SequenceData::create_sequence_data(), dIJK, dIJKm1, and vertexParams.

    : SequenceData( 3,
                    start_vertex,
                    start_vertex + ( imax - imin + 1 ) * ( jmax - jmin + 1 ) * ( kmax - kmin + 1 ) - 1 )
{
    // need to have meaningful parameters
    assert( imax >= imin && jmax >= jmin && kmax >= kmin );

    vertexParams[0] = HomCoord( imin, jmin, kmin );
    vertexParams[1] = HomCoord( imax, jmax, kmax );
    vertexParams[2] = HomCoord( 1, 1, 1 );

    dIJK[0]   = imax - imin + 1;
    dIJK[1]   = jmax - jmin + 1;
    dIJK[2]   = kmax - kmin + 1;
    dIJKm1[0] = dIJK[0] - 1;
    dIJKm1[1] = dIJK[1] - 1;
    dIJKm1[2] = dIJK[2] - 1;

    create_sequence_data( 0, sizeof( double ) );
    create_sequence_data( 1, sizeof( double ) );
    create_sequence_data( 2, sizeof( double ) );
}
virtual moab::ScdVertexData::~ScdVertexData ( ) [inline, virtual]

Definition at line 58 of file ScdVertexData.hpp.

{}

Member Function Documentation

bool moab::ScdVertexData::contains ( const HomCoord coords) const [inline]

return whether this vseq's parameter space contains these parameters

Definition at line 185 of file ScdVertexData.hpp.

References vertexParams.

Referenced by contains().

{
    return ( coords >= vertexParams[0] && coords <= vertexParams[1] ) ? true : false;
}
bool moab::ScdVertexData::contains ( const int  i,
const int  j,
const int  k 
) const [inline]

Definition at line 190 of file ScdVertexData.hpp.

References contains().

{
    return contains( HomCoord( i, j, k ) );
}
ErrorCode moab::ScdVertexData::get_params ( const EntityHandle  vhandle,
int &  i,
int &  j,
int &  k 
) const [inline]

get the parameters of a given handle; return MB_FAILURE if vhandle not in this sequence

Definition at line 131 of file ScdVertexData.hpp.

References dIJK, moab::HomCoord::i(), i_max(), i_min(), moab::HomCoord::j(), j_max(), j_min(), moab::HomCoord::k(), k_max(), k_min(), MB_SUCCESS, MBVERTEX, moab::SequenceData::start_handle(), moab::TYPE_FROM_HANDLE(), and vertexParams.

Referenced by moab::ScdBox::get_params().

{
    if( TYPE_FROM_HANDLE( vhandle ) != MBVERTEX ) return MB_FAILURE;

    int hdiff = vhandle - start_handle();

    k = hdiff / ( dIJK[0] * dIJK[1] );
    j = ( hdiff - ( k * dIJK[0] * dIJK[1] ) ) / dIJK[0];
    i = hdiff % dIJK[0];

    k += vertexParams[0].k();
    j += vertexParams[0].j();
    i += vertexParams[0].i();

    return ( vhandle >= start_handle() && i >= i_min() && i <= i_max() && j >= j_min() && j <= j_max() &&
             k >= k_min() && k <= k_max() )
               ? MB_SUCCESS
               : MB_FAILURE;
}
EntityHandle moab::ScdVertexData::get_vertex ( const int  i,
const int  j,
const int  k 
) const [inline]

get handle of vertex at i, j, k

Definition at line 121 of file ScdVertexData.hpp.

References dIJK, i_min(), j_min(), k_min(), and moab::SequenceData::start_handle().

Referenced by get_vertex().

{
    return start_handle() + ( i - i_min() ) + ( j - j_min() ) * dIJK[0] + ( k - k_min() ) * dIJK[0] * dIJK[1];
}
EntityHandle moab::ScdVertexData::get_vertex ( const HomCoord coords) const [inline]

get handle of vertex at homogeneous coordinates

Definition at line 126 of file ScdVertexData.hpp.

References get_vertex(), and moab::HomCoord::hom_coord().

{
    return get_vertex( coords.hom_coord()[0], coords.hom_coord()[1], coords.hom_coord()[2] );
}
int moab::ScdVertexData::i_max ( ) const [inline]

Definition at line 98 of file ScdVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), and max_params().

    {
        return vertexParams[1].hom_coord()[0];
    }
int moab::ScdVertexData::i_min ( ) const [inline]

convenience functions for parameter extents

Definition at line 86 of file ScdVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), get_vertex(), and min_params().

    {
        return vertexParams[0].hom_coord()[0];
    }
int moab::ScdVertexData::j_max ( ) const [inline]

Definition at line 102 of file ScdVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), and max_params().

    {
        return vertexParams[1].hom_coord()[1];
    }
int moab::ScdVertexData::j_min ( ) const [inline]

Definition at line 90 of file ScdVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), get_vertex(), and min_params().

    {
        return vertexParams[0].hom_coord()[1];
    }
int moab::ScdVertexData::k_max ( ) const [inline]

Definition at line 106 of file ScdVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), and max_params().

    {
        return vertexParams[1].hom_coord()[2];
    }
int moab::ScdVertexData::k_min ( ) const [inline]

Definition at line 94 of file ScdVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), get_vertex(), and min_params().

    {
        return vertexParams[0].hom_coord()[2];
    }
void moab::ScdVertexData::max_params ( int &  i,
int &  j,
int &  k 
) const [inline]

get max params for this vertex

Definition at line 160 of file ScdVertexData.hpp.

References i_max(), j_max(), and k_max().

Referenced by moab::ScdElementData::add_vsequence(), and moab::ScdBox::ScdBox().

{
    i = i_max();
    j = j_max();
    k = k_max();
}
const HomCoord & moab::ScdVertexData::max_params ( ) const [inline]

get the max params

Definition at line 172 of file ScdVertexData.hpp.

References vertexParams.

{
    return vertexParams[1];
}
void moab::ScdVertexData::min_params ( int &  i,
int &  j,
int &  k 
) const [inline]

get min params for this vertex

Definition at line 152 of file ScdVertexData.hpp.

References i_min(), j_min(), and k_min().

Referenced by moab::ScdElementData::add_vsequence(), and moab::ScdBox::ScdBox().

{
    i = i_min();
    j = j_min();
    k = k_min();
}
const HomCoord & moab::ScdVertexData::min_params ( ) const [inline]

get the min params

Definition at line 167 of file ScdVertexData.hpp.

References vertexParams.

{
    return vertexParams[0];
}
void moab::ScdVertexData::param_extents ( int &  di,
int &  dj,
int &  dk 
) const [inline]

get the number of vertices in each direction, inclusive

Definition at line 178 of file ScdVertexData.hpp.

References dIJK.

{
    di = dIJK[0];
    dj = dIJK[1];
    dk = dIJK[2];
}
SequenceData * moab::ScdVertexData::subset ( EntityHandle  start,
EntityHandle  end,
const int *  sequence_data_sizes,
const int *  tag_data_sizes 
) const

Definition at line 53 of file ScdVertexData.cpp.

{
    return 0;
}

Member Data Documentation

int moab::ScdVertexData::dIJK[3] [private]

difference between max and min params plus one (i.e. # VERTICES in each parametric direction)

Definition at line 42 of file ScdVertexData.hpp.

Referenced by get_params(), get_vertex(), param_extents(), and ScdVertexData().

int moab::ScdVertexData::dIJKm1[3] [private]

difference between max and min params (i.e. # VERTEXS in each parametric direction)

Definition at line 46 of file ScdVertexData.hpp.

Referenced by ScdVertexData().

parameter min/max, in homogeneous coords ijkh (extra row for stride eventually)

Definition at line 38 of file ScdVertexData.hpp.

Referenced by contains(), get_params(), i_max(), i_min(), j_max(), j_min(), k_max(), k_min(), max_params(), min_params(), and ScdVertexData().

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