Trisurf Monte Carlo simulator
Samo Penic
2014-04-09 dc77e8ef10378188ee0a9657cedd1b7991a0a29f
commit | author | age
d7639a 1 #ifndef _IO_H
SP 2 #define _IO_H
3
083e03 4 /** @ Global variables for I/O operations like filenames etc. */
SP 5 /*static char mastername[1024];
6 static char prefixname[1024];
7 static ts_bool restore=0;
8 static char tape[1024]; */
9 int force_from_tape;
10
8a6614 11
SP 12 typedef struct {
13     long int nshell;
14     long int ncxmax;
15     long int ncymax;
16     long int nczmax;
17     long int npoly;
18     long int nmono;
58230a 19     long int nfil;
M 20     long int nfono;
21     long int R_nucleus;
8a6614 22     long int pswitch;
SP 23         char *multiprocessing;
24        long int brezveze0;
25         long int brezveze1;
26         long int brezveze2;
27         ts_double xk0;
28     ts_double dmax;
ea1cce 29     ts_double dmin_interspecies;
8a6614 30     ts_double stepsize;
SP 31     ts_double kspring;
b30f45 32     ts_double xi;
8a6614 33     ts_double pressure;
SP 34     long int iterations;
35     long int inititer;
36     long int mcsweeps;
37     long int quiet;
dc77e8 38     long int shc;
8a6614 39 } ts_tape;
SP 40
41 typedef struct{
42     ts_int force_from_tape;
43     ts_int reset_iteration_count;
3f5c83 44     char path[1024]; //path where all files should be added
SP 45     char output_fullfilename[1024]; //name of the master file
46     char dump_fullfilename[1024]; //name of the dump file
47     char tape_fullfilename[1024]; //name of the tape file
8a6614 48 } ts_args;
SP 49
50 ts_args command_line_args;
51
083e03 52 ts_bool parse_args(int argc, char **argv);
SP 53
54
55
d7639a 56 /** @brief Prints the position of vertices for the whole list
SP 57  *  
58  *  The function is meant more or less as a debug tool, but can be used in production
59  *  environment aswell.
60  *  the output is in form of idx: x y z
61  *      @param *vlist is a structure holding information on vertex list.
62  *    @returns TS_SUCCESS on successful execution, TS_FAIL otherwise.
63 */
64
65 ts_bool print_vertex_list(ts_vertex_list *vlist);
66
67 /** @brief Prints the neighbours of all the vertices
68  *  
69  *  The function is meant more or less as a debug tool, but can be used in production
70  *  environment aswell.
71  *  the output is in form of idx(number of neighbours): (x1,y1,z1) (x2,y2,z2) ...
72  *      @param *vlist is a structure holding information on vertex list.
73  *    @returns TS_SUCCESS on successful execution, TS_FAIL otherwise.
74 */
75 ts_bool print_vertex_neighbours(ts_vertex_list *vlist);
76
77
78 /** @brief Function outputs the vetex list file to comply to old fortran format
79  *  
80  *      @param *vlist is a list of vertices
81  *      @param *filename is a name of the output file to be created (note that if the file already
82  *  exists it will be overwritten.
83  */
84 ts_bool write_vertex_fcompat_file(ts_vertex_list *vlist,ts_char *filename);
85 ts_bool fprint_vertex_list(FILE *fh,ts_vertex_list *vlist);
86 ts_bool fprint_tristar(FILE *fh, ts_vesicle *vesicle);
87 ts_bool fprint_triangle_list(FILE *fh, ts_vesicle *vesicle);
88 ts_bool fprint_vertex_data(FILE *fh,ts_vertex_list *vlist);
89 ts_bool fprint_bonds(FILE *fh,ts_vesicle *vesicle);
90 ts_bool write_dout_fcompat_file(ts_vesicle *vesicle, ts_char *filename);
91 ts_bool read_tape_fcompat_file(ts_vesicle *vesicle, ts_char *filename);
92
93
94 /** @brief Outputs file in vtk format, compatible with paraview.
95  *
96  *    @param *vlist is a list of vertices
97  *    @param *filename is a name of the output file. If exists, it will be overwritten
98  *    @param *text is a description line (max. 255 characters) to be included in the file
99  */
100 ts_bool write_vertex_vtk_file(ts_vesicle *vesicle,ts_char *filename, ts_char *text);
a6b1b5 101 ts_bool write_vertex_xml_file(ts_vesicle *vesicle, ts_uint timestepno);
SP 102 ts_bool write_master_xml_file(ts_char *filename);
144784 103 ts_bool write_pov_file(ts_vesicle *vesicle, char *filename);
SP 104
1ab449 105 ts_tape *parsetape(char *filename);
SP 106 ts_bool tape_free(ts_tape *tape);
d7639a 107
1ab449 108 ts_bool dump_state(ts_vesicle *vesicle, ts_uint iteration);
SP 109 ts_vesicle *restore_state(ts_uint *iteration);
d7639a 110 #endif