main.c 1016 Bytes
Newer Older
1
2
3
#include <stdlib.h>
#include <stdio.h>

4
#include "gebt.h"
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20


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

    // 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");
21
22
    Gebt *bm = malloc(sizeof(Gebt));
    initGebt(bm);
23
24
25
26
27
28
29
30
31
    printf("...Done!\n");

    // Creating an array with the uniform load for each member
    printf("Creating the loads...\n");
    double *loads = malloc(sizeof(double)*bm->nmemb);
    for(i=0;i<bm->nmemb;i++)
    {
        loads[i] = atof(argv[1]);
    }
François Trigaux's avatar
François Trigaux committed
32
    gebt_setLoads(bm,loads,2);
33
34
35
36
37
    printf("...Done!\n");

    
    // Performing the analysis
    printf("Performing the analysis...\n");
François Trigaux's avatar
François Trigaux committed
38
    gebt_analysis(bm);
39
40
41
42
    printf("...Done!\n");
    

    printf("Outputting the results...\n");
François Trigaux's avatar
François Trigaux committed
43
    gebt_writeSolToFile(bm);
44
45
46
47
    printf("... Done!\n");
    
    return EXIT_SUCCESS;
}