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