Diploma Thesis Percolation Simulation C++ Sourcecode Documentation |
00001 00002 // frontend.h 00003 // user interaction 00004 // 00005 // Andreas Krueger 31.10.2000 00006 // v1.0 , last changes: 31.10.2000 00007 00008 namespace frontend{ 00009 00010 00011 void ask_for_parameters (NUMBER &n, int &min_loops, int &additional_loops, int &steps, const REAL file_from, const REAL file_to ){ 00012 00013 cout <<" Number of spheres: (e.g. 2500) "; 00014 cin >> n; 00015 cout <<" number of (radius) steps between fillingfactor "<<file_from<<" and "<<file_to<<": (e.g. 60) "; 00016 cin >> steps; 00017 cout <<" number of minimum averaging loops on each radius: (e.g. 50) "; 00018 cin >> min_loops ; 00019 cout <<" number of additional averaging loops around critical radius: (e.g. 100) "; 00020 cin >> additional_loops ; 00021 } 00022 00023 void ask_parameter (NUMBER &n, int &loops, int &steps, const REAL file_from, const REAL file_to ) 00024 { 00025 00026 cout <<" Number of spheres: (e.g. 1000) "; 00027 cin >> n; 00028 cout <<" number of averaging loops on each radius: (e.g. 50) "; 00029 cin >> loops ; 00030 cout <<" number of (radius) steps between fillingfactor "<<file_from<<" and "<<file_to<<": (e.g. 60) "; 00031 cin >> steps; 00032 } 00033 00034 void ask_for_dim_N_loops (NUMBER &N, int &dim, COUNTER &loops) 00035 { 00036 cout <<" dimension: (e.g. 3) "; 00037 cin >> dim; 00038 cout <<" Number of spheres: (e.g. 1250) "; 00039 cin >> N; 00040 cout <<" number of averaging loops (e.g. 5) "; 00041 cin >> loops ; 00042 } 00043 00044 void introduction(NUMBER& N, REAL& R, int dimension) 00045 { 00046 srand( (unsigned)time( NULL ) ); // set the random generator 00047 00048 00049 cout <<"\nPlease type in the number of spheres to throw: "; 00050 cin >> N; 00051 00052 double rr=R_critical(N,GRIDSIZE, dimension); 00053 if (rr!=-1) { 00054 cout << "\nThe theoretically critical radius in "; 00055 cout <<dimension<<"dim is "<<rr; 00056 } 00057 else { 00058 rr=R_critical_guessed(N,GRIDSIZE,dimension); 00059 cout << "The critical radius in "; 00060 cout <<dimension<<"dim is approximately "<<rr; 00061 } 00062 00063 cout <<"\nPlease type in the radius of one sphere: "; 00064 cin >> R; 00065 } // gives back N: the number of spheres and R: the radius 00066 00067 00068 void ask_for_ff_range(REAL &ff_from, REAL &ff_to) 00069 { 00070 ff_from=0.00; ff_to=2.00; 00071 cout <<"range of scanned fillingfactors"; 00072 cout <<"\nfrom (e.g. 0.00): "; 00073 cin >> ff_from; 00074 cout <<"to (e.g. 2.00): "; 00075 cin >> ff_to; 00076 } 00077 00078 00079 00080 } // end of namespace frontend
Diploma Thesis Sourcecode
Documentation check out the text and the executable binaries |