diff --git a/doc/sphinx/system_setup.rst b/doc/sphinx/system_setup.rst index 84f9569606d..7a260284b25 100644 --- a/doc/sphinx/system_setup.rst +++ b/doc/sphinx/system_setup.rst @@ -120,21 +120,21 @@ Details about the cell system can be obtained by :meth:`espressomd.system.System * ``type`` The current type of the cell system. * ``verlet_reuse`` Average number of integration steps the Verlet list is re-used. -.. _Domain decomposition: +.. _Regular decomposition: -Domain decomposition -~~~~~~~~~~~~~~~~~~~~ +Regular decomposition +~~~~~~~~~~~~~~~~~~~~~ -Invoking :py:meth:`~espressomd.cellsystem.CellSystem.set_domain_decomposition` -selects the domain decomposition cell scheme, using Verlet lists +Invoking :py:meth:`~espressomd.cellsystem.CellSystem.set_regular_decomposition` +selects the regular decomposition cell scheme, using Verlet lists for the calculation of the interactions. If you specify ``use_verlet_lists=False``, only the -domain decomposition is used, but not the Verlet lists. :: +regular decomposition is used, but not the Verlet lists. :: system = espressomd.System(box_l=[1, 1, 1]) - system.cell_system.set_domain_decomposition(use_verlet_lists=True) + system.cell_system.set_regular_decomposition(use_verlet_lists=True) -The domain decomposition cellsystem is the default system and suits most +The regular decomposition cellsystem is the default system and suits most applications with short ranged interactions. The particles are divided up spatially into small compartments, the cells, such that the cell size is larger than the maximal interaction range. In this case interactions diff --git a/doc/sphinx/under_the_hood.rst b/doc/sphinx/under_the_hood.rst index b8e2804397f..f841946de52 100644 --- a/doc/sphinx/under_the_hood.rst +++ b/doc/sphinx/under_the_hood.rst @@ -27,7 +27,7 @@ how they are distributed onto the processor nodes and how they are organized on each of them. Moreover a cell system also defines procedures to efficiently calculate the force, energy and pressure for the short ranged interactions, since these can be heavily optimized -depending on the cell system. For example, the domain decomposition +depending on the cell system. For example, the regular decomposition cellsystem allows an order N interactions evaluation. Technically, a cell is organized as a dynamically growing array, not as @@ -41,7 +41,7 @@ without direct knowledge of the currently used cell system. Only the force, energy and pressure loops are implemented separately for each cell model as explained above. -The domain decomposition or link cell algorithm is implemented such +The regular decomposition or link cell algorithm is implemented such that the cells equal the cells, i.e. each cell is a separate particle list. For an example let us assume that the simulation box has size :math:`20\times 20\times 20` and that we assign 2 processors to the @@ -108,7 +108,7 @@ memory organization of |es|, the particles are accessed in a virtually linear order. Because the force calculation goes through the cells in a linear fashion, all accesses to a single cell occur close in time, for the force calculation of the cell itself as well as for its neighbors. -Using the domain decomposition cell scheme, two cell layers have to be +Using the regular decomposition cell scheme, two cell layers have to be kept in the processor cache. For 10000 particles and a typical cell grid size of 20, these two cell layers consume roughly 200 KBytes, which nearly fits into the L2 cache. Therefore every cell has to be read from diff --git a/doc/tutorials/constant_pH/constant_pH.ipynb b/doc/tutorials/constant_pH/constant_pH.ipynb index 0c8724d48ed..86f6b36268c 100644 --- a/doc/tutorials/constant_pH/constant_pH.ipynb +++ b/doc/tutorials/constant_pH/constant_pH.ipynb @@ -503,7 +503,7 @@ "After the initial relaxation we set the electrostatic interactions between the particles if it has been enabled via the `USE_ELECTROSTATICS` flag. For electrostatics can use either the Debye-Hückel `DH` algorithm or the `P3M` algorithm. The `DH` algorithm is based on the Debye-Hückel approximation, the assumptions of which are not satisfied in our simulated system. However, it runs much faster than the `P3M` algorithm, and the approximate result closely resembles the correct one. Therefore, the `DH` algorithm should not be used in production simulations. By using the `DH` algorithm in this tutorial, we sacrifice the accuracy for speed.\n", "To obtain an accurate result, we can use the `P3M` algorithm using `accuracy` of $10^{-3}$ as an acceptable tradeoff between accuracy and performance. For production runs it might be necessary to use a lower value of `accuracy`, depending on the simulated system.\n", "\n", - "By default, ESPResSo uses the domain decomposition cell system to speed up the calculation of short-range interactions. However, for a system with small number of particles and without electrostatics, it runs faster with `n_square` cell system. See the [user guide](https://espressomd.github.io/doc/system_setup.html#n-squared) for additional details on the cell systems." + "By default, ESPResSo uses the regular decomposition cell system to speed up the calculation of short-range interactions. However, for a system with small number of particles and without electrostatics, it runs faster with `n_square` cell system. See the [user guide](https://espressomd.github.io/doc/system_setup.html#n-squared) for additional details on the cell systems." ] }, { diff --git a/maintainer/benchmarks/p3m.py b/maintainer/benchmarks/p3m.py index 78a825c50fe..262cc675dae 100644 --- a/maintainer/benchmarks/p3m.py +++ b/maintainer/benchmarks/p3m.py @@ -87,7 +87,7 @@ # System ############################################################# system.box_l = 3 * (box_l,) -system.cell_system.set_domain_decomposition(use_verlet_lists=True) +system.cell_system.set_regular_decomposition(use_verlet_lists=True) # Integration parameters ############################################################# diff --git a/samples/chamber_game.py b/samples/chamber_game.py index 3a192fac16b..63621e72ad2 100644 --- a/samples/chamber_game.py +++ b/samples/chamber_game.py @@ -156,7 +156,7 @@ # CELLSYSTEM system.cell_system.skin = 3.0 -system.cell_system.set_domain_decomposition(use_verlet_lists=False) +system.cell_system.set_regular_decomposition(use_verlet_lists=False) # BONDS diff --git a/samples/visualization_cellsystem.py b/samples/visualization_cellsystem.py index 2eb015ddf44..c675088d88f 100644 --- a/samples/visualization_cellsystem.py +++ b/samples/visualization_cellsystem.py @@ -42,7 +42,7 @@ draw_cells=True) system.time_step = 0.0005 -system.cell_system.set_domain_decomposition(use_verlet_lists=True) +system.cell_system.set_regular_decomposition(use_verlet_lists=True) system.cell_system.skin = 0.4 #system.cell_system.node_grid = [i, j, k] diff --git a/samples/visualization_charged.py b/samples/visualization_charged.py index a3786933a1f..6375c2aac6d 100644 --- a/samples/visualization_charged.py +++ b/samples/visualization_charged.py @@ -29,7 +29,7 @@ box = [40, 40, 40] system = espressomd.System(box_l=box) -system.cell_system.set_domain_decomposition(use_verlet_lists=True) +system.cell_system.set_regular_decomposition(use_verlet_lists=True) visualizer = espressomd.visualization_opengl.openGLLive( system, background_color=[1, 1, 1], drag_enabled=True, drag_force=10) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 8a24cfe27f0..af41473123e 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -28,6 +28,7 @@ set(EspressoCore_SRC rotate_system.cpp rotation.cpp Observable_stat.cpp + RegularDecomposition.cpp RuntimeErrorCollector.cpp RuntimeError.cpp RuntimeErrorStream.cpp @@ -41,8 +42,7 @@ set(EspressoCore_SRC CellStructure.cpp PartCfg.cpp AtomDecomposition.cpp - EspressoSystemStandAlone.cpp - DomainDecomposition.cpp) + EspressoSystemStandAlone.cpp) if(CUDA) set(EspressoCuda_SRC diff --git a/src/core/CellStructure.cpp b/src/core/CellStructure.cpp index a1a5921ea39..94ff565c80a 100644 --- a/src/core/CellStructure.cpp +++ b/src/core/CellStructure.cpp @@ -22,7 +22,7 @@ #include "CellStructure.hpp" #include "AtomDecomposition.hpp" -#include "DomainDecomposition.hpp" +#include "RegularDecomposition.hpp" #include @@ -246,10 +246,10 @@ void CellStructure::set_atom_decomposition(boost::mpi::communicator const &comm, m_type = CELL_STRUCTURE_NSQUARE; } -void CellStructure::set_domain_decomposition( +void CellStructure::set_regular_decomposition( boost::mpi::communicator const &comm, double range, BoxGeometry const &box, LocalBox const &local_geo) { set_particle_decomposition( - std::make_unique(comm, range, box, local_geo)); - m_type = CELL_STRUCTURE_DOMDEC; + std::make_unique(comm, range, box, local_geo)); + m_type = CELL_STRUCTURE_REGULAR; } diff --git a/src/core/CellStructure.hpp b/src/core/CellStructure.hpp index d204154c5ca..1f6a8ad257a 100644 --- a/src/core/CellStructure.hpp +++ b/src/core/CellStructure.hpp @@ -50,8 +50,8 @@ /** Cell Structure */ enum CellStructureType : int { - /** cell structure domain decomposition */ - CELL_STRUCTURE_DOMDEC = 1, + /** cell structure regular decomposition */ + CELL_STRUCTURE_REGULAR = 1, /** cell structure n square */ CELL_STRUCTURE_NSQUARE = 2 }; @@ -503,16 +503,16 @@ struct CellStructure { BoxGeometry const &box); /** - * @brief Set the particle decomposition to DomainDecomposition. + * @brief Set the particle decomposition to RegularDecomposition. * * @param comm Cartesian communicator to use. * @param range Interaction range. * @param box Box Geometry * @param local_geo Geometry of the local box. */ - void set_domain_decomposition(boost::mpi::communicator const &comm, - double range, BoxGeometry const &box, - LocalBox const &local_geo); + void set_regular_decomposition(boost::mpi::communicator const &comm, + double range, BoxGeometry const &box, + LocalBox const &local_geo); public: template void bond_loop(BondKernel const &bond_kernel) { diff --git a/src/core/DomainDecomposition.cpp b/src/core/RegularDecomposition.cpp similarity index 91% rename from src/core/DomainDecomposition.cpp rename to src/core/RegularDecomposition.cpp index 9ebebd83198..322d585018a 100644 --- a/src/core/DomainDecomposition.cpp +++ b/src/core/RegularDecomposition.cpp @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -#include "DomainDecomposition.hpp" +#include "RegularDecomposition.hpp" #include "RuntimeErrorStream.hpp" #include "errorhandling.hpp" @@ -45,7 +45,7 @@ /** Returns pointer to the cell which corresponds to the position if the * position is in the nodes spatial domain otherwise a nullptr pointer. */ -Cell *DomainDecomposition::position_to_cell(const Utils::Vector3d &pos) { +Cell *RegularDecomposition::position_to_cell(const Utils::Vector3d &pos) { Utils::Vector3i cpos; for (int i = 0; i < 3; i++) { @@ -76,7 +76,7 @@ Cell *DomainDecomposition::position_to_cell(const Utils::Vector3d &pos) { return &(cells.at(ind)); } -void DomainDecomposition::move_if_local( +void RegularDecomposition::move_if_local( ParticleList &src, ParticleList &rest, std::vector &modified_cells) { for (auto &part : src) { @@ -93,10 +93,10 @@ void DomainDecomposition::move_if_local( src.clear(); } -void DomainDecomposition::move_left_or_right(ParticleList &src, - ParticleList &left, - ParticleList &right, - int dir) const { +void RegularDecomposition::move_left_or_right(ParticleList &src, + ParticleList &left, + ParticleList &right, + int dir) const { for (auto it = src.begin(); it != src.end();) { if ((m_box.get_mi_coord(it->r.p[dir], m_local_box.my_left()[dir], dir) < 0.0) and @@ -115,7 +115,7 @@ void DomainDecomposition::move_left_or_right(ParticleList &src, } } -void DomainDecomposition::exchange_neighbors( +void RegularDecomposition::exchange_neighbors( ParticleList &pl, std::vector &modified_cells) { auto const node_neighbors = Utils::Mpi::cart_neighbors<3>(m_comm); static ParticleList send_buf_l, send_buf_r, recv_buf_l, recv_buf_r; @@ -168,8 +168,8 @@ void fold_and_reset(Particle &p, BoxGeometry const &box_geo) { } } // namespace -void DomainDecomposition::resort(bool global, - std::vector &diff) { +void RegularDecomposition::resort(bool global, + std::vector &diff) { ParticleList displaced_parts; for (auto &c : local_cells()) { @@ -234,7 +234,7 @@ void DomainDecomposition::resort(bool global, } } -void DomainDecomposition::mark_cells() { +void RegularDecomposition::mark_cells() { m_local_cells.clear(); m_ghost_cells.clear(); @@ -250,9 +250,9 @@ void DomainDecomposition::mark_cells() { } } -void DomainDecomposition::fill_comm_cell_lists(ParticleList **part_lists, - const Utils::Vector3i &lc, - const Utils::Vector3i &hc) { +void RegularDecomposition::fill_comm_cell_lists(ParticleList **part_lists, + const Utils::Vector3i &lc, + const Utils::Vector3i &hc) { for (int o = lc[0]; o <= hc[0]; o++) for (int n = lc[1]; n <= hc[1]; n++) for (int m = lc[2]; m <= hc[2]; m++) { @@ -261,7 +261,7 @@ void DomainDecomposition::fill_comm_cell_lists(ParticleList **part_lists, *part_lists++ = &(cells.at(i).particles()); } } -Utils::Vector3d DomainDecomposition::max_cutoff() const { +Utils::Vector3d RegularDecomposition::max_cutoff() const { auto dir_max_range = [this](int i) { return std::min(0.5 * m_box.length()[i], m_local_box.length()[i]); }; @@ -269,8 +269,8 @@ Utils::Vector3d DomainDecomposition::max_cutoff() const { return {dir_max_range(0), dir_max_range(1), dir_max_range(2)}; } -Utils::Vector3d DomainDecomposition::max_range() const { return cell_size; } -int DomainDecomposition::calc_processor_min_num_cells() const { +Utils::Vector3d RegularDecomposition::max_range() const { return cell_size; } +int RegularDecomposition::calc_processor_min_num_cells() const { /* the minimal number of cells can be lower if there are at least two nodes serving a direction, since this also ensures that the cell size is at most half the box @@ -282,7 +282,7 @@ int DomainDecomposition::calc_processor_min_num_cells() const { }); } -void DomainDecomposition::create_cell_grid(double range) { +void RegularDecomposition::create_cell_grid(double range) { auto const cart_info = Utils::Mpi::cart_get<3>(m_comm); int n_local_cells; @@ -300,7 +300,7 @@ void DomainDecomposition::create_cell_grid(double range) { /* Calculate initial cell grid */ auto const &local_box_l = m_local_box.length(); auto const volume = Utils::product(local_box_l); - auto const scale = std::cbrt(DomainDecomposition::max_num_cells / volume); + auto const scale = std::cbrt(RegularDecomposition::max_num_cells / volume); for (int i = 0; i < 3; i++) { /* this is at least 1 */ @@ -328,7 +328,7 @@ void DomainDecomposition::create_cell_grid(double range) { n_local_cells = Utils::product(cell_grid); /* done */ - if (n_local_cells <= DomainDecomposition::max_num_cells) + if (n_local_cells <= RegularDecomposition::max_num_cells) break; /* find coordinate with the smallest cell range */ @@ -355,7 +355,7 @@ void DomainDecomposition::create_cell_grid(double range) { } } - if (n_local_cells > DomainDecomposition::max_num_cells) { + if (n_local_cells > RegularDecomposition::max_num_cells) { runtimeErrorMsg() << "no suitable cell grid found"; } @@ -378,7 +378,7 @@ void DomainDecomposition::create_cell_grid(double range) { m_ghost_cells.resize(new_cells - n_local_cells); } -void DomainDecomposition::init_cell_interactions() { +void RegularDecomposition::init_cell_interactions() { /* loop all local cells */ for (int o = 1; o < cell_grid[2] + 1; o++) for (int n = 1; n < cell_grid[1] + 1; n++) @@ -457,7 +457,7 @@ Utils::Vector3d shift(BoxGeometry const &box, LocalBox const &local_box, } } // namespace -GhostCommunicator DomainDecomposition::prepare_comm() { +GhostCommunicator RegularDecomposition::prepare_comm() { int dir, lr, i, cnt, n_comm_cells[3]; Utils::Vector3i lc{}, hc{}, done{}; @@ -560,12 +560,12 @@ GhostCommunicator DomainDecomposition::prepare_comm() { return ghost_comm; } -DomainDecomposition::DomainDecomposition(boost::mpi::communicator comm, - double range, - const BoxGeometry &box_geo, - const LocalBox &local_geo) +RegularDecomposition::RegularDecomposition(boost::mpi::communicator comm, + double range, + const BoxGeometry &box_geo, + const LocalBox &local_geo) : m_comm(std::move(comm)), m_box(box_geo), m_local_box(local_geo) { - /* set up new domain decomposition cell structure */ + /* set up new regular decomposition cell structure */ create_cell_grid(range); /* setup cell neighbors */ diff --git a/src/core/DomainDecomposition.hpp b/src/core/RegularDecomposition.hpp similarity index 91% rename from src/core/DomainDecomposition.hpp rename to src/core/RegularDecomposition.hpp index ee6cc1e18c8..765d4ffbeaf 100644 --- a/src/core/DomainDecomposition.hpp +++ b/src/core/RegularDecomposition.hpp @@ -19,8 +19,8 @@ * along with this program. If not, see . */ -#ifndef ESPRESSO_DOMAIN_DECOMPOSITION_HPP -#define ESPRESSO_DOMAIN_DECOMPOSITION_HPP +#ifndef ESPRESSO_REGULAR_DECOMPOSITION_HPP +#define ESPRESSO_REGULAR_DECOMPOSITION_HPP #include "ParticleDecomposition.hpp" @@ -40,13 +40,13 @@ #include /** @brief Structure containing the information about the cell grid used for - * domain decomposition. + * regular decomposition. * * The domain of a node is split into a 3D cell grid with dimension * cell_grid. Together with one ghost cell * layer on each side the overall dimension of the ghost cell grid is - * ghost_cell_grid. The domain - * decomposition enables one the use of the linked cell algorithm + * ghost_cell_grid. The regular + * decomposition enables the use of the linked cell algorithm * which is in turn used for setting up the Verlet list for the * system. You can see a 2D graphical representation of the linked * cell grid below. @@ -65,7 +65,7 @@ * some ghost-ghost cell interaction as well, which we do not need! * */ -struct DomainDecomposition : public ParticleDecomposition { +struct RegularDecomposition : public ParticleDecomposition { /** Grid dimensions per node. */ Utils::Vector3i cell_grid = {}; /** Cell size. */ @@ -74,7 +74,7 @@ struct DomainDecomposition : public ParticleDecomposition { Utils::Vector3i cell_offset = {}; /** linked cell grid with ghost frame. */ Utils::Vector3i ghost_cell_grid = {}; - /** inverse cell size = \see DomainDecomposition::cell_size ^ -1. */ + /** inverse cell size = \see RegularDecomposition::cell_size ^ -1. */ Utils::Vector3d inv_cell_size = {}; boost::mpi::communicator m_comm; @@ -87,9 +87,9 @@ struct DomainDecomposition : public ParticleDecomposition { GhostCommunicator m_collect_ghost_force_comm; public: - DomainDecomposition(boost::mpi::communicator comm, double range, - const BoxGeometry &box_geo, - const LocalBox &local_geo); + RegularDecomposition(boost::mpi::communicator comm, double range, + const BoxGeometry &box_geo, + const LocalBox &local_geo); GhostCommunicator const &exchange_ghosts_comm() const override { return m_exchange_ghosts_comm; @@ -118,7 +118,7 @@ struct DomainDecomposition : public ParticleDecomposition { } private: - /** Fill @c m_local_cells list and @c m_ghost_cells list for use with domain + /** Fill @c m_local_cells list and @c m_ghost_cells list for use with regular * decomposition. */ void mark_cells(); @@ -196,14 +196,14 @@ struct DomainDecomposition : public ParticleDecomposition { */ void create_cell_grid(double range); - /** Init cell interactions for cell system domain decomposition. + /** Init cell interactions for cell system regular decomposition. * Initializes the interacting neighbor cell list of a cell. * This list of interacting neighbor cells is used by the Verlet * algorithm. */ void init_cell_interactions(); - /** Create communicators for cell structure domain decomposition (see \ref + /** Create communicators for cell structure regular decomposition (see \ref * GhostCommunicator). */ GhostCommunicator prepare_comm(); diff --git a/src/core/cells.cpp b/src/core/cells.cpp index ffc74396290..753d7d09832 100644 --- a/src/core/cells.cpp +++ b/src/core/cells.cpp @@ -34,8 +34,8 @@ #include "integrate.hpp" #include "particle_data.hpp" -#include "DomainDecomposition.hpp" #include "ParticleDecomposition.hpp" +#include "RegularDecomposition.hpp" #include #include @@ -197,9 +197,9 @@ std::vector mpi_resort_particles(int global_flag) { void cells_re_init(int new_cs) { switch (new_cs) { - case CELL_STRUCTURE_DOMDEC: - cell_structure.set_domain_decomposition(comm_cart, interaction_range(), - box_geo, local_geo); + case CELL_STRUCTURE_REGULAR: + cell_structure.set_regular_decomposition(comm_cart, interaction_range(), + box_geo, local_geo); break; case CELL_STRUCTURE_NSQUARE: cell_structure.set_atom_decomposition(comm_cart, box_geo); @@ -263,8 +263,8 @@ Cell *find_current_cell(const Particle &p) { return cell_structure.find_current_cell(p); } -const DomainDecomposition *get_domain_decomposition() { - return &dynamic_cast( +const RegularDecomposition *get_regular_decomposition() { + return &dynamic_cast( Utils::as_const(cell_structure).decomposition()); } diff --git a/src/core/cells.hpp b/src/core/cells.hpp index 8b9abd36936..01c049cad2c 100644 --- a/src/core/cells.hpp +++ b/src/core/cells.hpp @@ -29,8 +29,8 @@ * (regardless if they reside on the same or different nodes) * interact with each other. The following cell systems are implemented: * - * - domain decomposition: The simulation box is divided spatially - * into cells (see \ref DomainDecomposition.hpp). This is suitable for + * - regular decomposition: The simulation box is divided spatially + * into cells (see \ref RegularDecomposition.hpp). This is suitable for * short range interactions. * - nsquare: The particles are distributed equally on all nodes * regardless their spatial position (see \ref AtomDecomposition.hpp). @@ -40,8 +40,8 @@ #include "Cell.hpp" #include "CellStructure.hpp" -#include "DomainDecomposition.hpp" #include "Particle.hpp" +#include "RegularDecomposition.hpp" #include #include @@ -121,11 +121,11 @@ std::vector mpi_resort_particles(int global_flag); Cell *find_current_cell(const Particle &p); /** - * @brief Return a pointer to the global DomainDecomposition. + * @brief Return a pointer to the global RegularDecomposition. * * @return Pointer to the decomposition if it is set, nullptr otherwise. */ -const DomainDecomposition *get_domain_decomposition(); +const RegularDecomposition *get_regular_decomposition(); class PairInfo { public: diff --git a/src/core/electrostatics_magnetostatics/fft.cpp b/src/core/electrostatics_magnetostatics/fft.cpp index 7b47ba9b9f1..9d386502113 100644 --- a/src/core/electrostatics_magnetostatics/fft.cpp +++ b/src/core/electrostatics_magnetostatics/fft.cpp @@ -63,7 +63,7 @@ using Utils::permute_ifield; namespace { /** This ugly function does the bookkeeping: which nodes have to * communicate to each other, when you change the node grid. - * Changing the domain decomposition requires communication. This + * Changing the regular decomposition requires communication. This * function finds (hopefully) the best way to do this. As input it * needs the two grids (@p grid1, @p grid2) and a linear list (@p node_list1) * with the node identities for @p grid1. The linear list (@p node_list2) @@ -415,8 +415,8 @@ void back_grid_comm(fft_forw_plan plan_f, fft_back_plan plan_b, } /** Calculate 'best' mapping between a 2D and 3D grid. - * Required for the communication from 3D domain decomposition - * to 2D row decomposition. + * Required for the communication from 3D regular domain + * decomposition to 2D regular row decomposition. * The dimensions of the 2D grid are resorted, if necessary, in a way * that they are multiples of the 3D grid dimensions. * \param g3d 3D grid. diff --git a/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp b/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp index 72e79a9737e..44fba840d01 100644 --- a/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp +++ b/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp @@ -1421,8 +1421,8 @@ bool dp3m_sanity_checks(const Utils::Vector3i &grid) { ret = true; } - if (cell_structure.decomposition_type() != CELL_STRUCTURE_DOMDEC) { - runtimeErrorMsg() << "dipolar P3M requires the domain decomposition " + if (cell_structure.decomposition_type() != CELL_STRUCTURE_REGULAR) { + runtimeErrorMsg() << "dipolar P3M requires the regular decomposition " "cell system"; ret = true; } diff --git a/src/core/electrostatics_magnetostatics/p3m.cpp b/src/core/electrostatics_magnetostatics/p3m.cpp index d6c03feafb9..f6112bbe37b 100644 --- a/src/core/electrostatics_magnetostatics/p3m.cpp +++ b/src/core/electrostatics_magnetostatics/p3m.cpp @@ -1286,8 +1286,8 @@ bool p3m_sanity_checks_system(const Utils::Vector3i &grid) { ret = true; } - if (cell_structure.decomposition_type() != CELL_STRUCTURE_DOMDEC) { - runtimeErrorMsg() << "P3M requires the domain decomposition cell system"; + if (cell_structure.decomposition_type() != CELL_STRUCTURE_REGULAR) { + runtimeErrorMsg() << "P3M requires the regular decomposition cell system"; ret = true; } diff --git a/src/core/event.cpp b/src/core/event.cpp index 883818372fd..2d11b5aa7b8 100644 --- a/src/core/event.cpp +++ b/src/core/event.cpp @@ -89,8 +89,8 @@ void on_program_start() { init_node_grid(); - /* initially go for domain decomposition */ - cells_re_init(CELL_STRUCTURE_DOMDEC); + /* initially go for regular decomposition */ + cells_re_init(CELL_STRUCTURE_REGULAR); if (this_node == 0) { /* make sure interaction 0<->0 always exists */ diff --git a/src/core/grid_based_algorithms/lb.cpp b/src/core/grid_based_algorithms/lb.cpp index 1b8faabb162..cc1749da82c 100644 --- a/src/core/grid_based_algorithms/lb.cpp +++ b/src/core/grid_based_algorithms/lb.cpp @@ -613,8 +613,8 @@ void lb_sanity_checks(const LB_Parameters &lb_parameters) { if (lb_parameters.viscosity <= 0.0) { runtimeErrorMsg() << "Lattice Boltzmann fluid viscosity not set"; } - if (cell_structure.decomposition_type() != CELL_STRUCTURE_DOMDEC) { - runtimeErrorMsg() << "LB requires domain-decomposition cellsystem"; + if (cell_structure.decomposition_type() != CELL_STRUCTURE_REGULAR) { + runtimeErrorMsg() << "LB requires regular-decomposition cellsystem"; } } diff --git a/src/core/object-in-fluid/oif_global_forces.hpp b/src/core/object-in-fluid/oif_global_forces.hpp index a0177900607..5a44b31aa9f 100644 --- a/src/core/object-in-fluid/oif_global_forces.hpp +++ b/src/core/object-in-fluid/oif_global_forces.hpp @@ -33,7 +33,7 @@ * - calculates the global area and global volume for a cell before the forces * are handled * - MPI synchronization with all reduce - * - !!! loop over particles from domain_decomposition !!! + * - !!! loop over particles from regular_decomposition !!! */ Utils::Vector2d calc_oif_global(int molType, CellStructure &cs); diff --git a/src/python/espressomd/cellsystem.pxd b/src/python/espressomd/cellsystem.pxd index ecf56f006c8..26f5a477a4e 100644 --- a/src/python/espressomd/cellsystem.pxd +++ b/src/python/espressomd/cellsystem.pxd @@ -36,7 +36,7 @@ cdef extern from "communication.hpp": int n_nodes cdef extern from "cells.hpp": - int CELL_STRUCTURE_DOMDEC + int CELL_STRUCTURE_REGULAR int CELL_STRUCTURE_NSQUARE ctypedef struct CellStructure: @@ -45,7 +45,7 @@ cdef extern from "cells.hpp": CellStructure cell_structure - const DomainDecomposition * get_domain_decomposition() + const RegularDecomposition * get_regular_decomposition() vector[pair[int, int]] mpi_get_pairs(double distance) except + vector[pair[int, int]] mpi_get_pairs_of_types(double distance, vector[int] types) except + @@ -62,8 +62,8 @@ cdef extern from "integrate.hpp": void mpi_set_skin(double skin) double get_verlet_reuse() -cdef extern from "DomainDecomposition.hpp": - cppclass DomainDecomposition: +cdef extern from "RegularDecomposition.hpp": + cppclass RegularDecomposition: Vector3i cell_grid double cell_size[3] diff --git a/src/python/espressomd/cellsystem.pyx b/src/python/espressomd/cellsystem.pyx index 9291fb0acfd..baf1e9159ee 100644 --- a/src/python/espressomd/cellsystem.pyx +++ b/src/python/espressomd/cellsystem.pyx @@ -30,9 +30,9 @@ from .utils cimport Vector3i from .utils cimport check_type_or_throw_except, make_array_locked cdef class CellSystem: - def set_domain_decomposition(self, use_verlet_lists=True): + def set_regular_decomposition(self, use_verlet_lists=True): """ - Activates domain decomposition cell system. + Activates regular decomposition cell system. Parameters ---------- @@ -42,7 +42,7 @@ cdef class CellSystem: """ mpi_set_use_verlet_lists(use_verlet_lists) - mpi_bcast_cell_structure(CELL_STRUCTURE_DOMDEC) + mpi_bcast_cell_structure(CELL_STRUCTURE_REGULAR) handle_errors("Error while initializing the cell system.") return True @@ -66,12 +66,12 @@ cdef class CellSystem: def get_state(self): s = self.__getstate__() - if cell_structure.decomposition_type() == CELL_STRUCTURE_DOMDEC: - dd = get_domain_decomposition() + if cell_structure.decomposition_type() == CELL_STRUCTURE_REGULAR: + rd = get_regular_decomposition() s["cell_grid"] = np.array( - [dd.cell_grid[0], dd.cell_grid[1], dd.cell_grid[2]]) + [rd.cell_grid[0], rd.cell_grid[1], rd.cell_grid[2]]) s["cell_size"] = np.array( - [dd.cell_size[0], dd.cell_size[1], dd.cell_size[2]]) + [rd.cell_size[0], rd.cell_size[1], rd.cell_size[2]]) s["verlet_reuse"] = get_verlet_reuse() s["n_nodes"] = n_nodes @@ -81,8 +81,8 @@ cdef class CellSystem: def __getstate__(self): s = {"use_verlet_list": cell_structure.use_verlet_list} - if cell_structure.decomposition_type() == CELL_STRUCTURE_DOMDEC: - s["type"] = "domain_decomposition" + if cell_structure.decomposition_type() == CELL_STRUCTURE_REGULAR: + s["type"] = "regular_decomposition" if cell_structure.decomposition_type() == CELL_STRUCTURE_NSQUARE: s["type"] = "nsquare" @@ -94,8 +94,8 @@ cdef class CellSystem: self.skin = d['skin'] self.node_grid = d['node_grid'] if 'type' in d: - if d['type'] == "domain_decomposition": - self.set_domain_decomposition( + if d['type'] == "regular_decomposition": + self.set_regular_decomposition( use_verlet_lists=d['use_verlet_list']) elif d['type'] == "nsquare": self.set_n_square(use_verlet_lists=d['use_verlet_list']) diff --git a/testsuite/python/CMakeLists.txt b/testsuite/python/CMakeLists.txt index 492a642c719..98ad4076ee2 100644 --- a/testsuite/python/CMakeLists.txt +++ b/testsuite/python/CMakeLists.txt @@ -143,7 +143,7 @@ python_test(FILE nsquare.py MAX_NUM_PROC 4) python_test(FILE virtual_sites_relative.py MAX_NUM_PROC 2) python_test(FILE virtual_sites_tracers.py MAX_NUM_PROC 2) python_test(FILE virtual_sites_tracers_gpu.py MAX_NUM_PROC 2 LABELS gpu) -python_test(FILE domain_decomposition.py MAX_NUM_PROC 4) +python_test(FILE regular_decomposition.py MAX_NUM_PROC 4) python_test(FILE integrator_npt.py MAX_NUM_PROC 4) python_test(FILE integrator_npt_stats.py MAX_NUM_PROC 4 LABELS long) python_test(FILE integrator_steepest_descent.py MAX_NUM_PROC 4) diff --git a/testsuite/python/brownian_dynamics.py b/testsuite/python/brownian_dynamics.py index b8e25c149eb..bdc663f5bd7 100644 --- a/testsuite/python/brownian_dynamics.py +++ b/testsuite/python/brownian_dynamics.py @@ -26,7 +26,7 @@ class BrownianThermostat(ut.TestCase): """Test Brownian Dynamics""" system = espressomd.System(box_l=[1.0, 1.0, 1.0]) - system.cell_system.set_domain_decomposition(use_verlet_lists=True) + system.cell_system.set_regular_decomposition(use_verlet_lists=True) system.cell_system.skin = 0 system.periodicity = [0, 0, 0] diff --git a/testsuite/python/brownian_dynamics_stats.py b/testsuite/python/brownian_dynamics_stats.py index 470e48fdeaf..c614c17a7cc 100644 --- a/testsuite/python/brownian_dynamics_stats.py +++ b/testsuite/python/brownian_dynamics_stats.py @@ -30,7 +30,7 @@ class BrownianThermostat(ut.TestCase, thermostats_common.ThermostatsCommon): """Tests velocity distributions and diffusion for Brownian Dynamics""" system = espressomd.System(box_l=[1.0, 1.0, 1.0]) - system.cell_system.set_domain_decomposition(use_verlet_lists=True) + system.cell_system.set_regular_decomposition(use_verlet_lists=True) system.cell_system.skin = 0 system.periodicity = [0, 0, 0] diff --git a/testsuite/python/cellsystem.py b/testsuite/python/cellsystem.py index a5a2b5358f9..c7f4b72070a 100644 --- a/testsuite/python/cellsystem.py +++ b/testsuite/python/cellsystem.py @@ -30,14 +30,15 @@ def test_cell_system(self): self.system.cell_system.set_n_square(use_verlet_lists=False) s = self.system.cell_system.get_state() self.assertEqual([s['use_verlet_list'], s['type']], [0, "nsquare"]) - self.system.cell_system.set_domain_decomposition(use_verlet_lists=True) + self.system.cell_system.set_regular_decomposition( + use_verlet_lists=True) s = self.system.cell_system.get_state() self.assertEqual( - [s['use_verlet_list'], s['type']], [1, "domain_decomposition"]) + [s['use_verlet_list'], s['type']], [1, "regular_decomposition"]) @ut.skipIf(n_nodes == 1, "Skipping test: only runs for n_nodes >= 2") def test_node_grid(self): - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() for i in range(3): node_grid_ref = [1, 1, 1] node_grid_ref[i] = self.n_nodes diff --git a/testsuite/python/collision_detection.py b/testsuite/python/collision_detection.py index e1ef7838f25..8a5930c97a1 100644 --- a/testsuite/python/collision_detection.py +++ b/testsuite/python/collision_detection.py @@ -637,7 +637,7 @@ def test_bind_three_particles(self): system.part.add(id=4, pos=e) system.part.add(id=1, pos=b) - system.cell_system.set_domain_decomposition() + system.cell_system.set_regular_decomposition() system.integrator.run(1, recalc_forces=True) self.verify_triangle_binding(cutoff, system.bonded_inter[2], res) system.cell_system.set_n_square() diff --git a/testsuite/python/coulomb_mixed_periodicity.py b/testsuite/python/coulomb_mixed_periodicity.py index d5b276094ea..706f6774690 100644 --- a/testsuite/python/coulomb_mixed_periodicity.py +++ b/testsuite/python/coulomb_mixed_periodicity.py @@ -76,7 +76,7 @@ def test_elc(self): for p in self.system.part: assert p.pos[2] >= 0. and p.pos[2] <= 9., f'particle {p.id} in gap' - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.cell_system.node_grid = sorted( self.system.cell_system.node_grid, key=lambda x: -x) self.system.periodicity = [1, 1, 1] @@ -95,7 +95,7 @@ def test_elc(self): 'Skipping test: missing feature SCAFACOS or p2nfft method') def test_scafacos_p2nfft(self): self.system.periodicity = [1, 1, 0] - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() scafacos = espressomd.electrostatics.Scafacos( prefactor=1, diff --git a/testsuite/python/ek_eof_one_species.py b/testsuite/python/ek_eof_one_species.py index bc2aa3ed084..38af417e236 100644 --- a/testsuite/python/ek_eof_one_species.py +++ b/testsuite/python/ek_eof_one_species.py @@ -156,7 +156,7 @@ def bisection(): pntm = pnt0 + size else: sys.exit("Bisection method fails:\n" - "Tuning of domain boundaries may be required.") + "Tuning of regular boundaries may be required.") return pntm diff --git a/testsuite/python/elc_vs_analytic.py b/testsuite/python/elc_vs_analytic.py index 7805e8a26d6..333061ba6ad 100644 --- a/testsuite/python/elc_vs_analytic.py +++ b/testsuite/python/elc_vs_analytic.py @@ -54,7 +54,7 @@ def test_elc(self): q=-self.q[0]) self.system.box_l = [self.box_l, self.box_l, self.box_l + self.elc_gap] - self.system.cell_system.set_domain_decomposition( + self.system.cell_system.set_regular_decomposition( use_verlet_lists=True) self.system.periodicity = [1, 1, 1] p3m = espressomd.electrostatics.P3M(prefactor=self.prefactor, diff --git a/testsuite/python/langevin_thermostat.py b/testsuite/python/langevin_thermostat.py index 86f19538ab6..ed931f8ccbb 100644 --- a/testsuite/python/langevin_thermostat.py +++ b/testsuite/python/langevin_thermostat.py @@ -26,7 +26,7 @@ class LangevinThermostat(ut.TestCase): """Test Langevin Dynamics""" system = espressomd.System(box_l=[1.0, 1.0, 1.0]) - system.cell_system.set_domain_decomposition(use_verlet_lists=True) + system.cell_system.set_regular_decomposition(use_verlet_lists=True) system.cell_system.skin = 0 system.periodicity = [0, 0, 0] diff --git a/testsuite/python/langevin_thermostat_stats.py b/testsuite/python/langevin_thermostat_stats.py index 604ef46f7a9..6a865bca844 100644 --- a/testsuite/python/langevin_thermostat_stats.py +++ b/testsuite/python/langevin_thermostat_stats.py @@ -30,7 +30,7 @@ class LangevinThermostat(ut.TestCase, thermostats_common.ThermostatsCommon): """Tests velocity distributions and diffusion for Langevin Dynamics""" system = espressomd.System(box_l=[1.0, 1.0, 1.0]) - system.cell_system.set_domain_decomposition(use_verlet_lists=True) + system.cell_system.set_regular_decomposition(use_verlet_lists=True) system.cell_system.skin = 0 system.periodicity = [0, 0, 0] diff --git a/testsuite/python/lj.py b/testsuite/python/lj.py index 9631323c22c..aaa6ad46e52 100644 --- a/testsuite/python/lj.py +++ b/testsuite/python/lj.py @@ -54,14 +54,15 @@ def check(self): self.assertLess(max_deviation, 1e-5) def test_dd(self): - self.system.cell_system.set_domain_decomposition( + self.system.cell_system.set_regular_decomposition( use_verlet_lists=False) self.system.integrator.run(recalc_forces=True, steps=0) self.check() def test_dd_vl(self): - self.system.cell_system.set_domain_decomposition(use_verlet_lists=True) + self.system.cell_system.set_regular_decomposition( + use_verlet_lists=True) # Build VL and calc ia self.system.integrator.run(recalc_forces=True, steps=0) diff --git a/testsuite/python/mass-and-rinertia_per_particle.py b/testsuite/python/mass-and-rinertia_per_particle.py index d3c1d7c5b34..89fea0d1f63 100644 --- a/testsuite/python/mass-and-rinertia_per_particle.py +++ b/testsuite/python/mass-and-rinertia_per_particle.py @@ -60,7 +60,7 @@ class ThermoTest(ut.TestCase): @classmethod def setUpClass(cls): np.random.seed(seed=15) - cls.system.cell_system.set_domain_decomposition(use_verlet_lists=True) + cls.system.cell_system.set_regular_decomposition(use_verlet_lists=True) cls.system.cell_system.skin = 5.0 def setUp(self): diff --git a/testsuite/python/mmm1d.py b/testsuite/python/mmm1d.py index 2c66dd9c83f..a63c56afa09 100644 --- a/testsuite/python/mmm1d.py +++ b/testsuite/python/mmm1d.py @@ -114,7 +114,7 @@ def test_exceptions(self): if self.MMM1D is espressomd.electrostatics.MMM1D: with self.assertRaisesRegex(Exception, "MMM1D requires the N-square cellsystem"): mmm1d = self.MMM1D(prefactor=1.0, maxPWerror=1e-2) - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.actors.add(mmm1d) self.system.cell_system.set_n_square() self.system.actors.clear() diff --git a/testsuite/python/p3m_tuning_exceptions.py b/testsuite/python/p3m_tuning_exceptions.py index 52c1b8e97ba..85e9c2b7a3b 100644 --- a/testsuite/python/p3m_tuning_exceptions.py +++ b/testsuite/python/p3m_tuning_exceptions.py @@ -210,10 +210,10 @@ def test_04_invalid_params_p3m_cpu(self): self.system.periodicity = (1, 1, 1) # check cell system exceptions - with self.assertRaisesRegex(Exception, "P3M requires the domain decomposition cell system"): + with self.assertRaisesRegex(Exception, "P3M requires the regular decomposition cell system"): self.system.cell_system.set_n_square() self.system.analysis.energy() - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.actors.clear() @utx.skipIfMissingGPU() @@ -259,10 +259,10 @@ def test_04_invalid_params_dp3m_cpu(self): self.system.periodicity = (1, 1, 1) # check cell system exceptions - with self.assertRaisesRegex(Exception, "dipolar P3M requires the domain decomposition cell system"): + with self.assertRaisesRegex(Exception, "dipolar P3M requires the regular decomposition cell system"): self.system.cell_system.set_n_square() self.system.analysis.energy() - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.actors.clear() @utx.skipIfMissingFeatures("P3M") diff --git a/testsuite/python/pairs.py b/testsuite/python/pairs.py index 8f032b50f3b..a466936980d 100644 --- a/testsuite/python/pairs.py +++ b/testsuite/python/pairs.py @@ -104,13 +104,13 @@ def test_nsquare_partial_z(self): self.run_and_check() def test_dd(self): - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.periodicity = [1, 1, 1] self.run_and_check() self.check_range_exception() def test_dd_partial_z(self): - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.periodicity = [1, 1, 0] self.run_and_check() self.check_range_exception() diff --git a/testsuite/python/particle.py b/testsuite/python/particle.py index d68e391d3ae..812b60e0d0c 100644 --- a/testsuite/python/particle.py +++ b/testsuite/python/particle.py @@ -344,7 +344,7 @@ def test_zz_remove_all(self): def test_coord_fold_corner_cases(self): system = self.system system.time_step = .5 - system.cell_system.set_domain_decomposition(use_verlet_lists=False) + system.cell_system.set_regular_decomposition(use_verlet_lists=False) system.cell_system.skin = 0 system.min_global_cut = 3 system.part.clear() diff --git a/testsuite/python/random_pairs.py b/testsuite/python/random_pairs.py index e08b01956b9..5c4b19d2e7c 100644 --- a/testsuite/python/random_pairs.py +++ b/testsuite/python/random_pairs.py @@ -82,7 +82,7 @@ def check_pairs(self, n2_pairs): self.assertEqual(n2_pairs ^ set(cs_pairs), set()) def check_dd(self, n2_pairs): - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.check_pairs(n2_pairs) def check_n_squared(self, n2_pairs): diff --git a/testsuite/python/domain_decomposition.py b/testsuite/python/regular_decomposition.py similarity index 97% rename from testsuite/python/domain_decomposition.py rename to testsuite/python/regular_decomposition.py index 741a79ed13a..55b2ee62f29 100644 --- a/testsuite/python/domain_decomposition.py +++ b/testsuite/python/regular_decomposition.py @@ -23,12 +23,12 @@ np.random.seed(42) -class DomainDecomposition(ut.TestCase): +class RegularDecomposition(ut.TestCase): system = espressomd.System(box_l=3 * [50.0]) original_node_grid = tuple(system.cell_system.node_grid) def setUp(self): - self.system.cell_system.set_domain_decomposition( + self.system.cell_system.set_regular_decomposition( use_verlet_lists=False) self.system.cell_system.node_grid = self.original_node_grid self.system.time_step = 1e-3 diff --git a/testsuite/python/virtual_sites_relative.py b/testsuite/python/virtual_sites_relative.py index 9d0f2fc87a8..cefc2d2b86c 100644 --- a/testsuite/python/virtual_sites_relative.py +++ b/testsuite/python/virtual_sites_relative.py @@ -307,9 +307,9 @@ def test_lj(self): system.cell_system.skin = 0.4 system.cell_system.set_n_square(use_verlet_lists=True) self.run_test_lj() - system.cell_system.set_domain_decomposition(use_verlet_lists=True) + system.cell_system.set_regular_decomposition(use_verlet_lists=True) self.run_test_lj() - system.cell_system.set_domain_decomposition(use_verlet_lists=False) + system.cell_system.set_regular_decomposition(use_verlet_lists=False) self.run_test_lj() @utx.skipIfMissingFeatures("EXTERNAL_FORCES")