/*****************************************************************************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* Main module for element model descriptions & utility routines.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, removed elm_triangle_normal43* Juha R44*45*46******************************************************************************/4748#define MODULE_ELEMENTS4950#include "../elmerpost.h"51#include <elements.h>5253/*******************************************************************************54*55* Name: elm_element_type_add56*57* Purpose: Add an element to element type list58*59* Parameters:60*61* Input: (element_type_t *) structure describing the element type62*63* Output: Global list of element types is modified64*65* Return value: malloc() success66*67******************************************************************************/68int elm_add_element_type( element_type_t *Def )69{70element_type_t *ptr;7172ptr = (element_type_t *)calloc( sizeof(element_type_t),1 );7374if ( !ptr )75{76fprintf( stderr, "elm_add_element_type: FATAL: can't allocate (a few bytes of) memory.\n" );77return FALSE;78}7980*ptr = *Def;8182ptr->Next = ElementDefs.ElementTypes;83ElementDefs.ElementTypes = ptr;8485return TRUE;86}8788int elm_2node_bar_initialize();89int elm_3node_bar_initialize();90int elm_4node_bar_initialize();9192int elm_3node_triangle_initialize();93int elm_4node_triangle_initialize();94int elm_6node_triangle_initialize();95int elm_10node_triangle_initialize();9697int elm_4node_quad_initialize();98int elm_5node_quad_initialize();99int elm_8node_quad_initialize();100int elm_9node_quad_initialize();101int elm_12node_quad_initialize();102int elm_16node_quad_initialize();103int elm_4node_tetra_initialize();104int elm_8node_tetra_initialize();105int elm_10node_tetra_initialize();106107int elm_5node_pyramid_initialize();108int elm_13node_pyramid_initialize();109110int elm_6node_wedge_initialize();111int elm_15node_wedge_initialize();112113int elm_8node_brick_initialize();114int elm_20node_brick_initialize();115int elm_27node_brick_initialize();116117/*******************************************************************************118*119* Name: elm_initialize_element_types120*121* Purpose: Initialize all internal element types122*123* Parameters:124*125* Input: none126*127* Output: Global list of element types is modified128*129* Return value: malloc() success130*131******************************************************************************/132int elm_initialize_element_types()133{134if ( !elm_2node_bar_initialize() ) return FALSE;135if ( !elm_3node_bar_initialize() ) return FALSE;136if ( !elm_4node_bar_initialize() ) return FALSE;137138if ( !elm_3node_triangle_initialize() ) return FALSE;139if ( !elm_4node_triangle_initialize() ) return FALSE;140if ( !elm_6node_triangle_initialize() ) return FALSE;141if ( !elm_10node_triangle_initialize() ) return FALSE;142143if ( !elm_4node_quad_initialize() ) return FALSE;144if ( !elm_5node_quad_initialize() ) return FALSE;145if ( !elm_8node_quad_initialize() ) return FALSE;146if ( !elm_9node_quad_initialize() ) return FALSE;147if ( !elm_12node_quad_initialize() ) return FALSE;148if ( !elm_16node_quad_initialize() ) return FALSE;149150if ( !elm_4node_tetra_initialize() ) return FALSE;151if ( !elm_8node_tetra_initialize() ) return FALSE;152if ( !elm_10node_tetra_initialize() ) return FALSE;153154if ( !elm_5node_pyramid_initialize() ) return FALSE;155if ( !elm_13node_pyramid_initialize() ) return FALSE;156157if ( !elm_6node_wedge_initialize() ) return FALSE;158if ( !elm_15node_wedge_initialize() ) return FALSE;159160if ( !elm_8node_brick_initialize() ) return FALSE;161if ( !elm_20node_brick_initialize() ) return FALSE;162if ( !elm_27node_brick_initialize() ) return FALSE;163164return TRUE;165}166167void elm_force_load(int stat)168{169void elm_divergence(), elm_gradient(), elm_rotor_3D();170if ( stat ) {171elm_divergence();172elm_gradient();173elm_rotor_3D();174}175}176177178