Mesh Oriented datABase  (version 5.5.0)
An array-based unstructured mesh library
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 More...
 
virtual ~ScdVertexData ()
 
EntityHandle get_vertex (const int i, const int j, const int k) const
 get handle of vertex at i, j, k More...
 
EntityHandle get_vertex (const HomCoord &coords) const
 get handle of vertex at homogeneous coordinates More...
 
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 More...
 
void min_params (int &i, int &j, int &k) const
 get min params for this vertex More...
 
void max_params (int &i, int &j, int &k) const
 get max params for this vertex More...
 
const HomCoordmin_params () const
 get the min params More...
 
const HomCoordmax_params () const
 get the max params More...
 
void param_extents (int &di, int &dj, int &dk) const
 get the number of vertices in each direction, inclusive More...
 
int i_min () const
 convenience functions for parameter extents More...
 
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 More...
 
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
 
- Public Member Functions inherited from moab::SequenceData
 SequenceData (int num_sequence_arrays, EntityHandle start, EntityHandle end)
 
virtual ~SequenceData ()
 
EntityHandle start_handle () const
 
EntityHandle end_handle () const
 
EntityID size () const
 
void * get_sequence_data (int array_num)
 
void const * get_sequence_data (int array_num) const
 
AdjacencyDataTypeget_adjacency_data ()
 
AdjacencyDataType const * get_adjacency_data () const
 
void * get_tag_data (unsigned tag_num)
 
void const * get_tag_data (unsigned tag_num) const
 
void * create_sequence_data (int array_num, int bytes_per_ent, const void *initial_val=0)
 Allocate array of sequence-specific data. More...
 
void * create_custom_data (int array_num, size_t total_bytes)
 Allocate array of sequence-specific data. More...
 
AdjacencyDataTypeallocate_adjacency_data ()
 Allocate array for storing adjacency data. More...
 
void * allocate_tag_array (int index, int bytes_per_ent, const void *default_value=0)
 Allocate array of dense tag data. More...
 
SequenceDatasubset (EntityHandle start, EntityHandle end, const int *sequence_data_sizes) const
 Create new SequenceData that is a copy of a subset of this one. More...
 
void move_tag_data (SequenceData *destination, const int *tag_sizes, int num_tag_sizes)
 Move tag data for a subset of this sequences to specified sequence. More...
 
void release_tag_data (const int *tag_sizes, int num_tag_sizes)
 Free all tag data arrays. More...
 
void release_tag_data (int index, int tag_size)
 Free specified tag data array. More...
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from moab::SequenceData
typedef std::vector< EntityHandle > * AdjacencyDataType
 
- Public Attributes inherited from moab::SequenceData
TypeSequenceManager::SequenceDataPtr seqManData
 SequenceManager data. More...
 
- Protected Member Functions inherited from moab::SequenceData
 SequenceData (const SequenceData *subset_from, EntityHandle start, EntityHandle end, const int *sequence_data_sizes)
 

Detailed Description

Definition at line 33 of file ScdVertexData.hpp.

Constructor & Destructor Documentation

◆ ScdVertexData()

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.

30  : SequenceData( 3,
31  start_vertex,
32  start_vertex + ( imax - imin + 1 ) * ( jmax - jmin + 1 ) * ( kmax - kmin + 1 ) - 1 )
33 {
34  // need to have meaningful parameters
35  assert( imax >= imin && jmax >= jmin && kmax >= kmin );
36 
37  vertexParams[0] = HomCoord( imin, jmin, kmin );
38  vertexParams[1] = HomCoord( imax, jmax, kmax );
39  vertexParams[2] = HomCoord( 1, 1, 1 );
40 
41  dIJK[0] = imax - imin + 1;
42  dIJK[1] = jmax - jmin + 1;
43  dIJK[2] = kmax - kmin + 1;
44  dIJKm1[0] = dIJK[0] - 1;
45  dIJKm1[1] = dIJK[1] - 1;
46  dIJKm1[2] = dIJK[2] - 1;
47 
48  create_sequence_data( 0, sizeof( double ) );
49  create_sequence_data( 1, sizeof( double ) );
50  create_sequence_data( 2, sizeof( double ) );
51 }

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

◆ ~ScdVertexData()

virtual moab::ScdVertexData::~ScdVertexData ( )
inlinevirtual

Definition at line 58 of file ScdVertexData.hpp.

58 {}

Member Function Documentation

◆ contains() [1/2]

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.

186 {
187  return ( coords >= vertexParams[0] && coords <= vertexParams[1] ) ? true : false;
188 }

References vertexParams.

Referenced by contains().

◆ contains() [2/2]

bool moab::ScdVertexData::contains ( const int  i,
const int  j,
const int  k 
) const
inline

Definition at line 190 of file ScdVertexData.hpp.

191 {
192  return contains( HomCoord( i, j, k ) );
193 }

References contains().

◆ get_params()

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.

132 {
133  if( TYPE_FROM_HANDLE( vhandle ) != MBVERTEX ) return MB_FAILURE;
134 
135  int hdiff = vhandle - start_handle();
136 
137  k = hdiff / ( dIJK[0] * dIJK[1] );
138  j = ( hdiff - ( k * dIJK[0] * dIJK[1] ) ) / dIJK[0];
139  i = hdiff % dIJK[0];
140 
141  k += vertexParams[0].k();
142  j += vertexParams[0].j();
143  i += vertexParams[0].i();
144 
145  return ( vhandle >= start_handle() && i >= i_min() && i <= i_max() && j >= j_min() && j <= j_max() &&
146  k >= k_min() && k <= k_max() )
147  ? MB_SUCCESS
148  : MB_FAILURE;
149 }

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().

◆ get_vertex() [1/2]

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.

127 {
128  return get_vertex( coords.hom_coord()[0], coords.hom_coord()[1], coords.hom_coord()[2] );
129 }

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

◆ get_vertex() [2/2]

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.

122 {
123  return start_handle() + ( i - i_min() ) + ( j - j_min() ) * dIJK[0] + ( k - k_min() ) * dIJK[0] * dIJK[1];
124 }

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

Referenced by get_vertex().

◆ i_max()

int moab::ScdVertexData::i_max ( ) const
inline

Definition at line 98 of file ScdVertexData.hpp.

99  {
100  return vertexParams[1].hom_coord()[0];
101  }

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

Referenced by get_params(), and max_params().

◆ i_min()

int moab::ScdVertexData::i_min ( ) const
inline

convenience functions for parameter extents

Definition at line 86 of file ScdVertexData.hpp.

87  {
88  return vertexParams[0].hom_coord()[0];
89  }

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

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

◆ j_max()

int moab::ScdVertexData::j_max ( ) const
inline

Definition at line 102 of file ScdVertexData.hpp.

103  {
104  return vertexParams[1].hom_coord()[1];
105  }

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

Referenced by get_params(), and max_params().

◆ j_min()

int moab::ScdVertexData::j_min ( ) const
inline

Definition at line 90 of file ScdVertexData.hpp.

91  {
92  return vertexParams[0].hom_coord()[1];
93  }

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

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

◆ k_max()

int moab::ScdVertexData::k_max ( ) const
inline

Definition at line 106 of file ScdVertexData.hpp.

107  {
108  return vertexParams[1].hom_coord()[2];
109  }

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

Referenced by get_params(), and max_params().

◆ k_min()

int moab::ScdVertexData::k_min ( ) const
inline

Definition at line 94 of file ScdVertexData.hpp.

95  {
96  return vertexParams[0].hom_coord()[2];
97  }

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

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

◆ max_params() [1/2]

const HomCoord & moab::ScdVertexData::max_params ( ) const
inline

get the max params

Definition at line 172 of file ScdVertexData.hpp.

173 {
174  return vertexParams[1];
175 }

References vertexParams.

◆ max_params() [2/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.

161 {
162  i = i_max();
163  j = j_max();
164  k = k_max();
165 }

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

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

◆ min_params() [1/2]

const HomCoord & moab::ScdVertexData::min_params ( ) const
inline

get the min params

Definition at line 167 of file ScdVertexData.hpp.

168 {
169  return vertexParams[0];
170 }

References vertexParams.

◆ min_params() [2/2]

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.

153 {
154  i = i_min();
155  j = j_min();
156  k = k_min();
157 }

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

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

◆ param_extents()

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.

179 {
180  di = dIJK[0];
181  dj = dIJK[1];
182  dk = dIJK[2];
183 }

References dIJK.

◆ subset()

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.

57 {
58  return 0;
59 }

Member Data Documentation

◆ dIJK

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().

◆ dIJKm1

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().

◆ vertexParams

HomCoord moab::ScdVertexData::vertexParams[3]
private

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().


The documentation for this class was generated from the following files: