Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
moab::StructuredElementSeq Class Reference

#include <StructuredElementSeq.hpp>

+ Inheritance diagram for moab::StructuredElementSeq:
+ Collaboration diagram for moab::StructuredElementSeq:

Public Member Functions

 StructuredElementSeq (EntityHandle start_handle, const int imin, const int jmin, const int kmin, const int imax, const int jmax, const int kmax, int *is_periodic=NULL)
 constructor More...
 
virtual ~StructuredElementSeq ()
 
ScdElementDatasdata ()
 
ScdElementData const * sdata () const
 
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 coords More...
 
EntityHandle get_element (const int i, const int j, const int k) const
 get handle of element at i, j, k More...
 
EntityHandle get_element (const HomCoord &coords) const
 get handle of element at homogeneous coords More...
 
const HomCoordmin_params () const
 get min params for this element More...
 
void min_params (HomCoord &coords) const
 
void min_params (int &i, int &j, int &k) const
 
const HomCoordmax_params () const
 get max params for this element More...
 
void max_params (HomCoord &coords) const
 
void max_params (int &i, int &j, int &k) const
 
void param_extents (int &di, int &dj, int &dk) const
 get the number of vertices in each direction, inclusive More...
 
ErrorCode get_params (const EntityHandle ehandle, int &i, int &j, int &k) const
 given a handle, get the corresponding parameters 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 boundary_complete () const
 test the bounding vertex sequences and determine whether they fully define the vertices covering this element block's parameter space More...
 
bool contains (const int i, const int j, const int k) const
 test whether this sequence contains these parameters More...
 
bool contains (const HomCoord &coords) const
 
ErrorCode get_params_connectivity (const int i, const int j, const int k, std::vector< EntityHandle > &connectivity) const
 get connectivity of an entity given entity's parameters More...
 
int is_periodic_i () const
 Return whether box is periodic in i. More...
 
int is_periodic_j () const
 Return whether box is periodic in j. More...
 
void is_periodic (int is_periodic_ij[2]) const
 Return whether box is periodic in i and j. More...
 
virtual ErrorCode get_connectivity (EntityHandle handle, std::vector< EntityHandle > &connect, bool topological=false) const
 
virtual ErrorCode get_connectivity (EntityHandle handle, EntityHandle const *&connect, int &connect_length, bool topological=false, std::vector< EntityHandle > *storage=0) const
 
virtual ErrorCode set_connectivity (EntityHandle handle, EntityHandle const *connect, int connect_length)
 
virtual EntityHandleget_connectivity_array ()
 
virtual int values_per_entity () const
 Integer value used in finding appropriate SequenceData. More...
 
virtual EntitySequencesplit (EntityHandle here)
 Split this sequence into two consecutive sequences. More...
 
virtual SequenceDatacreate_data_subset (EntityHandle start_handle, EntityHandle end_handle) const
 Create a new SequenceData that is a copy of a subset of the one referenced by this sequence. More...
 
virtual void get_const_memory_use (unsigned long &bytes_per_entity, unsigned long &size_of_sequence) const
 Get memory characteristcs that are the same for all entities. More...
 
- Public Member Functions inherited from moab::ElementSequence
 ElementSequence (EntityHandle start, EntityID count, unsigned int nodes_per_elem, SequenceData *dat)
 
virtual ~ElementSequence ()
 
unsigned int nodes_per_element () const
 
EntityHandle const * get_connectivity_array () const
 
bool has_mid_edge_nodes () const
 
bool has_mid_face_nodes () const
 
bool has_mid_volume_nodes () const
 
- Public Member Functions inherited from moab::EntitySequence
 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. More...
 
virtual ErrorCode merge (EntitySequence &other)
 Merge this sequence with another. More...
 
virtual ErrorCode pop_back (EntityID count)
 Erase entities in range: (end_handle()-count, end_handle()]. More...
 
virtual ErrorCode pop_front (EntityID count)
 Erase entities in range: [start_handle(), start_handle()+count) More...
 
virtual unsigned long get_per_entity_memory_use (EntityHandle first, EntityHandle last) const
 Get portion of memory use that varies per entity. More...
 

Protected Member Functions

 StructuredElementSeq (StructuredElementSeq &split_from, EntityHandle here)
 
- Protected Member Functions inherited from moab::ElementSequence
 ElementSequence (ElementSequence &split_from, EntityHandle here)
 
- Protected Member Functions inherited from moab::EntitySequence
 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)
 

Detailed Description

Definition at line 36 of file StructuredElementSeq.hpp.

Constructor & Destructor Documentation

◆ StructuredElementSeq() [1/2]

moab::StructuredElementSeq::StructuredElementSeq ( EntityHandle  start_handle,
const int  imin,
const int  jmin,
const int  kmin,
const int  imax,
const int  jmax,
const int  kmax,
int *  is_periodic = NULL 
)

constructor

Definition at line 27 of file StructuredElementSeq.cpp.

35  : ElementSequence( shandle,
36  ScdElementData::calc_num_entities( shandle, imax - imin, jmax - jmin, kmax - kmin, is_per ),
38  new ScdElementData( shandle, imin, jmin, kmin, imax, jmax, kmax, is_per ) )
39 {
40 }

Referenced by split().

◆ ~StructuredElementSeq()

moab::StructuredElementSeq::~StructuredElementSeq ( )
virtual

Definition at line 42 of file StructuredElementSeq.cpp.

42 {}

◆ StructuredElementSeq() [2/2]

moab::StructuredElementSeq::StructuredElementSeq ( StructuredElementSeq split_from,
EntityHandle  here 
)
inlineprotected

Definition at line 238 of file StructuredElementSeq.hpp.

238 : ElementSequence( split_from, here ) {}

Member Function Documentation

◆ boundary_complete()

bool moab::StructuredElementSeq::boundary_complete ( ) const
inline

test the bounding vertex sequences and determine whether they fully define the vertices covering this element block's parameter space

Definition at line 156 of file StructuredElementSeq.hpp.

157  {
158  return sdata()->boundary_complete();
159  }

References moab::ScdElementData::boundary_complete(), and sdata().

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

◆ contains() [1/2]

bool moab::StructuredElementSeq::contains ( const HomCoord coords) const
inline

Definition at line 166 of file StructuredElementSeq.hpp.

167  {
168  return sdata()->contains( coords );
169  }

References moab::ScdElementData::contains(), and sdata().

◆ contains() [2/2]

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

test whether this sequence contains these parameters

Definition at line 162 of file StructuredElementSeq.hpp.

163  {
164  return sdata()->contains( HomCoord( i, j, k ) );
165  }

References moab::ScdElementData::contains(), and sdata().

◆ create_data_subset()

SequenceData * moab::StructuredElementSeq::create_data_subset ( EntityHandle  start_handle,
EntityHandle  end_handle 
) const
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.

Implements moab::EntitySequence.

Definition at line 94 of file StructuredElementSeq.cpp.

95 {
96  return 0;
97 }

◆ get_connectivity() [1/2]

ErrorCode moab::StructuredElementSeq::get_connectivity ( EntityHandle  handle,
EntityHandle const *&  connect,
int &  connect_length,
bool  topological = false,
std::vector< EntityHandle > *  storage = 0 
) const
virtual

Implements moab::ElementSequence.

Definition at line 54 of file StructuredElementSeq.cpp.

59 {
60  if( !storage )
61  {
62  connect = 0;
63  connect_length = 0;
64  return MB_STRUCTURED_MESH;
65  }
66 
67  storage->clear();
68  ErrorCode rval = get_connectivity( handle, *storage, topo );
69  connect = &( *storage )[0];
70  connect_length = storage->size();
71  return rval;
72 }

References ErrorCode, get_connectivity(), and MB_STRUCTURED_MESH.

◆ get_connectivity() [2/2]

ErrorCode moab::StructuredElementSeq::get_connectivity ( EntityHandle  handle,
std::vector< EntityHandle > &  connect,
bool  topological = false 
) const
virtual

Implements moab::ElementSequence.

Definition at line 44 of file StructuredElementSeq.cpp.

47 {
48  int i, j, k;
49  ErrorCode rval = get_params( handle, i, j, k );
50  if( MB_SUCCESS == rval ) rval = get_params_connectivity( i, j, k, connect );
51  return rval;
52 }

References ErrorCode, get_params(), get_params_connectivity(), and MB_SUCCESS.

Referenced by get_connectivity().

◆ get_connectivity_array()

EntityHandle * moab::StructuredElementSeq::get_connectivity_array ( )
virtual

Implements moab::ElementSequence.

Definition at line 79 of file StructuredElementSeq.cpp.

80 {
81  return 0;
82 }

◆ get_const_memory_use()

void moab::StructuredElementSeq::get_const_memory_use ( unsigned long &  bytes_per_entity,
unsigned long &  size_of_sequence 
) const
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

Implements moab::EntitySequence.

Definition at line 99 of file StructuredElementSeq.cpp.

100 {
101  sequence_size = sizeof( *this );
102  bytes_per_entity = sdata()->get_memory_use() / sdata()->size();
103 }

References moab::ScdElementData::get_memory_use(), sdata(), and moab::SequenceData::size().

◆ get_element() [1/2]

EntityHandle moab::StructuredElementSeq::get_element ( const HomCoord coords) const
inline

get handle of element at homogeneous coords

Definition at line 79 of file StructuredElementSeq.hpp.

80  {
81  return sdata()->get_element( coords.i(), coords.j(), coords.k() );
82  }

References moab::ScdElementData::get_element(), moab::HomCoord::i(), moab::HomCoord::j(), moab::HomCoord::k(), and sdata().

◆ get_element() [2/2]

EntityHandle moab::StructuredElementSeq::get_element ( const int  i,
const int  j,
const int  k 
) const
inline

get handle of element at i, j, k

Definition at line 73 of file StructuredElementSeq.hpp.

74  {
75  return sdata()->get_element( i, j, k );
76  }

References moab::ScdElementData::get_element(), and sdata().

◆ get_params()

ErrorCode moab::StructuredElementSeq::get_params ( const EntityHandle  ehandle,
int &  i,
int &  j,
int &  k 
) const
inline

given a handle, get the corresponding parameters

Definition at line 123 of file StructuredElementSeq.hpp.

124  {
125  return sdata()->get_params( ehandle, i, j, k );
126  }

References moab::ScdElementData::get_params(), and sdata().

Referenced by get_connectivity(), and moab::ScdBox::get_params().

◆ get_params_connectivity()

ErrorCode moab::StructuredElementSeq::get_params_connectivity ( const int  i,
const int  j,
const int  k,
std::vector< EntityHandle > &  connectivity 
) const
inline

get connectivity of an entity given entity's parameters

Definition at line 172 of file StructuredElementSeq.hpp.

176  {
177  return sdata()->get_params_connectivity( i, j, k, connectivity );
178  }

References moab::ScdElementData::get_params_connectivity(), and sdata().

Referenced by get_connectivity().

◆ get_vertex() [1/2]

EntityHandle moab::StructuredElementSeq::get_vertex ( const HomCoord coords) const
inline

get handle of vertex at homogeneous coords

Definition at line 67 of file StructuredElementSeq.hpp.

68  {
69  return sdata()->get_vertex( coords );
70  }

References moab::ScdElementData::get_vertex(), and sdata().

◆ get_vertex() [2/2]

EntityHandle moab::StructuredElementSeq::get_vertex ( const int  i,
const int  j,
const int  k 
) const
inline

get handle of vertex at i, j, k

Definition at line 61 of file StructuredElementSeq.hpp.

62  {
63  return get_vertex( HomCoord( i, j, k ) );
64  }

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

◆ i_max()

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

Definition at line 141 of file StructuredElementSeq.hpp.

142  {
143  return max_params().i();
144  }

References moab::HomCoord::i(), and max_params().

◆ i_min()

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

convenience functions for parameter extents

Definition at line 129 of file StructuredElementSeq.hpp.

130  {
131  return min_params().i();
132  }

References moab::HomCoord::i(), and min_params().

◆ is_periodic()

void moab::StructuredElementSeq::is_periodic ( int  is_periodic_ij[2]) const
inline

Return whether box is periodic in i and j.

Return whether box is periodic in i and j

Parameters
is_periodic_ijNon-zero if periodic in i [0] or j [1]

Definition at line 202 of file StructuredElementSeq.hpp.

203  {
204  sdata()->is_periodic( is_periodic_ij );
205  };

References moab::ScdElementData::is_periodic(), and sdata().

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

◆ is_periodic_i()

int moab::StructuredElementSeq::is_periodic_i ( ) const
inline

Return whether box is periodic in i.

Return whether box is periodic in i

Returns
True if box is periodic in i direction

Definition at line 184 of file StructuredElementSeq.hpp.

185  {
186  return sdata()->is_periodic_i();
187  };

References moab::ScdElementData::is_periodic_i(), and sdata().

◆ is_periodic_j()

int moab::StructuredElementSeq::is_periodic_j ( ) const
inline

Return whether box is periodic in j.

Return whether box is periodic in j

Returns
True if box is periodic in j direction

Definition at line 193 of file StructuredElementSeq.hpp.

194  {
195  return sdata()->is_periodic_j();
196  };

References moab::ScdElementData::is_periodic_j(), and sdata().

◆ j_max()

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

Definition at line 145 of file StructuredElementSeq.hpp.

146  {
147  return max_params().j();
148  }

References moab::HomCoord::j(), and max_params().

◆ j_min()

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

Definition at line 133 of file StructuredElementSeq.hpp.

134  {
135  return min_params().j();
136  }

References moab::HomCoord::j(), and min_params().

◆ k_max()

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

Definition at line 149 of file StructuredElementSeq.hpp.

150  {
151  return max_params().k();
152  }

References moab::HomCoord::k(), and max_params().

◆ k_min()

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

Definition at line 137 of file StructuredElementSeq.hpp.

138  {
139  return min_params().k();
140  }

References moab::HomCoord::k(), and min_params().

◆ max_params() [1/3]

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

get max params for this element

Definition at line 101 of file StructuredElementSeq.hpp.

102  {
103  return sdata()->max_params();
104  }

References moab::ScdElementData::max_params(), and sdata().

Referenced by i_max(), j_max(), k_max(), and max_params().

◆ max_params() [2/3]

void moab::StructuredElementSeq::max_params ( HomCoord coords) const
inline

Definition at line 105 of file StructuredElementSeq.hpp.

106  {
107  coords = max_params();
108  }

References max_params().

◆ max_params() [3/3]

void moab::StructuredElementSeq::max_params ( int &  i,
int &  j,
int &  k 
) const
inline

Definition at line 109 of file StructuredElementSeq.hpp.

110  {
111  i = max_params().i();
112  j = max_params().j();
113  k = max_params().k();
114  }

References moab::HomCoord::i(), moab::HomCoord::j(), moab::HomCoord::k(), and max_params().

◆ min_params() [1/3]

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

get min params for this element

Definition at line 85 of file StructuredElementSeq.hpp.

86  {
87  return sdata()->min_params();
88  }

References moab::ScdElementData::min_params(), and sdata().

Referenced by i_min(), j_min(), k_min(), and min_params().

◆ min_params() [2/3]

void moab::StructuredElementSeq::min_params ( HomCoord coords) const
inline

Definition at line 89 of file StructuredElementSeq.hpp.

90  {
91  coords = min_params();
92  }

References min_params().

◆ min_params() [3/3]

void moab::StructuredElementSeq::min_params ( int &  i,
int &  j,
int &  k 
) const
inline

Definition at line 93 of file StructuredElementSeq.hpp.

94  {
95  i = min_params().i();
96  j = min_params().j();
97  k = min_params().k();
98  }

References moab::HomCoord::i(), moab::HomCoord::j(), moab::HomCoord::k(), and min_params().

◆ param_extents()

void moab::StructuredElementSeq::param_extents ( int &  di,
int &  dj,
int &  dk 
) const
inline

get the number of vertices in each direction, inclusive

Definition at line 117 of file StructuredElementSeq.hpp.

118  {
119  sdata()->param_extents( di, dj, dk );
120  }

References moab::ScdElementData::param_extents(), and sdata().

◆ sdata() [1/2]

◆ sdata() [2/2]

ScdElementData const* moab::StructuredElementSeq::sdata ( ) const
inline

Definition at line 55 of file StructuredElementSeq.hpp.

56  {
57  return reinterpret_cast< const ScdElementData* >( data() );
58  }

References moab::EntitySequence::data().

◆ set_connectivity()

ErrorCode moab::StructuredElementSeq::set_connectivity ( EntityHandle  handle,
EntityHandle const *  connect,
int  connect_length 
)
virtual

Implements moab::ElementSequence.

Definition at line 74 of file StructuredElementSeq.cpp.

75 {
76  return MB_STRUCTURED_MESH;
77 }

References MB_STRUCTURED_MESH.

◆ split()

EntitySequence * moab::StructuredElementSeq::split ( EntityHandle  here)
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()]

Implements moab::EntitySequence.

Definition at line 89 of file StructuredElementSeq.cpp.

90 {
91  return new StructuredElementSeq( *this, here );
92 }

References StructuredElementSeq().

◆ values_per_entity()

int moab::StructuredElementSeq::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 from moab::EntitySequence.

Definition at line 84 of file StructuredElementSeq.cpp.

85 {
86  return -1;
87 } // never reuse freed handles for structured elements

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