|
5 | 5 | #include <nanobind/stl/optional.h> |
6 | 6 |
|
7 | 7 | static const char *docstringSetParameters = R"pbdoc( |
8 | | - Set the parameters for the NBody solver. |
| 8 | +Set the parameters for the NBody solver. |
9 | 9 |
|
10 | | - Parameters |
11 | | - ---------- |
12 | | - algorithm : str |
13 | | - The algorithm to use. Options are "naive", "fast", "block" and "advise". Default is "advise". |
14 | | - NBatch : int |
15 | | - The number of batches to use. If -1 (default), the number of batches is automatically determined. |
16 | | - NperBatch : int |
17 | | - The number of particles per batch. If -1 (default), the number of particles per batch is automatically determined. |
18 | | - wallHeight : float |
19 | | - The height of the wall. Only valid if periodicityZ is single_wall. |
20 | | - )pbdoc"; |
| 10 | +Parameters |
| 11 | +---------- |
| 12 | +algorithm : str |
| 13 | + The algorithm to use. Options are "naive", "fast", "block" and "advise". Default is "advise". |
| 14 | +NBatch : int |
| 15 | + The number of batches to use. If -1 (default), the number of batches is automatically determined. |
| 16 | +NperBatch : int |
| 17 | + The number of particles per batch. If -1 (default), the number of particles per batch is automatically determined. |
| 18 | +wallHeight : float |
| 19 | + The height of the wall. Only valid if periodicityZ is single_wall. |
| 20 | +delta : float |
| 21 | + The finite difference step size for random finite differences. Specified in units of hydrodynamicRadius. Default is 1e-3. |
| 22 | +)pbdoc"; |
21 | 23 |
|
22 | 24 | static const char *docstring = R"pbdoc( |
23 | 25 | This module computes hydrodynamic interactions using an :math:`O(N^2)` algorithm. |
@@ -50,10 +52,10 @@ MOBILITY_PYTHONIFY_WITH_EXTRA_CODE( |
50 | 52 | solver.def( |
51 | 53 | "setParameters", |
52 | 54 | [](NBody &myself, std::string algo, int NBatch, int NperBatch, |
53 | | - std::optional<real> wallHeight) { |
| 55 | + std::optional<real> wallHeight, real delta) { |
54 | 56 | myself.setParametersNBody({nbody_rpy::string2NBodyAlgorithm(algo), |
55 | | - NBatch, NperBatch, wallHeight}); |
| 57 | + NBatch, NperBatch, wallHeight, delta}); |
56 | 58 | }, |
57 | 59 | docstringSetParameters, "algorithm"_a = "advise", "Nbatch"_a = -1, |
58 | | - "NperBatch"_a = -1, "wallHeight"_a = std::nullopt); |
| 60 | + "NperBatch"_a = -1, "wallHeight"_a = std::nullopt, "delta"_a = 1e-3); |
59 | 61 | , docstring); |
0 commit comments