Skip to content

Commit

Permalink
core: Removed unused global
Browse files Browse the repository at this point in the history
  • Loading branch information
fweik committed Feb 17, 2020
1 parent f9ae0e8 commit 80a7907
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 15 deletions.
3 changes: 0 additions & 3 deletions src/core/global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ const std::unordered_map<int, Datafield> 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,
Expand Down
1 change: 0 additions & 1 deletion src/core/global.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion src/core/particle_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 0 additions & 2 deletions src/core/particle_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions src/python/espressomd/globals.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions src/python/espressomd/particle_data.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 80a7907

Please sign in to comment.