main.c 1.16 KB
Newer Older
François Trigaux's avatar
François Trigaux committed
1
2
3
4
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

5
#include "gebt.h"
François Trigaux's avatar
François Trigaux committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


int main(int argc, char* argv[])
{
    int i;
    double load;

    // Check the input argument
    if(argc<2)
    {
        printf("Please specify the uniform load value as arguments\n");
        printf("Example: ./gebt 100\n");
        exit(EXIT_FAILURE);
    }

    // Initializing the Beam
    printf("Initializing the beam...\n");
23
24
    Gebt *bm = malloc(sizeof(Gebt));
    initGebt(bm);
François Trigaux's avatar
François Trigaux committed
25
26
    printf("...Done!\n");

27
28
    /*double *twist = malloc(sizeof(double)*bm->nkp);
    for(i=0;i<bm->nkp;i++)
François Trigaux's avatar
François Trigaux committed
29
    {
30
        twist[i] = 90.0 * M_PI/180.0 * i / ((double) (bm->nkp - 1.0));
François Trigaux's avatar
François Trigaux committed
31
    }
François Trigaux's avatar
François Trigaux committed
32
    gebt_setTwist(bm,twist);
33
    free(twist);*/
François Trigaux's avatar
François Trigaux committed
34
    gebt_setTwistFromFile(bm,"Twist.dat");
François Trigaux's avatar
François Trigaux committed
35
36
37
38

    // Creating an array with the uniform load for each member
    printf("Creating the loads...\n");
    load = atof(argv[1]);
François Trigaux's avatar
François Trigaux committed
39
    gebt_setEndLoad(bm,load,2); // 2 -> Fz
François Trigaux's avatar
François Trigaux committed
40
41
42
43
44
45
46
    printf("...Done!\n");

    char fname[32] = "output";
    
    // Performing the analysis
    printf("Performing the analysis...\n");
    
François Trigaux's avatar
François Trigaux committed
47
48
    gebt_analysis(bm);
    gebt_writeSolToFile(bm,fname);
François Trigaux's avatar
François Trigaux committed
49
50
51
52
53
    printf("... Ok! \n");
    
    
    return EXIT_SUCCESS;
}