Trisurf Monte Carlo simulator
Samo Penic
2016-02-16 11fef8d1bbe449016584c061ddb2b302ee1ee593
commit | author | age
d7639a 1 #ifndef _IO_H
SP 2 #define _IO_H
7b0c07 3 #include <confuse.h>
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;
8a6614 10
SP 11 typedef struct{
12     ts_int force_from_tape;
13     ts_int reset_iteration_count;
3f5c83 14     char path[1024]; //path where all files should be added
SP 15     char output_fullfilename[1024]; //name of the master file
16     char dump_fullfilename[1024]; //name of the dump file
17     char tape_fullfilename[1024]; //name of the tape file
1bf3c3 18     char tape_templatefull[1024]; //name of the tape template file
7b0c07 19     char tape_opts[1000]; //commandline tape options
ee84bd 20     char dump_from_vtk[1024];
8a6614 21 } ts_args;
SP 22
23 ts_args command_line_args;
24
083e03 25 ts_bool parse_args(int argc, char **argv);
SP 26
27
28
d7639a 29 /** @brief Prints the position of vertices for the whole list
SP 30  *  
31  *  The function is meant more or less as a debug tool, but can be used in production
32  *  environment aswell.
33  *  the output is in form of idx: x y z
34  *      @param *vlist is a structure holding information on vertex list.
35  *    @returns TS_SUCCESS on successful execution, TS_FAIL otherwise.
36 */
37
38 ts_bool print_vertex_list(ts_vertex_list *vlist);
39
40 /** @brief Prints the neighbours of all the vertices
41  *  
42  *  The function is meant more or less as a debug tool, but can be used in production
43  *  environment aswell.
44  *  the output is in form of idx(number of neighbours): (x1,y1,z1) (x2,y2,z2) ...
45  *      @param *vlist is a structure holding information on vertex list.
46  *    @returns TS_SUCCESS on successful execution, TS_FAIL otherwise.
47 */
48 ts_bool print_vertex_neighbours(ts_vertex_list *vlist);
49
50
51 /** @brief Function outputs the vetex list file to comply to old fortran format
52  *  
53  *      @param *vlist is a list of vertices
54  *      @param *filename is a name of the output file to be created (note that if the file already
55  *  exists it will be overwritten.
56  */
57 ts_bool write_vertex_fcompat_file(ts_vertex_list *vlist,ts_char *filename);
58 ts_bool fprint_vertex_list(FILE *fh,ts_vertex_list *vlist);
59 ts_bool fprint_tristar(FILE *fh, ts_vesicle *vesicle);
60 ts_bool fprint_triangle_list(FILE *fh, ts_vesicle *vesicle);
61 ts_bool fprint_vertex_data(FILE *fh,ts_vertex_list *vlist);
62 ts_bool fprint_bonds(FILE *fh,ts_vesicle *vesicle);
63 ts_bool write_dout_fcompat_file(ts_vesicle *vesicle, ts_char *filename);
64 ts_bool read_tape_fcompat_file(ts_vesicle *vesicle, ts_char *filename);
65
66
67 /** @brief Outputs file in vtk format, compatible with paraview.
68  *
69  *    @param *vlist is a list of vertices
70  *    @param *filename is a name of the output file. If exists, it will be overwritten
71  *    @param *text is a description line (max. 255 characters) to be included in the file
72  */
73 ts_bool write_vertex_vtk_file(ts_vesicle *vesicle,ts_char *filename, ts_char *text);
a6b1b5 74 ts_bool write_vertex_xml_file(ts_vesicle *vesicle, ts_uint timestepno);
SP 75 ts_bool write_master_xml_file(ts_char *filename);
144784 76 ts_bool write_pov_file(ts_vesicle *vesicle, char *filename);
SP 77
1ab449 78 ts_tape *parsetape(char *filename);
SP 79 ts_bool tape_free(ts_tape *tape);
7b0c07 80 ts_bool getcmdline_tape(cfg_t *cfg, char *opts);
SP 81 ts_bool cmdline_to_tape(cfg_t *cfg, char *key, char *val);
d7639a 82
1ab449 83 ts_bool dump_state(ts_vesicle *vesicle, ts_uint iteration);
SP 84 ts_vesicle *restore_state(ts_uint *iteration);
d7639a 85 #endif