[santacruzgalaxy-list] Grackle proposal
Romain Teyssier
romain.teyssier at gmail.com
Wed Mar 19 13:58:10 PDT 2014
I totally agree with the 3 routines that need to be used.
Nothing else should be required on the code's side, except passing the required variables.
> grackle_init_run()
> called once per simulation
>
The parameters that should be passed here are
- some cosmological model parameters
- UV background model (spectrum, reionization redshift...)
- starting redshift to compute the initial temperature and ionisation state
> grackle_init_step(aexp,...)
> called once per each time-step, uses the value of the scale
> factor and other parameters as needed
In principle at this stage, only aexp is required for cosmo runs.
For non cosmo runs, the cooling tables do not need to be modified.
>
> grackle_solve_chemistry(dt,den,tem,...)
> called for each resolution element one or more times per one
> global time-step, uses gas properties to update internal energy.
> Input gas properties may be required to have specific units and
> be of specific data type. It should internally sense if it
> runs within an OpenMP construct and support OpenMP
> parallelization.
>
I would rather give the possibility of passing an array of cell.
Users could also set the array size to 1 to deal with cells one by one.
The required information could be
nH, T or Tovermu or specific energy, metallicity in some units, dt_hydro, ncell
On output, Delta T or Delta Tovermu or Delta specific energy
I suggest we use fixed units (cgs or mks) for all input and output variables.
These 3 routines are the only one that the user should care about.
Cheers,
Romain
> The API can also define its own data types with natutal conversion from
> standard types, for example the following code should be valid:
>
> float f;
> double d;
> gr_float gr_f;
>
> gr_f = f;
> gr_f = d;
>
> An analogous API should be provided for F77.
>
> Then in a code the API will be implemented as follows:
>
> Begin_code
>
> grackle_init_run()
>
> Loop_over_timesteps(aexp)
>
> grackle_init_step(aexp,...)
>
> #pragma omp parallel loop
> Loop_over_resolution_elements(elem)
> {
> gr_float dt = code_time_step*time_unit;
> gr_float den = code_density(elem)*den_unit;
> gr_float tem = code_temperature(elem)*tem_unit;
> grackle_solve_chemistry(dt,den,tem,...)
> }
>
> End_loop
>
> End_code
>
> Let's converge on the API, and then the Grackle team will be able to
> write a couple of wrappers that will suit everyone.
>
> Given the wrappers, if Grackle is installed as an external library and
> provides a proper Linus-style installer (that will handle all HDF5 and
> other dependencies), then it should be trivial to integrate it in any code.
>
> Nick
>
> To unsubscribe from this group and stop receiving emails from it, send an email to santacruzgalaxy-list+unsubscribe at ucsc.edu.
> _______________________________________________
> santacruzgalaxy-list mailing list
> santacruzgalaxy-list at ucsc.edu
> https://lists.ucsc.edu/mailman/listinfo/santacruzgalaxy-list
To unsubscribe from this group and stop receiving emails from it, send an email to santacruzgalaxy-list+unsubscribe at ucsc.edu.
More information about the santacruzgalaxy-list
mailing list