32 #ifndef _ELEMENT_ACCESSORS_H_
33 #define _ELEMENT_ACCESSORS_H_
55 const std::pair<int,int> &
id);
88 void get_nodes( std::vector< int > &nodes);
119 int vertex(
int lvid,
bool level=
false)
const;
130 return ( i==1 || i==2)? t+1 : t;
155 const std::pair<int,int> &
id)
164 return ( i==1 || i==2)? t+1 : t;
215 void get_nodes( std::vector< int > &nodes,
bool quad_ret);
233 template <
class Value>
241 { std::fill_n(
_vs, 9, reinterpret_cast<Value*>(NULL)); }
248 _vs[
i] = &p[(ene[
i]-1)*strd];
260 const Value *p =
reinterpret_cast<const Value*
>(a->
pointer());
262 for (
int i=0;
i<nn; ++
i)
_vs[
i] = &p[(ene[
i]-1)*strd];
275 return reinterpret_cast<const Value*
>
276 (aj->pointer())[
_offsets[i]*aj->stride()];
294 template <
class Value>
317 template <
class Value>
328 _vs = &p[(ene.
id()-1)*strd];
339 const Value *p =
reinterpret_cast<const Value*
>(a->
pointer());
341 _vs = &p[(ene.
id()-1)*strd];
354 return reinterpret_cast<const Value*
>
355 (aj->pointer())[
_offset*aj->stride()];
373 template <
class Value>
397 #endif // _ELEMENT_ENUMERATOR_H_
int type() const
Obtain the type of the element.
A Pane object contains a mesh, pane attribute, and field variables.
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
An adaptor for enumerating node IDs of an element.
int size_of_corners() const
Value & operator[](int i) const
Value & operator()(int i, int j) const
const int * pointer() const
Get a constant pointer to the connectivity array.
Value & operator[](int i) const
An Attribute object is a data member of a window.
int operator[](int i) const
int vertex(int lvid, bool level=false) const
Get the vertex index of an vertex within the element.
Element_vectors_k_const()
Default constructor.
void get_nodes(std::vector< int > &nodes, bool quad_ret)
void set(Value *p, Element_node_enumerator &ene, int strd)
const Connectivity * _conn
This file contains the prototypes for Roccom API.
bool is_structured() const
Is mesh of the pane structured?
const Value & operator()(int i) const
Value & operator()(int i, int j) const
Size size_of_corners_pe() const
Get the number of corners per element of the current connectivity table.
int size_of_nodes() const
const Value & operator[](int i) const
void set(Value *p, Element_node_enumerator &ene, int strd)
Adaptor for enumerating node IDs of a facet of an element.
bool is_quadratic() const
Determine whether the element type is quadratic.
static const int _face_node_lists_pris[5][9]
void get_nodes(std::vector< int > &nodes)
Get a vector of all of the nodes in the element.
Element_node_enumerator_str_2(const Pane *pane, int i)
int id() const
Get the local id of the element within the pane.
Facet_node_enumerator(const Element_node_enumerator *ene, int k)
static const int _face_node_lists_hexa[6][9]
int operator[](int i) const
Obtain the pane-scope node ID from its element-scope index.
const void * pointer() const
Obtain a constant pointer to the physical address.
This is a helper class for accessing nodal data.
Size index_offset() const
Get the index of the first element.
Element_node_vectors_k_const< Value > Base
int operator[](int i) const
const Value & operator[](int i) const
int size_of_edges() const
int size_of_edges() const
Number of edges per element.
void set(const Value *p, Element_node_enumerator &ene, int strd)
initialize the accessor with a pointer and a specific stride.
const Value & operator()(int i, int j) const
void set(Attribute *a, Element_node_enumerator &ene)
Element_node_vectors_k_const()
Default constructor.
This is a helper class for accessing elemental data.
int size_of_nodes() const
Number of nodes per element.
const Value & operator()(int i) const
int COM_get_sizeof(const COM_Type type, int c)
Size size_of_edges_pe() const
Get the number of edges per element of the current connectivity table.
int dimension() const
Get the dimension of the base pane.
int stride() const
Obtain the stride of the attribute in base datatype.
Value & operator()(int i) const
bool is_nodal() const
Checks whether the attribute is associated with a node.
Element_node_enumerator()
static const int _face_node_lists_tets[4][6]
const Pane * pane() const
Obtain a constant pointer to the owner pane of the attribute.
const Element_node_enumerator *const _ene
int dimension() const
Dimension of the pane.
Size size_of_nodes_pe() const
Get the number of nodes per element of the current connectivity table.
Connectivity * connectivity(Size i)
Obtain the connectivity table containing the element with the given ID.
Element_node_enumerator_str_2()
void set(const Value *p, Element_node_enumerator &ene, int strd)
initialize the accessor with a pointer and a specific stride.
int is_quadratic() const
Check whether the element is quadratic.
int size_of_faces() const
Number of faces per element.
Size size_of_elements() const
Get the total number of elements (including ghost elements) in the table.
int element_type() const
Obtain element type ID.
const Value & operator()(int i, int j) const
Element_vectors_k_const< Value > Base
const Value * _vs[MAX_NODES]
void next()
Go to the next element within the connectivity tables of a pane.
Element_node_enumerator_str_2(const Pane *pane, const std::pair< int, int > &id)
void set(const Attribute *a, Element_node_enumerator &ene)
initialize the accessor from an attribute assiciated with a pane.
int size_of_nodes() const
COM_Type data_type() const
Obtain the data type of each component of the attribute.
Size size_i() const
Get the number of nodes in i-dimension if the mesh is structured.
Optimized version for unstructured meshes.
int operator[](int i) const
void set(Attribute *a, Element_node_enumerator &ene)
Size size_of_faces_pe() const
Get the number of faces per element of the current connectivity table.
bool is_elemental() const
Checks whether the attribute is associated with an element.
void set(const Attribute *a, Element_node_enumerator &ene)
initialize the accessor from an attribute assiciated with a pane.
Encapsulates an element-connectivity of a mesh.
int id() const
Get the ID of the pane.
static const int _face_node_lists_pyra[5][8]
Element_node_enumerator_uns(const Pane *pane, int i, const Connectivity *conn=NULL)
const Pane * pane() const
int size_of_corners() const
Number of corners per element.
Value & operator()(int i) const
Optimized version for 2-D structured meshes.
Element_node_enumerator_uns()
int size_of_components() const
Obtain the number of components in the attribute.