[newchem-cpp] Transcribe calc_gr_balance_g#519
Conversation
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
…p_transcribe_calc_gr_balance_g
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
…transcribe_calc_gr_balance_g
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
|
@ChristopherBignamini, do you think you could fix these merger conflicts? |
…transcribe_calc_gr_balance_g
|
@brittonsmith @mabruzzo should I remove the _g suffix in calc_gr_balance_g? |
…transcribe_calc_gr_balance_g
|
@ChristopherBignamini @mabruzzo, I've looked at the test failures here and they are acceptable differences in my opinion. It is only the free-fall models with dust that show differences and they are all of the order that we have accepted previously. I'm not sure this has been reviewed yet, but from a testing standpoint this can be merged. |
| // FORTRAN_NAME(calc_grain_size_increment_species_1d)( | ||
| // &my_chemistry->grain_growth, itmask, | ||
| // &inject_pathway_props->n_pathways, &my_fields->grid_dimension[0], | ||
| // &my_fields->grid_dimension[1], &my_fields->grid_dimension[2], | ||
| // &idx_range.i_start, &idx_range.i_end, &idx_range.jp1, &idx_range.kp1, | ||
| // &dom, my_fields->density, &n_selected_inj_paths, grsp_density, | ||
| // repacked_inj_path_metal_densities.data(), repacked_yields.data(), | ||
| // repacked_size_moments.data(), &bulk_density, | ||
| // internal_dust_prop_buf.grain_sigma_per_gas_mass.data[grsp_i], | ||
| // internal_dust_prop_buf.grain_dyntab_kappa.data[grsp_i], gr_N, | ||
| // &gr_Size, | ||
| // &inject_pathway_props->log10Tdust_interp_props.parameter_spacing[0], | ||
| // inject_pathway_props->log10Tdust_interp_props.parameters[0], | ||
| // repacked_opac_table.data()); |
There was a problem hiding this comment.
We can remove this now
| // FORTRAN_NAME(calc_grain_size_increment_species_1d)( | |
| // &my_chemistry->grain_growth, itmask, | |
| // &inject_pathway_props->n_pathways, &my_fields->grid_dimension[0], | |
| // &my_fields->grid_dimension[1], &my_fields->grid_dimension[2], | |
| // &idx_range.i_start, &idx_range.i_end, &idx_range.jp1, &idx_range.kp1, | |
| // &dom, my_fields->density, &n_selected_inj_paths, grsp_density, | |
| // repacked_inj_path_metal_densities.data(), repacked_yields.data(), | |
| // repacked_size_moments.data(), &bulk_density, | |
| // internal_dust_prop_buf.grain_sigma_per_gas_mass.data[grsp_i], | |
| // internal_dust_prop_buf.grain_dyntab_kappa.data[grsp_i], gr_N, | |
| // &gr_Size, | |
| // &inject_pathway_props->log10Tdust_interp_props.parameter_spacing[0], | |
| // inject_pathway_props->log10Tdust_interp_props.parameters[0], | |
| // repacked_opac_table.data()); |
| /// @param[in] SN_kp0sp_data Tables of values for opacity calculations | ||
| /// | ||
| /// @par History | ||
| /// modified: February, 2026 by Christopher Bignamini & Matthew Abruzzo; C++ |
There was a problem hiding this comment.
| /// modified: February, 2026 by Christopher Bignamini & Matthew Abruzzo; C++ | |
| /// modified: February, 2026 by Christopher Bignamini; port to C++ |
| /// @todo | ||
| /// The subroutine's name should be more descriptive | ||
| /// | ||
| /// @param[in] igrgr Flag to solve grain growth reactions () |
There was a problem hiding this comment.
| /// @param[in] igrgr Flag to solve grain growth reactions () | |
| /// @param[in] igrgr Flag to solve grain growth reactions |
| /// port | ||
| void calc_grain_size_increment_species_1d( | ||
| int igrgr, const gr_mask_type* itmask, int SN0_N, int in, int jn, int kn, | ||
| IndexRange idx_range, gr_float* density_data, int nSN, |
There was a problem hiding this comment.
Can we convert gr_float* density_data to const gr_float* density_data?
| /// @param[in] itmask Specifies the general iteration-mask of the @p idx_range | ||
| /// for this calculation. | ||
| /// @param[in] SN0_N Number of modelled injection pathways | ||
| /// @param[in] in, jn, kn Dimensions of the computational grid |
There was a problem hiding this comment.
(I think) it would be great if we could replace in, jn, and kn with a single 3-element array arg called grid_dimensions.
But, I'm totally happy for other feedback
| /// @param[in] in, jn, kn Dimensions of the computational grid | ||
| /// @param[in] idx_range Specifies the current index-range | ||
| /// @param[in] density_data Pointer to the density field data | ||
| /// @param[in] nSN Number of selected injection pathways |
There was a problem hiding this comment.
It would be great if we could replace nSN with n_selected_inj_paths
| /// @param[in] SN_metal_data Pointer to the field data for the metal densities | ||
| /// for the current injection pathway |
There was a problem hiding this comment.
It would be great if we could rename SN_metal_data to selected_inj_path_metal_densities.
| /// @param[in] SN_metal_data Pointer to the field data for the metal densities | ||
| /// for the current injection pathway |
There was a problem hiding this comment.
| /// @param[in] SN_metal_data Pointer to the field data for the metal densities | |
| /// for the current injection pathway | |
| /// @param[in] SN_metal_data Pointer to repacked selected injection pathway | |
| /// metal densities for the current @p idx_range. This is a 2d array where | |
| /// the contiguous axis holds @p in elements and the other axis has space | |
| /// for @p SN0_N entries (in practice only the first @p nSN indices along | |
| /// this axis are used). |
(Obviously this needs to be updated if you choose to update SN_metal_density, SN0_N or nSN.
…transcribe_calc_gr_balance_g
…s_1d' into newchem-cpp_transcribe_calc_gr_balance_g
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
|
At a glance this looks good to me. Would you mind merging newchem-cpp into this branch just to make the diff easier to understand? |
|
Hi @mabruzzo I could be wrong but my git says that this branch is already up-to-date with newchem-cpp (of the original repo) |
09b0763
into
grackle-project:newchem-cpp
Update gold standard for PR #519.
This PR depends on #516. Cleanup needed after analysis of numerical discrepancies.