CalculiX  2.8
A Free Software Three-Dimensional Structural Finite Element Program
 All Classes Files Functions Variables Macros
frdheader.c File Reference
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "CalculiX.h"
Include dependency graph for frdheader.c:

Go to the source code of this file.

Functions

void frdheader (ITG *icounter, double *oner, double *time, double *pi, ITG *noddiam, double *cs, ITG *null, ITG *mode, ITG *noutloc, char *description, ITG *kode, ITG *nmethod, FILE *f1, char *output, ITG *istep, ITG *iinc)
 

Function Documentation

void frdheader ( ITG icounter,
double *  oner,
double *  time,
double *  pi,
ITG noddiam,
double *  cs,
ITG null,
ITG mode,
ITG noutloc,
char *  description,
ITG kode,
ITG nmethod,
FILE *  f1,
char *  output,
ITG istep,
ITG iinc 
)

Definition at line 24 of file frdheader.c.

27  {
28 
29  char tmp[132],text[132];
30 
31  ITG i,ncomma;
32 
33  /* icounter counts the number of loadcases in the frd-file
34  kode counts the number of increments in the frd-file */
35 
36  strcpy1(&text[0]," 1PSTEP",10);
37  for(i=10;i<70;i++)text[i]=' ';text[70]='\0';
38  (*icounter)++;
39  sprintf(&text[24],"%12" ITGFORMAT "",*icounter);
40  sprintf(&text[36],"%12" ITGFORMAT "",*iinc);
41  sprintf(&text[48],"%12" ITGFORMAT "",*istep);text[60]=' ';
42  fprintf(f1,"%s\n",text);
43 
44  /* additional headers for frequency calculations */
45 
46  if((*nmethod==2)||(*nmethod==6)||(*nmethod==7)){
47  strcpy1(&text[0]," 1PGM",8);
48  for(i=8;i<70;i++)text[i]=' ';text[70]='\0';
49  sprintf(&text[24],"%12.6E",*oner);text[36]=' ';
50  fprintf(f1,"%s\n",text);
51 
52  strcpy1(&text[0]," 1PGK",8);
53  for(i=8;i<70;i++)text[i]=' ';text[70]='\0';
54  sprintf(&text[24],"%12.6E",(*time*2.**pi)*(*time*2.**pi));text[36]=' ';
55  fprintf(f1,"%s\n",text);
56 
57  strcpy1(&text[0]," 1PHID",9);
58  for(i=9;i<70;i++)text[i]=' ';text[70]='\0';
59  sprintf(&text[24],"%12" ITGFORMAT "",*noddiam);text[36]=' ';
60  fprintf(f1,"%s\n",text);
61 
62  /* additional headers for cyclic symmetry calculations */
63 
64  if((*noddiam>=0)&&(cs!=NULL)){
65  strcpy1(&text[0]," 1PAX",8);
66  for(i=8;i<24;i++)text[i]=' ';
67  sprintf(&text[24],"%12.5E",cs[5]);
68  sprintf(&text[36],"%12.5E",cs[6]);
69  sprintf(&text[48],"%12.5E",cs[7]);
70  sprintf(&text[60],"%12.5E",cs[8]);
71  sprintf(&text[72],"%12.5E",cs[9]);
72  sprintf(&text[84],"%12.5E",cs[10]);
73  fprintf(f1,"%s\n",text);
74  }
75 
76  strcpy1(&text[0]," 1PSUBC",10);
77  for(i=10;i<70;i++)text[i]=' ';text[70]='\0';
78  sprintf(&text[24],"%12" ITGFORMAT "",*null);text[36]=' ';
79  fprintf(f1,"%s\n",text);
80 
81  strcpy1(&text[0]," 1PMODE",10);
82  for(i=10;i<70;i++)text[i]=' ';text[70]='\0';
83  sprintf(&text[24],"%12" ITGFORMAT "",*mode+1);text[36]=' ';
84  fprintf(f1,"%s\n",text);
85  }
86 
87 #ifdef COMPANY
88  writeBasisParameter(f1,istep,iinc);
89 #endif
90 
91  /* 100CL line */
92 
93  for(i=0;i<75;i++)text[i]=' ';
94  if(abs(*nmethod)==1){
95  strcpy1(&text[0]," 100CL .00000E+00 0 1",63);
96  }else if(*nmethod==2){
97  strcpy1(&text[0]," 100CL .00000E+00 2 1",63);
98  }else if(*nmethod==3){
99  strcpy1(&text[0]," 100CL .00000E+00 4 1",63);
100  }else if((*nmethod==4)||(*nmethod==5)){
101  strcpy1(&text[0]," 100CL .00000E+00 1 1",63);
102  }else{
103  strcpy1(&text[0]," 100CL .00000E+00 3 1",63);
104  }
105 
106  sprintf(tmp,"%12" ITGFORMAT "",*noutloc);
107  strcpy1(&text[24],tmp,12);
108  strcpy1(&text[36],description,12);
109  if(*nmethod==2)strcpy1(&text[63],"MODAL",5);
110  if(strcmp1(output,"asc")==0){
111  strcpy1(&text[74],"1",1);
112  }else{
113  strcpy1(&text[74],"2",1);
114  }
115  sprintf(tmp,"%5" ITGFORMAT "",100+(*kode));
116  strcpy1(&text[7],tmp,5);
117 // sprintf(tmp,"%12.5E",*time);
118 
119  if((*time<=0.)||(*nmethod==2)){
120  sprintf(tmp,"%12.5E",*time);
121  }else if((log10(*time)>=0)&&(log10(*time)<10.)){
122  ncomma=10-floor(log10(*time)+1.);
123  if(ncomma==0){
124  sprintf(tmp,"%12.0f",*time);
125  }else if(ncomma==1){
126  sprintf(tmp,"%12.1f",*time);
127  }else if(ncomma==2){
128  sprintf(tmp,"%12.2f",*time);
129  }else if(ncomma==3){
130  sprintf(tmp,"%12.3f",*time);
131  }else if(ncomma==4){
132  sprintf(tmp,"%12.4f",*time);
133  }else if(ncomma==5){
134  sprintf(tmp,"%12.5f",*time);
135  }else if(ncomma==6){
136  sprintf(tmp,"%12.6f",*time);
137  }else if(ncomma==7){
138  sprintf(tmp,"%12.7f",*time);
139  }else if(ncomma==8){
140  sprintf(tmp,"%12.8f",*time);
141  }else{
142  sprintf(tmp,"%12.9f",*time);
143  }
144  }else{
145  sprintf(tmp,"%12.5E",*time);
146  }
147 
148  strcpy1(&text[12],tmp,12);
149  sprintf(tmp,"%5" ITGFORMAT "",*kode);
150  strcpy1(&text[58],tmp,5);
151  text[75]='\0';
152  fprintf(f1,"%s\n",text);
153 
154 }
#define ITGFORMAT
Definition: CalculiX.h:52
ITG strcpy1(char *s1, const char *s2, ITG length)
Definition: strcpy1.c:24
ITG strcmp1(const char *s1, const char *s2)
Definition: strcmp1.c:24
void writeBasisParameter(FILE *f, ITG *istep, ITG *iinc)
#define ITG
Definition: CalculiX.h:51
Hosted by OpenAircraft.com, (Michigan UAV, LLC)