00001
00008 #ifndef SIMULATION_H
00009 #define SIMULATION_H
00010
00011 class BezierMesh;
00012 class BoundaryMesh;
00013 class DataStore;
00014 class PersistantStore;
00015 #include "util.h"
00016
00040 class Simulation {
00041 private:
00042
00043 Simulation( const Simulation &o);
00044 const Simulation& operator=( const Simulation &o);
00045
00046
00047 void initialize_structures();
00048
00049 const LinearData& get_data(const ControlPoint&) const;
00050
00051 PersistantStore *persistant_store;
00052 DataStore *data_store;
00053 BoundaryMesh *bdry_mesh;
00054 BezierMesh *bezier_mesh;
00056 public:
00057
00058 Simulation( char *filename );
00059 Simulation();
00060
00061 BezierMesh* get_bezier_mesh();
00062 BoundaryMesh* get_boundary_mesh();
00063 DataStore* get_data_store();
00064
00065
00066
00067
00068 void move_(double time_step, unsigned vx_pos, unsigned vy_pos, unsigned newx_pos, unsigned newy_pos);
00069
00070 void move_(double time_step, unsigned vx1_pos, unsigned vy1_pos, unsigned vx0_pos, unsigned vy0_pos, unsigned newx_pos, unsigned newy_pos);
00071
00072
00073
00074 void move_(double time_step, unsigned vx_pos, unsigned newx_pos);
00075
00076
00077 void move_(double time_step, unsigned vx1_pos, unsigned vx0_pos, unsigned newx_pos);
00078
00079
00080
00081 unsigned XposIndex;
00082 unsigned YposIndex;
00083 bool positions_set;
00084
00085 void set_positions(unsigned xPosI,unsigned yPosI);
00086
00087
00088 void move(double time_step, unsigned vx_pos, unsigned vy_pos);
00089
00090 void move(double time_step, unsigned vx1_pos, unsigned vy1_pos, unsigned vx0_pos, unsigned vy0_pos);
00091
00092
00093 void move(double time_step, unsigned vx_pos);
00094
00095
00096 double move_safe(double time_step, unsigned vx_pos, unsigned vy_pos);
00097
00098 double move_safe(double time_step, unsigned vx1_pos, unsigned vy1_pos, unsigned vx0_pos, unsigned vy0_pos);
00099
00100
00101 double move_safe(double time_step, unsigned vx_pos);
00102
00103 void store_state(unsigned vIndexFrom, unsigned vIndexTo, unsigned xIndexTo);
00104 void restore_state(unsigned vIndexFrom, unsigned vIndexTo, unsigned xIndexFrom);
00105
00106
00107
00108
00109
00110 int read_from_text_file( char *filename );
00111
00112
00113
00114
00115
00116
00117
00118 int read_from_binary_file( char *filename );
00119
00120
00121
00122
00123 int to_text_file( char *filename );
00124
00125
00126
00127
00128
00129 int to_binary_file( char *filename);
00130
00131
00132
00133
00134
00135 int to_eps(char *epsfile);
00136
00137
00138 void print();
00139
00140
00141 void print_statistics();
00142
00143
00144
00145 };
00146
00147 #endif
00148