/* $Header: /usr/home/sanjay/Feap/Elem/Ec/RCS/inpt13.c,v 1.4 2000/01/28 20:29:34 sanjay Exp $ */ #include #include struct { int nh1, nh2, nh3; } hdata_; struct { int ior, iow; } iofile_; void inpt13(double *d) { /* c------------------------------------------------------- c * * F E A P * * A Finite Element Analysis Program c Copyright (c) 1984-1994: Robert L. Taylor c c C Language Example Element for FEAP c Copyright (c) 2000 : Sanjay Govindjee c c Input routine c c Material Properties: c d[0] Lambda lame parameter c d[1] Shear modulus c d[2] relaxation time c d[3] Viscous shear modulus c d[10] Number of history variables per gauss point c------------------------------------------------------- */ int tinput_(); int errck,ntx,ntd; char text[15]; /* Due to the incompatibility of multidimensional array indexing in C and Fortran using a double index 'text' variable is not recommended */ double td; char iow_str[1600]; int len; ntx = 1; /* number of strings to be read */ ntd = 1; /* number of strings to be numbers */ strcpy(text,"xxxx"); while(strncmp(text," ",4) != 0) { errck = tinput_(text,&ntx,&td,&ntd); if (strncmp(text,"lambda",6) == 0) d[0] = td; if (strncmp(text,"mu",2) == 0) d[1] = td; if (strncmp(text,"tau",3) == 0) d[2] = td; if (strncmp(text,"stren",5) == 0) d[3] = td; } hdata_.nh1 = 6*4; d[10] = 6; /* c To output to iow first write the string to a char c array then use the fortran cover function fortiow_() */ len = sprintf(iow_str," \ Lambda Parameter = %12.5e\n \ Shear Modulus = %12.5e\n \ Relaxation Time = %12.5e\n \ Viscous Shear Mod = %12.5e\n",d[0],d[1],d[2],d[3]); fortiow_(iow_str,&len); if(iofile_.ior < 0) printf("%s\n",iow_str); }