|
|
5f659ed |
Marek Mahut <mmahut@fedoraproject.org>: this patch add more interactive support
|
|
|
5f659ed |
|
|
|
5f659ed |
diff -Naur ./accrete-1.0-original/display.c ./accrete-1.0/display.c
|
|
|
5f659ed |
--- ./accrete-1.0-original/display.c 2007-11-24 22:37:57.000000000 +0100
|
|
|
5f659ed |
+++ ./accrete-1.0/display.c 2007-11-25 15:03:44.000000000 +0100
|
|
|
5f659ed |
@@ -1,13 +1,13 @@
|
|
|
5f659ed |
#include "structs.h"
|
|
|
5f659ed |
|
|
|
5f659ed |
void
|
|
|
5f659ed |
-display_system (void)
|
|
|
5f659ed |
+display_system (char *filename)
|
|
|
5f659ed |
{
|
|
|
5f659ed |
planet_pointer node1;
|
|
|
5f659ed |
int counter;
|
|
|
5f659ed |
|
|
|
5f659ed |
FILE *f;
|
|
|
5f659ed |
- f = fopen("New.System", "w");
|
|
|
5f659ed |
+ f = fopen(filename, "w");
|
|
|
5f659ed |
|
|
|
5f659ed |
fprintf(f," SYSTEM CHARACTERISTICS\n");
|
|
|
5f659ed |
fprintf(f,"Mass of central star: %6.3f solar masses\n", stellar_mass_ratio);
|
|
|
5f659ed |
@@ -105,5 +105,6 @@
|
|
|
5f659ed |
counter++;
|
|
|
5f659ed |
node1 = node1->next_planet;
|
|
|
5f659ed |
}
|
|
|
5f659ed |
+ printf("\nResult saved in %s.\n", filename);
|
|
|
5f659ed |
fclose(f);
|
|
|
5f659ed |
}
|
|
|
5f659ed |
diff -Naur ./accrete-1.0-original/main.c ./accrete-1.0/main.c
|
|
|
5f659ed |
--- ./accrete-1.0-original/main.c 2007-11-24 22:37:57.000000000 +0100
|
|
|
5f659ed |
+++ ./accrete-1.0/main.c 2007-11-25 15:05:30.000000000 +0100
|
|
|
5f659ed |
@@ -22,6 +22,7 @@
|
|
|
5f659ed |
init_genrand(time(NULL));
|
|
|
5f659ed |
}
|
|
|
5f659ed |
|
|
|
5f659ed |
+
|
|
|
5f659ed |
void
|
|
|
5f659ed |
generate_stellar_system (void)
|
|
|
5f659ed |
{
|
|
|
5f659ed |
@@ -87,10 +88,17 @@
|
|
|
5f659ed |
|
|
|
5f659ed |
|
|
|
5f659ed |
int
|
|
|
5f659ed |
-main (void)
|
|
|
5f659ed |
+main (int argc, char **argv)
|
|
|
5f659ed |
{
|
|
|
5f659ed |
+
|
|
|
5f659ed |
+ if (argc != 2) {
|
|
|
5f659ed |
+ printf("Usage: %s FILE\n", argv[0]);
|
|
|
5f659ed |
+ printf("Save the result of simulation of solar system planet formation in FILE.\n");
|
|
|
5f659ed |
+ exit(0);
|
|
|
5f659ed |
+ }
|
|
|
5f659ed |
+
|
|
|
5f659ed |
init();
|
|
|
5f659ed |
generate_stellar_system();
|
|
|
5f659ed |
- display_system();
|
|
|
5f659ed |
+ display_system(argv[1]);
|
|
|
5f659ed |
return 0;
|
|
|
5f659ed |
}
|
|
|
5f659ed |
diff -Naur ./accrete-1.0-original/proto.h ./accrete-1.0/proto.h
|
|
|
5f659ed |
--- ./accrete-1.0-original/proto.h 2007-11-24 22:37:57.000000000 +0100
|
|
|
5f659ed |
+++ ./accrete-1.0/proto.h 2007-11-25 14:57:16.000000000 +0100
|
|
|
5f659ed |
@@ -17,7 +17,7 @@
|
|
|
5f659ed |
void coalesce_planetesimals(double a, double e, double mass, double crit_mass, double stellar_luminosity_ratio, double body_inner_bound, double body_outer_bound);
|
|
|
5f659ed |
planet_pointer distribute_planetary_masses(double stellar_mass_ratio, double stellar_luminosity_ratio, double inner_dust, double outer_dust);
|
|
|
5f659ed |
/* display.c */
|
|
|
5f659ed |
-void display_system(void);
|
|
|
5f659ed |
+void display_system(char *filename);
|
|
|
5f659ed |
/* enviro.c */
|
|
|
5f659ed |
double luminosity(double mass_ratio);
|
|
|
5f659ed |
int orbital_zone(double orbital_radius);
|
|
|
5f659ed |
@@ -48,7 +48,7 @@
|
|
|
5f659ed |
/* main.c */
|
|
|
5f659ed |
void init(void);
|
|
|
5f659ed |
void generate_stellar_system(void);
|
|
|
5f659ed |
-int main(void);
|
|
|
5f659ed |
+int main(int argc, char *argv[]);
|
|
|
5f659ed |
/* mtrng.c */
|
|
|
5f659ed |
void init_genrand(unsigned long s);
|
|
|
5f659ed |
void init_by_array(unsigned long init_key[], unsigned long key_length);
|