28 PolarGrid *gas_density, *gas_v_rad, *gas_v_theta, *gas_label;
31 boolean disable =
NO, TimeInfo =
NO, Profiling =
NO;
32 boolean TimeToWrite, verbose =
NO;
34 char ParameterFile[256];
36 struct reb_simulation *rsim;
44 int numproc = omp_get_num_procs ();
45 omp_set_num_threads (numproc);
50 strcpy (ParameterFile,
"");
51 for (i = 1; i < argc; i++) {
52 if (*(argv[i]) ==
'-') {
53 if (strspn (argv[i],
"-secndovtpfamzib0123456789") != strlen (argv[i]))
55 if (strchr (argv[i],
'n'))
57 if (strchr (argv[i],
'v'))
59 if (strchr (argv[i],
't'))
61 if (strchr (argv[i],
'c'))
63 if (strchr (argv[i],
'p'))
65 if (strchr (argv[i],
'd'))
67 if (strchr (argv[i],
'b'))
69 if (strchr (argv[i],
'm'))
71 if (strchr (argv[i],
'a'))
73 if (strchr (argv[i],
'z'))
75 if (strchr (argv[i],
'i'))
78 if (strchr (argv[i],
'0'))
80 if ((argv[i][1] >=
'1') && (argv[i][1] <=
'9')) {
84 if (strchr (argv[i],
's')) {
93 if (strchr (argv[i],
'o')) {
98 if (strchr (argv[i],
'f')) {
109 else strcpy (ParameterFile, argv[i]);
112 mastererr (
"You cannot use tabulated surface density\n");
113 mastererr (
"or surface internal energy in a non-restart run.\n");
117 if (ParameterFile[0] == 0)
PrintUsage (argv[0]);
121 masterprint (
"\033[1mMultithreading enabled!\033[0m\n");
122 masterprint (
"Number of threads available to parallel constructs: %d\n", omp_get_max_threads());
144 if (
CPU_Master) printf (
"%d planet(s) found.\n", npl);
158 Initialization (gas_density, gas_v_rad, gas_v_theta, gas_energy, gas_label);
193 AlgoGas (gas_density, gas_v_rad, gas_v_theta, gas_energy, gas_label, sys, rsim);
214 reb_free_simulation (rsim);
PlanetarySystem * AllocPlanetSystem()
void PrintUsage(char *execname)
double real
Definition of the type 'real' used throughout the code.
void MultiplyPolarGridbyConstant(PolarGrid *arraysrc, real constant)
This structure is used for monitoring CPU time usage.
PolarGrid * CreatePolarGrid(int Nr, int Ns, char *name)
real GetOmegaFrame(int TimeStep)
Finds the angular velocity of the coordinate system in 'omegaframe.dat' at a given TimeStep...
A structure used to store any scalar fied on the computational domain.
boolean WriteTorqueMapFile
void DumpSources(int argc, argv)
Contains all the information about a planetary system at a given instant in time. ...
void CreateTorqueMapInfile(int istep, PolarGrid *Surfdens)
Writes an input file for the 'torquemap' code written by Bertram Bitsch.
void MPI_Comm_size(int a, int *b)
boolean CentrifugalBalance
int FindNumberOfPlanets()
void MPI_Comm_rank(int a, int *b)
void SendOutput(int index, PolarGrid *dens, PolarGrid *gasvr, PolarGrid *gasvt, PolarGrid *gasenerg, PolarGrid *label)
void MakeDir(char *string)
void GiveTimeInfo(int number)
static int InnerOutputCounter
void mastererr(const char *template,...)
struct reb_simulation * SetupReboundSimulation()
boolean DumpTorqueDensNow
Contains all the include directives requested by the code.
struct reb_simulation * RestartReboundSimulation()
void DumpOmegaFrame(int TimeStep)
Writes the angular velocity of the coordinate system.
void GiveSpecificTime(boolean profiling, TimeProcess process_name)
void ReadVariables(char *filename)
void OutputNbodySimulation()
void InitSpecificTime(boolean profiling, TimeProcess *process_name, char *title)
boolean OverridesOutputdir
static int StillWriteOneOutput
void masterprint(const char *template,...)
void Initialization(PolarGrid *gas_density, PolarGrid *gas_v_rad, PolarGrid *gas_v_theta, PolarGrid *gas_energy, PolarGrid *gas_label)
void MPI_Init(int *argc, argv)