-
Notifications
You must be signed in to change notification settings - Fork 56
[newchem-cpp] transcribe of cool1d_cloudy_g #450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: newchem-cpp
Are you sure you want to change the base?
[newchem-cpp] transcribe of cool1d_cloudy_g #450
Conversation
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
…ub.com/ChristopherBignamini/grackle into newchem-cpp_transcribe_cool1d_cloudy_g
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
This reverts commit ff94f5d.
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
src/clib/cool1d_cloudy_g.cpp
Outdated
| const double* rhoH, const double* metallicity, const double* logtem, | ||
| double* edot, double comp2, double dom, double zr, int icmbTfloor, | ||
| int iClHeat, int iZscale, long long clGridRank, long long* clGridDim, | ||
| double* clPar1, double* clPar2, double* clPar3, long long* clDataSize, | ||
| double* clCooling, double* clHeating, const gr_mask_type* itmask, | ||
| grackle_field_data* my_fields, IndexRange idx_range) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you mind making a few simplifications to the signature.
Namely:
- could you replace
long long clGridRank,long long* clGridDim,double* clPar1,double* clPar2,double* clPar3,long long* clDataSize,double* clCooling,double* clHeatingwith a single argument of typecloudy_data?- importantly,
cloudy_dataalready exists, and you are currently loading arguments from it right now
- importantly,
- could you cut
grackle_field_data* my_fieldsfrom the argument list?- AFAICT, we only use
grackle_fields->grid_dimension[0]in this function and I'm pretty confident that in those places we can useidx_range->i_stop
- AFAICT, we only use
src/clib/cool1d_cloudy_g.cpp
Outdated
| FORTRAN_NAME(interpolate_1d_g)(&log10tem[i], clGridDim, clPar1, | ||
| dclPar.data(), clDataSize, clCooling, | ||
| &log_cool[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind replacing all occurrences of FORTRAN_NAME(interpolate_...) with the C++ wrappers?
It's worth mentioning that the C++ function signature is slightly different. The most notable change is that the C++ wrapper directly returns the result (rather than modifying a pointer argument)
… we only use grackle_fields->grid_dimension[0] which can be obtained from IdxRange
…ub.com/ChristopherBignamini/grackle into newchem-cpp_transcribe_cool1d_cloudy_g
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
No description provided.