Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
56755055
Commit
56755055
authored
Jan 13, 2009
by
Mark Friedrichs
Browse files
Remove Brownian dynamics files -- not ready yet
parent
aff802d9
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
1523 deletions
+5
-1523
platforms/brook/src/BrookBrownianDynamics.cpp
platforms/brook/src/BrookBrownianDynamics.cpp
+0
-884
platforms/brook/src/BrookBrownianDynamics.h
platforms/brook/src/BrookBrownianDynamics.h
+0
-376
platforms/brook/src/BrookIntegrateBrownianStepKernel.cpp
platforms/brook/src/BrookIntegrateBrownianStepKernel.cpp
+0
-155
platforms/brook/src/BrookIntegrateBrownianStepKernel.h
platforms/brook/src/BrookIntegrateBrownianStepKernel.h
+0
-107
platforms/brook/src/BrookNonBonded.cpp
platforms/brook/src/BrookNonBonded.cpp
+5
-1
No files found.
platforms/brook/src/BrookBrownianDynamics.cpp
deleted
100644 → 0
View file @
aff802d9
This diff is collapsed.
Click to expand it.
platforms/brook/src/BrookBrownianDynamics.h
deleted
100644 → 0
View file @
aff802d9
#ifndef OPENMM_BROOK_BROWNIAN_DYNAMCIS_H_
#define OPENMM_BROOK_BROWNIAN_DYNAMCIS_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* This is part of the OpenMM molecular simulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008 Stanford University and the Authors. *
* Authors: Peter Eastman, Mark Friedrichs *
* Contributors: *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
* THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include <vector>
#include <set>
#include "BrookFloatStreamInternal.h"
#include "BrookShakeAlgorithm.h"
#include "BrookRandomNumberGenerator.h"
#include "BrookPlatform.h"
#include "BrookCommon.h"
namespace
OpenMM
{
/**
*
* Encapsulates stochastic dynamics algorithm
*
*/
class
BrookBrownianDynamics
:
public
BrookCommon
{
public:
/**
* Constructor
*
*/
BrookBrownianDynamics
(
);
/**
* Destructor
*
*/
~
BrookBrownianDynamics
();
/**
* Get tau
*
* @return tau
*/
BrookOpenMMFloat
getTau
(
void
)
const
;
/**
* Get friction
*
* @return friction
*/
BrookOpenMMFloat
getFriction
(
void
)
const
;
/**
* Get temperature
*
* @return temperature
*/
BrookOpenMMFloat
getTemperature
(
void
)
const
;
/**
* Get step size
*
* @return step size
*/
BrookOpenMMFloat
getStepSize
(
void
)
const
;
/**
* Get noise amplitude
*
* @return noise amplitude
*/
BrookOpenMMFloat
getNoiseAmplitude
(
void
)
const
;
/**
* Get force scale
*
* @return force scale
*/
BrookOpenMMFloat
getForceScale
(
void
)
const
;
/**
* Get BrownianDynamics particle stream width
*
* @return particle stream width
*/
int
getBrownianDynamicsParticleStreamWidth
(
void
)
const
;
/**
* Get BrownianDynamics particle stream height
*
* @return particle stream height
*/
int
getBrownianDynamicsParticleStreamHeight
(
void
)
const
;
/**
* Get BrownianDynamics particle stream size
*
* @return particle stream size
*/
int
getBrownianDynamicsParticleStreamSize
(
void
)
const
;
/**
* Update parameters
*
* @param temperature temperature
* @param friction friction
* @param step size step size
*
* @return DefaultReturnValue
*
*/
int
updateParameters
(
double
temperature
,
double
friction
,
double
stepSize
);
/**
* Update
*
* @param positions particle positions
* @param velocities particle velocities
* @param forces particle forces
* @param brookShakeAlgorithm BrookShakeAlgorithm reference
* @param brookRandomNumberGenerator BrookRandomNumberGenerator reference
*
* @return DefaultReturnValue
*
*/
int
update
(
Stream
&
positions
,
Stream
&
velocities
,
const
Stream
&
forces
,
BrookShakeAlgorithm
&
brookShakeAlgorithm
,
BrookRandomNumberGenerator
&
brookRandomNumberGenerator
);
/**
* Get array of BrownianDynamics streams
*
* @return array ofstreams
*
*/
BrookFloatStreamInternal
**
getStreams
(
void
);
/*
* Setup of BrownianDynamics parameters
*
* @param masses particle masses
* @param platform Brook platform
*
* @return ErrorReturnValue value if error, else DefaultReturnValue
*
* */
int
setup
(
const
std
::
vector
<
double
>&
masses
,
const
Platform
&
platform
);
/*
* Get contents of object
*
* @param level of dump
*
* @return string containing contents
*
* */
std
::
string
getContentsString
(
int
level
=
0
)
const
;
/**
* Get X-prime stream
*
* @return X-prime stream
*
*/
BrookFloatStreamInternal
*
getXPrimeStream
(
void
)
const
;
/**
* Get inverse sqrt masses
*
* @return inverse sqrt masses stream
*
*/
BrookFloatStreamInternal
*
getInverseMassStream
(
void
)
const
;
private:
// streams indices
enum
BrookBrownianDynamicsStreams
{
VPrimeStream
,
XPrimeStream
,
InverseMassStream
,
LastStreamIndex
};
// randomNumberSeed
unsigned
int
_randomNumberSeed
;
BrookOpenMMFloat
_tau
;
BrookOpenMMFloat
_temperature
;
BrookOpenMMFloat
_stepSize
;
BrookOpenMMFloat
_forceScale
;
BrookOpenMMFloat
_noiseAmplitude
;
// Particle stream dimensions
int
_bdParticleStreamWidth
;
int
_bdParticleStreamHeight
;
int
_bdParticleStreamSize
;
/*
* Update streams
*
* @return DefaultReturn
*
*/
int
_updateStreams
(
void
);
// inverse sqrt masses
BrookOpenMMFloat
*
_inverseSqrtMasses
;
// internal streams
BrookFloatStreamInternal
*
_streams
[
LastStreamIndex
];
/**
* Set tau
*
* @param tau new tau value
*
* @return DefaultReturn
*
*/
int
_setTau
(
BrookOpenMMFloat
tau
);
/**
* Set friction = 1/tau
*
* @param friction new friction value
*
* @return DefaultReturn
*
*/
int
_setFriction
(
BrookOpenMMFloat
friction
);
/**
* Set temperature
*
* @parameter temperature
*
* @return DefaultReturn
*
*/
int
_setTemperature
(
BrookOpenMMFloat
temperature
);
/**
* Set stepSize
*
* @param stepSize
*
* @return DefaultReturn
*
*/
int
_setStepSize
(
BrookOpenMMFloat
stepSize
);
/**
* Set force scale
*
* @return DefaultReturn
*
*/
int
_setForceScale
(
void
);
/**
* Set noise amplitude
*
* @return DefaultReturn
*
*/
int
_setNoiseAmplitude
(
void
);
/*
* Setup of stream dimensions
*
* @param particleStreamSize particle stream size
* @param particleStreamWidth particle stream width
*
* @return ErrorReturnValue if error, else DefaultReturnValue
*
* */
int
_initializeStreamSizes
(
int
particleStreamSize
,
int
particleStreamWidth
);
/**
* Initialize stream dimensions
*
* @param numberOfParticles number of particles
* @param platform platform
*
* @return ErrorReturnValue if error, else DefaultReturnValue
*
*/
int
_initializeStreamSizes
(
int
numberOfParticles
,
const
Platform
&
platform
);
/**
* Initialize stream dimensions and streams
*
* @param platform platform
*
* @return nonzero value if error
*
*/
int
_initializeStreams
(
const
Platform
&
platform
);
/**
* Set masses
*
* @param masses particleic masses
*
*/
int
_setInverseSqrtMasses
(
const
std
::
vector
<
double
>&
masses
);
};
}
// namespace OpenMM
#endif
/* OPENMM_BROOK_BROWNIAN_DYNAMCIS_H_ */
platforms/brook/src/BrookIntegrateBrownianStepKernel.cpp
deleted
100644 → 0
View file @
aff802d9
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* This is part of the OpenMM molecular simulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
* THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "BrookIntegrateBrownianStepKernel.h"
#include "BrookStreamInternal.h"
using
namespace
OpenMM
;
using
namespace
std
;
/**
* BrookIntegrateBrownianStepKernel constructor
*
* @param name name of the stream to create
* @param platform platform
*
*/
BrookIntegrateBrownianStepKernel
::
BrookIntegrateBrownianStepKernel
(
std
::
string
name
,
const
Platform
&
platform
)
:
IntegrateBrownianStepKernel
(
name
,
platform
){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "BrookIntegrateBrownianStepKernel::BrookIntegrateBrownianStepKernel";
// ---------------------------------------------------------------------------------------
_brookBrownianDynamics
=
NULL
;
_brookShakeAlgorithm
=
NULL
;
_brookRandomNumberGenerator
=
NULL
;
}
/**
* BrookIntegrateVerletStepKernel destructor
*
*/
BrookIntegrateBrownianStepKernel
::~
BrookIntegrateBrownianStepKernel
(
){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "BrookIntegrateBrownianStepKernel::~BrookIntegrateBrownianStepKernel";
// ---------------------------------------------------------------------------------------
delete
_brookBrownianDynamics
;
delete
_brookShakeAlgorithm
;
delete
_brookRandomNumberGenerator
;
}
/**
* Initialize the kernel, setting up all parameters related to integrator.
*
* @param masses the mass of each particle
* @param constraintIndices each element contains the indices of two particles whose distance should be constrained
* @param constraintLengths the required distance between each pair of constrained particles
*
*/
void
BrookIntegrateBrownianStepKernel
::
initialize
(
const
vector
<
double
>&
masses
,
const
vector
<
vector
<
int
>
>&
constraintIndices
,
const
vector
<
double
>&
constraintLengths
){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "BrookIntegrateBrownianStepKernel::initialize";
// ---------------------------------------------------------------------------------------
_brookBrownianDynamics
=
new
BrookBrownianDynamics
(
);
_brookBrownianDynamics
->
setup
(
masses
,
getPlatform
()
);
_brookShakeAlgorithm
=
new
BrookShakeAlgorithm
(
);
_brookShakeAlgorithm
->
setup
(
masses
,
constraintIndices
,
constraintLengths
,
getPlatform
()
);
// assert( (_brookShakeAlgorithm->getNumberOfConstraints() > 0) );
_brookRandomNumberGenerator
=
new
BrookRandomNumberGenerator
(
);
_brookRandomNumberGenerator
->
setup
(
(
int
)
masses
.
size
(),
getPlatform
()
);
// _brookRandomNumberGenerator->setVerbosity( 1 );
}
/**
* Execute kernel
*
* @param positions particle coordinates
* @param velocities particle velocities
* @param forces particle forces
* @param temperature heat bath temperature
* @param friction friction coefficient coupling the system to the heat bath
* @param stepSize integration step size
*
*/
void
BrookIntegrateBrownianStepKernel
::
execute
(
Stream
&
positions
,
Stream
&
velocities
,
const
Stream
&
forces
,
double
temperature
,
double
friction
,
double
stepSize
){
// ---------------------------------------------------------------------------------------
double
epsilon
=
1.0e-04
;
static
const
std
::
string
methodName
=
"BrookIntegrateBrownianStepKernel::execute"
;
// ---------------------------------------------------------------------------------------
// first time through initialize _brookBrownianDynamics
// for each subsequent call, check if parameters need to be updated due to a change
// in T, gamma, or the step size
// take step
double
differences
[
3
];
differences
[
0
]
=
temperature
-
(
double
)
_brookBrownianDynamics
->
getTemperature
();
differences
[
1
]
=
friction
-
(
double
)
_brookBrownianDynamics
->
getFriction
();
differences
[
2
]
=
stepSize
-
(
double
)
_brookBrownianDynamics
->
getStepSize
();
if
(
fabs
(
differences
[
0
]
)
>
epsilon
||
fabs
(
differences
[
1
]
)
>
epsilon
||
fabs
(
differences
[
2
]
)
>
epsilon
){
//printf( "%s calling updateParameters\n", methodName.c_str() );
_brookBrownianDynamics
->
updateParameters
(
temperature
,
friction
,
stepSize
);
}
else
{
//printf( "%s NOT calling updateParameters\n", methodName.c_str() );
}
_brookBrownianDynamics
->
update
(
positions
,
velocities
,
forces
,
*
_brookShakeAlgorithm
,
*
_brookRandomNumberGenerator
);
}
platforms/brook/src/BrookIntegrateBrownianStepKernel.h
deleted
100644 → 0
View file @
aff802d9
#ifndef OPENMM_BROOK_INTEGRATE_BROWNIAN_STEP_KERNEL_H_
#define OPENMM_BROOK_INTEGRATE_BROWNIAN_STEP_KERNEL_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* This is part of the OpenMM molecular simulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright ( c ) 2008 Stanford University and the Authors. *
* Authors: Peter Eastman, Mark Friedrichs *
* Contributors: *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files ( the "Software" ), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
* THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "kernels.h"
#include "BrookBrownianDynamics.h"
#include "BrookShakeAlgorithm.h"
#include "BrookRandomNumberGenerator.h"
namespace
OpenMM
{
/**
* This is the base class of Float and Double streams in the Brook Platform.
*/
class
BrookIntegrateBrownianStepKernel
:
public
IntegrateBrownianStepKernel
{
public:
// return values
static
const
int
DefaultReturnValue
=
0
;
static
const
int
ErrorReturnValue
=
-
1
;
/**
* BrookIntegrateBrownianStepKernel constructor
*
* @param name name of the stream to create
* @param platform platform
*
*/
BrookIntegrateBrownianStepKernel
(
std
::
string
name
,
const
Platform
&
platform
);
/**
* BrookIntegrateBrownianStepKernel destructor
*
*/
~
BrookIntegrateBrownianStepKernel
();
/**
* Initialize the kernel, setting up all parameters related to integrator.
*
* @param masses particle masses
* @param constraintIndices each element contains the indices of two particles whose distance should be constrained
* @param constraintLengths required distance between each pair of constrained particles
*/
void
initialize
(
const
std
::
vector
<
double
>&
masses
,
const
std
::
vector
<
std
::
vector
<
int
>
>&
constraintIndices
,
const
std
::
vector
<
double
>&
constraintLengths
);
/**
* Execute kernel
*
* @param positions coordinates
* @param velocities velocities
* @param forces forces
* @param temperature heat bath temperature
* @param friction friction coefficient coupling the system to the heat bath
* @param stepSize step size
*
*/
void
execute
(
Stream
&
positions
,
Stream
&
velocities
,
const
Stream
&
forces
,
double
temperature
,
double
friction
,
double
stepSize
);
protected:
BrookBrownianDynamics
*
_brookBrownianDynamics
;
BrookShakeAlgorithm
*
_brookShakeAlgorithm
;
BrookRandomNumberGenerator
*
_brookRandomNumberGenerator
;
};
}
// namespace OpenMM
#endif
/* OPENMM_BROOK_INTEGRATE_BROWNIAN_STEP_KERNEL_H_ */
platforms/brook/src/BrookNonBonded.cpp
View file @
56755055
...
...
@@ -1287,7 +1287,11 @@ void BrookNonBonded::computeForces( BrookStreamImpl& positionStream, BrookStream
// ---------------------------------------------------------------------------------------
printOn
=
(
printOn
&&
getLog
())
?
printOn
:
0
;
if
(
printOn
&&
getLog
()
){
log
=
getLog
();
}
else
{
printOn
=
0
;
}
// nonbonded forces
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment