Skip to content
Snippets Groups Projects
Commit 87a82f59 authored by Rob Izzard's avatar Rob Izzard
Browse files

add disc parameter space outputter: this tests the whole

parameter space and optionally outputs to a file for plotting

also added line numbers to binary_c's rgrep wrapper
parent a18b1321
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
# search only .c and .h files # search only .c and .h files
grep --include=*.c --include=*.h --color=always "$1" -rI ./src $2 $3 $4 | sed s/\:/\ \:/ grep --include=*.c --include=*.h --color=always "$1" -rIn ./src $2 $3 $4 | sed s/\:/\ \:/
...@@ -69,6 +69,9 @@ double disc_evolve_disc_structure(struct stardata_t * stardata, ...@@ -69,6 +69,9 @@ double disc_evolve_disc_structure(struct stardata_t * stardata,
memcpy(discwas,disc,sizeof(struct disc_t)); memcpy(discwas,disc,sizeof(struct disc_t));
} }
/*
* Detect first timestep entry
*/
Boolean first = Boolean_(IS_ZERO(disc->lifetime) || disc->first); Boolean first = Boolean_(IS_ZERO(disc->lifetime) || disc->first);
/* /*
...@@ -91,8 +94,7 @@ double disc_evolve_disc_structure(struct stardata_t * stardata, ...@@ -91,8 +94,7 @@ double disc_evolve_disc_structure(struct stardata_t * stardata,
Discdebug(1," %s ", Discdebug(1," %s ",
first==TRUE ? "first" : first==TRUE ? "first" :
disc->append==TRUE ? "append" : disc->append==TRUE ? "append" :
"!conv" "!conv");
);
disc->dt = DISC_MIN_TIMESTEP; disc->dt = DISC_MIN_TIMESTEP;
memset(disc->loss,0,sizeof(struct disc_loss_t)*DISC_LOSS_N); memset(disc->loss,0,sizeof(struct disc_loss_t)*DISC_LOSS_N);
disc_initial_structure(disc, disc_initial_structure(disc,
...@@ -101,11 +103,16 @@ double disc_evolve_disc_structure(struct stardata_t * stardata, ...@@ -101,11 +103,16 @@ double disc_evolve_disc_structure(struct stardata_t * stardata,
t, t,
first, first,
&can_evolve); &can_evolve);
if(can_evolve) if(can_evolve)
{ {
Discdebug(1,"Have converged initial disc structure\n");
disc->converged = TRUE; disc->converged = TRUE;
memcpy(discwas,disc,sizeof(struct disc_t)); memcpy(discwas,disc,sizeof(struct disc_t));
} }
disc_parameter_space(stardata,disc);
Exit_binary_c(2,"Found first structure? %s\n",can_evolve?"y":"n");
} }
...@@ -409,13 +416,13 @@ double disc_evolve_disc_structure(struct stardata_t * stardata, ...@@ -409,13 +416,13 @@ double disc_evolve_disc_structure(struct stardata_t * stardata,
/* /*
* Check for failure modes * Check for failure modes: failure_reason
* is NULL if there is no failure.
*/ */
char * failure_reason = disc_failure_mode(stardata, char * failure_reason = disc_failure_mode(stardata,
disc, disc,
binary, binary,
status); status);
if(failure_reason) if(failure_reason)
{ {
Discdebug(1, Discdebug(1,
...@@ -796,8 +803,6 @@ static char * disc_failure_mode(struct stardata_t * stardata, ...@@ -796,8 +803,6 @@ static char * disc_failure_mode(struct stardata_t * stardata,
disc_is_ring ? " is ring" : "", disc_is_ring ? " is ring" : "",
flux_negative ? " flux negative" : "", flux_negative ? " flux negative" : "",
too_ringlike ? " too ringlike" : ""); too_ringlike ? " too ringlike" : "");
} }
else else
{ {
......
...@@ -276,6 +276,10 @@ void disc_evaporate_cbdiscs(struct stardata_t * stardata); ...@@ -276,6 +276,10 @@ void disc_evaporate_cbdiscs(struct stardata_t * stardata);
void disc_stellar_wind_to_cbdisc(struct stardata_t * stardata); void disc_stellar_wind_to_cbdisc(struct stardata_t * stardata);
#endif // DISCS_CIRCUMBINARY_FROM_WIND #endif // DISCS_CIRCUMBINARY_FROM_WIND
void disc_parameter_space(struct stardata_t * stardata,
struct disc_t * disc);
#endif // DISCS #endif // DISCS
#endif // DISC_PROTOTYPES_H #endif // DISC_PROTOTYPES_H
......
...@@ -56,7 +56,9 @@ void disc_trisector2(struct disc_t * disc, ...@@ -56,7 +56,9 @@ void disc_trisector2(struct disc_t * disc,
double *xx) double *xx)
{ {
/* /*
* * Function that does the work. This may be
* called from elsewhere for debugging purposes,
* so is not a static function.
*/ */
int status = disc_build_disc_zones(disc,binary); int status = disc_build_disc_zones(disc,binary);
...@@ -73,7 +75,7 @@ void disc_trisector2(struct disc_t * disc, ...@@ -73,7 +75,7 @@ void disc_trisector2(struct disc_t * disc,
double M = disc_total_mass(disc); double M = disc_total_mass(disc);
double J = disc_total_angular_momentum(disc,binary); double J = disc_total_angular_momentum(disc,binary);
double F = disc_total_angular_momentum_flux(disc,binary); double F = disc_total_angular_momentum_flux(disc,binary);
Discdebug(1, Discdebug(2,
"Trisector : Rin = %g, Rout = %g Rsun, Tvisc0 = %g : M=%30.20e (want %g) J=%30.20e (want %g) F = %30.20e (want %g)\n", "Trisector : Rin = %g, Rout = %g Rsun, Tvisc0 = %g : M=%30.20e (want %g) J=%30.20e (want %g) F = %30.20e (want %g)\n",
disc->Rin/R_SUN, disc->Rin/R_SUN,
disc->Rout/R_SUN, disc->Rout/R_SUN,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment