ESYS13  Revision_
ReferenceElements.h
Go to the documentation of this file.
00001 
00002 /*******************************************************
00003 *
00004 * Copyright (c) 2003-2012 by University of Queensland
00005 * Earth Systems Science Computational Center (ESSCC)
00006 * http://www.uq.edu.au/esscc
00007 *
00008 * Primary Business: Queensland, Australia
00009 * Licensed under the Open Software License version 3.0
00010 * http://www.opensource.org/licenses/osl-3.0.php
00011 *
00012 *******************************************************/
00013 
00014 
00015 /**************************************************************/
00016 
00017 /*   Finley: Reference elements */
00018 
00019 /**************************************************************/
00020 
00021 #ifndef INC_FINLEY_REFERENCEELEMENTS
00022 #define INC_FINLEY_REFERENCEELEMENTS
00023 
00024 
00025 /**************************************************************/
00026 
00027 #include "Finley.h"
00028 #include "ShapeFunctions.h"
00029 #include "Quadrature.h"
00030 
00031 /**************************************************************/
00032 
00033 /*     The ids of the allowed reference elements: */
00034 
00035 #define MAX_numNodes 64
00036 #define MAX_numSubElements 8
00037 #define MAX_numSides 2
00038 
00039 typedef enum {
00040   Finley_Point1,
00041   Finley_Line2,
00042   Finley_Line3,
00043   Finley_Line4,
00044   Finley_Tri3,
00045   Finley_Tri6,
00046   Finley_Tri9,
00047   Finley_Tri10,
00048   Finley_Rec4,
00049   Finley_Rec8,
00050   Finley_Rec9,
00051   Finley_Rec12,
00052   Finley_Rec16,
00053   Finley_Tet4,
00054   Finley_Tet10,
00055   Finley_Tet16,
00056   Finley_Hex8,
00057   Finley_Hex20,
00058   Finley_Hex27,
00059   Finley_Hex32,
00060   Finley_Line2Face,
00061   Finley_Line3Face,
00062   Finley_Line4Face,
00063   Finley_Tri3Face,
00064   Finley_Tri6Face,
00065   Finley_Tri9Face,
00066   Finley_Tri10Face,
00067   Finley_Rec4Face,
00068   Finley_Rec8Face,
00069   Finley_Rec9Face,
00070   Finley_Rec12Face,
00071   Finley_Rec16Face,
00072   Finley_Tet4Face, 
00073   Finley_Tet10Face, 
00074   Finley_Tet16Face,
00075   Finley_Hex8Face,
00076   Finley_Hex20Face, 
00077   Finley_Hex27Face, 
00078   Finley_Hex32Face, 
00079   Finley_Point1_Contact,
00080   Finley_Line2_Contact,
00081   Finley_Line3_Contact,
00082   Finley_Line4_Contact,
00083   Finley_Tri3_Contact,
00084   Finley_Tri6_Contact,
00085   Finley_Tri9_Contact,
00086   Finley_Tri10_Contact,
00087   Finley_Rec4_Contact,
00088   Finley_Rec8_Contact,
00089   Finley_Rec9_Contact,
00090   Finley_Rec12_Contact,
00091   Finley_Rec16_Contact,
00092   Finley_Line2Face_Contact,
00093   Finley_Line3Face_Contact,
00094   Finley_Line4Face_Contact,
00095   Finley_Tri3Face_Contact,
00096   Finley_Tri6Face_Contact,
00097   Finley_Tri9Face_Contact,
00098   Finley_Tri10Face_Contact,
00099   Finley_Rec4Face_Contact,
00100   Finley_Rec8Face_Contact,
00101   Finley_Rec9Face_Contact,
00102   Finley_Rec12Face_Contact,
00103   Finley_Rec16Face_Contact,
00104   Finley_Tet4Face_Contact, 
00105   Finley_Tet10Face_Contact, 
00106   Finley_Tet16Face_Contact,
00107   Finley_Hex8Face_Contact,
00108   Finley_Hex20Face_Contact,
00109   Finley_Hex27Face_Contact, 
00110   Finley_Hex32Face_Contact, 
00111   Finley_Line3Macro, 
00112   Finley_Tri6Macro, 
00113   Finley_Rec9Macro,
00114   Finley_Tet10Macro,
00115   Finley_Hex27Macro,
00116   Finley_NoRef   /* marks end of list */
00117 } Finley_ElementTypeId;
00118 
00119 /**************************************************************/
00120 
00121 /*  this struct holds the definition of the reference element: */
00122 
00123 typedef struct Finley_ReferenceElementInfo {
00124   Finley_ElementTypeId TypeId;               /* the id */
00125   char* Name;                                /* the name in text form e.g. Line1,Rec12,... */
00126   dim_t numNodes;                            /* number of nodes defining the element*/
00127   dim_t numSubElements;                      /* number of subelements. >1 if macro elements are used. */
00128   dim_t numSides;                            /* specifies the number of sides the element supports. This =2 if contact elements are used
00129                                                 otherwise =1. */
00130                                                 
00131 
00132   index_t offsets[MAX_numSides+1];           /* offset to the side nodes: offsets[s]...offset[s+1]-1 refers to the nodes to be used for side s*/                                
00133 
00134   
00135   Finley_ElementTypeId LinearTypeId;         /* id of the linear version of the element */
00136   
00137   index_t linearNodes[MAX_numNodes*MAX_numSides];  /* gives the list of nodes defining the linear or macro element */
00138   
00139   Finley_QuadTypeId Quadrature;                /* quadrature scheme */
00140   Finley_ShapeFunctionTypeId Parametrization;  /* shape function for parametrization of the element */
00141   Finley_ShapeFunctionTypeId BasisFunctions;   /* shape function for the basis functions */ 
00142 
00143   index_t subElementNodes[MAX_numNodes*MAX_numSides*MAX_numSubElements];         /* gives the list of nodes defining the subelements:
00144                                                                         subElementNodes[INDEX2(i,s,BasisFunctions->numShape*numSides)] is the i-th node in the s-th subelement.*/ 
00145 /*********************************************************************************************************************************** */  
00146   dim_t numRelevantGeoNodes;                 /* number of nodes used to describe the geometry of the geometrically relevant part of the element
00147                                                 typically this is numNodes but for 'Face' elements where the quadrature points are defined on face of the element 
00148                         this is the number of nodes on the particular face. */
00149   index_t relevantGeoNodes[MAX_numNodes];    /* list to gather the geometrically relevant nodes (length used is numRelevantGeoNodes)
00150                                                 this list is used for the VTK interface */
00151   
00152   dim_t numNodesOnFace;                       /* if the element is allowed as a face element, numNodesOnFace defines the number of nodes defining the face */
00153                                               /* the following lists are only used for face elements defined by numNodesOnFace>0 */
00154   index_t faceNodes[MAX_numNodes];             /* list of the nodes defining the face */
00155   index_t shiftNodes[MAX_numNodes];           /* defines a permutation of the nodes which rotates the nodes on the face */
00156   index_t reverseNodes[MAX_numNodes];         /* reverses the order of the nodes on a face. The permutation has to keep 0 fixed. */
00157                                               /* shiftNodes={-1} or reverseNodes={-1} are ignored. */
00158 }  Finley_ReferenceElementInfo;
00159 
00160 
00161 /**************************************************************/
00162 
00163 /*  this struct holds the realization of a reference element */
00164 
00165 typedef struct Finley_ReferenceElement {
00166     Finley_ReferenceElementInfo* Type;     /* type of the reference element */
00167     Finley_ReferenceElementInfo* LinearType;     /* type of the linear reference element */
00168     index_t reference_counter;         /* reference counter */
00169         dim_t integrationOrder;                /* used integration order */
00170     dim_t numNodes;
00171         dim_t numLocalDim;
00172     dim_t numLinearNodes;
00173     Finley_ShapeFunction* Parametrization;
00174     Finley_ShapeFunction* BasisFunctions;
00175     Finley_ShapeFunction* LinearBasisFunctions;
00176         double* DBasisFunctionDv;                              /* pointer to derivatives to basis function corresponding to the Parametrization quad points */
00177         bool_t DBasisFunctionDvShared;                /* TRUE to indicate that DBasisFunctionDv is shared with another object which is managing it */
00178 
00179 }  Finley_ReferenceElement;
00180 
00181 /**************************************************************/
00182 
00183 /*    interfaces: */
00184 
00185 Finley_ReferenceElement* Finley_ReferenceElement_alloc(Finley_ElementTypeId,int);
00186 void Finley_ReferenceElement_dealloc(Finley_ReferenceElement*);
00187 Finley_ElementTypeId Finley_ReferenceElement_getTypeId(char*);
00188 Finley_ReferenceElement* Finley_ReferenceElement_reference(Finley_ReferenceElement* in);
00189 Finley_ReferenceElementInfo* Finley_ReferenceElement_getInfo(Finley_ElementTypeId id);
00190 
00191 
00192 #define Finley_ReferenceElement_getNumNodes(__in__) (__in__)->Type->numNodes
00193 
00194 #endif /* #ifndef INC_FINLEY_REFERENCEELEMENTS */
00195