-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.c
More file actions
28 lines (25 loc) · 837 Bytes
/
main.c
File metadata and controls
28 lines (25 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// File main.c
// This file should only contain the main function
//
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "vector_mtx.h" // vector and matrix utility functions
#include "params.h" // parameter definitions
#include "init.h" // initialization functions
#include "evolve.h" // time evolution
#include "analysis.h" // analyze the results
int main(int argc, char **argv)
{
char *input_file; // Input file name
double *x, *p;
input_file = argv[1];
ReadInParams(input_file);
PrintParams();
x = vector_malloc(PARAM_DATA.it_max + 1);
p = vector_malloc(PARAM_DATA.it_max + 1);
Initialize(x, p); //set iitial values for x and p (where iterations begin)
Evolve(x, p); //use algorithm to obtain converging solution for x and p
WriteResults(x, p); //store results in .dat file (analysis.c)
return 0;
}// main