From 3f2432512f17b41acf9a7c753b65b36194004afa Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 5 Apr 2026 10:53:46 -0400 Subject: [PATCH 01/19] Updated isothermal slab scale height with the factor of 2 for consistency with the recent Cylinder update --- exputil/SLGridMP2.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/exputil/SLGridMP2.cc b/exputil/SLGridMP2.cc index e13c8cd46..620637cd3 100644 --- a/exputil/SLGridMP2.cc +++ b/exputil/SLGridMP2.cc @@ -1844,24 +1844,28 @@ static double poffset=0.0; class IsothermalSlab : public SlabModel { +private: + + std::string psa = "IsothermalSlab NOW uses the traditional density profile proportional to sech^2(z/2H). If you are using the old profile proportional to sech(z/H), please update your model file to use the new profile and set the scale height H to be half of the old value. This will ensure that your model has the same density profile and potential as before, but with a more standard functional form. If you have any questions or concerns about this change, please contact the developers."; + public: - IsothermalSlab() { id = "iso"; } + IsothermalSlab() { id = "iso"; if (myid==0) std::cout << "SLGridSlab: " << psa << std::endl; } double pot(double z) { - return 2.0*M_PI*SLGridSlab::H*log(cosh(z/SLGridSlab::H)) - poffset; + return 4.0*M_PI*SLGridSlab::H*log(cosh(0.5*z/SLGridSlab::H)) - poffset; } double dpot(double z) { - return 2.0*M_PI*tanh(z/SLGridSlab::H); + return 2.0*M_PI*tanh(0.5*z/SLGridSlab::H); } double dens(double z) { - double tmp = 1.0/cosh(z/SLGridSlab::H); - return 4.0*M_PI * 0.5/SLGridSlab::H * tmp*tmp; + double tmp = 1.0/cosh(0.5*z/SLGridSlab::H); + return 0.25/SLGridSlab::H * tmp*tmp; } }; From 85864fae4be67c7c81e5d73d434f4eb9928846ac Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 5 Apr 2026 10:54:36 -0400 Subject: [PATCH 02/19] Updated SlabSL method to have a 'self_consistent' flag --- expui/BiorthBasis.cc | 3 ++- src/SlabSL.H | 44 +++++++++++++++++++++++++++++++++++++++++--- src/SlabSL.cc | 31 +++++++++++++++++++++++++------ src/cudaSlabSL.cu | 6 ++++-- 4 files changed, 72 insertions(+), 12 deletions(-) diff --git a/expui/BiorthBasis.cc b/expui/BiorthBasis.cc index b7723992f..3c79f8209 100644 --- a/expui/BiorthBasis.cc +++ b/expui/BiorthBasis.cc @@ -3420,7 +3420,8 @@ namespace BasisClasses "knots", "verbose", "check", - "method" + "method", + "self_consistent" }; Slab::Slab(const YAML::Node& CONF) : BiorthBasis(CONF, "slab") diff --git a/src/SlabSL.H b/src/SlabSL.H index 693ded977..d9f5fdd51 100644 --- a/src/SlabSL.H +++ b/src/SlabSL.H @@ -17,9 +17,38 @@ #include #endif -/*! This routine computes the potential, acceleration and density - using expansion periodic in X & Y and outgoing vacuum boundary - condtions in Z */ +/** @class SlabSL + @brief This routine computes the potential, acceleration and density + using expansion periodic in X & Y and outgoing vacuum boundary + condtions in Z + + @details **YAML configuration** + + @param nmaxx is the maximum order of the expansion in x (default 6) + + @param nmaxy is the maximum order of the expansion in y (default 6) + + @param nmaxz is the maximum order of the expansion in z (default 6) + + @param nminx is the minimum order of the expansion in x (default 0) + + @param nminy is the minimum order of the expansion in y (default 0) + + @param hslab is the scale height of the slab (default 0.2) + + @param zmax is the maximum z for the slab (default 10.0) + + @param ngrid is the number of grid points in z for the + Sturm-Liouville solver (default 1000) + + @param type is the type of slab to solve for (default + "isothermal", must be "isothermal", "parabolic", or "constant") + + @param self_consistent set to true allows the particles to evolve + under the time-dependent basis expansion. For a basis fixed in time to + the initial time: set to false. + +*/ class SlabSL : public PotAccel { @@ -47,6 +76,9 @@ private: //! Current coefficient tensor std::vector expccof, expccofP; + //! Coefficient tensor for frozen potential (if self_consistent=false) + coefType expcofF; + int nminx, nminy; int nmaxx, nmaxy, nmaxz; double zmax, hslab; @@ -120,6 +152,12 @@ private: #endif + //! Flag self_consitency + bool self_consistent = true; + + //! Flag whether coefficients have been initialized for the first time + bool firstime_coef = true; + //! Default number of grid points for SLGridSlab int ngrid = 1000; diff --git a/src/SlabSL.cc b/src/SlabSL.cc index 1de35675a..a6c6fd7d8 100644 --- a/src/SlabSL.cc +++ b/src/SlabSL.cc @@ -17,7 +17,8 @@ SlabSL::valid_keys = { "hslab", "zmax", "ngrid", - "type" + "type", + "self_consistent" }; //@{ @@ -48,6 +49,8 @@ SlabSL::SlabSL(Component* c0, const YAML::Node& conf) : PotAccel(c0, conf) int nnmax = (nmaxx > nmaxy) ? nmaxx : nmaxy; + // Make the Sturm-Liouville grid and basis functions + // grid = std::make_shared(nnmax, nmaxz, ngrid, zmax, type); // Test for basis consistency (will generate an exception if maximum @@ -164,6 +167,11 @@ void SlabSL::initialize() if (conf["hslab"]) hslab = conf["hslab"].as(); if (conf["zmax" ]) zmax = conf["zmax" ].as(); if (conf["type" ]) type = conf["type" ].as(); + + if (conf["self_consistent"]) { + self_consistent = conf["self_consistent"].as(); + } else + self_consistent = true; } catch (YAML::Exception & error) { if (myid==0) std::cout << "Error parsing parameters in SlabSL: " @@ -253,6 +261,11 @@ void SlabSL::determine_coefficients(void) compute_multistep_coefficients(); } + // Only used if self_consistent is false to ensure that coefficients + // are only computed once (at the first time step) + // + firstime_coef = false; + if (not self_consistent) expcofF = expccof[0]; } void * SlabSL::determine_coefficients_thread(void * arg) @@ -343,7 +356,7 @@ void SlabSL::get_acceleration_and_potential(Component* C) if (use_external == false) { - if (multistep && initializing) { + if (multistep && (self_consistent || initializing)) { compute_multistep_coefficients(); } @@ -454,11 +467,17 @@ void * SlabSL::determine_acceleration_and_potential_thread(void * arg) for (int iz=0; iz Date: Sun, 5 Apr 2026 12:28:40 -0400 Subject: [PATCH 03/19] Comment updates only --- include/SLGridMP2.H | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/SLGridMP2.H b/include/SLGridMP2.H index da209403c..caa8976b2 100644 --- a/include/SLGridMP2.H +++ b/include/SLGridMP2.H @@ -292,12 +292,21 @@ private: void compute_table_worker(void); - // Local MPI stuff + //@{ + //! Local MPI stuff void mpi_setup(void); void mpi_unpack_table(void); int mpi_pack_table(TableSlab* table, int kx, int ky); + //@} + + //@{ + //! Cache reading and writing bool ReadH5Cache(void); void WriteH5Cache(void); + //@} + + //! Cache versioning + inline static const std::string Version = "1.0"; int mpi_myid, mpi_numprocs; int mpi_bufsz; From 3d55d7574f263acd07182b18696aec68527025c1 Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 5 Apr 2026 12:29:09 -0400 Subject: [PATCH 04/19] Added cache versioning --- exputil/SLGridMP2.cc | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/exputil/SLGridMP2.cc b/exputil/SLGridMP2.cc index 620637cd3..0568c9392 100644 --- a/exputil/SLGridMP2.cc +++ b/exputil/SLGridMP2.cc @@ -1846,11 +1846,18 @@ class IsothermalSlab : public SlabModel private: - std::string psa = "IsothermalSlab NOW uses the traditional density profile proportional to sech^2(z/2H). If you are using the old profile proportional to sech(z/H), please update your model file to use the new profile and set the scale height H to be half of the old value. This will ensure that your model has the same density profile and potential as before, but with a more standard functional form. If you have any questions or concerns about this change, please contact the developers."; + std::string psa = + "---- IsothermalSlab NOW uses the traditional density profile proportional to sech^2(z/2H).\n" + "---- If you are using the old profile proportional to sech(z/H), please update your model\n" + "---- to use the new profile and set the scale height H to be half of the old value. This\n" + "---- will ensure that your model has the same density profile and potential as before, but\n" + "---- with a more standard functional form. If you have any questions or concerns about this\n" + "---- change, please contact the developers on GitHUB."; public: - IsothermalSlab() { id = "iso"; if (myid==0) std::cout << "SLGridSlab: " << psa << std::endl; } + IsothermalSlab() { id = "iso"; if (myid==0) std::cout << "---- SLGridSlab: IMPORTANT UPDATE\n" << psa + << std::endl; } double pot(double z) { @@ -1865,7 +1872,7 @@ class IsothermalSlab : public SlabModel double dens(double z) { double tmp = 1.0/cosh(0.5*z/SLGridSlab::H); - return 0.25/SLGridSlab::H * tmp*tmp; + return 4.0*M_PI*0.25/SLGridSlab::H * tmp*tmp; } }; @@ -2259,6 +2266,18 @@ bool SLGridSlab::ReadH5Cache(void) if (not checkStr(geometry, "geometry")) return false; if (not checkStr(forceID, "forceID")) return false; + // Version check + // + if (h5file.hasAttribute("Version")) { + if (not checkStr(Version, "Version")) return false; + } else { + if (myid==0) + std::cout << "---- SLGridSlab::ReadH5Cache: " + << "recomputing cache for HighFive API change" + << std::endl; + return false; + } + // Parameter check // if (not checkStr(type, "type")) return false; @@ -2352,6 +2371,7 @@ void SLGridSlab::WriteH5Cache(void) file.createAttribute("geometry", HighFive::DataSpace::From(geometry)).write(geometry); file.createAttribute("forceID", HighFive::DataSpace::From(forceID)).write(forceID); + file.createAttribute("Version", HighFive::DataSpace::From(Version)).write(Version); // Write parameters // From aeb39a2b7aadb2a436bb70355f5b44b63edd606b Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 5 Apr 2026 13:20:05 -0400 Subject: [PATCH 05/19] Added compile-time version string parsing for future development work --- exputil/libvars.cc | 2 ++ include/EXPversion.H | 49 ++++++++++++++++++++++++++++++++++++++++++++ include/libvars.H | 6 ++++++ 3 files changed, 57 insertions(+) create mode 100644 include/EXPversion.H diff --git a/exputil/libvars.cc b/exputil/libvars.cc index 14ff71690..11ee23a56 100644 --- a/exputil/libvars.cc +++ b/exputil/libvars.cc @@ -3,6 +3,7 @@ standalone utilities */ +#include "config_exp.h" #include "libvars.H" namespace __EXP__ @@ -36,6 +37,7 @@ namespace __EXP__ //! Sanity tolerance for orthogonality double orthoTol = 1.0e-2; + }; diff --git a/include/EXPversion.H b/include/EXPversion.H new file mode 100644 index 000000000..41f7625b6 --- /dev/null +++ b/include/EXPversion.H @@ -0,0 +1,49 @@ +#pragma once + +#include + +namespace __EXP__ +{ + // Runtime parser for "X.Y.Z" format + + /* Example usage: + + #define VERSION_STR "2.4.12" + static constexpr EXPversion current_v = EXP_parse_version(VERSION_STR); + + int main() { + static_assert(current_v.major == 2, "Major version mismatch"); + std::cout << "Parsed: " << current_v.major << "." << current_v.minor << "\n"; + return 0;} + */ + + + struct EXPversion + { + int major, minor, patch; + }; + + // Compile-time parser for "X.Y.Z" format + constexpr EXPversion EXP_parse_version(const char* str) + { + EXPversion v = {0, 0, 0}; + int* target = &v.major; + int current = 0; + + // Scan the version string until we hit a dot, then move to the next target + for (int i = 0; str[i] != '\0'; ++i) { + if (str[i] == '.') { + *target = current; + if (target == &v.major) target = &v.minor; + else if (target == &v.minor) target = &v.patch; + current = 0; + } else { + // Add the current digit to the current version component + current = current * 10 + (str[i] - '0'); + } + } + *target = current; + return v; + } +} + diff --git a/include/libvars.H b/include/libvars.H index 12dfd45d3..5dde89c0c 100644 --- a/include/libvars.H +++ b/include/libvars.H @@ -7,6 +7,9 @@ #include +#include "config_exp.h" // For version string +#include "EXPversion.H" // For compile-time version parsing + namespace __EXP__ { //! @name Theading variables @@ -42,6 +45,9 @@ namespace __EXP__ //! Sanity tolerance for orthogonality extern double orthoTol; + //! Compile-time version parsing + static constexpr EXPversion exp_version = EXP_parse_version(VERSION); + }; #endif // END _LIBVARS_H From c8af8b30727ad69754e44c29e3ed4f1992765ab0 Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 5 Apr 2026 13:20:36 -0400 Subject: [PATCH 06/19] Use compile-time version info to toggle warning message --- exputil/SLGridMP2.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/exputil/SLGridMP2.cc b/exputil/SLGridMP2.cc index 0568c9392..c8df89b01 100644 --- a/exputil/SLGridMP2.cc +++ b/exputil/SLGridMP2.cc @@ -21,6 +21,7 @@ #include "SLGridMP2.H" #include "massmodel.H" #include "EXPmath.H" +#include "libvars.H" // For parsed version info #ifdef USE_DMALLOC #include @@ -1856,8 +1857,12 @@ class IsothermalSlab : public SlabModel public: - IsothermalSlab() { id = "iso"; if (myid==0) std::cout << "---- SLGridSlab: IMPORTANT UPDATE\n" << psa - << std::endl; } + IsothermalSlab() { + id = "iso"; + if (myid==0 and __EXP__::exp_version.minor<11) + std::cout << "---- SLGridSlab: IMPORTANT UPDATE\n" << psa + << std::endl; + } double pot(double z) { From a5149ed8d941734f31c0338ffc3e537e88c3397c Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 5 Apr 2026 13:44:22 -0400 Subject: [PATCH 07/19] Remove unnecessary preprocessor variable --- utils/ICs/bonnerebert.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/utils/ICs/bonnerebert.cc b/utils/ICs/bonnerebert.cc index a7589b6d0..c20c38ff4 100644 --- a/utils/ICs/bonnerebert.cc +++ b/utils/ICs/bonnerebert.cc @@ -28,8 +28,6 @@ */ -#define VERSION 0.1 - #include #include #include @@ -366,8 +364,7 @@ decode_switches (int argc, char **argv) "R:" /* runit */ "N:" /* number */ "S:" /* seed */ - "h" /* help */ - "V", /* version */ + "h", /* help */ long_options, (int *) 0)) != EOF) { switch (c) @@ -399,10 +396,6 @@ decode_switches (int argc, char **argv) case 'S': /* --seed */ S = atoi(optarg); break; - case 'V': - cout << program_name << " " << VERSION << endl; - exit (0); - case 'h': usage (0); From 5cffd92ff3ec15eb6884b82ca4688aca2169fee4 Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 5 Apr 2026 13:44:47 -0400 Subject: [PATCH 08/19] Added test example for internal version parser --- utils/Test/CMakeLists.txt | 3 ++- utils/Test/version_test.cc | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 utils/Test/version_test.cc diff --git a/utils/Test/CMakeLists.txt b/utils/Test/CMakeLists.txt index 5a8a6fc4b..dd3a4c56c 100644 --- a/utils/Test/CMakeLists.txt +++ b/utils/Test/CMakeLists.txt @@ -1,5 +1,5 @@ -set(bin_PROGRAMS testBarrier expyaml orthoTest testED) +set(bin_PROGRAMS testBarrier expyaml orthoTest testED vtest) set(common_LINKLIB OpenMP::OpenMP_CXX MPI::MPI_CXX expui exputil yaml-cpp ${VTK_LIBRARIES}) @@ -33,6 +33,7 @@ add_executable(testBarrier test_barrier.cc) add_executable(expyaml test_config.cc) add_executable(orthoTest orthoTest.cc Biorth2Ortho.cc) add_executable(testED testED.cc) +add_executable(vtest version_test.cc) foreach(program ${bin_PROGRAMS}) target_link_libraries(${program} ${common_LINKLIB}) diff --git a/utils/Test/version_test.cc b/utils/Test/version_test.cc new file mode 100644 index 000000000..5f8ce527e --- /dev/null +++ b/utils/Test/version_test.cc @@ -0,0 +1,15 @@ +// Example of using the version string and parsed octet of integers from libvars.H + +#include +#include "libvars.H" +using namespace __EXP__; + +int main() +{ + std::cout << "Version string: " << VERSION << '\n'; + std::cout << "Parsed octet of integers:\n"; + std::cout << "-- Major=" << exp_build.major << '\n'; + std::cout << "-- Minor=" << exp_build.minor << '\n'; + std::cout << "-- Patch=" << exp_build.patch << '\n'; + return 0; +} From ca731d4a4cc944a5ebce7a44e5680fa8b3a06331 Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 5 Apr 2026 13:45:13 -0400 Subject: [PATCH 09/19] Updated name of version struction to prevent variable name conflicts --- exputil/SLGridMP2.cc | 2 +- include/libvars.H | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exputil/SLGridMP2.cc b/exputil/SLGridMP2.cc index c8df89b01..7cc30bd4c 100644 --- a/exputil/SLGridMP2.cc +++ b/exputil/SLGridMP2.cc @@ -1859,7 +1859,7 @@ class IsothermalSlab : public SlabModel IsothermalSlab() { id = "iso"; - if (myid==0 and __EXP__::exp_version.minor<11) + if (myid==0 and exp_build.minor<11) std::cout << "---- SLGridSlab: IMPORTANT UPDATE\n" << psa << std::endl; } diff --git a/include/libvars.H b/include/libvars.H index 5dde89c0c..bbbcd6e11 100644 --- a/include/libvars.H +++ b/include/libvars.H @@ -46,7 +46,7 @@ namespace __EXP__ extern double orthoTol; //! Compile-time version parsing - static constexpr EXPversion exp_version = EXP_parse_version(VERSION); + static constexpr EXPversion exp_build = EXP_parse_version(VERSION); }; From 08fc515a5f43d80adb03cb5c7538348d11673736 Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 5 Apr 2026 15:36:23 -0400 Subject: [PATCH 10/19] stdout changes only --- exputil/SLGridMP2.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exputil/SLGridMP2.cc b/exputil/SLGridMP2.cc index 7cc30bd4c..4d27115a5 100644 --- a/exputil/SLGridMP2.cc +++ b/exputil/SLGridMP2.cc @@ -1852,16 +1852,16 @@ class IsothermalSlab : public SlabModel "---- If you are using the old profile proportional to sech(z/H), please update your model\n" "---- to use the new profile and set the scale height H to be half of the old value. This\n" "---- will ensure that your model has the same density profile and potential as before, but\n" - "---- with a more standard functional form. If you have any questions or concerns about this\n" - "---- change, please contact the developers on GitHUB."; + "---- with a more standard functional form. If you have any questions or concerns about\n" + "---- this change, please contact the developers on GitHUB."; public: IsothermalSlab() { id = "iso"; if (myid==0 and exp_build.minor<11) - std::cout << "---- SLGridSlab: IMPORTANT UPDATE\n" << psa - << std::endl; + std::cout << "---- SLGridSlab: IMPORTANT UPDATE for EXP " + << VERSION << '\n' << psa << std::endl; } double pot(double z) From bd75f99f88247569b002645a7b152148f55d619a Mon Sep 17 00:00:00 2001 From: Martin Weinberg Date: Sun, 5 Apr 2026 16:33:36 -0400 Subject: [PATCH 11/19] Update src/SlabSL.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/SlabSL.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SlabSL.cc b/src/SlabSL.cc index a6c6fd7d8..5e2454af6 100644 --- a/src/SlabSL.cc +++ b/src/SlabSL.cc @@ -264,8 +264,8 @@ void SlabSL::determine_coefficients(void) // Only used if self_consistent is false to ensure that coefficients // are only computed once (at the first time step) // + if (not self_consistent and firstime_coef) expcofF = expccof[0]; firstime_coef = false; - if (not self_consistent) expcofF = expccof[0]; } void * SlabSL::determine_coefficients_thread(void * arg) From 69a25c4b6bbb636c5213d52deb1e3ba19e262694 Mon Sep 17 00:00:00 2001 From: Martin Weinberg Date: Sun, 5 Apr 2026 16:33:55 -0400 Subject: [PATCH 12/19] Update src/SlabSL.H Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/SlabSL.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SlabSL.H b/src/SlabSL.H index d9f5fdd51..8fce83898 100644 --- a/src/SlabSL.H +++ b/src/SlabSL.H @@ -20,7 +20,7 @@ /** @class SlabSL @brief This routine computes the potential, acceleration and density using expansion periodic in X & Y and outgoing vacuum boundary - condtions in Z + conditions in Z @details **YAML configuration** From f23f427ee36f604a887401dbd8d40b40477b1b9b Mon Sep 17 00:00:00 2001 From: Martin Weinberg Date: Sun, 5 Apr 2026 16:34:09 -0400 Subject: [PATCH 13/19] Update src/SlabSL.H Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/SlabSL.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SlabSL.H b/src/SlabSL.H index 8fce83898..c394a9b84 100644 --- a/src/SlabSL.H +++ b/src/SlabSL.H @@ -152,7 +152,7 @@ private: #endif - //! Flag self_consitency + //! Flag self_consistency bool self_consistent = true; //! Flag whether coefficients have been initialized for the first time From 4d7f43b03af41bd0a8e7972909db2d869b06ae53 Mon Sep 17 00:00:00 2001 From: Martin Weinberg Date: Sun, 5 Apr 2026 16:35:06 -0400 Subject: [PATCH 14/19] Update exputil/SLGridMP2.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- exputil/SLGridMP2.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exputil/SLGridMP2.cc b/exputil/SLGridMP2.cc index 4d27115a5..11082a853 100644 --- a/exputil/SLGridMP2.cc +++ b/exputil/SLGridMP2.cc @@ -1859,7 +1859,8 @@ class IsothermalSlab : public SlabModel IsothermalSlab() { id = "iso"; - if (myid==0 and exp_build.minor<11) + if (myid==0 and (exp_build.major < 7 or + (exp_build.major == 7 and exp_build.minor < 11))) std::cout << "---- SLGridSlab: IMPORTANT UPDATE for EXP " << VERSION << '\n' << psa << std::endl; } From c84a843616a4fac7b04bb685648d273a4d835807 Mon Sep 17 00:00:00 2001 From: Martin Weinberg Date: Sun, 5 Apr 2026 16:35:39 -0400 Subject: [PATCH 15/19] Update exputil/SLGridMP2.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- exputil/SLGridMP2.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exputil/SLGridMP2.cc b/exputil/SLGridMP2.cc index 11082a853..cd7ef60e5 100644 --- a/exputil/SLGridMP2.cc +++ b/exputil/SLGridMP2.cc @@ -1849,11 +1849,11 @@ class IsothermalSlab : public SlabModel std::string psa = "---- IsothermalSlab NOW uses the traditional density profile proportional to sech^2(z/2H).\n" - "---- If you are using the old profile proportional to sech(z/H), please update your model\n" + "---- If you are using the old profile proportional to sech^2(z/H), please update your model\n" "---- to use the new profile and set the scale height H to be half of the old value. This\n" "---- will ensure that your model has the same density profile and potential as before, but\n" "---- with a more standard functional form. If you have any questions or concerns about\n" - "---- this change, please contact the developers on GitHUB."; + "---- this change, please contact the developers on GitHub."; public: From 7e4597528a2b8f032e6e062915d27128669c8d1a Mon Sep 17 00:00:00 2001 From: Martin Weinberg Date: Sun, 5 Apr 2026 16:36:02 -0400 Subject: [PATCH 16/19] Update include/EXPversion.H Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- include/EXPversion.H | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/EXPversion.H b/include/EXPversion.H index 41f7625b6..94edc0b18 100644 --- a/include/EXPversion.H +++ b/include/EXPversion.H @@ -1,10 +1,8 @@ #pragma once -#include - namespace __EXP__ { - // Runtime parser for "X.Y.Z" format + // Compile-time parser for "X.Y.Z" format /* Example usage: From a3aaefe2a8cf9afc8ef4c04ebd329082d6dc4777 Mon Sep 17 00:00:00 2001 From: Martin Weinberg Date: Sun, 5 Apr 2026 16:57:32 -0400 Subject: [PATCH 17/19] Update output message for parsed version integers --- utils/Test/version_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/Test/version_test.cc b/utils/Test/version_test.cc index 5f8ce527e..0d51ae26c 100644 --- a/utils/Test/version_test.cc +++ b/utils/Test/version_test.cc @@ -7,7 +7,7 @@ using namespace __EXP__; int main() { std::cout << "Version string: " << VERSION << '\n'; - std::cout << "Parsed octet of integers:\n"; + std::cout << "Parsed into integer triplet:\n"; std::cout << "-- Major=" << exp_build.major << '\n'; std::cout << "-- Minor=" << exp_build.minor << '\n'; std::cout << "-- Patch=" << exp_build.patch << '\n'; From b7ed7eb5989e7fe7a2e4b33225a730dea865148b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 5 Apr 2026 21:13:08 +0000 Subject: [PATCH 18/19] Fix remaining 'octet of integers' wording in version_test.cc comment Agent-Logs-Url: https://github.com/EXP-code/EXP/sessions/a9b4ee92-2327-4580-968b-23dded26f6e2 Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com> --- utils/Test/version_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/Test/version_test.cc b/utils/Test/version_test.cc index 0d51ae26c..16f2b585b 100644 --- a/utils/Test/version_test.cc +++ b/utils/Test/version_test.cc @@ -1,4 +1,4 @@ -// Example of using the version string and parsed octet of integers from libvars.H +// Example of using the version string and parsed integer triplet from libvars.H #include #include "libvars.H" From 875571d3c9328fdc0703927e1f0dd377b73c294b Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 5 Apr 2026 19:49:35 -0400 Subject: [PATCH 19/19] Comments only [no ci] --- include/EXPversion.H | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/EXPversion.H b/include/EXPversion.H index 41f7625b6..c0619ab2f 100644 --- a/include/EXPversion.H +++ b/include/EXPversion.H @@ -23,7 +23,7 @@ namespace __EXP__ int major, minor, patch; }; - // Compile-time parser for "X.Y.Z" format + // Compile-time parser for "X.Y.Z" format using c++-17 features constexpr EXPversion EXP_parse_version(const char* str) { EXPversion v = {0, 0, 0}; @@ -34,15 +34,16 @@ namespace __EXP__ for (int i = 0; str[i] != '\0'; ++i) { if (str[i] == '.') { *target = current; - if (target == &v.major) target = &v.minor; + if (target == &v.major) target = &v.minor; else if (target == &v.minor) target = &v.patch; current = 0; } else { - // Add the current digit to the current version component + // Append the current decimal digit to the current version current = current * 10 + (str[i] - '0'); } } - *target = current; + // Store the int of this version string + *target = current; return v; } }