root/src/frd.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. frd

   1 /*     CalculiX - A 3-dimensional finite element program                 */
   2 /*              Copyright (C) 1998-2015 Guido Dhondt                          */
   3 
   4 /*     This program is free software; you can redistribute it and/or     */
   5 /*     modify it under the terms of the GNU General Public License as    */
   6 /*     published by the Free Software Foundation(version 2);    */
   7 /*                                                                       */
   8 
   9 /*     This program is distributed in the hope that it will be useful,   */
  10 /*     but WITHOUT ANY WARRANTY; without even the implied warranty of    */ 
  11 /*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the      */
  12 /*     GNU General Public License for more details.                      */
  13 
  14 /*     You should have received a copy of the GNU General Public License */
  15 /*     along with this program; if not, write to the Free Software       */
  16 /*     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.         */
  17 
  18 #include <stdlib.h>
  19 #include <math.h>
  20 #include <stdio.h>
  21 #include <string.h>
  22 #include "CalculiX.h"
  23 
  24 #define min(a,b) ((a) <= (b) ? (a) : (b))
  25 #define max(a,b) ((a) >= (b) ? (a) : (b))
  26 
  27 void frd(double *co,ITG *nk,ITG *kon,ITG *ipkon,char *lakon,ITG *ne0,
  28          double *v,double *stn,ITG *inum,ITG *nmethod,ITG *kode,
  29          char *filab,double *een,double *t1,double *fn,double *time,
  30          double *epn,ITG *ielmat,char *matname,double *enern,
  31          double *xstaten,ITG *nstate_,ITG *istep,ITG *iinc,
  32          ITG *ithermal,double *qfn,ITG *mode,ITG *noddiam,
  33          double *trab,ITG *inotr,ITG *ntrans,double *orab,
  34          ITG *ielorien,ITG *norien,char *description,ITG *ipneigh,
  35          ITG *neigh,ITG *mi,double *stx,double *vr,double *vi,
  36          double *stnr,double *stni,double *vmax,double *stnmax,
  37          ITG *ngraph,double *veold,double *ener,ITG *ne,double *cs,
  38          char *set,ITG *nset,ITG *istartset,ITG *iendset,ITG *ialset,
  39          double *eenmax,double *fnr,double *fni,double *emn,
  40          double *thicke,char *jobnamec,char *output,double *qfx,
  41          double *cdn,ITG *mortar,double *cdnr,double *cdni,ITG *nmat){
  42 
  43      /* stores the results in frd format
  44 
  45      iselect selects which nodes are to be stored:
  46           iselect=-1 means only those nodes for which inum negative
  47                      ist, i.e. network nodes
  48           iselect=+1 means only those nodes for which inum positive
  49                      ist, i.e. structural nodes
  50           iselect=0  means both of the above */
  51   
  52   FILE *f1;
  53   
  54   char c[2]="C",m1[4]=" -1",m2[4]=" -2",m3[4]=" -3",
  55     p0[6]="    0",p1[6]="    1",p2[6]="    2",p3[6]="    3",p4[6]="    4",
  56     p5[6]="    5",p6[6]="    6",p7[6]="    7",p8[6]="    8",p9[6]="    9",
  57     p10[6]="   10",p11[6]="   11",
  58     p12[6]="   12", fneig[132]="",date[8],clock[10],newdate[21],newclock[9],
  59     material[59]="                                                          ",
  60     text[2]=" ";
  61 
  62   static ITG icounter=0,nkcoords,iaxial;
  63 
  64   ITG null,one,i,j,k,indexe,nemax,nlayer,noutloc,iset,iselect,ncomp,nope,
  65       nodes,ifield[7],nfield[2],icomp[7],ifieldstate[*nstate_],two,three,
  66       icompstate[*nstate_],ip0=0,ip1=1,ip2=2,ip3=3,ip4=4,ip5=5,ip6=6,ip7=7,
  67       ip8=8,ip9=9,ip10=10,ip11=11,ip12=12,imat,nelout,
  68       nterms,nout,noutplus,noutmin,mt=mi[1]+1;
  69 
  70   ITG ncompscalar=1,ifieldscalar[1]={1},icompscalar[1]={0},
  71       nfieldscalar[2]={1,0};
  72   ITG ncompvector=3,ifieldvector[3]={1,1,1},icompvector[3]={0,1,2},
  73       nfieldvector1[2]={3,0},nfieldvector0[2]={mi[1]+1,0},
  74       icompvectorlast[3]={3,4,5};
  75   ITG ncomptensor=6,ifieldtensor[6]={1,1,1,1,1,1},icomptensor[6]={0,1,2,3,5,4},
  76       nfieldtensor[2]={6,0};
  77   ITG ncompscalph=2,ifieldscalph[2]={1,2},icompscalph[2]={0,0},
  78       nfieldscalph[2]={0,0};
  79   ITG ncompvectph=6,ifieldvectph[6]={1,1,1,2,2,2},icompvectph[6]={1,2,3,1,2,3},
  80       nfieldvectph[2]={mi[1]+1,mi[1]+1};
  81   ITG ncomptensph=12,ifieldtensph[12]={1,1,1,1,1,1,2,2,2,2,2,2},
  82       icomptensph[12]={0,1,2,3,5,4,0,1,2,3,5,4},nfieldtensph[2]={6,6};
  83       
  84   int iw;
  85 
  86   float ifl;
  87 
  88   double pi,oner;
  89 
  90 #ifdef EXODUSII
  91   if(strcmp1(output,"exo")==0){
  92     exo(co,nk,kon,ipkon,lakon,ne0,v,stn,inum,nmethod,kode,
  93         filab,een,t1,fn,time,epn,ielmat,matname,enern,
  94         xstaten,nstate_,istep,iinc,ithermal,qfn,mode,noddiam,
  95         trab,inotr,ntrans,orab,ielorien,norien,description,
  96         ipneigh,neigh,mi,stx,vr,vi,stnr,stni,vmax,stnmax,
  97         ngraph,veold,ener,ne,cs,set,nset,istartset,iendset,
  98         ialset,eenmax,fnr,fni,emn,thicke,jobnamec,output,qfx,
  99         cdn,mortar,cdnr,cdni,nmat);
 100     return;
 101   }
 102 #endif
 103 
 104   strcpy(fneig,jobnamec);
 105   strcat(fneig,".frd");
 106 
 107   if((f1=fopen(fneig,"ab"))==NULL){
 108     printf("*ERROR in frd: cannot open frd file for writing...");
 109     exit(0);
 110   }
 111 
 112   pi=4.*atan(1.);
 113   null=0;
 114   one=1;two=2;three=3;
 115   oner=1.;
 116   iaxial=0.;
 117 
 118   /* determining nout, noutplus and noutmin 
 119               nout: number of structural and network nodes
 120               noutplus: number of structural nodes
 121               noutmin: number of network nodes */
 122 
 123   if(*nmethod!=0){
 124       nout=0;
 125       noutplus=0;
 126       noutmin=0;
 127       for(i=0;i<*nk;i++){
 128           if(inum[i]==0) continue;
 129           nout++;
 130           if(inum[i]>0) noutplus++;
 131           if(inum[i]<0) noutmin++;
 132       }
 133   }else{
 134       nout=*nk;
 135   }
 136 
 137   /* first time something is written in the frd-file: store
 138      computational metadata, the nodal coordinates and the
 139      topology */
 140 
 141   if(*kode==1){
 142 //    fprintf(f1,"%5s%1s\n",p1,c);
 143 
 144     /* date and time */
 145 
 146     FORTRAN(dattime,(date,clock));
 147 
 148     for(i=0;i<20;i++) newdate[i]=' ';
 149     newdate[20]='\0';
 150 
 151     strcpy1(newdate,&date[6],2);
 152     strcpy1(&newdate[2],".",1);
 153     if(strcmp1(&date[4],"01")==0){
 154       strcpy1(&newdate[3],"january.",8);
 155       strcpy1(&newdate[11],&date[0],4);
 156     }else if(strcmp1(&date[4],"02")==0){
 157       strcpy1(&newdate[3],"february.",9);
 158       strcpy1(&newdate[12],&date[0],4);
 159     }else if(strcmp1(&date[4],"03")==0){
 160       strcpy1(&newdate[3],"march.",6);
 161       strcpy1(&newdate[9],&date[0],4);
 162     }else if(strcmp1(&date[4],"04")==0){
 163       strcpy1(&newdate[3],"april.",6);
 164       strcpy1(&newdate[9],&date[0],4);
 165     }else if(strcmp1(&date[4],"05")==0){
 166       strcpy1(&newdate[3],"may.",4);
 167       strcpy1(&newdate[7],&date[0],4);
 168     }else if(strcmp1(&date[4],"06")==0){
 169       strcpy1(&newdate[3],"june.",5);
 170       strcpy1(&newdate[8],&date[0],4);
 171     }else if(strcmp1(&date[4],"07")==0){
 172       strcpy1(&newdate[3],"july.",5);
 173       strcpy1(&newdate[8],&date[0],4);
 174     }else if(strcmp1(&date[4],"08")==0){
 175       strcpy1(&newdate[3],"august.",7);
 176       strcpy1(&newdate[10],&date[0],4);
 177     }else if(strcmp1(&date[4],"09")==0){
 178       strcpy1(&newdate[3],"september.",10);
 179       strcpy1(&newdate[13],&date[0],4);
 180     }else if(strcmp1(&date[4],"10")==0){
 181       strcpy1(&newdate[3],"october.",8);
 182       strcpy1(&newdate[11],&date[0],4);
 183     }else if(strcmp1(&date[4],"11")==0){
 184       strcpy1(&newdate[3],"november.",9);
 185       strcpy1(&newdate[12],&date[0],4);
 186     }else if(strcmp1(&date[4],"12")==0){
 187       strcpy1(&newdate[3],"december.",9);
 188       strcpy1(&newdate[12],&date[0],4);
 189     }
 190 
 191     strcpy1(newclock,clock,2);
 192     strcpy1(&newclock[2],":",1);
 193     strcpy1(&newclock[3],&clock[2],2);
 194     strcpy1(&newclock[5],":",1);
 195     strcpy1(&newclock[6],&clock[4],2);
 196     newclock[8]='\0';
 197 
 198     fprintf(f1,"%5sUUSER                                                              \n",p1);
 199     fprintf(f1,"%5sUDATE              %20s                            \n",p1,newdate);
 200     fprintf(f1,"%5sUTIME              %8s                                        \n",p1,newclock);
 201     fprintf(f1,"%5sUHOST                                                              \n",p1);
 202     fprintf(f1,"%5sUPGM               CalculiX                                        \n",p1);
 203     fprintf(f1,"%5sUDIR                                                               \n",p1);
 204     fprintf(f1,"%5sUDBN                                                               \n",p1);
 205     
 206     for(i=0;i<*nmat;i++){
 207         strcpy1(material,&matname[80*i],58);
 208         fprintf(f1,"%5sUMAT%5" ITGFORMAT "%58s\n",p1,i+1,material);
 209     }
 210 
 211     /* storing the header of the coordinates */
 212 
 213     if(strcmp1(output,"asc")==0){
 214       fprintf(f1,"%5s%1s                  %12" ITGFORMAT "%38" ITGFORMAT "\n",p2,c,nout,one);
 215     }else{
 216       fprintf(f1,"%5s%1s                  %12" ITGFORMAT "%38" ITGFORMAT "\n",p2,c,nout,three);
 217     }
 218 
 219     /* storing the coordinates themselves */
 220 
 221     if(*nmethod!=0){
 222       for(i=0;i<*nk;i++){
 223         if(inum[i]==0) continue;
 224         if(strcmp1(output,"asc")==0){
 225             fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E\n",m1,i+1,(float)co[3*i],
 226                   (float)co[3*i+1],(float)co[3*i+2]);
 227         }else{
 228           iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 229           fwrite(&co[3*i],sizeof(double),1,f1);
 230           fwrite(&co[3*i+1],sizeof(double),1,f1);
 231           fwrite(&co[3*i+2],sizeof(double),1,f1);
 232         }
 233       }
 234     }else{
 235       for(i=0;i<*nk;i++){
 236         if(strcmp1(output,"asc")==0){
 237           fprintf(f1,"%3s%10" ITGFORMAT "%12.5E%12.5E%12.5E\n",m1,i+1,(float)co[3*i],
 238                 (float)co[3*i+1],(float)co[3*i+2]);
 239         }else{
 240           iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 241           fwrite(&co[3*i],sizeof(double),1,f1);
 242           fwrite(&co[3*i+1],sizeof(double),1,f1);
 243           fwrite(&co[3*i+2],sizeof(double),1,f1);
 244         }
 245       }
 246     }
 247 
 248     /* nkcoords is the number of nodes at the time when 
 249        the nodal coordinates are stored in the frd file */
 250 
 251     nkcoords=*nk;
 252     if(strcmp1(output,"asc")==0)fprintf(f1,"%3s\n",m3);
 253 
 254     /* determining the number of elements */
 255 
 256     if(*nmethod!=0){
 257         nelout=0;
 258         for(i=0;i<*ne0;i++){
 259             if(ipkon[i]<=-1){
 260                 continue;
 261             }else if(strcmp1(&lakon[8*i],"ESPRNGC")==0){
 262                 continue;
 263             }else if(strcmp1(&lakon[8*i],"ESPRNGF")==0){
 264                 continue;
 265             }else if(strcmp1(&lakon[8*i],"DCOUP3D")==0){
 266                 continue;
 267             }
 268             nelout++;
 269         }
 270     }else{
 271         nelout=*ne;
 272     }
 273 
 274     /* storing the topology */
 275 
 276     if(strcmp1(output,"asc")==0){
 277       fprintf(f1,"%5s%1s                  %12" ITGFORMAT "%38" ITGFORMAT "\n",p3,c,nelout,one);
 278     }else{
 279       fprintf(f1,"%5s%1s                  %12" ITGFORMAT "%38" ITGFORMAT "\n",p3,c,nelout,two);
 280     }
 281     nemax=*ne0;
 282 
 283     for(i=0;i<*ne0;i++){
 284       if(ipkon[i]<=-1){
 285           continue;
 286       }else if(strcmp1(&lakon[8*i],"F")==0){
 287           continue;
 288       }else if(strcmp1(&lakon[8*i],"ESPRNGC")==0){
 289           continue;
 290       }else if(strcmp1(&lakon[8*i],"ESPRNGF")==0){
 291           continue;
 292       }else if(strcmp1(&lakon[8*i],"DCOUP3D")==0){
 293           continue;
 294       }else{
 295           indexe=ipkon[i];
 296       }
 297       imat=ielmat[i*mi[2]];
 298       if(strcmp1(&lakon[8*i+3],"2")==0){
 299 
 300           /* 20-node brick element */
 301 
 302         if(((strcmp1(&lakon[8*i+6]," ")==0)||
 303             (strcmp1(&filab[4],"E")==0)||
 304             (strcmp1(&lakon[8*i+6],"I")==0))&&
 305            (strcmp2(&lakon[8*i+6],"LC",2)!=0)){
 306           if(strcmp1(output,"asc")==0){
 307             fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 308                     m1,i+1,p4,p0,imat,m2);
 309             for(j=0;j<10;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 310             fprintf(f1,"\n%3s",m2);
 311             for(j=10;j<12;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 312             for(j=16;j<19;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 313             for(j=19;j<20;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 314             for(j=12;j<16;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 315             fprintf(f1,"\n");
 316           }else{
 317             iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 318             iw=(int)ip4;fwrite(&iw,sizeof(int),1,f1);
 319             iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 320             iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 321             for(j=0;j<10;j++){iw=(int)kon[indexe+j];
 322                               fwrite(&iw,sizeof(int),1,f1);}
 323             for(j=10;j<12;j++){iw=(int)kon[indexe+j];
 324                               fwrite(&iw,sizeof(int),1,f1);}
 325             for(j=16;j<19;j++){iw=(int)kon[indexe+j];
 326                               fwrite(&iw,sizeof(int),1,f1);}
 327             for(j=19;j<20;j++){iw=(int)kon[indexe+j];
 328                               fwrite(&iw,sizeof(int),1,f1);}
 329             for(j=12;j<16;j++){iw=(int)kon[indexe+j];
 330                               fwrite(&iw,sizeof(int),1,f1);}
 331           }
 332         }else if(strcmp2(&lakon[8*i+6],"LC",2)==0){
 333 
 334           /* composite material */
 335 
 336           /* 20-node brick elements */
 337 
 338           nlayer=0;
 339           for(k=0;k<mi[2];k++){
 340             if(ielmat[i*mi[2]+k]==0) break;
 341             nlayer++;
 342           }
 343           for(k=0;k<nlayer;k++){
 344             nemax++;
 345             if(strcmp1(output,"asc")==0){
 346               fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 347                       m1,nemax,p4,p0,imat,m2);
 348               for(j=0;j<10;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+28+20*k+j]);
 349               fprintf(f1,"\n%3s",m2);
 350               for(j=10;j<12;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+28+20*k+j]);
 351               for(j=16;j<19;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+28+20*k+j]);
 352               for(j=19;j<20;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+28+20*k+j]);
 353               for(j=12;j<16;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+28+20*k+j]);
 354               fprintf(f1,"\n");
 355             }else{
 356               iw=(int)nemax;fwrite(&iw,sizeof(int),1,f1);
 357               iw=(int)ip4;fwrite(&iw,sizeof(int),1,f1);
 358               iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 359               iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 360               for(j=0;j<10;j++){iw=(int)kon[indexe+28+20*k+j];
 361                               fwrite(&iw,sizeof(int),1,f1);}
 362               for(j=10;j<12;j++){iw=(int)kon[indexe+28+20*k+j];
 363                               fwrite(&iw,sizeof(int),1,f1);}
 364               for(j=16;j<19;j++){iw=(int)kon[indexe+28+20*k+j];
 365                               fwrite(&iw,sizeof(int),1,f1);}
 366               for(j=19;j<20;j++){iw=(int)kon[indexe+28+20*k+j];
 367                               fwrite(&iw,sizeof(int),1,f1);}
 368               for(j=12;j<16;j++){iw=(int)kon[indexe+28+20*k+j];
 369                               fwrite(&iw,sizeof(int),1,f1);}
 370             }
 371           }
 372         }else if(strcmp1(&lakon[8*i+6],"B")==0){
 373 
 374             /* 3-node beam element */
 375 
 376           if(strcmp1(output,"asc")==0){
 377             fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p12,p0,imat);
 378             fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe+20],
 379                     kon[indexe+22],kon[indexe+21]);
 380           }else{
 381             iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 382             iw=(int)ip12;fwrite(&iw,sizeof(int),1,f1);
 383             iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 384             iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 385             iw=(int)kon[indexe+20];fwrite(&iw,sizeof(int),1,f1);
 386             iw=(int)kon[indexe+22];fwrite(&iw,sizeof(int),1,f1);
 387             iw=(int)kon[indexe+21];fwrite(&iw,sizeof(int),1,f1);
 388           }
 389         }else{
 390 
 391             /* 8-node 2d element */
 392             
 393           if(strcmp1(&lakon[8*i+6],"A")==0) iaxial=1;
 394           if(strcmp1(output,"asc")==0){
 395             fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 396                     m1,i+1,p10,p0,imat,m2);
 397             for(j=0;j<8;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+20+j]);
 398             fprintf(f1,"\n");
 399           }else{
 400             iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 401             iw=(int)ip10;fwrite(&iw,sizeof(int),1,f1);
 402             iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 403             iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 404             for(j=0;j<8;j++){iw=(int)kon[indexe+20+j];
 405                               fwrite(&iw,sizeof(int),1,f1);}
 406           }
 407         }
 408       }else if(strcmp1(&lakon[8*i+3],"8")==0){
 409           if((strcmp1(&lakon[8*i+6]," ")==0)||
 410              (strcmp1(&filab[4],"E")==0)){
 411 
 412               /* 8-node brick element */
 413 
 414               if(strcmp1(output,"asc")==0){
 415                   fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 416                           m1,i+1,p1,p0,imat,m2);
 417                   for(j=0;j<8;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 418                   fprintf(f1,"\n");
 419               }else{
 420                   iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 421                   iw=(int)ip1;fwrite(&iw,sizeof(int),1,f1);
 422                   iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 423                   iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 424                   for(j=0;j<8;j++){iw=(int)kon[indexe+j];
 425                       fwrite(&iw,sizeof(int),1,f1);}
 426               }
 427           }else if(strcmp1(&lakon[8*i+6],"B")==0){
 428 
 429               /* 2-node 1d element */
 430 
 431               if(strcmp1(&lakon[8*i+4],"R")==0){
 432                   if(strcmp1(output,"asc")==0){
 433                       fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p11,p0,imat);
 434                       fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe+8],
 435                               kon[indexe+9]);
 436                   }else{
 437                       iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 438                       iw=(int)ip11;fwrite(&iw,sizeof(int),1,f1);
 439                       iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 440                       iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 441                       iw=(int)kon[indexe+8];fwrite(&iw,sizeof(int),1,f1);
 442                       iw=(int)kon[indexe+9];fwrite(&iw,sizeof(int),1,f1);
 443                   }
 444               }else if(strcmp1(&lakon[8*i+4],"I")==0){
 445                   if(strcmp1(output,"asc")==0){
 446                       fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p11,p0,imat);
 447                       fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe+11],
 448                               kon[indexe+12]);
 449                   }else{
 450                       iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 451                       iw=(int)ip11;fwrite(&iw,sizeof(int),1,f1);
 452                       iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 453                       iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 454                       iw=(int)kon[indexe+11];fwrite(&iw,sizeof(int),1,f1);
 455                       iw=(int)kon[indexe+12];fwrite(&iw,sizeof(int),1,f1);
 456                   }
 457               }
 458           }else{
 459 
 460               /* 4-node 2d element */
 461 
 462               if(strcmp1(&lakon[8*i+6],"A")==0) iaxial=1;
 463               if((strcmp1(&lakon[8*i+4],"R")==0)||
 464                  (strcmp1(&lakon[8*i+4]," ")==0)){
 465                   if(strcmp1(output,"asc")==0){
 466                       fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 467                               m1,i+1,p9,p0,imat,m2);
 468                       for(j=0;j<4;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+8+j]);
 469                       fprintf(f1,"\n");
 470                   }else{
 471                       iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 472                       iw=(int)ip9;fwrite(&iw,sizeof(int),1,f1);
 473                       iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 474                       iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 475                       for(j=0;j<4;j++){iw=(int)kon[indexe+8+j];
 476                           fwrite(&iw,sizeof(int),1,f1);}
 477                   }
 478               }else if(strcmp1(&lakon[8*i+4],"I")==0){
 479                   if(strcmp1(output,"asc")==0){
 480                       fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 481                               m1,i+1,p9,p0,imat,m2);
 482                       for(j=0;j<4;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+11+j]);
 483                       fprintf(f1,"\n");
 484                   }else{
 485                       iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 486                       iw=(int)ip9;fwrite(&iw,sizeof(int),1,f1);
 487                       iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 488                       iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 489                       for(j=0;j<4;j++){iw=(int)kon[indexe+11+j];
 490                           fwrite(&iw,sizeof(int),1,f1);}
 491                   }
 492               }
 493           }
 494       }else if((strcmp1(&lakon[8*i+3],"10")==0)||
 495                (strcmp1(&lakon[8*i+3],"14")==0)){
 496 
 497         /* 10-node tetrahedral element */
 498 
 499         if(strcmp1(output,"asc")==0){
 500           fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 501                   m1,i+1,p6,p0,imat,m2);
 502           for(j=0;j<10;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 503           fprintf(f1,"\n");
 504         }else{
 505           iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 506           iw=(int)ip6;fwrite(&iw,sizeof(int),1,f1);
 507           iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 508           iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 509           for(j=0;j<10;j++){iw=(int)kon[indexe+j];
 510                               fwrite(&iw,sizeof(int),1,f1);}
 511         }
 512       }else if(strcmp1(&lakon[8*i+3],"4")==0){
 513 
 514         /* 4-node tetrahedral element */
 515 
 516         if(strcmp1(output,"asc")==0){
 517           fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 518                   m1,i+1,p3,p0,imat,m2);
 519           for(j=0;j<4;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 520           fprintf(f1,"\n");
 521         }else{
 522           iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 523           iw=(int)ip3;fwrite(&iw,sizeof(int),1,f1);
 524           iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 525           iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 526           for(j=0;j<4;j++){iw=(int)kon[indexe+j];
 527                               fwrite(&iw,sizeof(int),1,f1);}
 528         }
 529       }else if(strcmp1(&lakon[8*i+3],"15")==0){
 530         if((strcmp1(&lakon[8*i+6]," ")==0)||
 531            (strcmp1(&filab[4],"E")==0)){
 532 
 533           /* 15-node wedge element */
 534 
 535           if(strcmp1(output,"asc")==0){
 536             fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 537                     m1,i+1,p5,p0,imat,m2);
 538             for(j=0;j<9;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 539             for(j=12;j<13;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 540             fprintf(f1,"\n%3s",m2);
 541             for(j=13;j<15;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 542             for(j=9;j<12;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 543             fprintf(f1,"\n");
 544           }else{
 545             iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 546             iw=(int)ip5;fwrite(&iw,sizeof(int),1,f1);
 547             iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 548             iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 549             for(j=0;j<9;j++){iw=(int)kon[indexe+j];
 550                               fwrite(&iw,sizeof(int),1,f1);}
 551             for(j=12;j<13;j++){iw=(int)kon[indexe+j];
 552                               fwrite(&iw,sizeof(int),1,f1);}
 553             for(j=13;j<15;j++){iw=(int)kon[indexe+j];
 554                               fwrite(&iw,sizeof(int),1,f1);}
 555             for(j=9;j<12;j++){iw=(int)kon[indexe+j];
 556                               fwrite(&iw,sizeof(int),1,f1);}
 557           }
 558         }else{
 559 
 560           /* 6-node 2d element */
 561 
 562           if(strcmp1(&lakon[8*i+6],"A")==0) iaxial=1;
 563           if(strcmp1(output,"asc")==0){
 564             fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 565                     m1,i+1,p8,p0,imat,m2);
 566             for(j=0;j<6;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+15+j]);
 567             fprintf(f1,"\n");
 568           }else{
 569             iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 570             iw=(int)ip8;fwrite(&iw,sizeof(int),1,f1);
 571             iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 572             iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 573             for(j=0;j<6;j++){iw=(int)kon[indexe+15+j];
 574                               fwrite(&iw,sizeof(int),1,f1);}
 575           }
 576         }
 577       }else if(strcmp1(&lakon[8*i+3],"6")==0){
 578           if((strcmp1(&lakon[8*i+6]," ")==0)||
 579              (strcmp1(&filab[4],"E")==0)){
 580 
 581               /* 6-node wedge element */
 582 
 583               if(strcmp1(output,"asc")==0){
 584                   fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 585                           m1,i+1,p2,p0,imat,m2);
 586                   for(j=0;j<6;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+j]);
 587                   fprintf(f1,"\n");
 588               }else{
 589                   iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 590                   iw=(int)ip2;fwrite(&iw,sizeof(int),1,f1);
 591                   iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 592                   iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 593                   for(j=0;j<6;j++){iw=(int)kon[indexe+j];
 594                       fwrite(&iw,sizeof(int),1,f1);}
 595               }
 596           }else{
 597 
 598               /* 3-node 2d element */
 599 
 600               if(strcmp1(&lakon[8*i+6],"A")==0) iaxial=1;
 601               if(strcmp1(output,"asc")==0){
 602                   fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n%3s",
 603                           m1,i+1,p7,p0,imat,m2);
 604                   for(j=0;j<3;j++)fprintf(f1,"%10" ITGFORMAT "",kon[indexe+6+j]);
 605                   fprintf(f1,"\n");
 606               }else{
 607                   iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 608                   iw=(int)ip7;fwrite(&iw,sizeof(int),1,f1);
 609                   iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 610                   iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 611                   for(j=0;j<3;j++){iw=(int)kon[indexe+6+j];
 612                       fwrite(&iw,sizeof(int),1,f1);}
 613               }
 614           }
 615       }else if((strcmp1(&lakon[8*i],"D")==0)&&(ithermal[1]>1)){
 616           if(kon[indexe]==0){
 617 
 618               /* 2-node 1d element (network entry element) */
 619 
 620               if(strcmp1(output,"asc")==0){
 621                   fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p11,p0,imat);
 622                   fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,
 623                           kon[indexe+1],kon[indexe+2]);
 624               }else{
 625                   iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 626                   iw=(int)ip11;fwrite(&iw,sizeof(int),1,f1);
 627                   iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 628                   iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 629                   iw=(int)kon[indexe+1];fwrite(&iw,sizeof(int),1,f1);
 630                   iw=(int)kon[indexe+2];fwrite(&iw,sizeof(int),1,f1);
 631               }
 632           }else if(kon[indexe+2]==0){
 633 
 634               /* 2-node 1d element (network exit element) */
 635 
 636               if(strcmp1(output,"asc")==0){
 637                   fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p11,p0,imat);
 638                   fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe],
 639                           kon[indexe+1]);
 640               }else{
 641                   iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 642                   iw=(int)ip11;fwrite(&iw,sizeof(int),1,f1);
 643                   iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 644                   iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 645                   iw=(int)kon[indexe];fwrite(&iw,sizeof(int),1,f1);
 646                   iw=(int)kon[indexe+1];fwrite(&iw,sizeof(int),1,f1);
 647               }
 648           }else{
 649 
 650               /* 3-node 1d element (genuine network element) */
 651 
 652               if(strcmp1(output,"asc")==0){
 653                   fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p12,p0,imat);
 654                   fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe],
 655                           kon[indexe+2],kon[indexe+1]);
 656               }else{
 657                   iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 658                   iw=(int)ip12;fwrite(&iw,sizeof(int),1,f1);
 659                   iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 660                   iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 661                   iw=(int)kon[indexe];fwrite(&iw,sizeof(int),1,f1);
 662                   iw=(int)kon[indexe+2];fwrite(&iw,sizeof(int),1,f1);
 663                   iw=(int)kon[indexe+1];fwrite(&iw,sizeof(int),1,f1);
 664               }
 665           }
 666       }else if((strcmp1(&lakon[8*i],"E")==0)&&
 667                (strcmp1(&lakon[8*i+6],"A")==0)){
 668 
 669           /* 2-node 1d element (spring element) */
 670 
 671         if(strcmp1(output,"asc")==0){
 672           fprintf(f1,"%3s%10" ITGFORMAT "%5s%5s%5" ITGFORMAT "\n",m1,i+1,p11,p0,imat);
 673           fprintf(f1,"%3s%10" ITGFORMAT "%10" ITGFORMAT "\n",m2,kon[indexe],kon[indexe+1]);
 674         }else{
 675           iw=(int)(i+1);fwrite(&iw,sizeof(int),1,f1);
 676           iw=(int)ip11;fwrite(&iw,sizeof(int),1,f1);
 677           iw=(int)ip0;fwrite(&iw,sizeof(int),1,f1);
 678           iw=(int)imat;fwrite(&iw,sizeof(int),1,f1);
 679           iw=(int)kon[indexe];fwrite(&iw,sizeof(int),1,f1);
 680           iw=(int)kon[indexe+1];fwrite(&iw,sizeof(int),1,f1);
 681         }
 682       }
 683     }
 684     if(strcmp1(output,"asc")==0)fprintf(f1,"%3s\n",m3);
 685 
 686     if(*nmethod==0){fclose(f1);return;}
 687   }
 688 
 689   /*  for cyclic symmetry frequency calculations only results for
 690       even numbers (= odd modes, numbering starts at 0) are stored */
 691 
 692   if((*nmethod==2)&&(((*mode/2)*2!=*mode)&&(*noddiam>=0))){fclose(f1);return;}
 693 
 694   /* storing the displacements in the nodes */
 695   
 696   if((strcmp1(filab,"U ")==0)&&(*ithermal!=2)){
 697     iselect=1;
 698     
 699     frdset(filab,set,&iset,istartset,iendset,ialset,
 700            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
 701            ngraph);
 702     
 703     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 704               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 705 
 706     fprintf(f1," -4  DISP        4    1\n");
 707     fprintf(f1," -5  D1          1    2    1    0\n");
 708     fprintf(f1," -5  D2          1    2    2    0\n");
 709     fprintf(f1," -5  D3          1    2    3    0\n");
 710     fprintf(f1," -5  ALL         1    2    0    0    1ALL\n");
 711 
 712     frdvector(v,&iset,ntrans,filab,&nkcoords,inum,m1,inotr,
 713               trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
 714   }
 715 
 716   /*     storing the imaginary part of displacements in the nodes
 717          for the odd modes of cyclic symmetry calculations */
 718 
 719   if(*noddiam>=0){
 720     if((strcmp1(filab,"U ")==0)&&(*ithermal!=2)){
 721     
 722       frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 723                 &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 724 
 725       fprintf(f1," -4  DISPI       4    1\n");
 726       fprintf(f1," -5  D1          1    2    1    0\n");
 727       fprintf(f1," -5  D2          1    2    2    0\n");
 728       fprintf(f1," -5  D3          1    2    3    0\n");
 729       fprintf(f1," -5  ALL         1    2    0    0    1ALL\n");
 730       
 731       frdvector(&v[*nk*mt],&iset,ntrans,filab,&nkcoords,inum,m1,inotr,
 732                 trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
 733     }
 734   }
 735 
 736   /* storing the velocities in the nodes */
 737   
 738   if((strcmp1(&filab[1740],"V   ")==0)&&(*ithermal!=2)){
 739     iselect=1;
 740     
 741     frdset(&filab[1740],set,&iset,istartset,iendset,ialset,
 742            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
 743            ngraph);
 744     
 745     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 746               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 747 
 748     fprintf(f1," -4  VELO        4    1\n");
 749     fprintf(f1," -5  V1          1    2    1    0\n");
 750     fprintf(f1," -5  V2          1    2    2    0\n");
 751     fprintf(f1," -5  V3          1    2    3    0\n");
 752     fprintf(f1," -5  ALL         1    2    0    0    1ALL\n");
 753 
 754     frdvector(veold,&iset,ntrans,&filab[1740],&nkcoords,inum,m1,inotr,
 755               trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
 756   }
 757 
 758   /* storing the temperatures in the nodes */
 759   
 760   if(strcmp1(&filab[87],"NT  ")==0){
 761     iselect=0;
 762     
 763     frdset(&filab[87],set,&iset,istartset,iendset,ialset,
 764            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
 765            ngraph);
 766     
 767     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 768               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 769 
 770     fprintf(f1," -4  NDTEMP      1    1\n");
 771     fprintf(f1," -5  T           1    1    0    0\n");
 772 
 773     if(*ithermal<=1){
 774       frdselect(t1,t1,&iset,&nkcoords,inum,m1,istartset,iendset,
 775                 ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
 776                 nfieldscalar,&iselect,m2,f1,output,m3);
 777     }else{
 778       frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
 779                 ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
 780                 nfieldvector0,&iselect,m2,f1,output,m3);
 781     }
 782   }
 783 
 784   /* storing the electrical potential in the nodes */
 785   
 786   if((strcmp1(&filab[3654],"POT ")==0)&&(*ithermal==2)){
 787     iselect=0;
 788     
 789     frdset(&filab[3654],set,&iset,istartset,iendset,ialset,
 790            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
 791            ngraph);
 792     
 793     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 794               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 795 
 796     fprintf(f1," -4  ELPOT       1    1\n");
 797     fprintf(f1," -5  V           1    1    0    0\n");
 798     
 799     frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
 800               ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
 801               nfieldvector0,&iselect,m2,f1,output,m3);
 802   }
 803 
 804   /* storing the stresses in the nodes */
 805   
 806   if((strcmp1(&filab[174],"S   ")==0)&&(*ithermal!=2)){
 807     iselect=1;
 808     
 809     frdset(&filab[174],set,&iset,istartset,iendset,ialset,
 810            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
 811            ngraph);
 812     
 813     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 814               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 815 
 816     fprintf(f1," -4  STRESS      6    1\n");
 817     fprintf(f1," -5  SXX         1    4    1    1\n");
 818     fprintf(f1," -5  SYY         1    4    2    2\n");
 819     fprintf(f1," -5  SZZ         1    4    3    3\n");
 820     fprintf(f1," -5  SXY         1    4    1    2\n");
 821     fprintf(f1," -5  SYZ         1    4    2    3\n");
 822     fprintf(f1," -5  SZX         1    4    3    1\n");
 823 
 824     frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
 825                 ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
 826                 nfieldtensor,&iselect,m2,f1,output,m3);
 827 
 828   }
 829 
 830   /* storing the imaginary part of the stresses in the nodes
 831      for the odd modes of cyclic symmetry calculations */
 832   
 833   if(*noddiam>=0){
 834     if((strcmp1(&filab[174],"S   ")==0)&&(*ithermal!=2)){
 835       
 836       frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 837                 &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 838       
 839       fprintf(f1," -4  STRESSI     6    1\n");
 840       fprintf(f1," -5  SXX         1    4    1    1\n");
 841       fprintf(f1," -5  SYY         1    4    2    2\n");
 842       fprintf(f1," -5  SZZ         1    4    3    3\n");
 843       fprintf(f1," -5  SXY         1    4    1    2\n");
 844       fprintf(f1," -5  SYZ         1    4    2    3\n");
 845       fprintf(f1," -5  SZX         1    4    3    1\n");
 846       
 847       frdselect(&stn[6**nk],stn,&iset,&nkcoords,inum,m1,istartset,iendset,
 848                 ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
 849                 nfieldtensor,&iselect,m2,f1,output,m3);
 850       
 851     }
 852   }
 853 
 854   /* storing the electromagnetic field E in the nodes */
 855   
 856   if((strcmp1(&filab[3741],"EMFE")==0)&&(*ithermal!=2)){
 857     iselect=1;
 858     
 859     frdset(&filab[3741],set,&iset,istartset,iendset,ialset,
 860            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
 861            ngraph);
 862     
 863     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 864               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 865 
 866     fprintf(f1," -4  EMFE        4    1\n");
 867     fprintf(f1," -5  E1          1    2    1    0\n");
 868     fprintf(f1," -5  E2          1    2    2    0\n");
 869     fprintf(f1," -5  E3          1    2    3    0\n");
 870     fprintf(f1," -5  ALL         1    2    0    0    1ALL\n");
 871 
 872     frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
 873                 ialset,ngraph,&ncompvector,ifieldvector,icompvector,
 874                 nfieldtensor,&iselect,m2,f1,output,m3);
 875 
 876   }
 877 
 878   /* storing the electromagnetic field B in the nodes */
 879   
 880   if((strcmp1(&filab[3828],"EMFB")==0)&&(*ithermal!=2)){
 881     iselect=1;
 882     
 883     frdset(&filab[3828],set,&iset,istartset,iendset,ialset,
 884            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
 885            ngraph);
 886     
 887     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 888               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 889 
 890     fprintf(f1," -4  EMFB        4    1\n");
 891     fprintf(f1," -5  B1          1    2    1    0\n");
 892     fprintf(f1," -5  B2          1    2    2    0\n");
 893     fprintf(f1," -5  B3          1    2    3    0\n");
 894     fprintf(f1," -5  ALL         1    2    0    0    1ALL\n");
 895 
 896     frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
 897                 ialset,ngraph,&ncompvector,ifieldvector,icompvectorlast,
 898                 nfieldtensor,&iselect,m2,f1,output,m3);
 899 
 900   }
 901 
 902   /* storing the total strains in the nodes */
 903   
 904   if((strcmp1(&filab[261],"E   ")==0)&&(*ithermal!=2)){
 905     iselect=1;
 906     
 907     frdset(&filab[261],set,&iset,istartset,iendset,ialset,
 908            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
 909            ngraph);
 910     
 911     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 912               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 913 
 914     fprintf(f1," -4  TOSTRAIN    6    1\n");
 915     fprintf(f1," -5  EXX         1    4    1    1\n");
 916     fprintf(f1," -5  EYY         1    4    2    2\n");
 917     fprintf(f1," -5  EZZ         1    4    3    3\n");
 918     fprintf(f1," -5  EXY         1    4    1    2\n");
 919     fprintf(f1," -5  EYZ         1    4    2    3\n");
 920     fprintf(f1," -5  EZX         1    4    3    1\n");
 921 
 922     frdselect(een,een,&iset,&nkcoords,inum,m1,istartset,iendset,
 923                 ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
 924                 nfieldtensor,&iselect,m2,f1,output,m3);
 925 
 926   }
 927 
 928   /* storing the imaginary part of the total strains in the nodes
 929      for the odd modes of cyclic symmetry calculations */
 930   
 931   if(*noddiam>=0){
 932     if((strcmp1(&filab[261],"E   ")==0)&&(*ithermal!=2)){
 933       
 934       frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 935                 &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 936       
 937       fprintf(f1," -4  TOSTRAII    6    1\n");
 938       fprintf(f1," -5  EXX         1    4    1    1\n");
 939       fprintf(f1," -5  EYY         1    4    2    2\n");
 940       fprintf(f1," -5  EZZ         1    4    3    3\n");
 941       fprintf(f1," -5  EXY         1    4    1    2\n");
 942       fprintf(f1," -5  EYZ         1    4    2    3\n");
 943       fprintf(f1," -5  EZX         1    4    3    1\n");
 944       
 945       frdselect(&een[6**nk],een,&iset,&nkcoords,inum,m1,istartset,iendset,
 946                 ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
 947                 nfieldtensor,&iselect,m2,f1,output,m3);
 948       
 949     }
 950   }
 951 
 952   /* storing the mechanical strains in the nodes */
 953   
 954   if((strcmp1(&filab[2697],"ME  ")==0)&&(*ithermal!=2)){
 955     iselect=1;
 956     
 957     frdset(&filab[2697],set,&iset,istartset,iendset,ialset,
 958            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
 959            ngraph);
 960     
 961     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 962               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 963 
 964     fprintf(f1," -4  MESTRAIN    6    1\n");
 965     fprintf(f1," -5  MEXX        1    4    1    1\n");
 966     fprintf(f1," -5  MEYY        1    4    2    2\n");
 967     fprintf(f1," -5  MEZZ        1    4    3    3\n");
 968     fprintf(f1," -5  MEXY        1    4    1    2\n");
 969     fprintf(f1," -5  MEYZ        1    4    2    3\n");
 970     fprintf(f1," -5  MEZX        1    4    3    1\n");
 971 
 972 
 973     frdselect(emn,emn,&iset,&nkcoords,inum,m1,istartset,iendset,
 974                 ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
 975                 nfieldtensor,&iselect,m2,f1,output,m3);
 976 
 977   }
 978 
 979   /* storing the imaginary part of the mechanical strains in the nodes
 980      for the odd modes of cyclic symmetry calculations */
 981   
 982   if(*noddiam>=0){
 983     if((strcmp1(&filab[2697],"ME  ")==0)&&(*ithermal!=2)){
 984       
 985       frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
 986                 &noutloc,description,kode,nmethod,f1,output,istep,iinc);
 987       
 988       fprintf(f1," -4  MESTRAII    6    1\n");
 989       fprintf(f1," -5  MEXX        1    4    1    1\n");
 990       fprintf(f1," -5  MEYY        1    4    2    2\n");
 991       fprintf(f1," -5  MEZZ        1    4    3    3\n");
 992       fprintf(f1," -5  MEXY        1    4    1    2\n");
 993       fprintf(f1," -5  MEYZ        1    4    2    3\n");
 994       fprintf(f1," -5  MEZX        1    4    3    1\n");
 995       
 996       frdselect(&emn[6**nk],een,&iset,&nkcoords,inum,m1,istartset,iendset,
 997                 ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
 998                 nfieldtensor,&iselect,m2,f1,output,m3);
 999       
1000     }
1001   }
1002 
1003   /* storing the forces in the nodes */
1004   
1005   if((strcmp1(&filab[348],"RF  ")==0)&&(*ithermal!=2)){
1006     iselect=1;
1007     
1008     frdset(&filab[348],set,&iset,istartset,iendset,ialset,
1009            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1010            ngraph);
1011     
1012     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1013               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1014 
1015     fprintf(f1," -4  FORC        4    1\n");
1016     fprintf(f1," -5  F1          1    2    1    0\n");
1017     fprintf(f1," -5  F2          1    2    2    0\n");
1018     fprintf(f1," -5  F3          1    2    3    0\n");
1019     fprintf(f1," -5  ALL         1    2    0    0    1ALL\n");
1020 
1021     if((iaxial==1)&&(strcmp1(&filab[352],"I")==0)){for(i=0;i<*nk;i++){fn[1+i*mt]*=180.;fn[2+i*mt]*=180.;fn[3+i*mt]*=180.;}}
1022     frdvector(fn,&iset,ntrans,&filab[348],&nkcoords,inum,m1,inotr,
1023               trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
1024     if((iaxial==1)&&(strcmp1(&filab[352],"I")==0)){for(i=0;i<*nk;i++){fn[1+i*mt]/=180.;fn[2+i*mt]/=180.;fn[3+i*mt]/=180.;}}
1025   }
1026 
1027   /*     storing the imaginary part of the forces in the nodes
1028          for the odd modes of cyclic symmetry calculations */
1029 
1030   if(*noddiam>=0){
1031     if((strcmp1(&filab[348],"RF  ")==0)&&(*ithermal!=2)){
1032     
1033       frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1034                 &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1035 
1036       fprintf(f1," -4  FORCI       4    1\n");
1037       fprintf(f1," -5  F1          1    2    1    0\n");
1038       fprintf(f1," -5  F2          1    2    2    0\n");
1039       fprintf(f1," -5  F3          1    2    3    0\n");
1040       fprintf(f1," -5  ALL         1    2    0    0    1ALL\n");
1041       
1042       frdvector(&fn[*nk*mt],&iset,ntrans,filab,&nkcoords,inum,m1,inotr,
1043                 trab,co,istartset,iendset,ialset,mi,ngraph,f1,output,m3);
1044     }
1045   }
1046 
1047   /* storing the equivalent plastic strains in the nodes */
1048   
1049   if((strcmp1(&filab[435],"PEEQ")==0)&&(*ithermal!=2)){
1050     iselect=1;
1051     
1052     frdset(&filab[435],set,&iset,istartset,iendset,ialset,
1053            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1054            ngraph);
1055     
1056     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1057               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1058 
1059     fprintf(f1," -4  PE          1    1\n");
1060     fprintf(f1," -5  PE          1    1    0    0\n");
1061 
1062     frdselect(epn,epn,&iset,&nkcoords,inum,m1,istartset,iendset,
1063                 ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
1064                 nfieldscalar,&iselect,m2,f1,output,m3);
1065 
1066   }
1067 
1068   /* storing the energy in the nodes */
1069   
1070   if((strcmp1(&filab[522],"ENER")==0)&&(*ithermal!=2)){
1071     iselect=1;
1072     
1073     frdset(&filab[522],set,&iset,istartset,iendset,ialset,
1074            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1075            ngraph);
1076     
1077     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1078               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1079 
1080     fprintf(f1," -4  ENER        1    1\n");
1081     fprintf(f1," -5  ENER        1    1    0    0\n");
1082 
1083     frdselect(enern,enern,&iset,&nkcoords,inum,m1,istartset,iendset,
1084                 ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
1085                 nfieldscalar,&iselect,m2,f1,output,m3);
1086 
1087   }
1088   
1089   /* storing the contact displacements and stresses at the slave nodes */
1090 
1091   /* node-to-face penalty */
1092   
1093   if((strcmp1(&filab[2175],"CONT")==0)&&(*mortar!=1)&&(*ithermal!=2)&&(*nmethod!=2)){
1094     
1095     for(i=*ne-1;i>=0;i--){
1096       if((strcmp1(&lakon[8*i+1],"S")!=0)||(strcmp1(&lakon[8*i+6],"C")!=0))
1097         break;
1098     }
1099     noutloc=*ne-i-1;
1100     
1101     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1102               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1103     
1104     fprintf(f1," -4  CONTACT     6    1\n");
1105     fprintf(f1," -5  COPEN       1    4    1    1\n");
1106     fprintf(f1," -5  CSLIP1      1    4    2    2\n");
1107     fprintf(f1," -5  CSLIP2      1    4    3    3\n");
1108     fprintf(f1," -5  CPRESS      1    4    1    2\n");
1109     fprintf(f1," -5  CSHEAR1     1    4    2    3\n");
1110     fprintf(f1," -5  CSHEAR2     1    4    3    1\n");
1111     
1112     for(i=*ne-1;i>=0;i--){
1113       if((strcmp1(&lakon[8*i+1],"S")!=0)||(strcmp1(&lakon[8*i+6],"C")!=0))
1114         break;
1115       strcpy1(text,&lakon[8*i+7],1);
1116       nope=atoi(text)+1;
1117       nodes=kon[ipkon[i]+nope-1];
1118       if(strcmp1(output,"asc")==0){
1119           fprintf(f1,"%3s%10" ITGFORMAT "",m1,nodes);
1120           for(j=0;j<6;j++)fprintf(f1,"%12.5E",(float)stx[6*mi[0]*i+j]);
1121       }else{
1122           iw=(int)(nodes);fwrite(&iw,sizeof(int),1,f1);
1123           for(j=0;j<6;j++){
1124               ifl=(float)stx[6*mi[0]*i+j];
1125               fwrite(&ifl,sizeof(float),1,f1);
1126           }
1127       }
1128      if(strcmp1(output,"asc")==0)fprintf(f1,"\n");
1129     }
1130     
1131     if(strcmp1(output,"asc")==0)fprintf(f1,"%3s\n",m3);
1132   }
1133 
1134   /* face-to-face penalty */
1135 
1136   if((strcmp1(&filab[2175],"CONT")==0)&&(*mortar==1)&&(*ithermal!=2)){
1137       iselect=1;
1138     
1139       frdset(&filab[2175],set,&iset,istartset,iendset,ialset,
1140            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1141            ngraph);
1142     
1143       frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1144               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1145       fprintf(f1," -4  CONTACT     6    1\n");
1146       fprintf(f1," -5  COPEN       1    4    1    1\n");
1147       fprintf(f1," -5  CSLIP1      1    4    2    2\n");
1148       fprintf(f1," -5  CSLIP2      1    4    3    3\n");
1149       fprintf(f1," -5  CPRESS      1    4    1    2\n");
1150       fprintf(f1," -5  CSHEAR1     1    4    2    3\n");
1151       fprintf(f1," -5  CSHEAR2     1    4    3    1\n");
1152 
1153       frdselect(cdn,cdn,&iset,&nkcoords,inum,m1,istartset,iendset,
1154                 ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1155                 nfieldtensor,&iselect,m2,f1,output,m3);
1156 
1157   }
1158 
1159   /* storing imaginary part of the differential contact displacements 
1160      and the contact stresses for the odd modes of cyclic symmetry
1161      calculations */
1162 
1163   if(*noddiam>=0){
1164       if((strcmp1(&filab[2175],"CONT")==0)&&(*mortar==1)&&(*ithermal!=2)){
1165           iselect=1;
1166           
1167           frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1168              &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1169           fprintf(f1," -4  CONTACTI    6    1\n");
1170           fprintf(f1," -5  COPEN       1    4    1    1\n");
1171           fprintf(f1," -5  CSLIP1      1    4    2    2\n");
1172           fprintf(f1," -5  CSLIP2      1    4    3    3\n");
1173           fprintf(f1," -5  CPRESS      1    4    1    2\n");
1174           fprintf(f1," -5  CSHEAR1     1    4    2    3\n");
1175           fprintf(f1," -5  CSHEAR2     1    4    3    1\n");
1176           
1177           frdselect(&cdn[6**nk],cdn,&iset,&nkcoords,inum,m1,istartset,iendset,
1178              ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1179              nfieldtensor,&iselect,m2,f1,output,m3);
1180           
1181       }
1182   }
1183   /* storing the contact energy at the slave nodes */
1184   
1185   if((strcmp1(&filab[2262],"CELS")==0)&&(*ithermal!=2)){
1186     
1187     for(i=*ne-1;i>=0;i--){
1188       if((strcmp1(&lakon[8*i+1],"S")!=0)||(strcmp1(&lakon[8*i+6],"C")!=0))
1189         break;
1190     }
1191     noutloc=*ne-i-1;
1192     
1193     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1194               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1195     
1196     fprintf(f1," -4  CELS        1    1\n");
1197     fprintf(f1," -5  CELS        1    1    0    0\n");
1198     
1199     for(i=*ne-1;i>=0;i--){
1200       if((strcmp1(&lakon[8*i+1],"S")!=0)||(strcmp1(&lakon[8*i+6],"C")!=0))
1201         break;
1202       nope=atoi(&lakon[8*i+7])+1;
1203       nodes=kon[ipkon[i]+nope-1];
1204       if(strcmp1(output,"asc")==0){
1205           fprintf(f1,"%3s%10" ITGFORMAT "%12.5E\n",m1,nodes,(float)ener[i*mi[0]]);
1206       }else{
1207           iw=(int)(nodes);fwrite(&iw,sizeof(int),1,f1);
1208           ifl=(float)ener[i*mi[0]];
1209           fwrite(&ifl,sizeof(float),1,f1);
1210       }
1211     }
1212     
1213     if(strcmp1(output,"asc")==0)fprintf(f1,"%3s\n",m3);
1214   }
1215   
1216   /* storing the internal state variables in the nodes */
1217   
1218   if(strcmp1(&filab[609],"SDV ")==0){
1219     iselect=1;
1220     
1221     frdset(&filab[609],set,&iset,istartset,iendset,ialset,
1222            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1223            ngraph);
1224     
1225     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1226               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1227 
1228     fprintf(f1," -4  SDV        %2" ITGFORMAT "    1\n",*nstate_);
1229     for(j=1;j<=*nstate_;j++){
1230       fprintf(f1," -5  SDV%2" ITGFORMAT "       1    1    0    0\n",j);
1231     }
1232 
1233     for(i=0;i<*nstate_;i++){
1234       ifieldstate[i]=1;icompstate[i]=i;
1235     }
1236     nfield[0]=*nstate_;
1237 
1238     frdselect(xstaten,xstaten,&iset,&nkcoords,inum,m1,istartset,iendset,
1239                 ialset,ngraph,nstate_,ifieldstate,icompstate,
1240                 nfield,&iselect,m2,f1,output,m3);
1241 
1242   }
1243   
1244   /* storing the heat flux in the nodes
1245      the heat flux has been extrapolated from the integration points
1246      in subroutine extropolate.f, taking into account whether the 
1247      results are requested in the global system or in a local system.
1248      Therefore, subroutine frdvector cannot be used, since it assumes
1249      the values are stored in the global system */
1250   
1251   if((strcmp1(&filab[696],"HFL ")==0)&&(*ithermal>1)){
1252     iselect=1;
1253     
1254     frdset(&filab[696],set,&iset,istartset,iendset,ialset,
1255            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1256            ngraph);
1257     
1258     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1259               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1260 
1261     fprintf(f1," -4  FLUX        4    1\n");
1262     fprintf(f1," -5  F1          1    2    1    0\n");
1263     fprintf(f1," -5  F2          1    2    2    0\n");
1264     fprintf(f1," -5  F3          1    2    3    0\n");
1265     fprintf(f1," -5  ALL         1    2    0    0    1ALL\n");
1266 
1267     frdselect(qfn,qfn,&iset,&nkcoords,inum,m1,istartset,iendset,
1268                 ialset,ngraph,&ncompvector,ifieldvector,icompvector,
1269                 nfieldvector1,&iselect,m2,f1,output,m3);
1270 
1271   }
1272   
1273   /* storing the electrical current in the nodes
1274      (cf. heat flux HFL above)  */
1275   
1276   if((strcmp1(&filab[3567],"ECD ")==0)&&(*ithermal==2)){
1277     iselect=1;
1278     
1279     frdset(&filab[3567],set,&iset,istartset,iendset,ialset,
1280            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1281            ngraph);
1282     
1283     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1284               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1285 
1286     fprintf(f1," -4  CURR        4    1\n");
1287     fprintf(f1," -5  j1          1    2    1    0\n");
1288     fprintf(f1," -5  j2          1    2    2    0\n");
1289     fprintf(f1," -5  j3          1    2    3    0\n");
1290     fprintf(f1," -5  ALL         1    2    0    0    1ALL\n");
1291 
1292     frdselect(qfn,qfn,&iset,&nkcoords,inum,m1,istartset,iendset,
1293                 ialset,ngraph,&ncompvector,ifieldvector,icompvector,
1294                 nfieldvector1,&iselect,m2,f1,output,m3);
1295 
1296   }
1297           
1298   /* storing the heat generation in the nodes */
1299 
1300   if((strcmp1(&filab[783],"RFL ")==0)&&(*ithermal>1)){
1301     iselect=1;
1302     
1303     frdset(&filab[783],set,&iset,istartset,iendset,ialset,
1304            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1305            ngraph);
1306     
1307     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1308               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1309 
1310     fprintf(f1," -4  RFL         1    1\n");
1311     fprintf(f1," -5  RFL         1    1    0    0\n");
1312 
1313     frdselect(fn,fn,&iset,&nkcoords,inum,m1,istartset,iendset,
1314                 ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
1315                 nfieldvector0,&iselect,m2,f1,output,m3);
1316 
1317   }
1318   
1319   /* storing the Zienkiewicz-Zhu improved stresses in the nodes */
1320   
1321   if((strcmp1(&filab[1044],"ZZS")==0)&&(*ithermal!=2)){
1322 
1323     FORTRAN(zienzhu,(co,nk,kon,ipkon,lakon,ne0,stn,ipneigh,neigh,
1324                     stx,&mi[0]));
1325 
1326     iselect=1;
1327     
1328     frdset(&filab[1044],set,&iset,istartset,iendset,ialset,
1329            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1330            ngraph);
1331     
1332     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1333               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1334 
1335     fprintf(f1," -4  ZZSTR       6    1\n");
1336     fprintf(f1," -5  SXX         1    4    1    1\n");
1337     fprintf(f1," -5  SYY         1    4    2    2\n");
1338     fprintf(f1," -5  SZZ         1    4    3    3\n");
1339     fprintf(f1," -5  SXY         1    4    1    2\n");
1340     fprintf(f1," -5  SYZ         1    4    2    3\n");
1341     fprintf(f1," -5  SZX         1    4    3    1\n");
1342 
1343     frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
1344                 ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1345                 nfieldtensor,&iselect,m2,f1,output,m3);
1346 
1347   }
1348 
1349   /* storing the imaginary part of the Zienkiewicz-Zhu 
1350      improved stresses in the nodes
1351      for the odd modes of cyclic symmetry calculations */
1352   
1353   if(*noddiam>=0){
1354     if((strcmp1(&filab[1044],"ZZS")==0)&&(*ithermal!=2)){
1355 
1356       FORTRAN(zienzhu,(co,nk,kon,ipkon,lakon,ne0,stn,ipneigh,neigh,
1357                       &stx[6*mi[0]**ne],&mi[0]));
1358       
1359       frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1360                 &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1361       
1362       fprintf(f1," -4  ZZSTRI      6    1\n");
1363       fprintf(f1," -5  SXX         1    4    1    1\n");
1364       fprintf(f1," -5  SYY         1    4    2    2\n");
1365       fprintf(f1," -5  SZZ         1    4    3    3\n");
1366       fprintf(f1," -5  SXY         1    4    1    2\n");
1367       fprintf(f1," -5  SYZ         1    4    2    3\n");
1368       fprintf(f1," -5  SZX         1    4    3    1\n");
1369       
1370       frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
1371                 ialset,ngraph,&ncomptensor,ifieldtensor,icomptensor,
1372                 nfieldtensor,&iselect,m2,f1,output,m3);
1373       
1374     }
1375   }
1376   
1377   /* storing the error estimator in the nodes */
1378   
1379   if((strcmp1(&filab[1044],"ERR")==0)&&(*ithermal!=2)){
1380 
1381     nterms=6;
1382     FORTRAN(errorestimator,(stx,stn,ipkon,inum,kon,lakon,nk,ne,
1383                             mi,ielmat,thicke,&nterms));
1384 
1385     iselect=1;
1386     
1387     frdset(&filab[1044],set,&iset,istartset,iendset,ialset,
1388            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1389            ngraph);
1390     
1391     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1392               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1393 
1394     fprintf(f1," -4  ERROR       2    1\n");
1395     fprintf(f1," -5  PSTD        1    1    1    0\n");
1396     fprintf(f1," -5  VMSTD       1    2    2    0\n");
1397 
1398     ncomp=2;
1399     ifield[0]=1;ifield[1]=1;
1400     icomp[0]=2;icomp[1]=4;
1401 
1402     frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
1403                 ialset,ngraph,&ncomp,ifield,icomp,
1404                 nfieldtensor,&iselect,m2,f1,output,m3);
1405 
1406   }
1407 
1408   /* storing the imaginary part of the error estimator in the nodes
1409      for the odd modes of cyclic symmetry calculations */
1410   
1411   if(*noddiam>=0){
1412     if((strcmp1(&filab[1044],"ERR")==0)&&(*ithermal!=2)){
1413 
1414       nterms=6;
1415       FORTRAN(errorestimator,(&stx[6*mi[0]**ne],stn,ipkon,inum,kon,lakon,nk,ne,
1416                               mi,ielmat,thicke,&nterms));
1417       
1418       frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1419                 &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1420 
1421       fprintf(f1," -4  ERRORI      2    1\n");
1422       fprintf(f1," -5  PSTD        1    1    1    0\n");
1423       fprintf(f1," -5  VMSTD       1    2    2    0\n");
1424       
1425       ncomp=2;
1426       ifield[0]=1;ifield[1]=1;
1427       icomp[0]=2;icomp[1]=4;
1428 
1429       frdselect(stn,stn,&iset,&nkcoords,inum,m1,istartset,iendset,
1430                 ialset,ngraph,&ncomp,ifield,icomp,
1431                 nfieldtensor,&iselect,m2,f1,output,m3);
1432       
1433     }
1434   }
1435   
1436   /* storing the thermal error estimator in the nodes */
1437   
1438   if((strcmp1(&filab[2784],"HER")==0)&&(*ithermal>1)){
1439 
1440     nterms=3;
1441     FORTRAN(errorestimator,(qfx,qfn,ipkon,inum,kon,lakon,nk,ne,
1442                             mi,ielmat,thicke,&nterms));
1443 
1444     iselect=1;
1445     
1446     frdset(&filab[2784],set,&iset,istartset,iendset,ialset,
1447            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1448            ngraph);
1449     
1450     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1451               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1452 
1453     fprintf(f1," -4  HERROR      1    1\n");
1454     fprintf(f1," -5  HFLSTD      1    1    1    0\n");
1455 
1456     ncomp=1;
1457     ifield[0]=1;
1458     icomp[0]=2;
1459 
1460     frdselect(qfn,qfn,&iset,&nkcoords,inum,m1,istartset,iendset,
1461                 ialset,ngraph,&ncomp,ifield,icomp,
1462                 nfieldvector1,&iselect,m2,f1,output,m3);
1463 
1464   }
1465 
1466   /* storing the imaginary part of the thermal error estimator in the nodes
1467      for the odd modes of cyclic symmetry calculations */
1468   
1469   if(*noddiam>=0){
1470     if((strcmp1(&filab[2784],"HER")==0)&&(*ithermal>1)){
1471 
1472       nterms=3;
1473       FORTRAN(errorestimator,(&qfx[3*mi[0]**ne],qfn,ipkon,inum,kon,lakon,nk,ne,
1474                               mi,ielmat,thicke,&nterms));
1475       
1476       frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1477                 &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1478 
1479       fprintf(f1," -4  HERRORI     1    1\n");
1480       fprintf(f1," -5  HFLSTD      1    1    1    0\n");
1481       
1482       ncomp=1;
1483       ifield[0]=1;
1484       icomp[0]=2;
1485 
1486       frdselect(qfn,qfn,&iset,&nkcoords,inum,m1,istartset,iendset,
1487                 ialset,ngraph,&ncomp,ifield,icomp,
1488                 nfieldtensor,&iselect,m2,f1,output,m3);
1489       
1490     }
1491   }
1492 
1493   /* storing the total temperatures in the network nodes */
1494   
1495   if((strcmp1(&filab[1131],"TT  ")==0)&&(*ithermal>1)){
1496 
1497     iselect=-1;
1498     frdset(&filab[1131],set,&iset,istartset,iendset,ialset,
1499            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1500            ngraph);
1501     
1502     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1503               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1504 
1505     fprintf(f1," -4  TOTEMP      1    1\n");
1506     fprintf(f1," -5  TT          1    1    0    0\n");
1507 
1508     frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1509                 ialset,ngraph,&ncompscalar,ifieldscalar,icompscalar,
1510                 nfieldvector0,&iselect,m2,f1,output,m3);
1511 
1512   }
1513 
1514   /* storing the mass flow in the network nodes */
1515   
1516   if((strcmp1(&filab[1218],"MF  ")==0)&&(*ithermal>1)){
1517 
1518     iselect=-1;
1519     frdset(&filab[1218],set,&iset,istartset,iendset,ialset,
1520            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1521            ngraph);
1522     
1523     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1524               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1525 
1526     fprintf(f1," -4  MAFLOW      1    1\n");
1527     fprintf(f1," -5  MF          1    1    0    0\n");
1528 
1529     icomp[0]=1;
1530     if((iaxial==1)&&(strcmp1(&filab[1222],"I")==0)){for(i=0;i<*nk;i++)v[1+i*mt]*=180.;}
1531     frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1532                 ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1533                 nfieldvector0,&iselect,m2,f1,output,m3);
1534     if((iaxial==1)&&(strcmp1(&filab[1222],"I")==0)){for(i=0;i<*nk;i++)v[1+i*mt]/=180.;}
1535 
1536   }
1537 
1538   /* storing the total pressure in the network nodes */
1539   
1540   if((strcmp1(&filab[1305],"PT  ")==0)&&(*ithermal>1)){
1541 
1542     iselect=-1;
1543     frdset(&filab[1305],set,&iset,istartset,iendset,ialset,
1544            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1545            ngraph);
1546     
1547     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1548               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1549 
1550     fprintf(f1," -4  TOPRES      1    1\n");
1551     fprintf(f1," -5  PT          1    1    0    0\n");
1552 
1553     icomp[0]=2;
1554     frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1555                 ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1556                 nfieldvector0,&iselect,m2,f1,output,m3);
1557 
1558   }
1559 
1560   /* storing the static pressure in the liquid network nodes */
1561   
1562   if((strcmp1(&filab[1827],"PS  ")==0)&&(*ithermal>1)){
1563 
1564     iselect=-1;
1565     frdset(&filab[1827],set,&iset,istartset,iendset,ialset,
1566            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1567            ngraph);
1568     
1569     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1570               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1571 
1572     fprintf(f1," -4  STPRES      1    1\n");
1573     fprintf(f1," -5  PS          1    1    0    0\n");
1574 
1575     icomp[0]=2;
1576     frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1577                 ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1578                 nfieldvector0,&iselect,m2,f1,output,m3);
1579 
1580   }
1581 
1582   /* storing the liquid depth in the channel nodes */
1583   
1584   if((strcmp1(&filab[2349],"PS  ")==0)&&(*ithermal>1)){
1585 
1586     iselect=-1;
1587     frdset(&filab[2349],set,&iset,istartset,iendset,ialset,
1588            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1589            ngraph);
1590     
1591     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1592               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1593 
1594     fprintf(f1," -4  DEPTH       1    1\n");
1595     fprintf(f1," -5  DEPTH       1    1    0    0\n");
1596 
1597     icomp[0]=2;
1598     frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1599                 ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1600                 nfieldvector0,&iselect,m2,f1,output,m3);
1601 
1602   }
1603 
1604   /* storing the critical depth in the channel nodes */
1605   
1606   if((strcmp1(&filab[2436],"HCRI")==0)&&(*ithermal>1)){
1607 
1608     iselect=-1;
1609     frdset(&filab[2436],set,&iset,istartset,iendset,ialset,
1610            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1611            ngraph);
1612     
1613     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1614               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1615 
1616     fprintf(f1," -4  HCRIT       1    1\n");
1617     fprintf(f1," -5  HCRIT       1    1    0    0\n");
1618 
1619     icomp[0]=3;
1620     frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1621                 ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1622                 nfieldvector0,&iselect,m2,f1,output,m3);
1623 
1624   }
1625 
1626   /* storing the static temperature in the network nodes */
1627   
1628   if((strcmp1(&filab[1392],"TS  ")==0)&&(*ithermal>1)){
1629 
1630     iselect=-1;
1631     frdset(&filab[1392],set,&iset,istartset,iendset,ialset,
1632            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1633            ngraph);
1634     
1635     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1636               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1637 
1638     fprintf(f1," -4  STTEMP      1    1\n");
1639     fprintf(f1," -5  TS          1    1    0    0\n");
1640 
1641     icomp[0]=3;
1642     frdselect(v,v,&iset,&nkcoords,inum,m1,istartset,iendset,
1643                 ialset,ngraph,&ncompscalar,ifieldscalar,icomp,
1644                 nfieldvector0,&iselect,m2,f1,output,m3);
1645 
1646   }
1647 
1648   /*  the remaining lines only apply to frequency calculations
1649       with cyclic symmetry, complex frequency and steady state calculations */
1650 
1651   if((*nmethod!=2)&&(*nmethod!=5)&&(*nmethod!=6)&&(*nmethod!=7)){fclose(f1);return;}
1652   if((*nmethod==5)&&(*mode==-1)){fclose(f1);return;}
1653 
1654   /* storing the displacements in the nodes (magnitude, phase) */
1655           
1656   if((strcmp1(&filab[870],"PU  ")==0)&&(*ithermal!=2)){
1657     iselect=1;
1658     
1659     frdset(&filab[870],set,&iset,istartset,iendset,ialset,
1660            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1661            ngraph);
1662     
1663     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1664               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1665 
1666     fprintf(f1," -4  PDISP       6    1\n");
1667     fprintf(f1," -5  MAG1        1   12    1    0\n");
1668     fprintf(f1," -5  MAG2        1   12    2    0\n");
1669     fprintf(f1," -5  MAG3        1   12    3    0\n");
1670     fprintf(f1," -5  PHA1        1   12    4    0\n");
1671     fprintf(f1," -5  PHA2        1   12    5    0\n");
1672     fprintf(f1," -5  PHA3        1   12    6    0\n");
1673 
1674     frdselect(vr,vi,&iset,&nkcoords,inum,m1,istartset,iendset,
1675                 ialset,ngraph,&ncompvectph,ifieldvectph,icompvectph,
1676                 nfieldvectph,&iselect,m2,f1,output,m3);
1677 
1678   }
1679 
1680   /* storing the temperatures in the nodes (magnitude, phase) */
1681           
1682   if((strcmp1(&filab[957],"PNT ")==0)&&(*ithermal>1)){
1683     iselect=1;
1684     
1685     frdset(&filab[957],set,&iset,istartset,iendset,ialset,
1686            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1687            ngraph);
1688     
1689     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1690               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1691 
1692     fprintf(f1," -4  PNDTEMP     2    1\n");
1693     fprintf(f1," -5  MAG1        1    1    1    0\n");
1694     fprintf(f1," -5  PHA1        1    1    2    0\n");
1695 
1696     frdselect(vr,vi,&iset,&nkcoords,inum,m1,istartset,iendset,
1697                 ialset,ngraph,&ncompscalph,ifieldscalph,icompscalph,
1698                 nfieldscalph,&iselect,m2,f1,output,m3);
1699 
1700   }
1701 
1702   /* storing the stresses in the nodes (magnitude, phase) */
1703           
1704   if((strcmp1(&filab[1479],"PHS ")==0)&&(*ithermal!=2)){
1705     iselect=1;
1706     
1707     frdset(&filab[1479],set,&iset,istartset,iendset,ialset,
1708            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1709            ngraph);
1710     
1711     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1712               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1713 
1714     fprintf(f1," -4  PSTRESS    12    1\n");
1715     fprintf(f1," -5  MAGXX       1   14    1    1\n");
1716     fprintf(f1," -5  MAGYY       1   14    2    2\n");
1717     fprintf(f1," -5  MAGZZ       1   14    3    3\n");
1718     fprintf(f1," -5  MAGXY       1   14    1    2\n");
1719     fprintf(f1," -5  MAGYZ       1   14    2    3\n");
1720     fprintf(f1," -5  MAGZX       1   14    3    1\n");
1721     fprintf(f1," -5  PHAXX       1   14    1    1\n");
1722     fprintf(f1," -5  PHAYY       1   14    2    2\n");
1723     fprintf(f1," -5  PHAZZ       1   14    3    3\n");
1724     fprintf(f1," -5  PHAXY       1   14    1    2\n");
1725     fprintf(f1," -5  PHAYZ       1   14    2    3\n");
1726     fprintf(f1," -5  PHAZX       1   14    3    1\n");
1727 
1728     frdselect(stnr,stni,&iset,&nkcoords,inum,m1,istartset,iendset,
1729                 ialset,ngraph,&ncomptensph,ifieldtensph,icomptensph,
1730                 nfieldtensph,&iselect,m2,f1,output,m3);
1731 
1732   }
1733 
1734   /* storing the differential contact displacements and
1735      the contact stresses in the nodes (magnitude, phase)
1736      only for face-to-face penalty contact */
1737           
1738   if((strcmp1(&filab[3915],"PCON")==0)&&(*ithermal!=2)&&(*mortar==1)){
1739     iselect=1;
1740     
1741     frdset(&filab[3915],set,&iset,istartset,iendset,ialset,
1742            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1743            ngraph);
1744     
1745     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1746               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1747 
1748     fprintf(f1," -4  PCONTAC    12    1\n");
1749     fprintf(f1," -5  MAGO        1   14    1    1\n");
1750     fprintf(f1," -5  MAGSL1      1   14    2    2\n");
1751     fprintf(f1," -5  MAGSL2      1   14    3    3\n");
1752     fprintf(f1," -5  MAGP        1   14    1    2\n");
1753     fprintf(f1," -5  MAGSH1      1   14    2    3\n");
1754     fprintf(f1," -5  MAGSH2      1   14    3    1\n");
1755     fprintf(f1," -5  PHAO        1   14    1    1\n");
1756     fprintf(f1," -5  PHASL1      1   14    2    2\n");
1757     fprintf(f1," -5  PHASL2      1   14    3    3\n");
1758     fprintf(f1," -5  PHAP        1   14    1    2\n");
1759     fprintf(f1," -5  PHASH1      1   14    2    3\n");
1760     fprintf(f1," -5  PHASH2      1   14    3    1\n");
1761 
1762     frdselect(cdnr,cdni,&iset,&nkcoords,inum,m1,istartset,iendset,
1763                 ialset,ngraph,&ncomptensph,ifieldtensph,icomptensph,
1764                 nfieldtensph,&iselect,m2,f1,output,m3);
1765 
1766   }
1767 
1768   /* storing the forces in the nodes (magnitude, phase) */
1769           
1770   if((strcmp1(&filab[2610],"PRF ")==0)&&(*ithermal!=2)){
1771     iselect=1;
1772     
1773     frdset(&filab[2610],set,&iset,istartset,iendset,ialset,
1774            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1775            ngraph);
1776     
1777     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1778               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1779 
1780     fprintf(f1," -4  PFORC       6    1\n");
1781     fprintf(f1," -5  MAG1        1   12    1    0\n");
1782     fprintf(f1," -5  MAG2        1   12    2    0\n");
1783     fprintf(f1," -5  MAG3        1   12    3    0\n");
1784     fprintf(f1," -5  PHA1        1   12    4    0\n");
1785     fprintf(f1," -5  PHA2        1   12    5    0\n");
1786     fprintf(f1," -5  PHA3        1   12    6    0\n");
1787 
1788     frdselect(fnr,fni,&iset,&nkcoords,inum,m1,istartset,iendset,
1789                 ialset,ngraph,&ncompvectph,ifieldvectph,icompvectph,
1790                 nfieldvectph,&iselect,m2,f1,output,m3);
1791 
1792   }
1793 
1794   /* the remaining parts are for frequency calculations with cyclic symmetry only */
1795 
1796   if(*nmethod!=2){fclose(f1);return;}
1797 
1798   /* storing the maximum displacements of the nodes in the base sector
1799      (components, magnitude) */
1800           
1801   if((strcmp1(&filab[1566],"MAXU")==0)&&(*ithermal!=2)){
1802     iselect=1;
1803     
1804     frdset(&filab[1566],set,&iset,istartset,iendset,ialset,
1805            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1806            ngraph);
1807     
1808     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1809               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1810 
1811     fprintf(f1," -4  MDISP       4    1\n");
1812     fprintf(f1," -5  DX          1    4    1    0\n");
1813     fprintf(f1," -5  DY          1    4    2    0\n");
1814     fprintf(f1," -5  DZ          1    4    3    0\n");
1815     fprintf(f1," -5  ANG         1    4    4    0\n");
1816     
1817     ncomp=4;
1818     ifield[0]=1;icomp[0]=1;
1819     ifield[1]=1;icomp[1]=2;
1820     ifield[2]=1;icomp[2]=3;
1821     ifield[3]=1;icomp[3]=0;
1822     nfield[0]=4;nfield[1]=4;
1823 
1824     frdselect(vmax,vmax,&iset,&nkcoords,inum,m1,istartset,iendset,
1825                 ialset,ngraph,&ncomp,ifield,icomp,
1826                 nfield,&iselect,m2,f1,output,m3);
1827 
1828   }
1829 
1830   /* storing the worst principal stress at the nodes
1831      in the basis sector (components, magnitude)
1832 
1833      the worst principal stress is the maximum of the
1834      absolute value of all principal stresses, times
1835      its original sign */
1836           
1837   if((strcmp1(&filab[1653],"MAXS")==0)&&(*ithermal!=2)){
1838     iselect=1;
1839     
1840     frdset(&filab[1653],set,&iset,istartset,iendset,ialset,
1841            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1842            ngraph);
1843     
1844     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1845               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1846 
1847     fprintf(f1," -4  MSTRESS     7    1\n");
1848     fprintf(f1," -5  SXX         1    4    1    1\n");
1849     fprintf(f1," -5  SYY         1    4    2    2\n");
1850     fprintf(f1," -5  SZZ         1    4    3    3\n");
1851     fprintf(f1," -5  SXY         1    4    1    2\n");
1852     fprintf(f1," -5  SYZ         1    4    2    3\n");
1853     fprintf(f1," -5  SZX         1    4    3    1\n");
1854     fprintf(f1," -5  MAG         1    4    0    0\n");
1855     
1856     ncomp=7;
1857     ifield[0]=1;icomp[0]=1;
1858     ifield[1]=1;icomp[1]=2;
1859     ifield[2]=1;icomp[2]=3;
1860     ifield[3]=1;icomp[3]=4;
1861     ifield[4]=1;icomp[4]=6;
1862     ifield[5]=1;icomp[5]=5;
1863     ifield[6]=1;icomp[6]=0;
1864     nfield[0]=7;nfield[1]=7;
1865 
1866     frdselect(stnmax,stnmax,&iset,&nkcoords,inum,m1,istartset,iendset,
1867                 ialset,ngraph,&ncomp,ifield,icomp,
1868                 nfield,&iselect,m2,f1,output,m3);
1869 
1870   }
1871 
1872   /* storing the worst principal strain at the nodes
1873      in the basis sector (components, magnitude)
1874 
1875      the worst principal strain is the maximum of the
1876      absolute value of all principal strains, times
1877      its original sign */
1878           
1879   if((strcmp1(&filab[2523],"MAXE")==0)&&(*ithermal!=2)){
1880     iselect=1;
1881     
1882     frdset(&filab[2523],set,&iset,istartset,iendset,ialset,
1883            inum,&noutloc,&nout,nset,&noutmin,&noutplus,&iselect,
1884            ngraph);
1885     
1886     frdheader(&icounter,&oner,time,&pi,noddiam,cs,&null,mode,
1887               &noutloc,description,kode,nmethod,f1,output,istep,iinc);
1888 
1889     fprintf(f1," -4  MSTRAIN     7    1\n");
1890     fprintf(f1," -5  EXX         1    4    1    1\n");
1891     fprintf(f1," -5  EYY         1    4    2    2\n");
1892     fprintf(f1," -5  EZZ         1    4    3    3\n");
1893     fprintf(f1," -5  EXY         1    4    1    2\n");
1894     fprintf(f1," -5  EYZ         1    4    2    3\n");
1895     fprintf(f1," -5  EZX         1    4    3    1\n");
1896     fprintf(f1," -5  MAG         1    4    0    0\n");
1897     
1898     ncomp=7;
1899     ifield[0]=1;icomp[0]=1;
1900     ifield[1]=1;icomp[1]=2;
1901     ifield[2]=1;icomp[2]=3;
1902     ifield[3]=1;icomp[3]=4;
1903     ifield[4]=1;icomp[4]=6;
1904     ifield[5]=1;icomp[5]=5;
1905     ifield[6]=1;icomp[6]=0;
1906     nfield[0]=7;nfield[1]=7;
1907 
1908     frdselect(eenmax,eenmax,&iset,&nkcoords,inum,m1,istartset,iendset,
1909                 ialset,ngraph,&ncomp,ifield,icomp,
1910                 nfield,&iselect,m2,f1,output,m3);
1911 
1912   }
1913   
1914   fclose(f1);
1915   return;
1916   
1917 }

/* [<][>][^][v][top][bottom][index][help] */