/*****************************************************************************1*2* Elmer, A Finite Element Software for Multiphysical Problems3*4* Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland5*6* This program is free software; you can redistribute it and/or7* modify it under the terms of the GNU General Public License8* as published by the Free Software Foundation; either version 29* of the License, or (at your option) any later version.10*11* This program is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14* GNU General Public License for more details.15*16* You should have received a copy of the GNU General Public License17* along with this program (in file fem/GPL-2); if not, write to the18* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,19* Boston, MA 02110-1301, USA.20*21*****************************************************************************/2223/*******************************************************************************24*25* Element model type definitions etc.26*27*******************************************************************************28*29* Author: Juha Ruokolainen30*31* Address: CSC - IT Center for Science Ltd.32* Keilaranta 14, P.O. BOX 40533* 02101 Espoo, Finland34* Tel. +358 0 457 272335* Telefax: +358 0 457 230236* EMail: [email protected]37*38* Date: 20 Sep 199539*40* Modification history:41*42* 28 Sep 1995, modified element_defs_t and element_type_t structures to hold43* list of element_types instead of an array44* Juha R45*46*******************************************************************************/4748#if !defined(ELEMENTS_H)4950#define ELEMENTS_H5152#define TRUE 153#define FALSE 05455#ifdef MODULE_ELEMENTS56#define ELM_EXT57#else58#define ELM_EXT extern59#endif6061#define AEPS 1.0E-126263#define ELM_NULL_ELEMENT -16465#define ELM_MAX_ELEMENT_TYPES 10066#define ELM_MAX_ELEMENT_CODE 9996768#define ELM_MAX_ELEMENT_NODES 27 /* TODO: FIX THIS WHEN YOU'VE GOT MORE... */6970#define MAX_GROUP_IDS 87172typedef struct element_s73{74struct element_type_s *ElementType;75signed char DisplayFlag;76int *Topology;77signed char GroupIds[MAX_GROUP_IDS];78} element_t;7980typedef struct element_model_s81{82double *NodeArray;83element_t *Elements;8485group_t *Groups;8687int NofNodes, NofElements, NofTimesteps;88} element_model_t;8990ELM_EXT element_model_t ElementModel;91ELM_EXT element_t *Elements;9293typedef struct element_type_s94{95struct element_type_s *Next;9697char *ElementName; /* One line description of the element */98int ElementCode; /* Numeric code for the element */99100double *NodeU; /* node u coordinates */101double *NodeV; /* node v coordinates */102double *NodeW; /* node w coordinates */103104int NumberOfNodes; /* number of nodes */105106/*107* function to give value of a variable (f), given coordinates (u,v,w)108*/109double (*FunctionValue)( double *f,double u,double v,double w );110111/*112* function to give value of first partial derivate in (u) of a variable (f),113* given coordinates (u,v,w)114*/115double (*PartialU)( double *f,double u,double v,double w );116117/*118* function to give value of first partial derivate in (v) of a variable (f),119* given coordinates (u,v,w)120*/121double (*PartialV)( double *f,double u,double v,double w );122123/*124* function to give value of first partial derivate in (w) of a variable (f),125* given coordinates (u,v,w)126*/127double (*PartialW)( double *f,double u,double v,double w );128129/*130* function to give value of second partial derivates of a variable (f),131* given coordinates (u,v,w)132*/133double (*SecondPartials)( double *f,double u,double v,double w,double *Values );134135/*136* Trianglulate the element given node coordinates. Return value is 1 for137* success, 0 for failure.138*/139int (*Triangulate)( geometry_t *,element_t *,element_t * );140141/*142* Check if a point is inside element boundaries, and return element coordinates143* of the point if it is.144*/145int (*PointInside)146(147double *nodex, double *nodey, double *nodez,148double x, double y, double z, double *u,double *v,double *w149);150151/*152* Isoline extraction for an element.153*/154int (*IsoLine)155(156double K, double *F, double *C, double *nx, double *ny, double *nz, line_t *line157);158159/*160* Isosurface extraction for element.161*/162int (*IsoSurface)163(164double K, double *F, double *C, double *nx, double *ny,double *nz,165double *nu,double *nv,double *nw,polygon_t *poly166);167168} element_type_t;169170/*171* Element type definitions172*/173typedef struct element_defs_s174{175element_type_t *ElementTypes;176int NumberOfTypes;177} element_defs_t;178179ELM_EXT element_defs_t ElementDefs;180181#ifdef MODULE_ELEMENTS182183int ElmBrickFace[6][9] =184{185{ 0,1,2,3, 8, 9,10,11,20 },186{ 4,5,6,7,16,17,18,19,21 },187{ 0,1,5,4, 8,13,16,12,22 },188{ 3,2,6,7,10,14,18,15,24 },189{ 0,3,7,4,11,15,19,12,25 },190{ 1,2,6,5, 9,14,17,13,23 }191};192193int ElmWedgeFace[5][8] =194{195{ 0, 1, 4, 3, 6, 13, 9, 12 },196{ 0, 2, 5, 3, 8, 14, 11, 12 },197{ 1, 2, 5, 4, 7, 14, 10, 13 },198{ 0, 1, 2, 6, 7, 8, 0, 0 },199{ 3, 4, 5, 9, 10, 11, 0, 0 }200};201202int ElmTetraFace[4][7] =203{204{ 0, 1, 2, 4, 5, 6, 10 },205{ 0, 1, 3, 4, 8, 7, 11 },206{ 1, 2, 3, 5, 9, 8, 12 },207{ 0, 2, 3, 6, 9, 7, 13 }208};209210int ElmTetraFaceCubic[4][10] =211{212{ 0, 1, 2, 4, 5, 6, 7, 8, 9,16 },213{ 0, 1, 3, 4, 5,11,14,13,10,17 },214{ 1, 2, 3, 6, 7,12,15,14,11,18 },215{ 0, 2, 3, 9, 8,12,15,13,10,19 }216};217218#else219220extern int ElmBrickFace[6][9];221extern int ElmWedgeFace[5][8];222extern int ElmTetraFace[4][7];223extern int ElmTetraFaceCubic[4][10];224225#endif226227void lu_mtrinv( double *, int );228int elm_initialize_element_types();229#endif230231232