From 80a79079674e30f6c2f8c4441faa7ca51c8ec2ad Mon Sep 17 00:00:00 2001 From: Florian Weik Date: Mon, 17 Feb 2020 22:37:24 +0100 Subject: [PATCH] core: Removed unused global --- src/core/global.cpp | 3 --- src/core/global.hpp | 1 - src/core/particle_data.cpp | 1 - src/core/particle_data.hpp | 2 -- src/python/espressomd/globals.pxd | 2 -- src/python/espressomd/particle_data.pyx | 8 ++------ 6 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/core/global.cpp b/src/core/global.cpp index 273f067025d..19aeaa6fb3a 100644 --- a/src/core/global.cpp +++ b/src/core/global.cpp @@ -150,9 +150,6 @@ const std::unordered_map fields{ {FIELD_MIN_GLOBAL_CUT, {&min_global_cut, Datafield::Type::DOUBLE, 1, "min_global_cut"}}, /* 43 from interaction_data.cpp */ - {FIELD_SWIMMING_PARTICLES_EXIST, - {&swimming_particles_exist, Datafield::Type::BOOL, 1, - "swimming_particles_exist"}}, /* from particle_data.cpp */ #ifndef PARTICLE_ANISOTROPY {FIELD_LANGEVIN_GAMMA_ROTATION, {&langevin.gamma_rotation, Datafield::Type::DOUBLE, 1, diff --git a/src/core/global.hpp b/src/core/global.hpp index 46fb4554579..d0090dc1099 100644 --- a/src/core/global.hpp +++ b/src/core/global.hpp @@ -98,7 +98,6 @@ enum Fields { FIELD_THERMALIZEDBONDS, FIELD_FORCE_CAP, FIELD_THERMO_VIRTUAL, - FIELD_SWIMMING_PARTICLES_EXIST, /** index of \ref BrownianThermostat::gamma */ FIELD_BROWNIAN_GAMMA, /** index of \ref BrownianThermostat::gamma_rotation */ diff --git a/src/core/particle_data.cpp b/src/core/particle_data.cpp index 7cafa8639d6..0950f4abb24 100644 --- a/src/core/particle_data.cpp +++ b/src/core/particle_data.cpp @@ -388,7 +388,6 @@ void add_id_to_type_map(int part_id, int type); int max_seen_particle = -1; int n_part = 0; -bool swimming_particles_exist = false; /** * @brief id -> rank */ diff --git a/src/core/particle_data.hpp b/src/core/particle_data.hpp index d021bb13051..60780a01b48 100644 --- a/src/core/particle_data.hpp +++ b/src/core/particle_data.hpp @@ -84,8 +84,6 @@ enum { extern int max_seen_particle; /** total number of particles on all nodes. */ extern int n_part; -/** flag that active swimming particles exist */ -extern bool swimming_particles_exist; /** id->particle mapping on all nodes. This is used to find partners * of bonded interactions. diff --git a/src/python/espressomd/globals.pxd b/src/python/espressomd/globals.pxd index 95ab83edaa7..694ac54fd52 100644 --- a/src/python/espressomd/globals.pxd +++ b/src/python/espressomd/globals.pxd @@ -37,7 +37,6 @@ cdef extern from "global.hpp": int FIELD_TEMPERATURE int FIELD_LANGEVIN_GAMMA int FIELD_BROWNIAN_GAMMA - int FIELD_SWIMMING_PARTICLES_EXIST IF ROTATION: int FIELD_LANGEVIN_GAMMA_ROTATION int FIELD_BROWNIAN_GAMMA_ROTATION @@ -74,7 +73,6 @@ cdef extern from "domain_decomposition.hpp": cdef extern from "particle_data.hpp": extern int n_part - extern bool swimming_particles_exist cdef extern from "nonbonded_interactions/nonbonded_interaction_data.hpp": double dpd_gamma diff --git a/src/python/espressomd/particle_data.pyx b/src/python/espressomd/particle_data.pyx index 045d7efaeba..3d7688ec957 100644 --- a/src/python/espressomd/particle_data.pyx +++ b/src/python/espressomd/particle_data.pyx @@ -27,7 +27,7 @@ from .interactions import BondedInteraction from .interactions import BondedInteractions from .interactions cimport bonded_ia_params from copy import copy -from globals cimport max_seen_particle, time_step, n_part, n_rigidbonds, max_seen_particle_type, swimming_particles_exist, FIELD_SWIMMING_PARTICLES_EXIST, mpi_bcast_parameter +from globals cimport max_seen_particle, time_step, n_part, n_rigidbonds, max_seen_particle_type, mpi_bcast_parameter import collections import functools import types @@ -1180,8 +1180,8 @@ cdef class ParticleHandle: """ def __set__(self, _params): - global swimming_particles_exist cdef particle_parameters_swimming swim + swim.swimming = True swim.v_swim = 0.0 swim.f_swim = 0.0 @@ -1224,10 +1224,6 @@ cdef class ParticleHandle: _params['dipole_length'], 1, float, "dipole_length has to be a float.") swim.dipole_length = _params['dipole_length'] - if swim.f_swim != 0 or swim.v_swim != 0: - swimming_particles_exist = True - mpi_bcast_parameter(FIELD_SWIMMING_PARTICLES_EXIST) - set_particle_swimming(self._id, swim) def __get__(self):