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/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'])