Commit 0b7d0cc1 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Cosmetic changes for most files

Fixed setting of runtime in BrookPlatform() constructor (constructor w/o args):
if 'brt_runtime' env variable not set, then
internal 'runtime' variable was NULL -- this led to a fault when _setBrookRuntime() was called
parent c3e1acf8
......@@ -63,8 +63,8 @@ BrookCalcGBSAOBCForceKernel::BrookCalcGBSAOBCForceKernel( std::string name, cons
// ---------------------------------------------------------------------------------------
_numberOfParticles = 0;
_log = NULL;
_numberOfParticles = 0;
_log = NULL;
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){
......
......@@ -59,8 +59,8 @@ BrookCalcHarmonicAngleForceKernel::BrookCalcHarmonicAngleForceKernel( std::strin
// ---------------------------------------------------------------------------------------
_brookBondParameters = NULL;
_log = NULL;
_brookBondParameters = NULL;
_log = NULL;
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){
......
......@@ -59,8 +59,8 @@ BrookCalcHarmonicBondForceKernel::BrookCalcHarmonicBondForceKernel( std::string
// ---------------------------------------------------------------------------------------
_brookBondParameters = NULL;
_log = NULL;
_brookBondParameters = NULL;
_log = NULL;
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){
......
......@@ -69,7 +69,7 @@ BrookCalcNonbondedForceKernel::BrookCalcNonbondedForceKernel( std::string name,
_brookBondParameters = NULL;
_log = NULL;
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() );
}
......
......@@ -59,8 +59,8 @@ BrookCalcPeriodicTorsionForceKernel::BrookCalcPeriodicTorsionForceKernel( std::s
// ---------------------------------------------------------------------------------------
_brookBondParameters = NULL;
_log = NULL;
_brookBondParameters = NULL;
_log = NULL;
_openMMBrookInterface.setNumberOfParticles( system.getNumParticles() );
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
......
......@@ -59,8 +59,8 @@ BrookCalcRBTorsionForceKernel::BrookCalcRBTorsionForceKernel( std::string name,
// ---------------------------------------------------------------------------------------
_brookBondParameters = NULL;
_log = NULL;
_brookBondParameters = NULL;
_log = NULL;
_openMMBrookInterface.setNumberOfParticles( system.getNumParticles() );
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
......
......@@ -313,7 +313,7 @@ void BrookCommon::_getParticleStreamDimensions( const Platform& platform ){
// get particle stream size
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookStreamFactory& brookStreamFactory = dynamic_cast<const BrookStreamFactory&> (platform.getDefaultStreamFactory() );
_particleStreamWidth = brookStreamFactory.getDefaultParticleStreamWidth();
_particleStreamSize = brookPlatform.getStreamSize( getNumberOfParticles(), _particleStreamWidth, NULL );
......
......@@ -63,7 +63,7 @@ BrookInitializeForcesKernel::BrookInitializeForcesKernel( std::string name, cons
_numberOfParticles = 0;
_log = NULL;
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() );
}
......
......@@ -55,12 +55,12 @@ BrookIntegrateLangevinStepKernel::BrookIntegrateLangevinStepKernel( std::string
// ---------------------------------------------------------------------------------------
_brookLangevinDynamics = NULL;
_brookShakeAlgorithm = NULL;
_brookRandomNumberGenerator = NULL;
_log = NULL;
_brookLangevinDynamics = NULL;
_brookShakeAlgorithm = NULL;
_brookRandomNumberGenerator = NULL;
_log = NULL;
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() );
}
......
......@@ -55,8 +55,8 @@ BrookIntegrateVerletStepKernel::BrookIntegrateVerletStepKernel( std::string name
// ---------------------------------------------------------------------------------------
_brookVerletDynamics = NULL;
_brookShakeAlgorithm = NULL;
_brookVerletDynamics = NULL;
_brookShakeAlgorithm = NULL;
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){
......
......@@ -815,7 +815,7 @@ int BrookLangevinDynamics::setup( const std::vector<double>& masses, const Platf
// ---------------------------------------------------------------------------------------
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
setLog( brookPlatform.getLog() );
int numberOfParticles = (int) masses.size();
......
......@@ -219,6 +219,12 @@ BrookPlatform::BrookPlatform( ){
char* runtime = getenv( "brt_runtime" );
#endif
// if environment variable brt_runtime not set, default to cal
if( runtime == NULL ){
runtime = _strdup( "cal" );
}
_initializeKernelFactory( );
_setBrookRuntime( runtime );
......
......@@ -942,7 +942,7 @@ int BrookRandomNumberGenerator::_initializeStreamSizes( int numberOfParticles, c
// get randomNumber stream dimensions
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookStreamFactory& brookStreamFactory = dynamic_cast<const BrookStreamFactory&> (platform.getDefaultStreamFactory() );
_randomNumberStreamWidth = brookStreamFactory.getDefaultRandomNumberStreamWidth();
_randomNumberStreamSize = brookStreamFactory.getDefaultRandomNumberStreamSize();
......@@ -1023,7 +1023,7 @@ int BrookRandomNumberGenerator::setup( int numberOfParticles, const Platform& pl
// ---------------------------------------------------------------------------------------
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
setLog( brookPlatform.getLog() );
// set stream sizes and then create streams
......
......@@ -56,11 +56,11 @@ BrookRemoveCMMotionKernel::BrookRemoveCMMotionKernel( std::string name, const Pl
// ---------------------------------------------------------------------------------------
_frequency = 0;
_log = NULL;
_brookVelocityCenterOfMassRemoval = NULL;
_frequency = 0;
_log = NULL;
_brookVelocityCenterOfMassRemoval = NULL;
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
if( brookPlatform.getLog() != NULL ){
setLog( brookPlatform.getLog() );
}
......
......@@ -354,7 +354,7 @@ int BrookVelocityCenterOfMassRemoval::setup( const std::vector<double>& masses,
// ---------------------------------------------------------------------------------------
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
setLog( brookPlatform.getLog() );
int numberOfParticles = (int) masses.size();
......
......@@ -53,9 +53,9 @@ BrookVerletDynamics::BrookVerletDynamics( ){
//static const std::string methodName = "BrookVerletDynamics::BrookVerletDynamics";
BrookOpenMMFloat zero = (BrookOpenMMFloat) 0.0;
BrookOpenMMFloat one = (BrookOpenMMFloat) 1.0;
BrookOpenMMFloat oneMinus = (BrookOpenMMFloat) -1.0;
BrookOpenMMFloat zero = static_cast<BrookOpenMMFloat>( 0.0 );
BrookOpenMMFloat one = static_cast<BrookOpenMMFloat>( 1.0 );
BrookOpenMMFloat oneMinus = static_cast<BrookOpenMMFloat>( -1.0 );
// ---------------------------------------------------------------------------------------
......@@ -373,7 +373,7 @@ int BrookVerletDynamics::setup( const std::vector<double>& masses, const Platfor
// ---------------------------------------------------------------------------------------
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
const BrookPlatform& brookPlatform = dynamic_cast<const BrookPlatform&> (platform);
setLog( brookPlatform.getLog() );
int numberOfParticles = (int) masses.size();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment