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

#include <SweptElementSeq.hpp>

+ Inheritance diagram for moab::SweptElementSeq:
+ Collaboration diagram for moab::SweptElementSeq:

Public Member Functions

 SweptElementSeq (EntityHandle start_handle, const int imin, const int jmin, const int kmin, const int imax, const int jmax, const int kmax, const int *Cq)
 constructor More...
 
virtual ~SweptElementSeq ()
 
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...
 
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

 SweptElementSeq (SweptElementSeq &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 31 of file SweptElementSeq.hpp.

Constructor & Destructor Documentation

◆ SweptElementSeq() [1/2]

moab::SweptElementSeq::SweptElementSeq ( EntityHandle  start_handle,
const int  imin,
const int  jmin,
const int  kmin,
const int  imax,
const int  jmax,
const int  kmax,
const int *  Cq 
)

constructor

Definition at line 27 of file SweptElementSeq.cpp.

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

Referenced by split().

◆ ~SweptElementSeq()

moab::SweptElementSeq::~SweptElementSeq ( )
virtual

Definition at line 42 of file SweptElementSeq.cpp.

42 {}

◆ SweptElementSeq() [2/2]

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

Definition at line 206 of file SweptElementSeq.hpp.

206 : ElementSequence( split_from, here ) {}

Member Function Documentation

◆ boundary_complete()

bool moab::SweptElementSeq::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 151 of file SweptElementSeq.hpp.

152  {
153  return sdata()->boundary_complete();
154  }

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

◆ contains() [1/2]

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

Definition at line 161 of file SweptElementSeq.hpp.

162  {
163  return sdata()->contains( coords );
164  }

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

◆ contains() [2/2]

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

test whether this sequence contains these parameters

Definition at line 157 of file SweptElementSeq.hpp.

158  {
159  return sdata()->contains( HomCoord( i, j, k ) );
160  }

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

◆ create_data_subset()

SequenceData * moab::SweptElementSeq::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 SweptElementSeq.cpp.

95 {
96  return 0;
97 }

◆ get_connectivity() [1/2]

ErrorCode moab::SweptElementSeq::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 SweptElementSeq.cpp.

59 {
60  if( !storage )
61  {
62  connect = 0;
63  connect_length = 0;
64  return MB_NOT_IMPLEMENTED;
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_NOT_IMPLEMENTED.

◆ get_connectivity() [2/2]

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

Implements moab::ElementSequence.

Definition at line 44 of file SweptElementSeq.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::SweptElementSeq::get_connectivity_array ( )
virtual

Implements moab::ElementSequence.

Definition at line 79 of file SweptElementSeq.cpp.

80 {
81  return 0;
82 }

◆ get_const_memory_use()

void moab::SweptElementSeq::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 SweptElementSeq.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::SweptElementSeq::get_element ( const HomCoord coords) const
inline

get handle of element at homogeneous coords

Definition at line 74 of file SweptElementSeq.hpp.

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

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

◆ get_element() [2/2]

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

get handle of element at i, j, k

Definition at line 68 of file SweptElementSeq.hpp.

69  {
70  return sdata()->get_element( i, j, k );
71  }

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

◆ get_params()

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

given a handle, get the corresponding parameters

Definition at line 118 of file SweptElementSeq.hpp.

119  {
120  return sdata()->get_params( ehandle, i, j, k );
121  }

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

Referenced by get_connectivity().

◆ get_params_connectivity()

ErrorCode moab::SweptElementSeq::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 167 of file SweptElementSeq.hpp.

171  {
172  return sdata()->get_params_connectivity( i, j, k, connectivity );
173  }

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

Referenced by get_connectivity().

◆ get_vertex() [1/2]

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

get handle of vertex at homogeneous coords

Definition at line 62 of file SweptElementSeq.hpp.

63  {
64  return sdata()->get_vertex( coords );
65  }

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

◆ get_vertex() [2/2]

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

get handle of vertex at i, j, k

Definition at line 56 of file SweptElementSeq.hpp.

57  {
58  return get_vertex( HomCoord( i, j, k ) );
59  }

◆ i_max()

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

Definition at line 136 of file SweptElementSeq.hpp.

137  {
138  return max_params().i();
139  }

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

◆ i_min()

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

convenience functions for parameter extents

Definition at line 124 of file SweptElementSeq.hpp.

125  {
126  return min_params().i();
127  }

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

◆ j_max()

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

Definition at line 140 of file SweptElementSeq.hpp.

141  {
142  return max_params().j();
143  }

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

◆ j_min()

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

Definition at line 128 of file SweptElementSeq.hpp.

129  {
130  return min_params().j();
131  }

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

◆ k_max()

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

Definition at line 144 of file SweptElementSeq.hpp.

145  {
146  return max_params().k();
147  }

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

◆ k_min()

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

Definition at line 132 of file SweptElementSeq.hpp.

133  {
134  return min_params().k();
135  }

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

◆ max_params() [1/3]

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

get max params for this element

Definition at line 96 of file SweptElementSeq.hpp.

97  {
98  return sdata()->max_params();
99  }

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

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

◆ max_params() [2/3]

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

Definition at line 100 of file SweptElementSeq.hpp.

101  {
102  coords = max_params();
103  }

References max_params().

◆ max_params() [3/3]

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

Definition at line 104 of file SweptElementSeq.hpp.

105  {
106  i = max_params().i();
107  j = max_params().j();
108  k = max_params().k();
109  }

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

◆ min_params() [1/3]

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

get min params for this element

Definition at line 80 of file SweptElementSeq.hpp.

81  {
82  return sdata()->min_params();
83  }

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

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

◆ min_params() [2/3]

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

Definition at line 84 of file SweptElementSeq.hpp.

85  {
86  coords = min_params();
87  }

References min_params().

◆ min_params() [3/3]

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

Definition at line 88 of file SweptElementSeq.hpp.

89  {
90  i = min_params().i();
91  j = min_params().j();
92  k = min_params().k();
93  }

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

◆ param_extents()

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

get the number of vertices in each direction, inclusive

Definition at line 112 of file SweptElementSeq.hpp.

113  {
114  sdata()->param_extents( di, dj, dk );
115  }

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

◆ sdata() [1/2]

ScdElementData* moab::SweptElementSeq::sdata ( )
inline

Definition at line 46 of file SweptElementSeq.hpp.

47  {
48  return reinterpret_cast< ScdElementData* >( data() );
49  }

References moab::EntitySequence::data().

Referenced by boundary_complete(), contains(), get_const_memory_use(), get_element(), get_params(), get_params_connectivity(), get_vertex(), max_params(), min_params(), and param_extents().

◆ sdata() [2/2]

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

Definition at line 50 of file SweptElementSeq.hpp.

51  {
52  return reinterpret_cast< const ScdElementData* >( data() );
53  }

References moab::EntitySequence::data().

◆ set_connectivity()

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

Implements moab::ElementSequence.

Definition at line 74 of file SweptElementSeq.cpp.

75 {
76  return MB_NOT_IMPLEMENTED;
77 }

References MB_NOT_IMPLEMENTED.

◆ split()

EntitySequence * moab::SweptElementSeq::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 SweptElementSeq.cpp.

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

References SweptElementSeq().

◆ values_per_entity()

int moab::SweptElementSeq::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 SweptElementSeq.cpp.

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

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