From bcce926ed6f7b737100be2d40a8f43846c503d36 Mon Sep 17 00:00:00 2001 From: Ryker Fish Date: Tue, 31 Mar 2026 16:35:26 -0600 Subject: [PATCH 1/2] remove the triply periodic FCM from DPStokes interface --- solvers/DPStokes/extra/uammd_interface.h | 4 +- solvers/DPStokes/extra/uammd_wrapper.cu | 56 ++++-------------------- 2 files changed, 10 insertions(+), 50 deletions(-) diff --git a/solvers/DPStokes/extra/uammd_interface.h b/solvers/DPStokes/extra/uammd_interface.h index 11393208..9b4768e2 100644 --- a/solvers/DPStokes/extra/uammd_interface.h +++ b/solvers/DPStokes/extra/uammd_interface.h @@ -20,8 +20,6 @@ std::string getPrecision(); struct PyParameters { // The number of cells in each direction - // If -1, they will be autocomputed from the tolerance if possible (DP cannot - // do it, FCM can) int nx = -1; int ny = -1; int nz = -1; @@ -29,7 +27,7 @@ struct PyParameters { real Lx; real Ly; real zmin, zmax; - // Tolerance will be ignored in DP mode, TP will use only tolerance and nxy/nz + // Tolerance will be ignored in DP mode real tolerance = 1e-5; real delta = 1e-3; // RFD step size real w, w_d; diff --git a/solvers/DPStokes/extra/uammd_wrapper.cu b/solvers/DPStokes/extra/uammd_wrapper.cu index b18cf075..00667be6 100644 --- a/solvers/DPStokes/extra/uammd_wrapper.cu +++ b/solvers/DPStokes/extra/uammd_wrapper.cu @@ -1,5 +1,5 @@ /* Raul P. Pelaez 2021. Doubly Periodic Stokes UAMMD wrapper - Allows to call the DPStokes or TP FCM modules from via a simple contained + Allows to call the DPStokes module from via a simple contained class to compute the product between the mobility tensor and a list forces and torques acting on a group of positions. @@ -9,14 +9,10 @@ */ #include // Doubly Periodic FCM implementation (currently without noise) -#include -// Triply Periodic FCM implementation #include "uammd_interface.h" -#include +#include // Some convenient aliases namespace uammd_dpstokes { -using FCM_BM = uammd::BDHI::FCM_ns::Kernels::BarnettMagland; -using FCM = uammd::BDHI::FCM_impl; using DPStokesSlab = uammd::DPStokesSlab_ns::DPStokes; using uammd::System; using uammd::DPStokesSlab_ns::WallMode; @@ -45,24 +41,6 @@ struct Real3ToReal4SubstractOriginZ { } }; -auto createFCMParameters(PyParameters pypar) { - FCM::Parameters par; - par.temperature = - 0; // FCM can compute fluctuations, but they are turned off here - par.viscosity = pypar.viscosity; - par.tolerance = pypar.tolerance; - par.box = uammd::Box({pypar.Lx, pypar.Ly, pypar.zmax - pypar.zmin}); - par.cells = {pypar.nx, pypar.ny, pypar.nz}; - par.kernel = - std::make_shared(pypar.w, pypar.alpha, - pypar.beta.x, // TODO beta parameter may need to - // be adjusted for non-square? - pypar.Lx / pypar.nx); - par.kernelTorque = std::make_shared( - pypar.w_d, pypar.alpha_d, pypar.beta_d.x, pypar.Lx / pypar.nx); - return par; -} - WallMode stringToWallMode(std::string str) { if (str.compare("nowall") == 0) { return WallMode::none; @@ -100,24 +78,14 @@ private: const uammd::real4 *d_force, const uammd::real4 *d_torques, int numberParticles, cudaStream_t st) { - if (fcm) { - return fcm->computeHydrodynamicDisplacements( - (uammd::real4 *)(d_pos), (uammd::real4 *)(d_force), - (uammd::real4 *)(d_torques), numberParticles, 0.0, 0.0, st); - } else if (dpstokes) { - return dpstokes->Mdot(reinterpret_cast(d_pos), - reinterpret_cast(d_force), - reinterpret_cast(d_torques), - numberParticles, st); - } else { - throw std::runtime_error("DPStokesUAMMD: No DPStokes or FCM module " - "initialized. This should not had happened"); - } + return dpstokes->Mdot(reinterpret_cast(d_pos), + reinterpret_cast(d_force), + reinterpret_cast(d_torques), + numberParticles, st); } public: std::shared_ptr dpstokes; - std::shared_ptr fcm; cudaStream_t st; thrust::device_vector tmp3; thrust::device_vector force4; @@ -127,15 +95,9 @@ public: real zOrigin; DPStokesUAMMD(PyParameters pypar) { - if (pypar.mode.compare("periodic") == 0) { - auto par = createFCMParameters(pypar); - this->fcm = std::make_shared(par); - zOrigin = 0; - } else { - auto par = createDPStokesParameters(pypar); - this->dpstokes = std::make_shared(par); - zOrigin = pypar.zmin + par.H * 0.5; - } + auto par = createDPStokesParameters(pypar); + this->dpstokes = std::make_shared(par); + zOrigin = pypar.zmin + par.H * 0.5; CudaSafeCall(cudaStreamCreate(&st)); } From e14aa2d515bfb0f8244af8727d08f7dccca2454b Mon Sep 17 00:00:00 2001 From: Ryker Fish Date: Tue, 31 Mar 2026 16:36:54 -0600 Subject: [PATCH 2/2] restrict cuda version --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 8f47f086..43728536 100644 --- a/environment.yml +++ b/environment.yml @@ -5,7 +5,7 @@ channels: dependencies: - python <3.13 - cmake >=3.24 - - cuda-version + - cuda-version <= 13.1 - gxx >9,<15 - cuda-libraries-dev - cuda-nvcc