/* CalculiX - A 3-dimensional finite element program */ /* Copyright (C) 1998-2007 Guido Dhondt */ /* 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(version 2); */ /* */ /* 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; if not, write to the Free Software */ /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include "CalculiX.h" #ifdef SPOOLES #include "spooles.h" #endif #ifdef SGI #include "sgi.h" #endif #ifdef TAUCS #include "tau.h" #endif void dynboun(double *amta,int *namta,int *nam,double *ampli, double *time, double *ttime,double *dtime,double *xbounold,double *xboun, double *xbounact,int *iamboun,int *nboun,int *nodeboun, int *ndirboun, double *ad, double *au, double *adb, double *aub, int *icol, int *irow, int *neq, int *nzs, double *sigma, double *b, int *isolver, double *alpham, double *betam, int *nzl, int *init,double *bact, double *bmin, int *jq){ int idiff[3],i,j,ic,ir; double *xbounmin=NULL,*xbounplus=NULL,*bplus=NULL, *bv=NULL,*ba=NULL,deltatime,deltatime2,deltatimesq,timemin,ttimemin, timeplus,ttimeplus,*aux=NULL,*b1=NULL,*b2=NULL; #ifdef SGI int token=1; #endif xbounmin=NNEW(double,*nboun); xbounplus=NNEW(double,*nboun); /* time increment for the calculation of the change of the particular solution (needed to account for nonzero SPC's) */ deltatime=*dtime; deltatime2=2.*deltatime; deltatimesq=deltatime*deltatime; /* the SPC value at timemin is stored in xbounmin */ if(*init==1){ /* at the start of a new step it is assumed that the previous step has reached steady state (at least for the SPC conditions) */ for(i=0;i<*nboun;i++){ xbounmin[i]=xbounold[i]; xbounact[i]=xbounold[i]; } } else{ timemin=*time-deltatime; ttimemin=*ttime-deltatime; FORTRAN(temploadmodal,(amta,namta,nam,ampli,&timemin,&ttimemin,dtime, xbounold,xboun,xbounmin,iamboun,nboun,nodeboun,ndirboun)); } /* the SPC value at timeplus is stored in xbounplus */ timeplus=*time+deltatime; ttimeplus=*ttime+deltatime; FORTRAN(temploadmodal,(amta,namta,nam,ampli,&timeplus,&ttimeplus,dtime, xbounold,xboun,xbounplus,iamboun,nboun,nodeboun,ndirboun)); bplus=NNEW(double,neq[1]); bv=NNEW(double,neq[1]); ba=NNEW(double,neq[1]); b1=NNEW(double,neq[1]); b2=NNEW(double,neq[1]); /* check whether boundary conditions changed comparision of min with prev */ if(*init==1){ for(i=0;i<*nboun;i++){ ic=neq[1]+i; for(j=jq[ic]-1;j1.e-10){ idiff[1]=1; break; } } if(*init==1){ for(i=0;i<*nboun;i++){ ic=neq[1]+i; for(j=jq[ic]-1;j1.e-10){ idiff[2]=1; break; } } if(idiff[2]==1){ for(i=0;i<*nboun;i++){ ic=neq[1]+i; for(j=jq[ic]-1;j