Skip to content
Snippets Groups Projects
Commit 7ba85366 authored by Izzard, Robert Dr (Maths & Physics)'s avatar Izzard, Robert Dr (Maths & Physics)
Browse files

update MINT_initial_XHc to use the initial hydrogen in the table

fix build issue in timestep_CHeB
parent f4bd432b
No related branches found
No related tags found
No related merge requests found
......@@ -11,27 +11,33 @@ double MINT_initial_XHc(struct stardata_t * const stardata)
* Determine the initial central hydrogen abundance
* in the MINT models
*/
const double MINT_offset = 0.7 - 0.6985;
/*
const double MINT_offset = 0.7 - 0.6985;
const double Z = Max(0.0,
0.760 - 3.0 * stardata->common.metallicity - MINT_offset);
return Z;
*/
int i=1;
int i = 1; // XHC column
const int nperline =
stardata->store->MINT_tables[MINT_TABLE_MS]->ndata +
stardata->store->MINT_tables[MINT_TABLE_MS]->nparam;
while(*(stardata->store->MINT_tables[MINT_TABLE_MS]->data +
MINT_MS_CENTRAL_HYDROGEN +
i*nperline) >
*(stardata->store->MINT_tables[MINT_TABLE_MS]->data +
MINT_MS_CENTRAL_HYDROGEN +
(i-1)*nperline))
double * p = stardata->store->MINT_tables[MINT_TABLE_MS]->data + i;
double * const pmin = p;
double * const pmax = p + nperline * stardata->store->MINT_tables[MINT_TABLE_MS]->nlines;
const double XHC0 = *p; /* first value */
/*
* While the abundance is increasing, keep looping through
* lines of data. When it
*/
while(p < pmax && *p >= XHC0)
{
i++;
p += nperline;
}
return *(stardata->store->MINT_tables[MINT_TABLE_MS]->data +
MINT_MS_CENTRAL_HYDROGEN +
(i-1)*nperline);
p = Max(p - nperline, pmin);
return *p;
}
#endif //MINT
......@@ -64,7 +64,7 @@
*
* Post-MS evolution has not yet been implemented.
*/
//#define MINT
#define MINT
/************************************************************
......
......@@ -5,8 +5,12 @@ No_empty_translation_unit_warning;
void timestep_CHeB(Timestep_prototype_args)
{
if(stardata->preferences->stellar_structure_algorithm == STELLAR_STRUCTURE_ALGORITHM_MINT &&
MINT_has_table(MINT_TABLE_CHeB_TA))
if(stardata->preferences->stellar_structure_algorithm == STELLAR_STRUCTURE_ALGORITHM_MINT
#ifdef MINT
&&
MINT_has_table(MINT_TABLE_CHeB_TA)
#endif//MINT
)
{
#ifdef MINT
double phase_lifetime;
......
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