Skip to content

Commit

Permalink
Style.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkreissl committed Oct 20, 2021
1 parent aacdb4b commit e184ceb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/core/CellStructure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ struct CellStructure {
* @brief Set the particle decomposition to HybridDecomposition.
*
*/
void set_hybrid_decomposition(boost::mpi::communicator const &comm,
void set_hybrid_decomposition(boost::mpi::communicator const &comm,
double range, BoxGeometry const &box,
LocalBox<double> const &local_geo);

Expand Down
10 changes: 6 additions & 4 deletions src/core/HybridDecomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ HybridDecomposition::HybridDecomposition(boost::mpi::communicator comm,
const BoxGeometry &box_geo,
const LocalBox<double> &local_box)
: m_comm(std::move(comm)), m_box(box_geo),
m_domain_decomposition(DomainDecomposition(m_comm, range,
m_box, local_box)),
m_domain_decomposition(
DomainDecomposition(m_comm, range, m_box, local_box)),
m_n_square(AtomDecomposition(m_comm, m_box)) {

/* Vector containing cells of both child decompositions */
Expand All @@ -52,8 +52,10 @@ HybridDecomposition::HybridDecomposition(boost::mpi::communicator comm,
exchange_ghosts_comm_n_square.communications.end(),
std::back_inserter(m_exchange_ghosts_comm.communications));

m_collect_ghost_force_comm = m_domain_decomposition.collect_ghost_force_comm();
auto collect_ghost_force_comm_n_square = m_n_square.collect_ghost_force_comm();
m_collect_ghost_force_comm =
m_domain_decomposition.collect_ghost_force_comm();
auto collect_ghost_force_comm_n_square =
m_n_square.collect_ghost_force_comm();
std::copy(collect_ghost_force_comm_n_square.communications.begin(),
collect_ghost_force_comm_n_square.communications.end(),
std::back_inserter(m_collect_ghost_force_comm.communications));
Expand Down
13 changes: 4 additions & 9 deletions src/core/HybridDecomposition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
#ifndef ESPRESSO_HYBRID_DECOMPOSITION_HPP
#define ESPRESSO_HYBRID_DECOMPOSITION_HPP

#include "AtomDecomposition.hpp"
#include "DomainDecomposition.hpp"
#include "Particle.hpp"
#include "ParticleDecomposition.hpp"
#include "DomainDecomposition.hpp"
#include "AtomDecomposition.hpp"
#include "ghosts.hpp"

#include <utils/Span.hpp>
Expand All @@ -38,7 +38,6 @@
#include <utility>
#include <vector>


class HybridDecomposition : public ParticleDecomposition {
boost::mpi::communicator m_comm;
BoxGeometry m_box;
Expand Down Expand Up @@ -95,8 +94,7 @@ class HybridDecomposition : public ParticleDecomposition {
Cell *id_to_cell;
if (m_n_square_types.find(p.identity()) != m_n_square_types.end()) {
id_to_cell = m_domain_decomposition.particle_to_cell(p);
}
else {
} else {
id_to_cell = m_n_square.particle_to_cell(p);
}
return id_to_cell;
Expand All @@ -105,10 +103,7 @@ class HybridDecomposition : public ParticleDecomposition {
Utils::Vector3d max_cutoff() const override {
return m_n_square.max_cutoff();
}

Utils::Vector3d max_range() const override {
return m_n_square.max_range();
}
Utils::Vector3d max_range() const override { return m_n_square.max_range(); }

boost::optional<BoxGeometry> minimum_image_distance() const override {
return m_box;
Expand Down
3 changes: 2 additions & 1 deletion src/python/espressomd/cellsystem.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ cdef class CellSystem:

return True

def set_hybrid_decomposition(self, n_square_types=[], use_verlet_lists=True):
def set_hybrid_decomposition(
self, n_square_types=[], use_verlet_lists=True):
"""
Activates the hybrid domain decomposition.
Expand Down

0 comments on commit e184ceb

Please sign in to comment.