Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Facet_node_enumerator Class Reference

Adaptor for enumerating node IDs of a facet of an element. More...

#include <Element_accessors.h>

Collaboration diagram for Facet_node_enumerator:

Public Member Functions

 Facet_node_enumerator (const Element_node_enumerator *ene, int k)
 
int size_of_nodes () const
 
int size_of_corners () const
 
int size_of_edges () const
 
void get_nodes (std::vector< int > &nodes, bool quad_ret)
 
int operator[] (int i) const
 

Protected Attributes

const Element_node_enumerator
*const 
_ene
 
const int _k
 
const int _ne
 
const int * _fn_list
 

Static Protected Attributes

static const int _face_node_lists_tets [4][6]
 
static const int _face_node_lists_pyra [5][8]
 
static const int _face_node_lists_pris [5][9]
 
static const int _face_node_lists_hexa [6][9]
 

Detailed Description

Adaptor for enumerating node IDs of a facet of an element.

Definition at line 200 of file Element_accessors.h.

Constructor & Destructor Documentation

Facet_node_enumerator ( const Element_node_enumerator ene,
int  k 
)

Definition at line 154 of file Element_accessors.C.

References _face_node_lists_hexa, _face_node_lists_pris, _face_node_lists_pyra, _face_node_lists_tets, _fn_list, _k, _ne, COM_assertion_msg, Element_node_enumerator::dimension(), and Element_node_enumerator::size_of_nodes().

155  : _ene(ene), _k(k), _ne(0) {
156  if ( ene->dimension() == 2) {
157  const_cast<int&>(_ne) = 1;
158  _fn_list = NULL;
159  }
160  else {
161  switch ( ene->size_of_nodes()) {
162  case 4: // Tetrahedra
163  case 10: {
164  const_cast<int&>(_ne) = 3;
166  break;
167  }
168  case 5: // Pyramids
169  case 14: {
170  const_cast<int&>(_ne) = (_k==0)? 4 : 3;
172  break;
173  }
174  case 6: // Prisms (Pentahedra)
175  case 15:
176  case 18: {
177  const_cast<int&>(_ne) = (_k<3)? 4 : 3;
179  break;
180  }
181  case 8: // Hexahedra
182  case 20:
183  case 27: {
184  const_cast<int&>(_ne) = 4;
186  break;
187  }
188  default: COM_assertion_msg(false, "Not supported yet.");
189  }
190  }
191 }
j indices k indices k
Definition: Indexing.h:6
#define COM_assertion_msg(EX, msg)
static const int _face_node_lists_pris[5][9]
static const int _face_node_lists_hexa[6][9]
int size_of_nodes() const
Number of nodes per element.
int dimension() const
Get the dimension of the base pane.
static const int _face_node_lists_tets[4][6]
const Element_node_enumerator *const _ene
static const int _face_node_lists_pyra[5][8]

Here is the call graph for this function:

Member Function Documentation

void get_nodes ( std::vector< int > &  nodes,
bool  quad_ret 
)

Definition at line 217 of file Element_accessors.C.

References _ene, _fn_list, _k, _ne, i, size_of_corners(), Element_node_enumerator::size_of_edges(), and size_of_nodes().

Referenced by Pane_boundary::determine_border_nodes_3().

217  {
218  int nn = quad_ret ? size_of_nodes() : size_of_corners();
219  nodes.resize( nn);
220 
221  if ( _ne == 1) {
222  int num_edges = _ene->size_of_edges();
223  // Retrun the nodes on each edge.
224  nodes[0] = (*_ene)[(_k)%num_edges];
225  nodes[1] = (*_ene)[(_k+1)%num_edges];
226 
227  if (nn>2) nodes[2] = (*_ene)[num_edges+_k];
228  }
229  else {
230  for ( int i=0; i<nn; ++i) nodes[i] = (*_ene)[_fn_list[i]];
231  }
232 }
int size_of_edges() const
Number of edges per element.
blockLoc i
Definition: read.cpp:79
const Element_node_enumerator *const _ene

Here is the call graph for this function:

Here is the caller graph for this function:

int operator[] ( int  i) const

Definition at line 207 of file Element_accessors.C.

References _ene, _fn_list, _k, _ne, i, and Element_node_enumerator::size_of_edges().

207  {
208  if ( _ne > 1)
209  return (*_ene)[_fn_list[i]];
210  else {
211  if ( i<2) return (*_ene)[(_k+i)%_ene->size_of_edges()];
212  else return (*_ene)[_ene->size_of_edges()+_k];
213  }
214 }
int size_of_edges() const
Number of edges per element.
blockLoc i
Definition: read.cpp:79
const Element_node_enumerator *const _ene

Here is the call graph for this function:

int size_of_corners ( ) const
inline

Definition at line 209 of file Element_accessors.h.

References _ne.

Referenced by get_nodes(), and Pane_boundary::min_squared_edge_len().

209 { return (_ne == 1) ? 2 : _ne ; }

Here is the caller graph for this function:

int size_of_edges ( ) const
inline

Definition at line 212 of file Element_accessors.h.

References _ne.

Referenced by Pane_boundary::determine_border_nodes_3().

212 { return _ne; }

Here is the caller graph for this function:

int size_of_nodes ( ) const

Definition at line 193 of file Element_accessors.C.

References _ene, _k, _ne, Element_node_enumerator::is_quadratic(), num_nodes, and Element_node_enumerator::size_of_nodes().

Referenced by get_nodes().

193  {
194  if ( _ne == 1)
195  return _ene->is_quadratic() ? 3 : 2;
196  else {
197  int nn = _ne; // Number of nodes per face
198 
199  if ( _ene->is_quadratic()) {
200  int num_nodes = _ene->size_of_nodes();
201  nn += _ne + (num_nodes == 18 && _k<3 || num_nodes == 27);
202  }
203  return nn;
204  }
205 }
const int num_nodes
Definition: ex1.C:96
int size_of_nodes() const
Number of nodes per element.
const Element_node_enumerator *const _ene
int is_quadratic() const
Check whether the element is quadratic.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const Element_node_enumerator* const _ene
protected

Definition at line 226 of file Element_accessors.h.

Referenced by get_nodes(), operator[](), and size_of_nodes().

const int _face_node_lists_hexa
staticprotected
Initial value:
=
{ {0,3,2,1,11,10,9, 8, 20}, {0,1,5,4,8, 13,16,12,21},
{1,2,6,5,9, 14,17,13,22}, {2,3,7,6,10,15,18,14,23},
{0,4,7,3,12,19,15,11,24}, {4,5,6,7,16,17,18,19,25}}

Definition at line 224 of file Element_accessors.h.

Referenced by Facet_node_enumerator().

const int _face_node_lists_pris
staticprotected
Initial value:
=
{ {0,1,4,3,6,10,12,9,15}, {1,2,5,4,7,11,13,10,16}, {2,0,3,5,8,9,14,11,17},
{0,2,1,8,7,6,-1,-1,-1}, {3,4,5,12,13,14,-1,-1,-1}}

Definition at line 223 of file Element_accessors.h.

Referenced by Facet_node_enumerator().

const int _face_node_lists_pyra
staticprotected
Initial value:
=
{ {0,3,2,1,8,7,6,5}, {0,1,4,5,10,9,-1,-1}, {1,2,4,6,11,10,-1,-1},
{2,3,4,7,12,11,-1,-1}, {3,0,4,8,9,12,-1,-1}}

Definition at line 222 of file Element_accessors.h.

Referenced by Facet_node_enumerator().

const int _face_node_lists_tets
staticprotected
Initial value:
=
{ {0, 2, 1, 6, 5, 4}, { 0, 1, 3, 4, 8, 7},
{1, 2, 3, 5, 9, 8}, {2, 0, 3, 6, 7, 9}}

Definition at line 221 of file Element_accessors.h.

Referenced by Facet_node_enumerator().

const int* _fn_list
protected

Definition at line 229 of file Element_accessors.h.

Referenced by Facet_node_enumerator(), get_nodes(), and operator[]().

const int _k
protected

Definition at line 227 of file Element_accessors.h.

Referenced by Facet_node_enumerator(), get_nodes(), operator[](), and size_of_nodes().

const int _ne
protected

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