/*****************************************************************************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* Type & structure definitions for objects & geometry. This is really the26* definition of the structure of ElmerPost.27*28*******************************************************************************29*30* Author: Juha Ruokolainen31*32* Address: CSC - IT Center for Science Ltd.33* Keilaranta 14, P.O. BOX 40534* 02101 Espoo, Finland35* Tel. +358 0 457 272336* Telefax: +358 0 457 230237* EMail: [email protected]38*39* Date: 26 Sep 199540*41* Modified by:42*43* Date of modification:44*45******************************************************************************/4647#ifdef MODULE_GEOMETRY48# define GEO_EXT49#else50# define GEO_EXT extern51#endif5253#define GEO_TRIANGLE_BLOCK_SIZE 409654#define GEO_VERTEX_BLOCK_SIZE 40965556#define FLOAT float5758typedef struct group_s59{60struct group_s *Next;61int status,Open;62char *Name;63} group_t;6465/*66* Triangle67*/68typedef struct69{70int v[3]; /* vertex pointers */71FLOAT Fu[3]; /* triangle normal */72FLOAT u[3][3]; /* vertex normals */7374struct element_s *Element;7576int Count;77logical_t Edge[3]; /* beginning of an edge flag */78} triangle_t;7980/*81* list of faces connected to a vertex82*/83typedef struct vertex_face_s84{85int Face;86struct vertex_face_s *Next;87} vertex_face_t;8889/*90* vertex def's91*/92typedef struct vertex_s93{94FLOAT x[3];95vertex_face_t *Faces;96logical_t ElementModelNode;97} vertex_t;9899typedef struct100{101FLOAT x[3],y[3],z[3];102FLOAT u[3],v[3],w[3];103FLOAT c[3],f[3];104} polygon_t;105106typedef enum107{108line_style_line,line_style_cylinder109} line_style_t;110111typedef struct line_s112{113float x[3];114float y[3];115float z[3];116float f[3],c[3];117} line_t;118119/*120* Edges of elements are hold in an array of lists that are121* indexed by smallest numbered vertex of a particular edge.122*/123typedef enum124{125edge_style_all, edge_style_free126} edge_style_t;127128typedef struct edge_list_s129{130struct edge_list_s *Next;131int Entry,Count;132struct element_s *Element;133} edge_list_t;134135typedef struct edge_s136{137edge_list_t *EdgeList;138} edge_t;139140/*141* geometry def's142*/143typedef struct geometry_s144{145struct Geometry_s *Next;146char *Name;147148triangle_t *Triangles;149int TriangleCount,MaxTriangleCount;150151vertex_t *Vertices;152int VertexCount,MaxVertexCount;153154edge_t *Edges;155156double Scale;157vertex_t MinMax[2];158} geometry_t;159160GEO_EXT geometry_t Geometry;161162typedef struct data_s163{164int a;165} data_t;166167168void geo_free_groups( group_t *groups );169int geo_add_vertex( geometry_t *geometry, vertex_t *vertex );170void geo_free_edge_tables( geometry_t *geometry );171void geo_free_vertex_face_tables( geometry_t *geometry );172int geo_add_triangle( geometry_t *geometry, triangle_t *triangle );173void geo_triangle_normal( geometry_t *geom,triangle_t *triangle );174void geo_vertex_normals( geometry_t *geometry, double Ang ) ;175176177