/*********************************************************************** * * ***** *** *** * * * * * * * * *** *** * * * * * * * ***** *** *** * * A FREE Finite Elements Analysis Program in ANSI C for the UNIX OS. * * Composed and edited and copyright by * Professor Dr.-Ing. Frank Rieg, University of Bayreuth, Germany * * eMail: * frank.rieg@uni-bayreuth.de * dr.frank.rieg@t-online.de * * V10.0 December 12, 2001 * * Z88 should compile and run under any UNIX OS and Motif 2.0. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ***********************************************************************/ /*********************************************************************** * z88a.c mit Jennings- Speicherung * 8.07.2002 Rieg ***********************************************************************/ /*********************************************************************** * Fuer UNIX ***********************************************************************/ #ifdef FR_UNIX #include #include #endif /*********************************************************************** * Fuer Windows 95 ***********************************************************************/ #ifdef FR_WIN95 #include #endif /*********************************************************************** * Functions ***********************************************************************/ int wrim88f(FR_INT4,int); int wlog88f(FR_INT4,int); int wtyp88f(FR_INT4,FR_INT4); /*********************************************************************** * hier beginnt Function z88a ***********************************************************************/ int z88a(void) { extern FR_INT4AY ip; extern FR_INT4AY koi; extern FR_INT4AY ioffs; extern FR_INT4AY ifrei; extern FR_INT4AY koffs; extern FR_INT4AY ityp; extern FR_INT4 mcomp[]; extern FR_INT4 nkp,ne,nfg; FR_INT4 i,i2,j,j2,k,mxknot,mxfrei,mcompi,mcompj; /*---------------------------------------------------------------------- * Start Function *---------------------------------------------------------------------*/ wrim88f(0,TX_Z88A); wlog88f(0,LOG_Z88A); /*********************************************************************** * Berechnung des Offsetvektors ioffs ***********************************************************************/ ioffs[1]= 1; for(i= 2;i <= nkp;i++) ioffs[i]= ioffs[i-1]+ifrei[i-1]; /*********************************************************************** * Aufbau der Skyline fuer gs,obere Haelfte ***********************************************************************/ /*---------------------------------------------------------------------- * ip auf Startwerte setzen *---------------------------------------------------------------------*/ for(i= 1;i <= (nfg+1);i++) ip[i]= i; /*---------------------------------------------------------------------- * grosse Formatierungsschleife *---------------------------------------------------------------------*/ wrim88f(0,TX_FORMA); wlog88f(0,LOG_FORMA); for(k= 1;k <= ne;k++) { /*---------------------------------------------------------------------- * es ist ityp(k): 1 isoparametrischer hexaeder, linearer ansatz * 2 balken * 3 scheibe, dreieckig, quadratischer ansatz * 4 stab * 5 welle * 6 torus, dreieckig, linearer ansatz * 7 isoparametrische scheibe, quadratischer ansatz * 8 isoparametrischer torus , quadratischer ansatz * 9 ebenes stabelement * 10 isopara. hexaeder, quadratischer ansatz * 11 isoparametrische scheibe, kubischer ansatz * 12 isoparametrischer torus, kubischer ansatz * 13 ebener balken * 14 krummlinige dreiecksscheibe, quadr. ansatz * 15 krummliniger dreieckstorus, quadr. ansatz * 16 krummliniger tetraeder, quadr. ansatz * 17 tetraeder, linearer ansatz * 18 6-knoten serendipity- platte * 19 16-knoten lagrange- platte * 20 8-knoten serendipity- platte *---------------------------------------------------------------------*/ /*---------------------------------------------------------------------- * Start 8-Knoten Quader, isoparametrischer linearer Ansatz *---------------------------------------------------------------------*/ if(ityp[k]== 1) { wtyp88f(k,1); /*---------------------------------------------------------------------- * Formatieren fuer lqua88 *---------------------------------------------------------------------*/ for(i= 1;i <= 8;i++) mcomp[i]= ioffs[ koi[koffs[k]+i-1]] -1; mxknot= 8; mxfrei= 3; goto L7000; /*---------------------------------------------------------------------- * Ende isopara-8-Knoten Quader *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start Balkenelement *---------------------------------------------------------------------*/ else if(ityp[k]== 2) { wtyp88f(k,2); /*---------------------------------------------------------------------- * Formatieren fuer balk88 *---------------------------------------------------------------------*/ mcomp[1]= ioffs[ koi[koffs[k] ]] -1; mcomp[2]= ioffs[ koi[koffs[k]+1]] -1; mxknot= 2; mxfrei= 6; goto L7000; /*---------------------------------------------------------------------- * Ende Balkenelement *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start Dreieck-Scheibenelement, quadratischer Ansatz *---------------------------------------------------------------------*/ else if(ityp[k]== 3) { wtyp88f(k,3); /*---------------------------------------------------------------------- * Formatieren fuer shei88 *---------------------------------------------------------------------*/ for(i= 1;i <= 6;i++) mcomp[i]= ioffs[ koi[koffs[k]+i-1]] -1; mxknot= 6; mxfrei= 2; goto L7000; /*---------------------------------------------------------------------- * Ende Scheibenelement *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start Stabelement *---------------------------------------------------------------------*/ else if(ityp[k]== 4) { wtyp88f(k,4); /*---------------------------------------------------------------------- * Formatieren fuer stab88 *---------------------------------------------------------------------*/ mcomp[1]= ioffs[ koi[koffs[k] ]] -1; mcomp[2]= ioffs[ koi[koffs[k]+1]] -1; mxknot= 2; mxfrei= 3; goto L7000; /*---------------------------------------------------------------------- * Ende Stabelement *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start Wellenelement *---------------------------------------------------------------------*/ else if(ityp[k]== 5) { wtyp88f(k,5); /*----------------------------------------------------------------------- * Formatieren fuer well88 *---------------------------------------------------------------------*/ mcomp[1]= ioffs[ koi[koffs[k] ]] -1; mcomp[2]= ioffs[ koi[koffs[k]+1]] -1; mxknot= 2; mxfrei= 6; goto L7000; /*---------------------------------------------------------------------- * Ende Wellenelement *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start Toruselement, linearer Ansatz *---------------------------------------------------------------------*/ else if(ityp[k]== 6) { wtyp88f(k,6); /*---------------------------------------------------------------------- * Formatieren fuer ring88 *---------------------------------------------------------------------*/ mcomp[1]= ioffs[ koi[koffs[k] ]] -1; mcomp[2]= ioffs[ koi[koffs[k]+1]] -1; mcomp[3]= ioffs[ koi[koffs[k]+2]] -1; mxknot= 3; mxfrei= 2; goto L7000; /*----------------------------------------------------------------------- * Ende Toruselement *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start 8-knoten Scheibe/Torus, isoparametrischer quadratischer Ansatz *---------------------------------------------------------------------*/ else if(ityp[k]== 7 || ityp[k]== 8) { if (ityp[k]== 7) wtyp88f(k,7); else wtyp88f(k,8); /*---------------------------------------------------------------------- * Formatieren fuer qshe88 *---------------------------------------------------------------------*/ for(i= 1;i <= 8;i++) mcomp[i]= ioffs[ koi[koffs[k]+i-1]] -1; mxknot= 8; mxfrei= 2; goto L7000; /*---------------------------------------------------------------------- * Ende isopara-8-Knoten Scheibe/Torus *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start ebenes Stabelement *---------------------------------------------------------------------*/ else if(ityp[k]== 9) { wtyp88f(k,9); /*---------------------------------------------------------------------- * Formatieren fuer esta88 *---------------------------------------------------------------------*/ mcomp[1]= ioffs[ koi[koffs[k] ]] -1; mcomp[2]= ioffs[ koi[koffs[k]+1]] -1; mxknot= 2; mxfrei= 2; goto L7000; /*---------------------------------------------------------------------- * Ende ebenes Stabelement *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start 20-Knoten Quader, isoparametrischer quadratischer Ansatz *---------------------------------------------------------------------*/ else if(ityp[k]== 10) { wtyp88f(k,10); /*----------------------------------------------------------------------- * Formatieren fuer hexa88 *---------------------------------------------------------------------*/ for(i= 1;i <= 20;i++) mcomp[i]= ioffs[ koi[koffs[k]+i-1]] -1; mxknot= 20; mxfrei= 3; goto L7000; /*---------------------------------------------------------------------- * Ende isopara-20-Knoten Quader *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start 12-knoten Scheibe/Torus, isoparametrischer kubischer Ansatz *---------------------------------------------------------------------*/ else if(ityp[k]== 11 || ityp[k]== 12) { if (ityp[k]== 11) wtyp88f(k,11); else wtyp88f(k,12); /*---------------------------------------------------------------------- * Formatieren fuer cshe88 *---------------------------------------------------------------------*/ for(i= 1;i <= 12;i++) mcomp[i]= ioffs[ koi[koffs[k]+i-1]] -1; mxknot= 12; mxfrei= 2; goto L7000; /*---------------------------------------------------------------------- * Ende isopara-12-Knoten Scheibe/Torus *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start ebenes Balkenelement *---------------------------------------------------------------------*/ else if(ityp[k]== 13) { wtyp88f(k,13); /*---------------------------------------------------------------------- * Formatieren fuer ebal88 *---------------------------------------------------------------------*/ mcomp[1]= ioffs[ koi[koffs[k] ]] -1; mcomp[2]= ioffs[ koi[koffs[k]+1]] -1; mxknot= 2; mxfrei= 3; goto L7000; /*---------------------------------------------------------------------- * Ende ebenes Balkenelement *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start 6-knoten Dreieck- Scheibe/Torus, isop. quadratischer Ansatz *---------------------------------------------------------------------*/ else if(ityp[k]== 14 || ityp[k]== 15) { if (ityp[k]== 14) wtyp88f(k,14); else wtyp88f(k,15); /*---------------------------------------------------------------------- * Formatieren fuer isod88 *---------------------------------------------------------------------*/ for(i= 1;i <= 6;i++) mcomp[i]= ioffs[ koi[koffs[k]+i-1]] -1; mxknot= 6; mxfrei= 2; goto L7000; /*---------------------------------------------------------------------- * Ende isopara-6-Knoten Dreieck-Scheibe/Torus *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start 10-Knoten Tetraeder, isoparametrischer quadratischer Ansatz *---------------------------------------------------------------------*/ else if(ityp[k]== 16) { wtyp88f(k,16); /*----------------------------------------------------------------------- * Formatieren fuer tetr88 *---------------------------------------------------------------------*/ for(i= 1;i <= 10;i++) mcomp[i]= ioffs[ koi[koffs[k]+i-1]] -1; mxknot= 10; mxfrei= 3; goto L7000; /*---------------------------------------------------------------------- * Ende isopara-10-Knoten Tetraeder *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start 4-Knoten Tetraeder, linearer Ansatz *---------------------------------------------------------------------*/ else if(ityp[k]== 17) { wtyp88f(k,17); /*----------------------------------------------------------------------- * Formatieren fuer spur88 *---------------------------------------------------------------------*/ for(i= 1;i <= 4;i++) mcomp[i]= ioffs[ koi[koffs[k]+i-1]] -1; mxknot= 4; mxfrei= 3; goto L7000; /*---------------------------------------------------------------------- * Ende isopara-10-Knoten Tetraeder *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start 6-Knoten Reissner- Mindlin Platte *---------------------------------------------------------------------*/ else if(ityp[k]== 18) { wtyp88f(k,18); /*----------------------------------------------------------------------- * Formatieren fuer spla88 *---------------------------------------------------------------------*/ for(i= 1;i <= 6;i++) mcomp[i]= ioffs[ koi[koffs[k]+i-1]] -1; mxknot= 6; mxfrei= 3; goto L7000; /*---------------------------------------------------------------------- * Ende 6-Knoten Reissner- Mindlin Platte *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start 16-Knoten Lagrange- Platte *---------------------------------------------------------------------*/ else if(ityp[k]== 19) { wtyp88f(k,19); /*----------------------------------------------------------------------- * Formatieren fuer hpla88 *---------------------------------------------------------------------*/ for(i= 1;i <= 16;i++) mcomp[i]= ioffs[ koi[koffs[k]+i-1]] -1; mxknot= 16; mxfrei= 3; goto L7000; /*---------------------------------------------------------------------- * Ende 16-Knoten Lagrange- Platte *---------------------------------------------------------------------*/ } /*---------------------------------------------------------------------- * Start 8-Knoten Reissner- Mindlin Serendipity-Platte *---------------------------------------------------------------------*/ else if(ityp[k]== 20) { wtyp88f(k,20); /*----------------------------------------------------------------------- * Formatieren fuer apla88 *---------------------------------------------------------------------*/ for(i= 1;i <= 8;i++) mcomp[i]= ioffs[ koi[koffs[k]+i-1]] -1; mxknot= 8; mxfrei= 3; goto L7000; /*---------------------------------------------------------------------- * Ende 8-Knoten Reissner- Mindlin Serendipity- Platte *---------------------------------------------------------------------*/ } else /*---------------------------------------------------------------------- * falscher/unbekannter Elementtyp *---------------------------------------------------------------------*/ { wlog88f(ityp[k],LOG_WROETYP); return(AL_WROETYP); } /*---------------------------------------------------------------------- * nun Aufbau der Skyline *---------------------------------------------------------------------*/ L7000:; for(j= 1;j <= mxknot;j++) { for(j2= 1;j2 <= mxfrei;j2++) { for(i= 1;i <= mxknot;i++) { for(i2= 1;i2 <= mxfrei;i2++) { mcompi= mcomp[i]+i2; mcompj= mcomp[j]+j2; if(mcompj > mcompi) continue; if(ip[mcompi] > mcompj) ip[mcompi]= mcompj; } } } } /*********************************************************************** * Ende der Schleife ueber alle Elemente ***********************************************************************/ } /* ende Form-Slei */ /*********************************************************************** * Aufbau von ip ***********************************************************************/ ip[1]= 1; for(i= 2;i <= nfg; i++) ip[i]= ip[i-1] + (i - ip[i]) +1; /*********************************************************************** * Ende Z88A ***********************************************************************/ wlog88f(0,LOG_EXITZ88A); return(0); }