Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
3f24325
Updated isothermal slab scale height with the factor of 2 for consist…
Apr 5, 2026
85864fa
Updated SlabSL method to have a 'self_consistent' flag
Apr 5, 2026
db8878b
Comment updates only
Apr 5, 2026
3d55d75
Added cache versioning
Apr 5, 2026
aeb39a2
Added compile-time version string parsing for future development work
Apr 5, 2026
c8af8b3
Use compile-time version info to toggle warning message
Apr 5, 2026
a5149ed
Remove unnecessary preprocessor variable
Apr 5, 2026
5cffd92
Added test example for internal version parser
Apr 5, 2026
ca731d4
Updated name of version struction to prevent variable name conflicts
Apr 5, 2026
08fc515
stdout changes only
Apr 5, 2026
bd75f99
Update src/SlabSL.cc
The9Cat Apr 5, 2026
69a25c4
Update src/SlabSL.H
The9Cat Apr 5, 2026
f23f427
Update src/SlabSL.H
The9Cat Apr 5, 2026
4d7f43b
Update exputil/SLGridMP2.cc
The9Cat Apr 5, 2026
c84a843
Update exputil/SLGridMP2.cc
The9Cat Apr 5, 2026
7e45975
Update include/EXPversion.H
The9Cat Apr 5, 2026
a3aaefe
Update output message for parsed version integers
The9Cat Apr 5, 2026
b7ed7eb
Fix remaining 'octet of integers' wording in version_test.cc comment
Copilot Apr 5, 2026
875571d
Comments only [no ci]
Apr 5, 2026
09b429c
Merge branch 'slabUpdate' of github.com:EXP-code/EXP into slabUpdate
Apr 5, 2026
1c8a6d4
Require SLGridSlab to have a non-default cachename for consistency wi…
Apr 10, 2026
0efa0b3
Preliminary implemenation of covariance for SlabSL; compiles but unte…
Apr 20, 2026
4452ee4
Merge branch 'devel' into slabUpdate
Apr 22, 2026
e327ca3
Merge branch 'slabUpdate' into slabCovar
Apr 22, 2026
626973e
Update for main-bug merge
Apr 22, 2026
37f6071
Clean up covariance tensor storage allocation in Cube and Slab
Apr 30, 2026
c883db1
Comments only
May 1, 2026
7c487bc
Fix option tags
May 1, 2026
dc2ae45
Use linear map on table by default
May 1, 2026
f7e7be4
Update orthogonality and Poisson check
May 1, 2026
a5a780b
Added cmap variable to Slab basis in both EXP and pyEXP
May 1, 2026
bab8d36
Some updates for covariance cuda code; untested but compiling
May 1, 2026
86baa99
Use mass, not mass scaled for biorthogonal function accumulation, for…
May 1, 2026
3766f97
Allow check to use all the coordinate mappings for testing
May 2, 2026
f047d3e
Add numz as a variable
May 2, 2026
8e25b53
Missing parameter parsing for cmap
May 2, 2026
f036c51
Add periodic box wrapping to cuda implementation for testing
May 2, 2026
e39cfc8
Potential fix for pull request finding
The9Cat May 3, 2026
6590d59
Potential fix for pull request finding
The9Cat May 3, 2026
a111a90
Potential fix for pull request finding
The9Cat May 3, 2026
7b4f5d7
Document nint and samplesz subsampling params in SlabSL YAML docstring
Copilot May 3, 2026
d87a355
Potential fix for pull request finding
The9Cat May 3, 2026
5e9e60b
Potential fix for pull request finding
The9Cat May 3, 2026
5dbe30a
Remove unused outer orthoMat declaration in orthochk.cc case 4
Copilot May 3, 2026
0cc1bc5
Fix SlabSL.ortho diagnostic gate, CoordMap safety, and bonnerebert -V…
Copilot May 3, 2026
227e859
Consistency fixes between CPU and GPU
May 3, 2026
8ff45d1
Fix up some missing variables and type mismatches introduced by signa…
May 3, 2026
5e3b42f
Miswritten 'assign' members for Slab and Cube
May 3, 2026
c0a233a
Sign error in force table folding
May 4, 2026
ec6e853
Correct the mass prefactor for the biorthogonal projection
May 4, 2026
f871e26
Correct the biorthogonal prefactor and update ui for Cube and Slab co…
May 4, 2026
dd0280b
Fix 4*pi factors in slab normalization
May 4, 2026
ac21815
Restored previous 4*pi factors which were correct
May 5, 2026
11beb18
Fix 4*pi factors in slab normalization, 2nd try
May 5, 2026
8531aa9
Make const defaults static in SLGridMP2.H to keep clang happy
May 7, 2026
8525a20
Move static initialization into the implementation
May 7, 2026
42b19ee
Covariance updates
May 11, 2026
6b6b5a9
Even/odd exclusion for k!=0
May 11, 2026
973f789
Implemented even/odd in cudaSlabSL
May 11, 2026
65c43da
Add even/odd restrictions for testing
May 14, 2026
32b4f7f
Merge branch 'devel' into slabUpdate
May 14, 2026
48055b3
Add slab to coefficient factory
May 14, 2026
9a8b385
Update uniform slab for consistency with LT from Orbit
May 26, 2026
3d42eed
Updates for clarity; no functional changes
May 27, 2026
bba264b
Add the Uniform density model
May 27, 2026
dba16fa
Add the Uniform density model
May 27, 2026
6964b52
Cube and SlabSL should derive from Basis rather than the base class P…
May 27, 2026
feab837
Check that z is in range before determining an index to prevent a sin…
May 28, 2026
9d68774
Enable covariance for Slab
May 30, 2026
635bae9
Convert from global to local header include syntax
May 30, 2026
27b9174
Merge branch 'devel' into slabUpdate
May 30, 2026
77c2784
Convert 'slab' key to lower case needed for Cuda implementation
May 30, 2026
8d0f415
Added the cosine bell model to the slab SL
Jun 1, 2026
c06ae53
Merge branch 'slabUpdate' of github.com:EXP-code/EXP into slabUpdate
Jun 1, 2026
55ab549
Add slab orthogonal checks for cosine bell model
Jun 1, 2026
a2f2074
Fix particle realization check for the cosine-bell model
Jun 2, 2026
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
3 changes: 2 additions & 1 deletion expui/BiorthBasis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3420,7 +3420,8 @@ namespace BasisClasses
"knots",
"verbose",
"check",
"method"
"method",
"self_consistent"
};

Slab::Slab(const YAML::Node& CONF) : BiorthBasis(CONF, "slab")
Expand Down
39 changes: 34 additions & 5 deletions exputil/SLGridMP2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "SLGridMP2.H"
#include "massmodel.H"
#include "EXPmath.H"
#include "libvars.H" // For parsed version info

#ifdef USE_DMALLOC
#include <dmalloc.h>
Expand Down Expand Up @@ -1844,24 +1845,39 @@ 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).\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\n"
"---- this change, please contact the developers on GitHUB.";
Comment thread
The9Cat marked this conversation as resolved.
Outdated

public:

IsothermalSlab() { id = "iso"; }
IsothermalSlab() {
id = "iso";
if (myid==0 and exp_build.minor<11)
Comment thread
The9Cat marked this conversation as resolved.
Outdated
std::cout << "---- SLGridSlab: IMPORTANT UPDATE for EXP "
<< VERSION << '\n' << 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 4.0*M_PI*0.25/SLGridSlab::H * tmp*tmp;
}
};

Expand Down Expand Up @@ -2255,6 +2271,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;
Expand Down Expand Up @@ -2348,6 +2376,7 @@ void SLGridSlab::WriteH5Cache(void)

file.createAttribute<std::string>("geometry", HighFive::DataSpace::From(geometry)).write(geometry);
file.createAttribute<std::string>("forceID", HighFive::DataSpace::From(forceID)).write(forceID);
file.createAttribute<std::string>("Version", HighFive::DataSpace::From(Version)).write(Version);

// Write parameters
//
Expand Down
2 changes: 2 additions & 0 deletions exputil/libvars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
standalone utilities
*/

#include "config_exp.h"
#include "libvars.H"

namespace __EXP__
Expand Down Expand Up @@ -36,6 +37,7 @@ namespace __EXP__

//! Sanity tolerance for orthogonality
double orthoTol = 1.0e-2;

};


49 changes: 49 additions & 0 deletions include/EXPversion.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#pragma once

#include <iostream>

namespace __EXP__
{
// Runtime parser for "X.Y.Z" format
Comment thread
The9Cat marked this conversation as resolved.
Outdated

/* 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;
}
}

11 changes: 10 additions & 1 deletion include/SLGridMP2.H
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions include/libvars.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

#include <mpi.h>

#include "config_exp.h" // For version string
#include "EXPversion.H" // For compile-time version parsing

namespace __EXP__
{
//! @name Theading variables
Expand Down Expand Up @@ -42,6 +45,9 @@ namespace __EXP__
//! Sanity tolerance for orthogonality
extern double orthoTol;

//! Compile-time version parsing
static constexpr EXPversion exp_build = EXP_parse_version(VERSION);

};

#endif // END _LIBVARS_H
44 changes: 41 additions & 3 deletions src/SlabSL.H
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,38 @@
#include <cudaMappingConstants.cuH>
#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
Comment thread
The9Cat marked this conversation as resolved.
Outdated

@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.

*/
Comment on lines +25 to +70

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added nint and samplesz to the YAML configuration docstring in commit 7b4f5d7, including the constraint that samplesz must be greater than 0 when nint>0.

class SlabSL : public PotAccel
{

Expand Down Expand Up @@ -47,6 +76,9 @@ private:
//! Current coefficient tensor
std::vector<coefType> expccof, expccofP;

//! Coefficient tensor for frozen potential (if self_consistent=false)
coefType expcofF;

int nminx, nminy;
int nmaxx, nmaxy, nmaxz;
double zmax, hslab;
Expand Down Expand Up @@ -120,6 +152,12 @@ private:

#endif

//! Flag self_consitency
Comment thread
The9Cat marked this conversation as resolved.
Outdated
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;

Expand Down
31 changes: 25 additions & 6 deletions src/SlabSL.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ SlabSL::valid_keys = {
"hslab",
"zmax",
"ngrid",
"type"
"type",
"self_consistent"
};

//@{
Expand Down Expand Up @@ -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<SLGridSlab>(nnmax, nmaxz, ngrid, zmax, type);

// Test for basis consistency (will generate an exception if maximum
Expand Down Expand Up @@ -164,6 +167,11 @@ void SlabSL::initialize()
if (conf["hslab"]) hslab = conf["hslab"].as<double>();
if (conf["zmax" ]) zmax = conf["zmax" ].as<double>();
if (conf["type" ]) type = conf["type" ].as<std::string>();

if (conf["self_consistent"]) {
self_consistent = conf["self_consistent"].as<bool>();
} else
self_consistent = true;
}
catch (YAML::Exception & error) {
if (myid==0) std::cout << "Error parsing parameters in SlabSL: "
Expand Down Expand Up @@ -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];
Comment thread
The9Cat marked this conversation as resolved.
Outdated
}

void * SlabSL::determine_coefficients_thread(void * arg)
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -454,11 +467,17 @@ void * SlabSL::determine_acceleration_and_potential_thread(void * arg)

for (int iz=0; iz<imz; iz++) {

fac = facx*facy*zpot[id][iz]*expccof[0](ix, iy, iz);
facf = facx*facy*zfrc[id][iz]*expccof[0](ix, iy, iz);

// Limit to minimum wave number
// Live for frozen potential
if (self_consistent) {
fac = facx*facy*zpot[id][iz]*expccof[0](ix, iy, iz);
facf = facx*facy*zfrc[id][iz]*expccof[0](ix, iy, iz);
} else {
fac = facx*facy*zpot[id][iz]*expcofF(ix, iy, iz);
facf = facx*facy*zfrc[id][iz]*expcofF(ix, iy, iz);
}

// Limit to minimum wave number
//
if (abs(ii)<nminx || abs(jj)<nminy) continue;

potl += fac;
Expand Down
6 changes: 4 additions & 2 deletions src/cudaSlabSL.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,10 @@ void SlabSL::HtoD_coefs()
host_coefs.resize(jmax);

// Copy from Slab
for (int i=0; i<host_coefs.size(); i++)
host_coefs[i] = expccof[0].data()[i];
for (int i=0; i<host_coefs.size(); i++) {
if (self_consistent) host_coefs[i] = expccof[0].data()[i];
else host_coefs[i] = expcofF.data()[i];
}

// Copy to device
dev_coefs = host_coefs;
Expand Down
9 changes: 1 addition & 8 deletions utils/ICs/bonnerebert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

*/

#define VERSION 0.1

#include <iostream>
#include <iomanip>
#include <sstream>
Expand Down Expand Up @@ -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)
Comment on lines -357 to 369

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored -V/--version handling in commit 0cc1bc5: added 'V' to the getopt_long option string and a case 'V': that prints program_name + VERSION (from libvars.H) and exits cleanly.

{
switch (c)
Expand Down Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion utils/Test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
Expand Down Expand Up @@ -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})
Expand Down
Loading
Loading