tsimulation.h - slidergrid - grid of elastic sliders on a frictional surface
HTML git clone git://src.adamsgaard.dk/slidergrid
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
tsimulation.h (1199B)
---
1 #ifndef SIMULATION_H_
2 #define SIMULATION_H_
3
4 #include "slider.h"
5
6 typedef struct {
7 slider* sliders;
8 int N;
9 Float time;
10 Float time_end;
11 Float dt;
12 long int iteration;
13 Float bond_length_limit;
14 char* id;
15 Float file_interval;
16 int file_number;
17 int verbose;
18 } simulation;
19
20 // create simulation with default values
21 simulation create_simulation();
22
23 // calculate the longest stable time step
24 Float find_time_step(const slider* sliders, const int N, const Float safety);
25
26 // check if simulation parameters have reasonable values
27 int check_simulation_values(const simulation* sim);
28
29 // save slider information to a file on the disk
30 int save_slider_data_to_file(
31 const slider* sliders,
32 const int N,
33 const char* filename);
34
35 int save_general_state_to_file(const simulation* sim, const char* filename);
36
37 int save_sliders_to_vtk_file(
38 const slider* sliders,
39 const int N,
40 const char* filename);
41
42 //int write_simulation_output(simulation sim, char* output_folder);
43 int write_simulation_output(simulation* sim, char* output_folder);
44
45 // user-defined function which sets up the simulation
46 simulation setup_simulation();
47
48 #endif