1 /*     CalculiX - A 3-Dimensional finite element program                   */
2 /*              Copyright (C) 1998-2021 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 <stdio.h>
19 #include <math.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include "CalculiX.h"
23 
writeheading(char * jobnamec,char * heading,ITG * nheading_)24 void writeheading(char *jobnamec,char *heading,ITG *nheading_){
25 
26     /* writes the headers in the frd-file */
27 
28     FILE *f1;
29 
30     char p1[6]="    1",fneig[132]="",c[2]="C",
31          text[67]="                                                                  ";
32 
33     ITG i;
34 
35     strcpy(fneig,jobnamec);
36     strcat(fneig,".frd");
37 
38     if((f1=fopen(fneig,"ab"))==NULL){
39 	printf("*ERROR in frd: cannot open frd file for writing...");
40 	exit(0);
41     }
42 
43     /* first line */
44 
45     fprintf(f1,"%5s%1s\n",p1,c);
46 
47     /* header lines */
48 
49     for(i=0;i<*nheading_;i++){
50 	strcpy1(text,&heading[66*i],66);
51 	fprintf(f1,"%5sU%66s\n",p1,text);
52     }
53 
54     fclose(f1);
55 
56     return;
57 }
58