Encapsulates an element-connectivity of a mesh. More...
#include <Connectivity.h>


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 | |
| Connectivity * | parent () |
| Parent attribute being used. More... | |
| const Connectivity * | parent () const |
| Connectivity * | root () |
| Root of use-inheritance. More... | |
| const Connectivity * | root () 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... | |
| Attribute * | parent () |
| Parent attribute used by this object. More... | |
| const Attribute * | parent () const |
| Attribute * | root () |
| Root of use-inheritance. More... | |
| const Attribute * | root () 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 Pane * | pane () const |
| Obtain a constant pointer to the owner pane of the attribute. More... | |
| Pane * | pane () |
| Obtain a modifiable pointer to the owner pane of the attribute. More... | |
| const Window * | window () const |
| Obtain a constant pointer to the parent window of the attribute. More... | |
| Window * | window () |
| 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) |
Encapsulates an element-connectivity of a mesh.
It supports both structured and unstructured meshes.
Definition at line 41 of file Connectivity.h.
| 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.
| enum Connectivity_info |
| Enumerator | |
|---|---|
| TYPE_ID | |
| SIZE_DIM | |
| ORDER | |
| SIZE_NNODES | |
| SIZE_NCORN | |
| SIZE_NEDGES | |
| SIZE_NFACES | |
| SIZE_MAX_CONN | |
Definition at line 50 of file Connectivity.h.
| enum Connectivity_type |
| 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.
|
inline |
Create an attribute with name n in window w.
| pane | pointer to its owner pane object. |
| parent | parent connectivity (for supporting inheritance). |
| name | connectivity name. |
| id | connectivity ID (always negative). |
| sizes | size information about the element type. |
| type | base data type. |
Definition at line 90 of file Connectivity.h.
|
inline |
Construct from another connectivity table.
Definition at line 98 of file Connectivity.h.
|
inline | ||||||||||||||||||||||||
Allocate memory for unstructured mesh.
Definition at line 236 of file Connectivity.h.
References Attribute::allocate(), COM_ERR_ALLOC_STRUCTURED, and is_structured().

|
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().

|
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().

| 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().

|
inline | ||||||||||||||||||||
Definition at line 216 of file Connectivity.h.
References COM_ERR_ATTRIBUTE_CONST, is_const(), and j.

|
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().

|
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().


|
inline | ||||||||||||||||||||||||
Inherit a connectivity table.
Definition at line 118 of file Connectivity.h.
References Attribute::inherit(), and parent().

|
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().


|
inlinestatic |
Definition at line 228 of file Connectivity.h.
Referenced by Window::alloc_array(), Window::append_array(), Window::copy_array(), Window::dealloc_array(), Window::get_array(), Window::get_attribute(), Window::get_parent(), Window::get_size(), Window::get_status(), Window::new_attribute(), Window::resize_array(), Window::set_array(), and Window::set_size().

|
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().

|
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().

|
inline |
Parent attribute being used.
Definition at line 108 of file Connectivity.h.
Referenced by inherit(), and Window::reinit_conn().

|
inline |
|
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().

|
inline |
Get a pointer to the connectivity array.
Definition at line 209 of file Connectivity.h.
References Attribute::pointer().

|
inline |
Root of use-inheritance.
Definition at line 112 of file Connectivity.h.
References Attribute::root().
Referenced by index_offset().


|
inline |
Definition at line 114 of file Connectivity.h.
References Attribute::root().

|
protected | ||||||||||||||
Set the index of the first element.
Definition at line 92 of file Connectivity.C.
References offset().
Referenced by Pane::refresh_connectivity().


|
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().

| 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.
|
inline |
Get the number of nodes in i-dimension if the mesh is structured.
Definition at line 192 of file Connectivity.h.
References pointer().

|
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().

|
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().

|
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().

|
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.
|
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().

|
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.
| 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().


|
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().

|
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.
| 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().


| 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.

| 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.

|
inline |
Get the number of nodes per element of the current connectivity table.
Definition at line 147 of file Connectivity.h.
References _size_info, and SIZE_NNODES.
Referenced by Element_node_enumerator::Element_node_enumerator(), Pane_ghost_connectivity::finalize_pconn(), Element_node_enumerator::id(), Element_node_enumerator::next(), Element_node_enumerator_uns::next(), Pane_ghost_connectivity::process_received_data(), Element_node_enumerator::size_of_nodes(), Element_node_enumerator_uns::size_of_nodes(), and Element_node_enumerator::vertex().

|
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.
| 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.

| 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.

|
protected |
Offset of the first element.
Definition at line 255 of file Connectivity.h.
Referenced by index_offset().
|
protected |
Definition at line 256 of file Connectivity.h.
Referenced by dimension(), element_type(), is_quadratic(), is_structured(), size_of_edges_pe(), size_of_elements(), size_of_faces_pe(), size_of_ghost_elements(), size_of_ghost_nodes(), size_of_nodes(), size_of_nodes_pe(), size_of_real_elements(), and size_of_real_nodes().
|
staticprotected |
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().