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

Encapsulates an element-connectivity of a mesh. More...

#include <Connectivity.h>

Inheritance diagram for Connectivity:
Collaboration diagram for Connectivity:

Public Types

enum  Connectivity_type {
  ST1, ST2, ST3, BAR2,
  BAR3, TRI3, TRI6, QUAD4,
  QUAD8, QUAD9, TET4, TET10,
  PYRIMID5, PYRIMID14, PRISM6, PRISM15,
  PRISM18, HEX8, HEX20, HEX27,
  TYPE_MAX_CONN
}
 
enum  Connectivity_info {
  TYPE_ID, SIZE_DIM, ORDER, SIZE_NNODES,
  SIZE_NCORN, SIZE_NEDGES, SIZE_NFACES, SIZE_MAX_CONN
}
 
typedef unsigned char Shorter_size
 One byte unsighed int. More...
 
typedef unsigned int Size
 Unsighed int. More...
 

Public Member Functions

bool is_const () const
 Returns whether the array is set to be read-only. More...
 
Constructors and destructor
 Connectivity (Pane *pane, const std::string &name, int id, const int sizes[], int type=COM_INT)
 Create an attribute with name n in window w. More...
 
 Connectivity (Pane *pane, Connectivity *con, const std::string &name, int id)
 Construct from another connectivity table. More...
 
Identity
Connectivityparent ()
 Parent attribute being used. More...
 
const Connectivityparent () const
 
Connectivityroot ()
 Root of use-inheritance. More...
 
const Connectivityroot () const
 
void inherit (Connectivity *parent, bool clone, bool withghost) throw (COM_exception)
 Inherit a connectivity table. More...
 
int element_type () const
 Obtain element type ID. More...
 
int dimension () const
 Get the dimension of the mesh. More...
 
bool is_structured () const
 Determine whether the mesh is quadratic. More...
 
bool is_quadratic () const
 Determine whether the element type is quadratic. More...
 
Array information
const int * pointer () const
 Get a constant pointer to the connectivity array. More...
 
int * pointer ()
 Get a pointer to the connectivity array. More...
 
const int * get_addr (int i, int j=0) const throw (COM_exception)
 Obtain the address of the jth component of the ith item, where 0<=i<size_of_items. More...
 
int * get_addr (int i, int j=0) throw (COM_exception)
 

Protected Member Functions

void set_pointer (void *p, int strd, int cap, bool is_const) throw (COM_exception)
 Set pointer of connectivity table. More...
 
void set_offset (Size offset) throw (COM_exception)
 Set the index of the first element. More...
 
- Protected Member Functions inherited from Attribute
void set_pointer (void *p, int strd, int cap, int offset, bool is_const) throw (COM_exception)
 Set the physical address of the attribute values. More...
 
void inherit (Attribute *a, bool clone, bool withghost, int depth=0) throw (COM_exception)
 Inherit from parent. If depth>0, then the procedure is for the subcomponents. More...
 
 Attribute (Pane *pane, int i)
 Constructor for keywords. The default nitems for keywords is 0. More...
 
void set_size (int nitems, int ngitems=0) throw (COM_exception)
 Set the size of items and ghost items. More...
 
void * allocate (int strd, int cap, bool force) throw (COM_exception)
 Allocate memory for the attribute. More...
 
int deallocate () throw (COM_exception)
 Deallocate memory if it was allocated by allocate(). More...
 
void copy_array (void *buf, int strd, int nitem, int offset=0, int direction=COPY_IN) throw (COM_exception)
 
void append_array (const void *from, int strd, int nitem) throw (COM_exception)
 
const std::string & name () const
 Obtain the name of the attribute. More...
 
std::string fullname () const
 Obtain the full name of the attribute including window name suitable for printing out error messages. More...
 
int id () const
 Obtain the id (or index) of the attribute. More...
 
Attributeparent ()
 Parent attribute used by this object. More...
 
const Attributeparent () const
 
Attributeroot ()
 Root of use-inheritance. More...
 
const Attributeroot () const
 
const void * pointer () const
 Obtain a constant pointer to the physical address. More...
 
void * pointer () throw (COM_exception)
 Obtain a modifiable pointer to the physical address. More...
 
const void * get_addr (int i, int j=0) const throw (COM_exception)
 Obtain the address of the jth component of the ith item, where 0<=i<size_of_items. More...
 
void * get_addr (int i, int j=0) throw (COM_exception)
 
 Attribute ()
 Default constructor. More...
 
 Attribute (Pane *pane, const std::string &name, int id, Shorter_size loc, int type, const int ncomp, const std::string &unit)
 Create an attribute with name n in window w. More...
 
 Attribute (Pane *pane, Attribute *parent, const std::string &name, int id)
 Inherit an attribute from another. More...
 
 ~Attribute ()
 Destructors. More...
 
const Panepane () const
 Obtain a constant pointer to the owner pane of the attribute. More...
 
Panepane ()
 Obtain a modifiable pointer to the owner pane of the attribute. More...
 
const Windowwindow () const
 Obtain a constant pointer to the parent window of the attribute. More...
 
Windowwindow ()
 Obtain a modifiable pointer to the parent window of the attribute. More...
 
Shorter_size location () const
 Obtain the location of the attribute. More...
 
bool is_windowed () const
 Checks whether the attribute is associated with the window. More...
 
bool is_panel () const
 Checks whether the attribute is associated with a pane. More...
 
bool is_elemental () const
 Checks whether the attribute is associated with an element. More...
 
bool is_nodal () const
 Checks whether the attribute is associated with a node. More...
 
COM_Type data_type () const
 Obtain the data type of each component of the attribute. More...
 
const std::string & unit () const
 Obtain the unit of the attribute. More...
 
int size_of_components () const
 Obtain the number of components in the attribute. More...
 
int size_of_items () const
 Obtain the number of items in the attribute. More...
 
int maxsize_of_items () const
 Obtain the maximum allowed number of items in the attribute. More...
 
int size_of_ghost_items () const
 Obtain the number of ghost items in the attribute. More...
 
int maxsize_of_ghost_items () const
 Obtain the maximum allowed number of items in the attribute. More...
 
int size_of_real_items () const
 Obtain the number of real items in the attribute. More...
 
int maxsize_of_real_items () const
 Obtain the maximum allowed number of real items in the attribute. More...
 
bool empty () const
 Check whether the number of items of the attribute is zero. More...
 
int capacity () const
 Obtain the capacity of the array. More...
 
int stride () const
 Obtain the stride of the attribute in base datatype. More...
 
int stride_in_bytes () const
 Obtain the stride of the attribute in bytes. More...
 
int status () const
 Obtain the status of the attribute. More...
 
bool initialized () const
 Returns whether the array for the attribute has been set or allocated. More...
 
bool size_set () const
 Returns whether the size for the attribute has been set. More...
 
bool allocated () const
 Returns whether the array for the attribute has been set or allocated. More...
 
bool is_const () const
 Returns whether the array is set to be read-only. More...
 
bool is_staggered () const
 Check how the attribute values are organized. More...
 

Protected Attributes

int _offset
 Offset of the first element. More...
 
const int * _size_info
 
- Protected Attributes inherited from Attribute
Pane_pane
 Pointer to its owner pane. More...
 
Attribute_parent
 Parent attribute being used. More...
 
std::string _name
 Name of the attribute. More...
 
int _id
 Id field data. More...
 
Shorter_size _loc
 Location. More...
 
int _ncomp
 Number of components. More...
 
COM_Type _type
 Base data type of the attribute. More...
 
std::string _unit
 Unit of the attribute. More...
 
int _nitems
 Size of total items. Default value is -1. More...
 
int _ngitems
 Size of ghost items. More...
 
int _gap
 Gap between the IDs of real and ghost items. More...
 
Shorter_size _status
 Indicating whether it has been initialized. More...
 
void * _ptr
 Physical address of the attribute. More...
 
int _strd
 Stride. More...
 
int _nbytes_strd
 Number of bytes of the stride. More...
 
int _cap
 Capacity. More...
 

Static Protected Attributes

static const int _sizes [TYPE_MAX_CONN][SIZE_MAX_CONN]
 
- Static Protected Attributes inherited from Attribute
static const char * _keywords [COM_NUM_KEYWORDS]
 List of keywords. More...
 
static const char _keylocs [COM_NUM_KEYWORDS]
 Default locations. More...
 
static const COM_Type _keytypes [COM_NUM_KEYWORDS]
 Default data types. More...
 
static const int _keysizes [COM_NUM_KEYWORDS]
 Default sizes. More...
 

Size information

Size size_of_corners_pe () const
 Get the number of corners per element of the current connectivity table. More...
 
Size size_of_nodes_pe () const
 Get the number of nodes per element of the current connectivity table. More...
 
Size size_of_edges_pe () const
 Get the number of edges per element of the current connectivity table. More...
 
Size size_of_faces_pe () const
 Get the number of faces per element of the current connectivity table. More...
 
Size size_of_elements () const
 Get the total number of elements (including ghost elements) in the table. More...
 
Size size_of_ghost_elements () const
 Get the number of ghost elements. More...
 
Size size_of_real_elements () const
 Get the number of real elements. More...
 
Size size_of_nodes () const
 Get the total number of nodes (including ghost nodes) of the owner pane. More...
 
Size size_of_ghost_nodes () const
 Get the number of ghost nodes of the owner pane. More...
 
Size size_of_real_nodes () const
 Get the number of real nodes of the owner pane. More...
 
Size index_offset () const
 Get the index of the first element. More...
 
Size size_i () const
 Get the number of nodes in i-dimension if the mesh is structured. More...
 
Size size_j () const
 Get the number of nodes in j-dimension if the mesh is structured. More...
 
Size size_k () const
 Get the number of nodes in k-dimension if the mesh is structured. More...
 
static Size size_of_corners_pe (int type)
 Get the number of corners per element of the given type of element. More...
 
static Size size_of_nodes_pe (int type)
 Get the number of nodes per element of the given type of element. More...
 
static Size size_of_edges_pe (int type)
 Get the number of edges per element of the given type of element. More...
 
static Size size_of_faces_pe (int type)
 Get the number of faces per element of the given type of element. More...
 

Helpers

void * allocate (int strd, int cap, bool force) throw (COM_exception)
 Allocate memory for unstructured mesh. More...
 
void set_size (int nitems, int ngitems=0) throw (COM_exception)
 Set the size of items and ghost items. More...
 
static bool is_element_name (const std::string &aname)
 
static const int * get_size_info (const std::string &aname)
 Obtain the size info of pre-defined connectivity. More...
 

Additional Inherited Members

- Protected Types inherited from Attribute
enum  {
  STATUS_NOT_INITIALIZED =0, STATUS_SET =1, STATUS_SET_CONST =2, STATUS_USE =3,
  STATUS_ALLOCATED =4
}
 
enum  Copy_dir { COPY_IN, COPY_OUT }
 
typedef unsigned char Shorter_size
 One byte unsighed int. More...
 
typedef unsigned int Size
 Unsighed int. More...
 
- Static Protected Member Functions inherited from Attribute
static int get_sizeof (COM_Type type, int count=1)
 
static bool compatible_types (COM_Type t1, COM_Type t2)
 
static bool is_digit (char c)
 

Detailed Description

Encapsulates an element-connectivity of a mesh.

It supports both structured and unstructured meshes.

Definition at line 41 of file Connectivity.h.

Member Typedef Documentation

typedef unsigned char Shorter_size

One byte unsighed int.

Definition at line 53 of file Attribute.h.

typedef unsigned int Size

Unsighed int.

Definition at line 54 of file Attribute.h.

Member Enumeration Documentation

Enumerator
ST1 
ST2 
ST3 
BAR2 
BAR3 
TRI3 
TRI6 
QUAD4 
QUAD8 
QUAD9 
TET4 
TET10 
PYRIMID5 
PYRIMID14 
PRISM6 
PRISM15 
PRISM18 
HEX8 
HEX20 
HEX27 
TYPE_MAX_CONN 

Definition at line 43 of file Connectivity.h.

Constructor & Destructor Documentation

Connectivity ( Pane pane,
const std::string &  name,
int  id,
const int  sizes[],
int  type = COM_INT 
)
inline

Create an attribute with name n in window w.

Parameters
panepointer to its owner pane object.
parentparent connectivity (for supporting inheritance).
nameconnectivity name.
idconnectivity ID (always negative).
sizessize information about the element type.
typebase data type.

Definition at line 90 of file Connectivity.h.

92  : Attribute( pane, name, id, 'p', type,
93  /* for structured meshes, ncomp is 1 */
94  (sizes[TYPE_ID]<=ST3)?1:sizes[SIZE_NNODES], ""),
95  _offset(0), _size_info(sizes) {}
Attribute()
Default constructor.
Definition: Attribute.h:60
int _offset
Offset of the first element.
Definition: Connectivity.h:255
const std::string & name() const
Obtain the name of the attribute.
Definition: Attribute.h:113
const int * _size_info
Definition: Connectivity.h:256
Connectivity ( Pane pane,
Connectivity con,
const std::string &  name,
int  id 
)
inline

Construct from another connectivity table.

Definition at line 98 of file Connectivity.h.

100  : Attribute( pane, (Attribute*)con, name, id),
101  _offset(con->_offset), _size_info( con->_size_info) {}
An Attribute object is a data member of a window.
Definition: Attribute.h:51
Attribute()
Default constructor.
Definition: Attribute.h:60
int _offset
Offset of the first element.
Definition: Connectivity.h:255
const std::string & name() const
Obtain the name of the attribute.
Definition: Attribute.h:113
const int * _size_info
Definition: Connectivity.h:256

Member Function Documentation

void* allocate ( int  strd,
int  cap,
bool  force 
)
throw (COM_exception
)
inline

Allocate memory for unstructured mesh.

Definition at line 236 of file Connectivity.h.

References Attribute::allocate(), COM_ERR_ALLOC_STRUCTURED, and is_structured().

236  {
237  if ( !is_structured()) return Attribute::allocate( strd, cap, force);
239  }
bool is_structured() const
Determine whether the mesh is quadratic.
Definition: Connectivity.h:128
Encapsulates the states of an exception.
void * allocate(int strd, int cap, bool force)
Allocate memory for the attribute.
Definition: Attribute.C:345

Here is the call graph for this function:

int dimension ( ) const
inline

Get the dimension of the mesh.

Definition at line 125 of file Connectivity.h.

References _size_info, and SIZE_DIM.

Referenced by cauchystressprinc(), get_enhanced_map(), get_external_loads(), get_jacobien(), get_mixed_map(), jacobi(), kronecker_product(), size_j(), size_k(), and tensormul().

125 { return _size_info[SIZE_DIM]; }
const int * _size_info
Definition: Connectivity.h:256

Here is the caller graph for this function:

int element_type ( ) const
inline

Obtain element type ID.

Definition at line 122 of file Connectivity.h.

References _size_info, and TYPE_ID.

Referenced by Element_node_enumerator::type().

122 { return _size_info[TYPE_ID]; }
const int * _size_info
Definition: Connectivity.h:256

Here is the caller graph for this function:

const int * get_addr ( int  i,
int  j = 0 
) const
throw (COM_exception
)

Obtain the address of the jth component of the ith item, where 0<=i<size_of_items.

This function is recursive and relatively expensive, and hence should be used only for performance-insenstive tasks.

Definition at line 64 of file Connectivity.C.

References append_frame, COM_ERR_INDEX_OUT_OF_BOUNDS, Attribute::get_addr(), i, j, and offset().

64  {
65  if ( _parent) return root()->get_addr( i,j);
66 
67  // Check that i is between 0 and size_of_items-1.
68  if ( i<0 || i>=size_of_items())
71 
72  int offset = ( _strd == 1) ? (j*_cap) : j;
73  return ((const int*)_ptr)+offset+i*_strd;
74 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _strd
Stride.
Definition: Attribute.h:321
const void * get_addr(int i, int j=0) const
Obtain the address of the jth component of the ith item, where 0&lt;=i&lt;size_of_items.
Definition: Attribute.C:85
real *8 function offset(vNorm, x2, y2, z2)
Definition: PlaneNorm.f90:211
Encapsulates the states of an exception.
Connectivity * root()
Root of use-inheritance.
Definition: Connectivity.h:112
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
blockLoc i
Definition: read.cpp:79
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.
j indices j
Definition: Indexing.h:6
const int * get_addr(int i, int j=0) const
Obtain the address of the jth component of the ith item, where 0&lt;=i&lt;size_of_items.
Definition: Connectivity.C:64
int _cap
Capacity.
Definition: Attribute.h:323
int size_of_items() const
Obtain the number of items in the attribute.
Definition: Attribute.C:111
std::string fullname() const
Obtain the full name of the attribute including window name suitable for printing out error messages...
Definition: Attribute.C:82

Here is the call graph for this function:

int* get_addr ( int  i,
int  j = 0 
)
throw (COM_exception
)
inline

Definition at line 216 of file Connectivity.h.

References COM_ERR_ATTRIBUTE_CONST, is_const(), and j.

216  {
218  return (int*)(((const Connectivity*)this)->get_addr(i,j));
219  }
Encapsulates the states of an exception.
blockLoc i
Definition: read.cpp:79
bool is_const() const
Returns whether the array is set to be read-only.
Definition: Connectivity.h:223
j indices j
Definition: Indexing.h:6
Encapsulates an element-connectivity of a mesh.
Definition: Connectivity.h:41

Here is the call graph for this function:

const int * get_size_info ( const std::string &  aname)
static

Obtain the size info of pre-defined connectivity.

Definition at line 234 of file Connectivity.C.

References _sizes, BAR2, BAR3, COM_assertion, HEX20, HEX27, HEX8, PRISM15, PRISM18, PRISM6, PYRIMID14, PYRIMID5, QUAD4, QUAD8, QUAD9, ST1, ST2, ST3, TET10, TET4, TRI3, TRI6, and TYPE_ID.

Referenced by Pane::connectivity(), and Window::get_attribute().

235 {
236  int idx = 2;
237  switch (aname[1]) {
238  case 'b':
239  while (aname[idx]=='0') idx++;
240  if ( aname[idx]=='2')
241  { COM_assertion( _sizes[BAR2][TYPE_ID]==BAR2); return _sizes[BAR2]; }
242  if ( aname[idx]=='3')
243  { COM_assertion( _sizes[BAR3][TYPE_ID]==BAR3); return _sizes[BAR3]; }
244  break;
245  case 't':
246  while (aname[idx]=='0') idx++;
247  if ( aname[idx]=='3')
248  { COM_assertion( _sizes[TRI3][TYPE_ID]==TRI3); return _sizes[TRI3]; }
249  if ( aname[idx]=='6')
250  { COM_assertion( _sizes[TRI6][TYPE_ID]==TRI6); return _sizes[TRI6]; }
251  break;
252  case 'q':
253  while (aname[idx]=='0') idx++;
254  if ( aname[idx]=='4')
255  { COM_assertion( _sizes[QUAD4][TYPE_ID]==QUAD4); return _sizes[QUAD4]; }
256  if ( aname[idx]=='8')
257  { COM_assertion( _sizes[QUAD8][TYPE_ID]==QUAD8); return _sizes[QUAD8]; }
258  if ( aname[idx]=='9')
259  { COM_assertion( _sizes[QUAD9][TYPE_ID]==QUAD9); return _sizes[QUAD9]; }
260  break;
261  case 'T':
262  while (aname[idx]=='0') idx++;
263  if ( aname[idx]=='4')
264  { COM_assertion( _sizes[TET4][TYPE_ID]==TET4); return _sizes[TET4]; }
265  if ( aname[idx]=='1' && aname[idx+1]=='0')
266  { COM_assertion( _sizes[TET10][TYPE_ID]==TET10); return _sizes[TET10]; }
267  break;
268  case 'H':
269  case 'B':
270  while (aname[idx]=='0') idx++;
271  if ( aname[idx]=='8')
272  { COM_assertion( _sizes[HEX8][TYPE_ID]==HEX8); return _sizes[HEX8]; }
273  if ( aname[idx]=='2') {
274  if ( aname[idx+1]=='0')
275  { COM_assertion( _sizes[HEX20][TYPE_ID]==HEX20); return _sizes[HEX20]; }
276  if ( aname[idx+1]=='7')
277  { COM_assertion( _sizes[HEX27][TYPE_ID]==HEX27); return _sizes[HEX27]; }
278  }
279  break;
280  case 'P':
281  while (aname[idx]=='0') idx++;
282  if ( aname[idx]=='5') {
284  return _sizes[PYRIMID5];
285  }
286  if ( aname[idx]=='6') {
288  return _sizes[PRISM6];
289  }
290 
291  if ( aname[idx]=='1') {
292  if ( aname[idx+1] == '4') {
294  return _sizes[PYRIMID14];
295  }
296 
297  if ( aname[idx+1] == '5') {
299  return _sizes[PRISM15];
300  }
301 
302  if ( aname[idx+1] == '8') {
304  return _sizes[PRISM18];
305  }
306  }
307  break;
308  case 'W':
309  while (aname[idx]=='0') idx++;
310  if ( aname[idx]=='6') {
312  return _sizes[PRISM6];
313  }
314 
315  if ( aname[idx]=='1') {
316  if ( aname[idx+1] == '5') {
318  return _sizes[PRISM15];
319  }
320 
321  if ( aname[idx+1] == '8') {
323  return _sizes[PRISM18];
324  }
325  }
326  break;
327  case 's':
328  if ( aname[idx++]=='t') {
329  while (aname[idx]=='0') idx++;
330  if ( aname[idx]=='3')
331  { COM_assertion( _sizes[ST3][TYPE_ID]==ST3); return _sizes[ST3]; }
332 
333  if ( aname[idx]=='2')
334  { COM_assertion( _sizes[ST2][TYPE_ID]==ST2); return _sizes[ST2]; }
335 
336  if ( aname[idx]=='1')
337  { COM_assertion( _sizes[ST1][TYPE_ID]==ST1); return _sizes[ST1]; }
338  }
339  break;
340  default: break;
341  }
342 
343  return NULL;
344 }
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
static const int _sizes[TYPE_MAX_CONN][SIZE_MAX_CONN]
Definition: Connectivity.h:258

Here is the caller graph for this function:

Size index_offset ( ) const
inline

Get the index of the first element.

Definition at line 189 of file Connectivity.h.

References _offset, and root().

Referenced by Pane::connectivity(), Element_node_enumerator::Element_node_enumerator(), Element_node_enumerator::id(), Element_node_enumerator::next(), and Element_node_enumerator_uns::next().

189 { return root()->_offset; }
Connectivity * root()
Root of use-inheritance.
Definition: Connectivity.h:112
int _offset
Offset of the first element.
Definition: Connectivity.h:255

Here is the call graph for this function:

Here is the caller graph for this function:

void inherit ( Connectivity parent,
bool  clone,
bool  withghost 
)
throw (COM_exception
)
inline

Inherit a connectivity table.

Definition at line 118 of file Connectivity.h.

References Attribute::inherit(), and parent().

119  { Attribute::inherit( parent, clone, withghost); }
void inherit(Attribute *a, bool clone, bool withghost, int depth=0)
Inherit from parent. If depth&gt;0, then the procedure is for the subcomponents.
Definition: Attribute.C:426

Here is the call graph for this function:

bool is_const ( ) const
inline

Returns whether the array is set to be read-only.

Definition at line 223 of file Connectivity.h.

References Attribute::is_const(), and is_structured().

Referenced by get_addr().

223 { return is_structured() || Attribute::is_const(); }
bool is_structured() const
Determine whether the mesh is quadratic.
Definition: Connectivity.h:128
bool is_const() const
Returns whether the array is set to be read-only.
Definition: Attribute.h:253

Here is the call graph for this function:

Here is the caller graph for this function:

static bool is_element_name ( const std::string &  aname)
inlinestatic
bool is_quadratic ( ) const
inline

Determine whether the element type is quadratic.

Definition at line 132 of file Connectivity.h.

References _size_info, and ORDER.

Referenced by Element_node_enumerator::is_quadratic().

132 { return _size_info[ORDER] == 2; }
const int * _size_info
Definition: Connectivity.h:256

Here is the caller graph for this function:

bool is_structured ( ) const
inline

Determine whether the mesh is quadratic.

Definition at line 128 of file Connectivity.h.

References _size_info, ST3, and TYPE_ID.

Referenced by allocate(), is_const(), size_of_elements(), size_of_ghost_elements(), size_of_ghost_nodes(), size_of_nodes(), size_of_real_elements(), and size_of_real_nodes().

Here is the caller graph for this function:

Connectivity* parent ( )
inline

Parent attribute being used.

Definition at line 108 of file Connectivity.h.

Referenced by inherit(), and Window::reinit_conn().

108 { return (Connectivity*)_parent; }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
Encapsulates an element-connectivity of a mesh.
Definition: Connectivity.h:41

Here is the caller graph for this function:

const Connectivity* parent ( ) const
inline

Definition at line 109 of file Connectivity.h.

References Attribute::_parent.

109 { return (const Connectivity*)_parent; }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
Encapsulates an element-connectivity of a mesh.
Definition: Connectivity.h:41
const int* pointer ( ) const
inline

Get a constant pointer to the connectivity array.

Definition at line 206 of file Connectivity.h.

Referenced by Element_node_enumerator::Element_node_enumerator(), Element_node_enumerator::id(), Pane::inherit(), Element_node_enumerator::next(), Element_node_enumerator_uns::next(), size_i(), size_j(), size_k(), size_of_elements(), size_of_ghost_elements(), size_of_ghost_nodes(), size_of_nodes(), size_of_real_elements(), and size_of_real_nodes().

206 { return (const int*)Attribute::pointer(); }
const void * pointer() const
Obtain a constant pointer to the physical address.
Definition: Attribute.h:150

Here is the caller graph for this function:

int* pointer ( )
inline

Get a pointer to the connectivity array.

Definition at line 209 of file Connectivity.h.

References Attribute::pointer().

209 { return (int*)Attribute::pointer(); }
const void * pointer() const
Obtain a constant pointer to the physical address.
Definition: Attribute.h:150

Here is the call graph for this function:

Connectivity* root ( )
inline

Root of use-inheritance.

Definition at line 112 of file Connectivity.h.

References Attribute::root().

Referenced by index_offset().

113  { return (Connectivity*)(Attribute::root()); }
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134
Encapsulates an element-connectivity of a mesh.
Definition: Connectivity.h:41

Here is the call graph for this function:

Here is the caller graph for this function:

const Connectivity* root ( ) const
inline

Definition at line 114 of file Connectivity.h.

References Attribute::root().

115  { return (const Connectivity*)(Attribute::root()); }
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134
Encapsulates an element-connectivity of a mesh.
Definition: Connectivity.h:41

Here is the call graph for this function:

void set_offset ( Size  offset)
throw (COM_exception
)
protected

Set the index of the first element.

Definition at line 92 of file Connectivity.C.

References offset().

Referenced by Pane::refresh_connectivity().

92  {
93  _offset = offset;
94 }
real *8 function offset(vNorm, x2, y2, z2)
Definition: PlaneNorm.f90:211
int _offset
Offset of the first element.
Definition: Connectivity.h:255

Here is the call graph for this function:

Here is the caller graph for this function:

void set_pointer ( void *  p,
int  strd,
int  cap,
bool  is_const 
)
throw (COM_exception
)
protected

Set pointer of connectivity table.

Definition at line 216 of file Connectivity.C.

References Attribute::allocate(), COM_assertion, Attribute::set_pointer(), and Attribute::set_size().

218 {
219  if ( !is_structured()) {
220  Attribute::set_pointer( p, strd, cap, 0, is_const);
221  }
222  else {
223  int ndims = dimension();
224  Attribute::set_size( ndims, _ngitems);
225  _ptr = Attribute::allocate( 1, ndims, true);
226  copy_array( p, strd, ndims);
227 
228  // Update number of nodes and elements
229  COM_assertion( _parent==NULL);
231  }
232 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
void set_pointer(void *p, int strd, int cap, int offset, bool is_const)
Set the physical address of the attribute values.
Definition: Attribute.C:208
bool is_structured() const
Determine whether the mesh is quadratic.
Definition: Connectivity.h:128
int dimension() const
Get the dimension of the mesh.
Definition: Connectivity.h:125
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
void set_size(int nitems, int ngitems=0)
Set the size of items and ghost items.
Definition: Attribute.C:191
bool is_const() const
Returns whether the array is set to be read-only.
Definition: Connectivity.h:223
void * allocate(int strd, int cap, bool force)
Allocate memory for the attribute.
Definition: Attribute.C:345
void refresh_connectivity()
Update offsets and sizes of connectivity of an unstructured mesh.
Definition: Pane.C:667
void copy_array(void *buf, int strd, int nitem, int offset=0, int direction=COPY_IN)
Definition: Attribute.C:249

Here is the call graph for this function:

void set_size ( int  nitems,
int  ngitems = 0 
)
throw (COM_exception
)

Set the size of items and ghost items.

Can be changed only if the attribute is a root.

Definition at line 76 of file Connectivity.C.

References append_frame, and COM_ERR_CHANGE_INHERITED.

76  {
77  if ( _parent)
80 
81  if ( !is_structured()) {
82  _nitems = nitems; _ngitems = ngitems;
84  }
85  else {
86  _nitems = dimension(); _ngitems = ngitems;
88  }
89 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
bool initialized() const
Returns whether the array for the attribute has been set or allocated.
Definition: Attribute.h:244
bool is_structured() const
Determine whether the mesh is quadratic.
Definition: Connectivity.h:128
int dimension() const
Get the dimension of the mesh.
Definition: Connectivity.h:125
Encapsulates the states of an exception.
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
void set_size(int nitems, int ngitems=0)
Set the size of items and ghost items.
Definition: Connectivity.C:76
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.
void refresh_connectivity()
Update offsets and sizes of connectivity of an unstructured mesh.
Definition: Pane.C:667
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312
std::string fullname() const
Obtain the full name of the attribute including window name suitable for printing out error messages...
Definition: Attribute.C:82
Size size_i ( ) const
inline

Get the number of nodes in i-dimension if the mesh is structured.

Definition at line 192 of file Connectivity.h.

References pointer().

193  { return pointer()[0]; }
const int * pointer() const
Get a constant pointer to the connectivity array.
Definition: Connectivity.h:206

Here is the call graph for this function:

Size size_j ( ) const
inline

Get the number of nodes in j-dimension if the mesh is structured.

Definition at line 195 of file Connectivity.h.

References dimension(), and pointer().

196  { return dimension()>1?pointer()[1]:1; }
const int * pointer() const
Get a constant pointer to the connectivity array.
Definition: Connectivity.h:206
int dimension() const
Get the dimension of the mesh.
Definition: Connectivity.h:125

Here is the call graph for this function:

Size size_k ( ) const
inline

Get the number of nodes in k-dimension if the mesh is structured.

Definition at line 198 of file Connectivity.h.

References dimension(), and pointer().

199  { return dimension()>2?pointer()[2]:1; }
const int * pointer() const
Get a constant pointer to the connectivity array.
Definition: Connectivity.h:206
int dimension() const
Get the dimension of the mesh.
Definition: Connectivity.h:125

Here is the call graph for this function:

Size size_of_corners_pe ( ) const
inline

Get the number of corners per element of the current connectivity table.

Definition at line 139 of file Connectivity.h.

Referenced by Element_node_enumerator::size_of_corners().

140  { return _size_info[SIZE_NCORN]; }
const int * _size_info
Definition: Connectivity.h:256

Here is the caller graph for this function:

static Size size_of_corners_pe ( int  type)
inlinestatic

Get the number of corners per element of the given type of element.

Definition at line 143 of file Connectivity.h.

References _sizes, and SIZE_NCORN.

144  { return _sizes[type][SIZE_NCORN]; }
static const int _sizes[TYPE_MAX_CONN][SIZE_MAX_CONN]
Definition: Connectivity.h:258
Size size_of_edges_pe ( ) const
inline

Get the number of edges per element of the current connectivity table.

Definition at line 155 of file Connectivity.h.

References _size_info, and SIZE_NEDGES.

Referenced by Element_node_enumerator::size_of_edges().

156  { return _size_info[SIZE_NEDGES]; }
const int * _size_info
Definition: Connectivity.h:256

Here is the caller graph for this function:

static Size size_of_edges_pe ( int  type)
inlinestatic

Get the number of edges per element of the given type of element.

Definition at line 159 of file Connectivity.h.

References _sizes, and SIZE_NEDGES.

160  { return _sizes[type][SIZE_NEDGES]; }
static const int _sizes[TYPE_MAX_CONN][SIZE_MAX_CONN]
Definition: Connectivity.h:258
Connectivity::Size size_of_elements ( ) const

Get the total number of elements (including ghost elements) in the table.

Definition at line 96 of file Connectivity.C.

References Attribute::_ngitems, Attribute::_pane, _size_info, COM_assertion, COM_assertion_msg, Pane::ignore_ghost(), is_structured(), max(), n, pointer(), Attribute::size_of_items(), ST1, ST2, ST3, and TYPE_ID.

Referenced by Pane::connectivity(), Element_node_enumerator::Element_node_enumerator(), Element_node_enumerator::next(), Element_node_enumerator_uns::next(), and Pane::refresh_connectivity().

97 {
98  if ( !is_structured())
99  return size_of_items();
100  else {
102  "Only unstructured meshes supports inheritance without ghost");
103 
104  const int *sizes=pointer();
105  if ( sizes==NULL) return 0;
106  int n=0;
107  switch ( _size_info[TYPE_ID]) {
108  case ST1: n=sizes[0]-1; break;
109  case ST2: n=(sizes[0]-1)*(sizes[1]-1); break;
110  case ST3: n=(sizes[0]-1)*(sizes[1]-1)*(sizes[2]-1); break;
111  default: COM_assertion(false); // Should never reach here.
112  }
113  return std::max(0,n);
114  }
115 }
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
const int * pointer() const
Get a constant pointer to the connectivity array.
Definition: Connectivity.h:206
bool is_structured() const
Determine whether the mesh is quadratic.
Definition: Connectivity.h:128
#define COM_assertion_msg(EX, msg)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
bool ignore_ghost() const
Definition: Pane.h:202
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
const int * _size_info
Definition: Connectivity.h:256
const NT & n
int size_of_items() const
Obtain the number of items in the attribute.
Definition: Attribute.C:111

Here is the call graph for this function:

Here is the caller graph for this function:

Size size_of_faces_pe ( ) const
inline

Get the number of faces per element of the current connectivity table.

Definition at line 163 of file Connectivity.h.

References _size_info, and SIZE_NFACES.

Referenced by Element_node_enumerator::size_of_faces().

164  { return _size_info[SIZE_NFACES]; }
const int * _size_info
Definition: Connectivity.h:256

Here is the caller graph for this function:

static Size size_of_faces_pe ( int  type)
inlinestatic

Get the number of faces per element of the given type of element.

Definition at line 167 of file Connectivity.h.

References _sizes, and SIZE_NFACES.

168  { return _sizes[type][SIZE_NFACES]; }
static const int _sizes[TYPE_MAX_CONN][SIZE_MAX_CONN]
Definition: Connectivity.h:258
Connectivity::Size size_of_ghost_elements ( ) const

Get the number of ghost elements.

Definition at line 117 of file Connectivity.C.

References Attribute::_ngitems, _size_info, COM_assertion, is_structured(), max(), n, pointer(), Attribute::size_of_ghost_items(), ST1, ST2, ST3, and TYPE_ID.

Referenced by Pane::refresh_connectivity().

118 {
119  if ( !is_structured())
120  return size_of_ghost_items();
121  else {
122  const int *sizes=pointer();
123  if ( sizes==NULL) return 0;
124  int n=0;
125  switch ( _size_info[TYPE_ID]) {
126  case ST1: n=2*_ngitems; break;
127  case ST2: n=(sizes[0]-1)*(sizes[1]-1)-
128  (sizes[0]-1-2*_ngitems)*(sizes[1]-1-2*_ngitems); break;
129  case ST3: n=(sizes[0]-1)*(sizes[1]-1)*(sizes[2]-1)-
130  (sizes[0]-1-2*_ngitems)*(sizes[1]-1-2*_ngitems)*
131  (sizes[2]-1-2*_ngitems); break;
132  default: COM_assertion(false); // Should never reach here.
133  }
134  return std::max(0,n);
135  }
136 }
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
const int * pointer() const
Get a constant pointer to the connectivity array.
Definition: Connectivity.h:206
bool is_structured() const
Determine whether the mesh is quadratic.
Definition: Connectivity.h:128
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
int size_of_ghost_items() const
Obtain the number of ghost items in the attribute.
Definition: Attribute.C:139
const int * _size_info
Definition: Connectivity.h:256
const NT & n

Here is the call graph for this function:

Here is the caller graph for this function:

Connectivity::Size size_of_ghost_nodes ( ) const

Get the number of ghost nodes of the owner pane.

Definition at line 178 of file Connectivity.C.

References Attribute::_ngitems, Attribute::_pane, _size_info, COM_assertion, is_structured(), pointer(), Pane::size_of_ghost_nodes(), ST1, ST2, ST3, and TYPE_ID.

179 {
180  if ( !is_structured())
181  return _pane->size_of_ghost_nodes();
182  else {
183  const int *sizes=pointer();
184  if ( sizes==NULL) return 0;
185  switch ( _size_info[TYPE_ID]) {
186  case ST1: return 2*_ngitems;
187  case ST2: return sizes[0]*sizes[1]-
188  (sizes[0]-2*_ngitems)*(sizes[1]-2*_ngitems);
189  case ST3: return sizes[0]*sizes[1]*sizes[2]-
190  (sizes[0]-2*_ngitems)*(sizes[1]-2*_ngitems)*
191  (sizes[2]-2*_ngitems);
192  default: COM_assertion(false); // Should never reach here.
193  }
194  return 0;
195  }
196 }
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
const int * pointer() const
Get a constant pointer to the connectivity array.
Definition: Connectivity.h:206
bool is_structured() const
Determine whether the mesh is quadratic.
Definition: Connectivity.h:128
Size size_of_ghost_nodes() const
Get the number of ghost nodes.
Definition: Pane.h:126
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
const int * _size_info
Definition: Connectivity.h:256

Here is the call graph for this function:

Connectivity::Size size_of_nodes ( ) const

Get the total number of nodes (including ghost nodes) of the owner pane.

Definition at line 158 of file Connectivity.C.

References Attribute::_ngitems, Attribute::_pane, _size_info, COM_assertion, COM_assertion_msg, Pane::ignore_ghost(), is_structured(), pointer(), Pane::size_of_nodes(), ST1, ST2, ST3, and TYPE_ID.

159 {
160  if ( !is_structured())
161  return _pane->size_of_nodes();
162  else {
164  "Only unstructured meshes supports inheritance without ghost");
165 
166  const int *sizes=pointer();
167  if ( sizes==NULL) return 0;
168  switch ( _size_info[TYPE_ID]) {
169  case ST1: return sizes[0];
170  case ST2: return sizes[0]*sizes[1];
171  case ST3: return sizes[0]*sizes[1]*sizes[2];
172  default: COM_assertion(false); // Should never reach here.
173  }
174  return 0;
175  }
176 }
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
const int * pointer() const
Get a constant pointer to the connectivity array.
Definition: Connectivity.h:206
bool is_structured() const
Determine whether the mesh is quadratic.
Definition: Connectivity.h:128
#define COM_assertion_msg(EX, msg)
bool ignore_ghost() const
Definition: Pane.h:202
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
const int * _size_info
Definition: Connectivity.h:256
Size size_of_nodes() const
Get the total number of nodes in the pane (including ghost nodes).
Definition: Pane.h:118

Here is the call graph for this function:

static Size size_of_nodes_pe ( int  type)
inlinestatic

Get the number of nodes per element of the given type of element.

Definition at line 151 of file Connectivity.h.

References _sizes, and SIZE_NNODES.

152  { return _sizes[type][SIZE_NNODES]; }
static const int _sizes[TYPE_MAX_CONN][SIZE_MAX_CONN]
Definition: Connectivity.h:258
Connectivity::Size size_of_real_elements ( ) const

Get the number of real elements.

Definition at line 139 of file Connectivity.C.

References Attribute::_ngitems, _size_info, COM_assertion, is_structured(), max(), n, pointer(), Attribute::size_of_real_items(), ST1, ST2, ST3, and TYPE_ID.

140 {
141  if ( !is_structured())
142  return size_of_real_items();
143  else {
144  const int *sizes=pointer();
145  if ( sizes==NULL) return 0;
146  int n=0;
147  switch ( _size_info[TYPE_ID]) {
148  case ST1: n=sizes[0]-1-2*_ngitems; break;
149  case ST2: n=(sizes[0]-1-2*_ngitems)*(sizes[1]-1-2*_ngitems); break;
150  case ST3: n=(sizes[0]-1-2*_ngitems)*(sizes[1]-1-2*_ngitems)*
151  (sizes[2]-1-2*_ngitems); break;
152  default: COM_assertion(false); // Should never reach here.
153  }
154  return std::max(0,n);
155  }
156 }
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
const int * pointer() const
Get a constant pointer to the connectivity array.
Definition: Connectivity.h:206
bool is_structured() const
Determine whether the mesh is quadratic.
Definition: Connectivity.h:128
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
const int * _size_info
Definition: Connectivity.h:256
const NT & n
int size_of_real_items() const
Obtain the number of real items in the attribute.
Definition: Attribute.C:167

Here is the call graph for this function:

Connectivity::Size size_of_real_nodes ( ) const

Get the number of real nodes of the owner pane.

Definition at line 198 of file Connectivity.C.

References Attribute::_ngitems, Attribute::_pane, _size_info, COM_assertion, is_structured(), pointer(), Pane::size_of_real_nodes(), ST1, ST2, ST3, and TYPE_ID.

199 {
200  if ( !is_structured())
201  return _pane->size_of_real_nodes();
202  else {
203  const int *sizes=pointer();
204  if ( sizes==NULL) return 0;
205  switch ( _size_info[TYPE_ID]) {
206  case ST1: return sizes[0]-2*_ngitems;
207  case ST2: return (sizes[0]-2*_ngitems)*(sizes[1]-2*_ngitems);
208  case ST3: return (sizes[0]-2*_ngitems)*(sizes[1]-2*_ngitems)*
209  (sizes[2]-2*_ngitems);
210  default: COM_assertion(false); // Should never reach here.
211  }
212  return 0;
213  }
214 }
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
const int * pointer() const
Get a constant pointer to the connectivity array.
Definition: Connectivity.h:206
bool is_structured() const
Determine whether the mesh is quadratic.
Definition: Connectivity.h:128
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
const int * _size_info
Definition: Connectivity.h:256
Size size_of_real_nodes() const
Get the number of real nodes in the pane (excluding ghost nodes).
Definition: Pane.h:134

Here is the call graph for this function:

Member Data Documentation

int _offset
protected

Offset of the first element.

Definition at line 255 of file Connectivity.h.

Referenced by index_offset().

COM_BEGIN_NAME_SPACE const int _sizes
staticprotected
Initial value:
=
{
{ST1, 1, 1, 2, 2, 1, 0},
{ST2, 2, 1, 4, 4, 4, 1},
{ST3, 3, 1, 8, 8, 12, 6},
{BAR2, 1, 1, 2, 2, 1, 0},
{BAR3, 1, 2, 3, 2, 1, 0},
{TRI3, 2, 1, 3, 3, 3, 1},
{TRI6, 2, 2, 6, 3, 3, 1},
{QUAD4, 2, 1, 4, 4, 4, 1},
{QUAD8, 2, 2, 8, 4, 4, 1},
{QUAD9, 2, 2, 9, 4, 4, 1},
{TET4, 3, 1, 4, 4, 6, 4},
{TET10, 3, 2, 10, 4, 6, 4},
{PYRIMID5, 3, 1, 5, 5, 8, 5},
{PYRIMID14,3, 2, 14, 5, 8, 5},
{PRISM6, 3, 1, 6, 6, 9, 5},
{PRISM15, 3, 2, 15, 6, 9, 5},
{PRISM18, 3, 2, 18, 6, 9, 5},
{HEX8, 3, 1, 8, 8, 12, 6},
{HEX20, 3, 2, 20, 8, 12, 6},
{HEX27, 3, 2, 27, 8, 12, 6}
}

Definition at line 258 of file Connectivity.h.

Referenced by get_size_info(), size_of_corners_pe(), size_of_edges_pe(), size_of_faces_pe(), and size_of_nodes_pe().


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