Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e4df3f9
address compiler warning in chemistry_solver_funcs.hppp
mabruzzo Dec 19, 2025
e2ea0d9
address warning about uninitialized variables in solve_rate_cool_g-cp…
mabruzzo Dec 19, 2025
9ff4b3a
mv testing utility library from tests/unit to tests/grtestutils
mabruzzo Dec 18, 2025
b5b7e65
slightly alter we define targets that support testing
mabruzzo Dec 18, 2025
8cae777
address a todo item (to reduce code duplication)
mabruzzo Dec 18, 2025
5cf43bc
Add gmock to the list of libraries linked via testdeps
mabruzzo Dec 19, 2025
deb6c84
mv GrackleCtxPack out of test_ghost_zone and refactor
mabruzzo Dec 16, 2025
c4495e7
transfer grtest_api_fixture out of test_ghost_zone
mabruzzo Dec 16, 2025
268b9b4
introduce some basic tests of ratequery
mabruzzo Dec 17, 2025
cd7deac
add more ratequery tests
mabruzzo Dec 17, 2025
2425701
tweak the name of the test_ghost_zone tests
mabruzzo Dec 17, 2025
37fad17
factor out machinery for creating adaptor
mabruzzo Dec 18, 2025
39e1c0c
fix a broken header include
mabruzzo Dec 19, 2025
804efcf
some light refactoring of the rate utlities
mabruzzo Dec 12, 2025
ff9eca6
rename rateprop -> ratequery::Descr (as in a rate description)
mabruzzo Dec 12, 2025
9a32a9e
slightly more refactoring
mabruzzo Dec 12, 2025
d13591e
tweak signatures of grunstable_(ratequery_id|ith_rate)
mabruzzo Dec 12, 2025
1fff13c
rename rate_utils to ratequery
mabruzzo Dec 12, 2025
3659a3a
rename Descr->Entry
mabruzzo Dec 12, 2025
11ddf78
introduce ratequery.hpp
mabruzzo Dec 12, 2025
fb030ff
Store the `Entry` Registry within chemistry_data_storage
mabruzzo Dec 12, 2025
e42e0dd
lay the foundation for querying properties
mabruzzo Dec 12, 2025
97d3ce6
gracklepy: start directly querying shapes
mabruzzo Dec 12, 2025
ab816b4
gracklepy: use new shape query logic
mabruzzo Dec 12, 2025
080a097
Tweak grackle wrapper
mabruzzo Dec 13, 2025
3a95ef0
remove unimplemented rate properties
mabruzzo Dec 13, 2025
5df10fc
address a gcc compiler warning
mabruzzo Dec 19, 2025
fe1aba6
introduce grunstable_ratequery_nrates
mabruzzo Dec 19, 2025
93c4c74
add some tests that query rates
mabruzzo Dec 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ src/include/grackle_float.h.in
src/include/grackle_misc.h
src/include/grackle_rate_functions.h
src/include/grackle_types.h
tests/unit/grtest_cmd.cpp
tests/unit/grtest_cmd.hpp
tests/unit/grtest_os.cpp
tests/unit/grtest_os.hpp
tests/unit/grtest_utils.cpp
tests/unit/grtest_utils.hpp
tests/grtestutils/cmd.cpp
tests/grtestutils/cmd.hpp
tests/grtestutils/os.cpp
tests/grtestutils/os.hpp
tests/grtestutils/utils.cpp
tests/grtestutils/utils.hpp
tests/grtestutils/googletest/check_allclose.hpp
tests/unit/test_chemistry_struct_synced.cpp
tests/unit/test_ghost_zone.cpp
tests/unit/test_interpolators_comparisons.cpp
tests/unit/test_linalg.cpp
tests/unit/test_status_reporting.cpp
tests/unit/test_unit_interpolators_g.cpp
tests/unit/utest_helpers.hpp

2 changes: 1 addition & 1 deletion src/clib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ add_library(Grackle_Grackle
lookup_cool_rates1d.hpp
make_consistent.cpp make_consistent.hpp
opaque_storage.hpp
rate_utils.cpp
ratequery.cpp ratequery.hpp
solve_chemistry.cpp
scale_fields.cpp scale_fields.hpp
solve_rate_cool_g-cpp.cpp solve_rate_cool_g-cpp.h
Expand Down
2 changes: 1 addition & 1 deletion src/clib/Make.config.objects
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ OBJS_CONFIG_LIB = \
calc_tdust_3d.lo \
calc_grain_size_increment_1d.lo \
rate_functions.lo \
rate_utils.lo \
ratequery.lo \
gaussj_g.lo \
utils.lo \
utils-cpp.lo \
Expand Down
21 changes: 16 additions & 5 deletions src/clib/chemistry_solver_funcs.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// See LICENSE file for license and copyright information

/// @file chemistry_solver_funcs.hpp
//===----------------------------------------------------------------------===//
//
// See the LICENSE file for license and copyright information
// SPDX-License-Identifier: NCSA AND BSD-3-Clause
//
//===----------------------------------------------------------------------===//
///
/// @file
/// @brief Defines chemistry reaction related functions invoked by the
/// grackle solver in order to integrate the species densities over time.
///
Expand All @@ -14,6 +19,8 @@
/// be decoupled from the derivative calculation for primoridial species
/// - it may also make sense to further divide logic by the kinds of species
/// that are affected (e.g. primordial vs grains)
///
//===----------------------------------------------------------------------===//

#ifndef CHEMISTRY_SOLVER_FUNCS_HPP
#define CHEMISTRY_SOLVER_FUNCS_HPP
Expand Down Expand Up @@ -579,7 +586,9 @@ inline void species_density_updates_gauss_seidel(

if ( (my_chemistry->metal_chemistry == 1) &&
(itmask_metal[i] != MASK_FALSE) ) {
scoef = scoef;
// we comment out the following line that assigns scoef to itself since
// it has no practical impact and produces a compiler warning
// scoef = scoef;
acoef = acoef
+ kcol_buf.data[CollisionalRxnLUT::kz44][i] * CII(i,j,k) / 12.
+ kcol_buf.data[CollisionalRxnLUT::kz45][i] * OII(i,j,k) / 16.
Expand Down Expand Up @@ -1932,7 +1941,9 @@ inline void species_density_derivatives_0d(

if ((my_chemistry->metal_chemistry == 1) &&
(itmask_metal[0] != MASK_FALSE)) {
scoef = scoef;
// we comment out the following line that assigns scoef to itself since
// it has no practical impact and produces a compiler warning
// scoef = scoef;
acoef = acoef
+ kcr_buf.data[CollisionalRxnLUT::kz44][0] * CII / 12.
+ kcr_buf.data[CollisionalRxnLUT::kz45][0] * OII / 16.
Expand Down
16 changes: 16 additions & 0 deletions src/clib/initialize_chemistry_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "internal_types.hpp" // drop_CollisionalRxnRateCollection
#include "opaque_storage.hpp" // gr_opaque_storage
#include "phys_constants.h"
#include "ratequery.hpp"

#ifdef _OPENMP
#include <omp.h>
Expand Down Expand Up @@ -403,6 +404,7 @@ extern "C" int local_initialize_chemistry_data(chemistry_data *my_chemistry,
init_empty_interp_grid_props_(
&my_rates->opaque_storage->h2dust_grain_interp_props);
my_rates->opaque_storage->grain_species_info = nullptr;
my_rates->opaque_storage->registry = nullptr;

double co_length_units, co_density_units;
if (my_units->comoving_coordinates == TRUE) {
Expand Down Expand Up @@ -456,6 +458,11 @@ extern "C" int local_initialize_chemistry_data(chemistry_data *my_chemistry,
/* store a copy of the initial units */
my_rates->initial_units = *my_units;

// initialize the registry
my_rates->opaque_storage->registry = new grackle::impl::ratequery::Registry(
grackle::impl::ratequery::new_Registry(*my_chemistry)
);

if (grackle_verbose) {
time_t timer;
char tstr[80];
Expand Down Expand Up @@ -659,6 +666,15 @@ extern "C" int local_free_chemistry_data(chemistry_data *my_chemistry,
delete my_rates->opaque_storage->grain_species_info;
}

if (my_rates->opaque_storage->registry != nullptr) {
// delete contents of registry
grackle::impl::ratequery::drop_Registry(
my_rates->opaque_storage->registry
);
// delete registry, itself
delete my_rates->opaque_storage->registry;
}

delete my_rates->opaque_storage;
my_rates->opaque_storage = nullptr;

Expand Down
4 changes: 4 additions & 0 deletions src/clib/opaque_storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "grackle.h"
#include "dust/grain_species_info.hpp"
#include "internal_types.hpp"
#include "ratequery.hpp"

/// a struct that used to wrap some private storage details
///
Expand Down Expand Up @@ -95,6 +96,9 @@ struct gr_opaque_storage {
/// > calculations). An alternative would be to briefly initialize an
/// > instance during setup and then repack the data.
grackle::impl::GrainSpeciesInfo* grain_species_info;

/// used to implement the experimental ratequery machinery
grackle::impl::ratequery::Registry* registry;
};

#endif /* OPAQUE_STORAGE_HPP */
239 changes: 0 additions & 239 deletions src/clib/rate_utils.cpp

This file was deleted.

Loading