initial_stepsize: initial step the solver takes.\n\n \
maximum_stepsize: This limits the sepsize to an upper limit.\n\n \
minimum_stepsize: This limits the sepsize to a lower limit.\n\n \
absolute_tolerance: absolute tolerance of the RK solver.\n\n \
relative_tolerance: relative tolerance of the RK solver.\n\n \
Note:\n \
Generally, both absolute and relative tolerances should be 1e-8.\n\n \
In some cases, however, one may need more accurate result (eg if f_a is extremely high,\n \
the oscillations happen violently, and the ODE destabilizes). Whatever the case, if the\n \
tolerances are below 1e-8, long doubles *must* be used.\n\n \
beta: controls how agreesive the adaptation is. Generally, it should be around but less than 1.\n\n \
fac_max, fac_min: the stepsize does not increase more than fac_max, and less than fac_min.\n\n \
This ensures a better stability. Ideally, fac_max=inf and fac_min=0, but in reality one must\n \
tweak them in order to avoid instabilities.\n\n \
maximum_No_steps: maximum steps the solver can take Quits if this number is reached even if integration\n \
is not finished.\n";
return 1;
}
int ar=0;
//model parameters
LD theta_i = atof(argv[++ar]) ;
LD fa = atof(argv[++ar]);
// solver parameters
LD umax = atof(argv[++ar]); //u at which the integration stops
LD TSTOP = atof(argv[++ar]); // temperature at which integration stops
LD ratio_ini=atof(argv[++ar]); // 3H/m_a at which integration begins (should be larger than 500 or so)
// stopping conditions.
// integration stops after the adiabatic invariant hasn't changed
// more than convergence_lim% for N_convergence_max consecutive peaks
unsigned int N_convergence_max=atoi(argv[++ar]);
LD convergence_lim=atof(argv[++ar]);
//file in which the cosmology is defined. the columns should be : u T[GeV] logH
std::string inputFile=argv[++ar];
/*options for the solver (These variables are optional. Yoou can use the Axion class without them).*/
LD initial_step_size=atof(argv[++ar]); //initial step the solver takes.
LD minimum_step_size=atof(argv[++ar]); //This limits the sepsize to an upper limit.
LD maximum_step_size=atof(argv[++ar]); //This limits the sepsize to a lower limit.
LD absolute_tolerance=atof(argv[++ar]); //absolute tolerance of the RK solver
LD relative_tolerance=atof(argv[++ar]); //relative tolerance of the RK solver
LD beta=atof(argv[++ar]); //controls how agreesive the adaptation is. Generally, it should be around but less than 1.
/*
the stepsize does not increase more than fac_max, and less than fac_min.
This ensures a better stability. Ideally, fac_max=inf and fac_min=0, but in reality one must
tweak them in order to avoid instabilities.
*/
LD fac_max=atof(argv[++ar]);
LD fac_min=atof(argv[++ar]);
unsigned int maximum_No_steps=atoi(argv[++ar]); //maximum steps the solver can take Quits if this number is reached even if integration is not finished.
+# This script executes the first argument and prints the time it took (is seconds) to run it.
+#
+
+# check if the number of arguments is correct
+expectedArgs=2
+if [ $# -ne $expectedArgs ]; then
+ echo "Please provide $expectedArgs arguments."
+ echo "The first should be a path to an executable, the second should be a file that contains its arguments (each argument should be in different line)."
+ exit
+fi
+
+# check if the first argument can be executed
+if ! command -v $1 &>/dev/null ; then
+ echo "$1 is not a valid executable."
+ echo "Please provide a valid path to an executable."
+ exit
+fi
+
+
+# check if the file exists
+if [ ! -f $2 ]; then
+ echo "File $2 does not exist."
+ echo "Please provide a valid path to a file."
+ exit
+fi
+
+# check if the file is readable
+if [ ! -r $2 ]; then
+ echo "File $2 is not readable."
+ echo "Please provide a valid path to a readable file."
+ exit
+fi
+
+# run the executable ($1) passing as arguments the contents of the file ($2)