Trisurf Monte Carlo simulator
Samo Penic
2022-05-04 06afc729f9061c1cfa14c78728d61d518324c2f0
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]; */
06afc7 10
8a6614 11 typedef struct{
SP 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
083e03 24 ts_bool parse_args(int argc, char **argv);
SP 25
26
27
d7639a 28 /** @brief Prints the position of vertices for the whole list
SP 29  *  
30  *  The function is meant more or less as a debug tool, but can be used in production
31  *  environment aswell.
32  *  the output is in form of idx: x y z
33  *      @param *vlist is a structure holding information on vertex list.
34  *    @returns TS_SUCCESS on successful execution, TS_FAIL otherwise.
35 */
36
37 ts_bool print_vertex_list(ts_vertex_list *vlist);
38
39 /** @brief Prints the neighbours of all the vertices
40  *  
41  *  The function is meant more or less as a debug tool, but can be used in production
42  *  environment aswell.
43  *  the output is in form of idx(number of neighbours): (x1,y1,z1) (x2,y2,z2) ...
44  *      @param *vlist is a structure holding information on vertex list.
45  *    @returns TS_SUCCESS on successful execution, TS_FAIL otherwise.
46 */
47 ts_bool print_vertex_neighbours(ts_vertex_list *vlist);
48
49
50 /** @brief Function outputs the vetex list file to comply to old fortran format
51  *  
52  *      @param *vlist is a list of vertices
53  *      @param *filename is a name of the output file to be created (note that if the file already
54  *  exists it will be overwritten.
55  */
56 ts_bool write_vertex_fcompat_file(ts_vertex_list *vlist,ts_char *filename);
57 ts_bool fprint_vertex_list(FILE *fh,ts_vertex_list *vlist);
58 ts_bool fprint_tristar(FILE *fh, ts_vesicle *vesicle);
59 ts_bool fprint_triangle_list(FILE *fh, ts_vesicle *vesicle);
60 ts_bool fprint_vertex_data(FILE *fh,ts_vertex_list *vlist);
61 ts_bool fprint_bonds(FILE *fh,ts_vesicle *vesicle);
62 ts_bool read_tape_fcompat_file(ts_vesicle *vesicle, ts_char *filename);
63
64
65 /** @brief Outputs file in vtk format, compatible with paraview.
66  *
67  *    @param *vlist is a list of vertices
68  *    @param *filename is a name of the output file. If exists, it will be overwritten
69  *    @param *text is a description line (max. 255 characters) to be included in the file
70  */
71 ts_bool write_vertex_vtk_file(ts_vesicle *vesicle,ts_char *filename, ts_char *text);
0a2c81 72 ts_bool write_vertex_xml_file(ts_vesicle *vesicle, ts_uint timestepno, ts_cluster_list *cstlist);
a6b1b5 73 ts_bool write_master_xml_file(ts_char *filename);
144784 74 ts_bool write_pov_file(ts_vesicle *vesicle, char *filename);
SP 75
1ab449 76 ts_tape *parsetape(char *filename);
698ae1 77 ts_tape *parsetapebuffer(char *buffer);
1ab449 78 ts_bool tape_free(ts_tape *tape);
7b0c07 79 ts_bool getcmdline_tape(cfg_t *cfg, char *opts);
SP 80 ts_bool cmdline_to_tape(cfg_t *cfg, char *key, char *val);
ba73ab 81 ts_bool print_help(FILE *fd);
1ab449 82 ts_bool dump_state(ts_vesicle *vesicle, ts_uint iteration);
SP 83 ts_vesicle *restore_state(ts_uint *iteration);
d7639a 84 #endif