moab
|
#include <StructuredElementSeq.hpp>
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 | |
virtual | ~StructuredElementSeq () |
ScdElementData * | sdata () |
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 | |
EntityHandle | get_vertex (const HomCoord &coords) const |
get handle of vertex at homogeneous coords | |
EntityHandle | get_element (const int i, const int j, const int k) const |
get handle of element at i, j, k | |
EntityHandle | get_element (const HomCoord &coords) const |
get handle of element at homogeneous coords | |
const HomCoord & | min_params () const |
get min params for this element | |
void | min_params (HomCoord &coords) const |
void | min_params (int &i, int &j, int &k) const |
const HomCoord & | max_params () const |
get max params for this element | |
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 | |
ErrorCode | get_params (const EntityHandle ehandle, int &i, int &j, int &k) const |
given a handle, get the corresponding parameters | |
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 | boundary_complete () const |
bool | contains (const int i, const int j, const int k) const |
test whether this sequence contains these parameters | |
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 | |
int | is_periodic_i () const |
Return whether box is periodic in i. | |
int | is_periodic_j () const |
Return whether box is periodic in j. | |
void | is_periodic (int is_periodic_ij[2]) const |
Return whether box is periodic in i and j. | |
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 EntityHandle * | get_connectivity_array () |
virtual int | values_per_entity () const |
Integer value used in finding appropriate SequenceData. | |
virtual EntitySequence * | split (EntityHandle here) |
Split this sequence into two consecutive sequences. | |
virtual SequenceData * | create_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. | |
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. | |
Protected Member Functions | |
StructuredElementSeq (StructuredElementSeq &split_from, EntityHandle here) |
Definition at line 35 of file StructuredElementSeq.hpp.
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 26 of file StructuredElementSeq.cpp.
: ElementSequence( shandle, ScdElementData::calc_num_entities( shandle, imax-imin, jmax-jmin, kmax-kmin, is_per), CN::VerticesPerEntity(TYPE_FROM_HANDLE(shandle)), new ScdElementData( shandle, imin, jmin, kmin, imax, jmax, kmax, is_per) ) { }
moab::StructuredElementSeq::~StructuredElementSeq | ( | ) | [virtual] |
Definition at line 43 of file StructuredElementSeq.cpp.
{ }
moab::StructuredElementSeq::StructuredElementSeq | ( | StructuredElementSeq & | split_from, |
EntityHandle | here | ||
) | [inline, protected] |
Definition at line 174 of file StructuredElementSeq.hpp.
: ElementSequence( split_from, here ) {}
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 104 of file StructuredElementSeq.hpp.
{ return sdata()->boundary_complete(); }
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 108 of file StructuredElementSeq.hpp.
bool moab::StructuredElementSeq::contains | ( | const HomCoord & | coords | ) | const [inline] |
Definition at line 110 of file StructuredElementSeq.hpp.
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 97 of file StructuredElementSeq.cpp.
{ return 0; }
ErrorCode moab::StructuredElementSeq::get_connectivity | ( | EntityHandle | handle, |
std::vector< EntityHandle > & | connect, | ||
bool | topological = false |
||
) | const [virtual] |
Implements moab::ElementSequence.
Definition at line 47 of file StructuredElementSeq.cpp.
{ int i, j, k; ErrorCode rval = get_params( handle, i, j, k ); if (MB_SUCCESS == rval) rval = get_params_connectivity( i, j, k, connect ); return rval; }
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 59 of file StructuredElementSeq.cpp.
{ if (!storage) { connect = 0; connect_length = 0; return MB_STRUCTURED_MESH; } storage->clear(); ErrorCode rval = get_connectivity( handle, *storage, topo ); connect = &(*storage)[0]; connect_length = storage->size(); return rval; }
EntityHandle * moab::StructuredElementSeq::get_connectivity_array | ( | ) | [virtual] |
Implements moab::ElementSequence.
Definition at line 88 of file StructuredElementSeq.cpp.
{ return 0; }
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.
bytes_per_entity | The 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_sequence | The size of the leaf subclass of this class |
Implements moab::EntitySequence.
Definition at line 100 of file StructuredElementSeq.cpp.
{ sequence_size = sizeof(*this); bytes_per_entity = sdata()->get_memory_use() / sdata()->size(); }
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 62 of file StructuredElementSeq.hpp.
{ return sdata()->get_element( i, j, k ); }
EntityHandle moab::StructuredElementSeq::get_element | ( | const HomCoord & | coords | ) | const [inline] |
get handle of element at homogeneous coords
Definition at line 66 of file StructuredElementSeq.hpp.
{ return sdata()->get_element( coords.i(), coords.j(), coords.k() ); }
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 90 of file StructuredElementSeq.hpp.
{ return sdata()->get_params( ehandle, i, j, k ); }
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 114 of file StructuredElementSeq.hpp.
{ return sdata()->get_params_connectivity( i, j, k, connectivity ); }
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 54 of file StructuredElementSeq.hpp.
{ return get_vertex( HomCoord(i,j,k) ); }
EntityHandle moab::StructuredElementSeq::get_vertex | ( | const HomCoord & | coords | ) | const [inline] |
get handle of vertex at homogeneous coords
Definition at line 58 of file StructuredElementSeq.hpp.
{ return sdata()->get_vertex(coords); }
int moab::StructuredElementSeq::i_max | ( | ) | const [inline] |
Definition at line 98 of file StructuredElementSeq.hpp.
{return max_params().i();}
int moab::StructuredElementSeq::i_min | ( | ) | const [inline] |
convenience functions for parameter extents
Definition at line 95 of file StructuredElementSeq.hpp.
{return min_params().i();}
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
is_periodic_ij | Non-zero if periodic in i [0] or j [1] |
Definition at line 134 of file StructuredElementSeq.hpp.
{sdata()->is_periodic(is_periodic_ij);};
int moab::StructuredElementSeq::is_periodic_i | ( | ) | const [inline] |
Return whether box is periodic in i.
Return whether box is periodic in i
Definition at line 122 of file StructuredElementSeq.hpp.
{return sdata()->is_periodic_i();};
int moab::StructuredElementSeq::is_periodic_j | ( | ) | const [inline] |
Return whether box is periodic in j.
Return whether box is periodic in j
Definition at line 128 of file StructuredElementSeq.hpp.
{return sdata()->is_periodic_j();};
int moab::StructuredElementSeq::j_max | ( | ) | const [inline] |
Definition at line 99 of file StructuredElementSeq.hpp.
{return max_params().j();}
int moab::StructuredElementSeq::j_min | ( | ) | const [inline] |
Definition at line 96 of file StructuredElementSeq.hpp.
{return min_params().j();}
int moab::StructuredElementSeq::k_max | ( | ) | const [inline] |
Definition at line 100 of file StructuredElementSeq.hpp.
{return max_params().k();}
int moab::StructuredElementSeq::k_min | ( | ) | const [inline] |
Definition at line 97 of file StructuredElementSeq.hpp.
{return min_params().k();}
const HomCoord& moab::StructuredElementSeq::max_params | ( | ) | const [inline] |
get max params for this element
Definition at line 78 of file StructuredElementSeq.hpp.
{ return sdata()->max_params(); }
void moab::StructuredElementSeq::max_params | ( | HomCoord & | coords | ) | const [inline] |
Definition at line 80 of file StructuredElementSeq.hpp.
{ coords = max_params(); }
void moab::StructuredElementSeq::max_params | ( | int & | i, |
int & | j, | ||
int & | k | ||
) | const [inline] |
Definition at line 82 of file StructuredElementSeq.hpp.
{ i = max_params().i(); j = max_params().j(); k = max_params().k(); }
const HomCoord& moab::StructuredElementSeq::min_params | ( | ) | const [inline] |
get min params for this element
Definition at line 70 of file StructuredElementSeq.hpp.
{ return sdata()->min_params(); }
void moab::StructuredElementSeq::min_params | ( | HomCoord & | coords | ) | const [inline] |
Definition at line 72 of file StructuredElementSeq.hpp.
{ coords = min_params(); }
void moab::StructuredElementSeq::min_params | ( | int & | i, |
int & | j, | ||
int & | k | ||
) | const [inline] |
Definition at line 74 of file StructuredElementSeq.hpp.
{ i = min_params().i(); j = min_params().j(); k = min_params().k(); }
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 86 of file StructuredElementSeq.hpp.
{ sdata()->param_extents( di, dj, dk ); }
ScdElementData* moab::StructuredElementSeq::sdata | ( | ) | [inline] |
Definition at line 48 of file StructuredElementSeq.hpp.
{ return reinterpret_cast<ScdElementData*>(data()); }
ScdElementData const* moab::StructuredElementSeq::sdata | ( | ) | const [inline] |
Definition at line 50 of file StructuredElementSeq.hpp.
{ return reinterpret_cast<const ScdElementData*>(data()); }
ErrorCode moab::StructuredElementSeq::set_connectivity | ( | EntityHandle | handle, |
EntityHandle const * | connect, | ||
int | connect_length | ||
) | [virtual] |
Implements moab::ElementSequence.
Definition at line 80 of file StructuredElementSeq.cpp.
{ return MB_STRUCTURED_MESH; }
EntitySequence * moab::StructuredElementSeq::split | ( | EntityHandle | here | ) | [virtual] |
Split this sequence into two consecutive sequences.
Split this sequence into two sequences.
here | New sequences should be [start_handle(),here) & [here,end_handle()] |
Implements moab::EntitySequence.
Definition at line 94 of file StructuredElementSeq.cpp.
{ return new StructuredElementSeq( *this, here ); }
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 91 of file StructuredElementSeq.cpp.
{ return -1; } // never reuse freed handles for structured elements