Skip to content

Commit

Permalink
Merge pull request #1234 from fweik/remove_noise_tests
Browse files Browse the repository at this point in the history
Remove switchable noise
  • Loading branch information
fweik authored Aug 12, 2017
2 parents 54eec23 + a7297b6 commit ee9bbbc
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 273 deletions.
8 changes: 0 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ matrix:
- os: osx
osx_image: xcode8
env: myconfig=maxset image=python3
- os: linux
sudo: required
services: docker
env: myconfig=maxset-gaussrandom
- os: linux
sudo: required
services: docker
env: myconfig=maxset-gaussrandomcut
- os: linux
sudo: required
services: docker
Expand Down
82 changes: 0 additions & 82 deletions maintainer/configs/maxset-gaussrandom.hpp

This file was deleted.

81 changes: 0 additions & 81 deletions maintainer/configs/maxset-gaussrandomcut.hpp

This file was deleted.

79 changes: 23 additions & 56 deletions src/core/thermostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
#include <fstream>
#include <unistd.h>

#if (!defined(FLATNOISE) && !defined(GAUSSRANDOMCUT) && !defined(GAUSSRANDOM))
#define FLATNOISE
#endif


/* thermostat switch */
int thermo_switch = THERMO_OFF;
/** Temperature */
Expand Down Expand Up @@ -117,25 +112,13 @@ void thermo_init_langevin()
int j;
#ifndef PARTICLE_ANISOTROPY
langevin_pref1 = -langevin_gamma/time_step;
#if defined (FLATNOISE)
langevin_pref2 = sqrt(24.0*temperature*langevin_gamma/time_step);
#elif defined (GAUSSRANDOMCUT) || defined (GAUSSRANDOM)
langevin_pref2 = sqrt(2.0*temperature*langevin_gamma/time_step);
#else
#error No Noise defined
#endif // Noise
#else
for ( j = 0 ; j < 3 ; j++)
{
langevin_pref1[j] = -langevin_gamma[j]/time_step;
#if defined (FLATNOISE)
langevin_pref2[j] = sqrt(24.0*temperature*langevin_gamma[j]/time_step);
#elif defined (GAUSSRANDOMCUT) || defined (GAUSSRANDOM)
langevin_pref2[j] = sqrt(2.0*temperature*langevin_gamma[j]/time_step);
#else
#error No Noise defined
#endif // Noise
}
for (j = 0; j < 3; j++) {
langevin_pref1[j] = -langevin_gamma[j] / time_step;
langevin_pref2[j] =
sqrt(24.0 * temperature * langevin_gamma[j] / time_step);
}
#endif // PARTICLE_ANISOTROPY

#ifdef MULTI_TIMESTEP
Expand Down Expand Up @@ -171,54 +154,38 @@ void thermo_init_langevin()
#endif // ROTATIONAL_INERTIA

#ifndef ROTATIONAL_INERTIA
#if defined (FLATNOISE)
langevin_pref2_rotation = sqrt(24.0*temperature*langevin_gamma_rotation/time_step);
#elif defined (GAUSSRANDOMCUT) || defined (GAUSSRANDOM)
langevin_pref2_rotation = sqrt(2.0*temperature*langevin_gamma_rotation/time_step);
#else
#error No Noise defined
#endif // FLATNOISE
#else
#if defined (FLATNOISE)
for ( j = 0 ; j < 3 ; j++) langevin_pref2_rotation[j] = sqrt(24.0*temperature*langevin_gamma_rotation[j]/time_step);
#elif defined (GAUSSRANDOMCUT) || defined (GAUSSRANDOM)
for ( j = 0 ; j < 3 ; j++) langevin_pref2_rotation[j] = sqrt(2.0*temperature*langevin_gamma_rotation[j]/time_step);
#else
#error No Noise defined
#endif // FLATNOISE
#endif // ROTATIONAL_INERTIA
THERMO_TRACE(fprintf(stderr,"%d: thermo_init_langevin: langevin_gamma_rotation=%f, langevin_pref2_rotation=%f",this_node, langevin_gamma_rotation,langevin_pref2_rotation));
#endif
THERMO_TRACE(fprintf(stderr,"%d: thermo_init_langevin: langevin_pref1=%f, langevin_pref2=%f",this_node,langevin_pref1,langevin_pref2));
}

#ifdef NPT
void thermo_init_npt_isotropic()
{
void thermo_init_npt_isotropic() {
if (nptiso.piston != 0.0) {
#if defined (FLATNOISE)
nptiso_pref1 = -nptiso_gamma0*0.5 * time_step;
nptiso_pref1 = -nptiso_gamma0 * 0.5 * time_step;
#ifdef MULTI_TIMESTEP
if (smaller_time_step > 0.)
nptiso_pref2 = sqrt(12.0*temperature*nptiso_gamma0*time_step) * smaller_time_step;
if (smaller_time_step > 0.)
nptiso_pref2 = sqrt(12.0 * temperature * nptiso_gamma0 * time_step) *
smaller_time_step;
else
#endif
nptiso_pref2 = sqrt(12.0*temperature*nptiso_gamma0*time_step) * time_step;
nptiso_pref3 = -nptiso_gammav*(1.0/nptiso.piston)*0.5*time_step;
nptiso_pref4 = sqrt(12.0*temperature*nptiso_gammav*time_step);
#elif defined (GAUSSRANDOMCUT) || defined (GAUSSRANDOM)
nptiso_pref1 = -nptiso_gamma0*0.5 * time_step;
nptiso_pref2 = sqrt(1.0*temperature*nptiso_gamma0*time_step) * time_step;
nptiso_pref3 = -nptiso_gammav*(1.0/nptiso.piston)*0.5*time_step;
nptiso_pref4 = sqrt(1.0*temperature*nptiso_gammav*time_step);
#else
#error No Noise defined
#endif
THERMO_TRACE(fprintf(stderr,"%d: thermo_init_npt_isotropic: nptiso_pref1=%f, nptiso_pref2=%f, nptiso_pref3=%f, nptiso_pref4=%f \n",this_node,nptiso_pref1,nptiso_pref2,nptiso_pref3,nptiso_pref4));
}
else {
thermo_switch = ( thermo_switch ^ THERMO_NPT_ISO );
THERMO_TRACE(fprintf(stderr,"%d: thermo_init_npt_isotropic: switched off nptiso (piston=%f; thermo_switch=%d) \n",this_node,nptiso.piston,thermo_switch));
nptiso_pref2 =
sqrt(12.0 * temperature * nptiso_gamma0 * time_step) * time_step;
nptiso_pref3 = -nptiso_gammav * (1.0 / nptiso.piston) * 0.5 * time_step;
nptiso_pref4 = sqrt(12.0 * temperature * nptiso_gammav * time_step);
THERMO_TRACE(fprintf(
stderr, "%d: thermo_init_npt_isotropic: nptiso_pref1=%f, "
"nptiso_pref2=%f, nptiso_pref3=%f, nptiso_pref4=%f \n",
this_node, nptiso_pref1, nptiso_pref2, nptiso_pref3, nptiso_pref4));
} else {
thermo_switch = (thermo_switch ^ THERMO_NPT_ISO);
THERMO_TRACE(fprintf(stderr, "%d: thermo_init_npt_isotropic: switched off "
"nptiso (piston=%f; thermo_switch=%d) \n",
this_node, nptiso.piston, thermo_switch));
}
}
#endif
Expand Down
Loading

0 comments on commit ee9bbbc

Please sign in to comment.