Commit 475b8fac authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Removed checks for implicit solvent parameter settings

parent 12a0e2c4
...@@ -637,24 +637,6 @@ int CpuImplicitSolvent::computeImplicitSolventForces( RealOpenMM** atomCoordinat ...@@ -637,24 +637,6 @@ int CpuImplicitSolvent::computeImplicitSolventForces( RealOpenMM** atomCoordinat
return SimTKOpenMMCommon::ErrorReturn; return SimTKOpenMMCommon::ErrorReturn;
} }
// check if parameters good-to-go
// radii and scalefactors (OBC) need to be set
if( callId == 1 ){
if( implicitSolventParameters->isNotReady() ){
std::stringstream message;
message << methodName;
message << " implicitSolventParameters are not set for force calculations!";
SimTKOpenMMLog::printError( message );
return SimTKOpenMMCommon::ErrorReturn;
} else {
std::stringstream message;
message << methodName;
message << " implicitSolventParameters appear to be set.";
// SimTKOpenMMLog::printMessage( message );
}
}
// check to see if Born radii have been previously calculated // check to see if Born radii have been previously calculated
// if not, then calculate; // if not, then calculate;
// logic here assumes that the radii are intitialized to zero // logic here assumes that the radii are intitialized to zero
......
...@@ -467,64 +467,6 @@ std::string GBVIParameters::getStateString( const char* title ) const { ...@@ -467,64 +467,6 @@ std::string GBVIParameters::getStateString( const char* title ) const {
} }
/**---------------------------------------------------------------------------------------
Return zero value if all parameters set; else return nonzero
@return ready status
--------------------------------------------------------------------------------------- */
int GBVIParameters::isNotReady( void ) const {
// ---------------------------------------------------------------------------------------
static const char* methodName = "\nGBVIParameters::isNotReady";
// ---------------------------------------------------------------------------------------
int isReady = ImplicitSolventParameters::isNotReady();
int errors = 0;
std::stringstream message;
message << methodName;
const RealOpenMM* scaledRadii = getScaledRadii();
if( scaledRadii == NULL || scaledRadii[0] <= 0.0 ){
errors++;
message << "\n scaledRadii are not set";
}
const RealOpenMM* gamma = getGammaParameters();
if( gamma == NULL ){
errors++;
message << "\n gamma parameters are not set";
}
// check scale factors are in correct units
RealOpenMM average, stdDev, maxValue, minValue;
int minIndex, maxIndex;
SimTKOpenMMUtilities::getArrayStatistics( getNumberOfAtoms(), scaledRadii, &average,
&stdDev, &minValue, &minIndex,
&maxValue, &maxIndex );
if( average < 0.3 || average > 2.0 || minValue < 0.1 ){
errors++;
message << "\n scale factors for atomic radii appear not to be set correctly -- radii should be in nm";
message << "\n average radius=" << average << " min radius=" << minValue << " at atom index=" << minIndex;
}
if( errors ){
message << std::endl;
SimTKOpenMMLog::printMessage( message );
}
errors += isReady;
return errors;
}
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
Set the force to use a cutoff. Set the force to use a cutoff.
......
...@@ -201,16 +201,6 @@ class GBVIParameters : public ImplicitSolventParameters { ...@@ -201,16 +201,6 @@ class GBVIParameters : public ImplicitSolventParameters {
std::string getStateString( const char* title ) const; std::string getStateString( const char* title ) const;
/**---------------------------------------------------------------------------------------
Return zero value if all parameters set; else return nonzero
@return ready status
--------------------------------------------------------------------------------------- */
int isNotReady( void ) const;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
Set the force to use a cutoff. Set the force to use a cutoff.
......
...@@ -714,118 +714,6 @@ std::string ImplicitSolventParameters::getStateString( const char* title ) const ...@@ -714,118 +714,6 @@ std::string ImplicitSolventParameters::getStateString( const char* title ) const
} }
/**---------------------------------------------------------------------------------------
Return zero value if all parameters set; else return nonzero
@return ready status
--------------------------------------------------------------------------------------- */
int ImplicitSolventParameters::isNotReady( void ) const {
// ---------------------------------------------------------------------------------------
static const char* methodName = "\nImplicitSolventParameters::isNotReady";
// ---------------------------------------------------------------------------------------
int errors = 0;
int warning = 0;
std::stringstream message;
message << methodName;
if( getNumberOfAtoms() <= 0 ){
errors++;
message << "\n number of atoms=" << getNumberOfAtoms() << " is invalid.";
}
RealOpenMM* atomicRadii = getAtomicRadii();
if( atomicRadii == NULL ){
errors++;
message << "\n scaledRadiusFactors is not set";
}
// check radii are in correct units
RealOpenMM average, stdDev, maxValue, minValue;
int minIndex, maxIndex;
SimTKOpenMMUtilities::getArrayStatistics( getNumberOfAtoms(), atomicRadii, &average,
&stdDev, &minValue, &minIndex,
&maxValue, &maxIndex );
if( average < 0.1 || average > 1.0 || minValue < 0.05 ){
errors++;
message << "\n atomic radii appear not to be set correctly -- radii should be in nanometers";
message << "\n average radius=" << average << " min radius=" << minValue << " at atom index=" << minIndex;
}
if( getPreFactor() == 0.0 ){
errors++;
message << "\n prefactor is not set.";
}
if( getSolventDielectric() <= 0.0 ){
errors++;
message << "\n solvent dielectric=" << getSolventDielectric() << " is invalid.";
}
if( getSolventDielectric() >= 1000.0 ){
warning++;
message << "\n Warning: solvent dielectric=" << getSolventDielectric() << " is large.";
}
if( getSoluteDielectric() <= 0.0 ){
errors++;
message << "\n solute dielectric=" << getSoluteDielectric() << " is invalid.";
}
if( getSoluteDielectric() >= 1000.0 ){
warning++;
message << "\n Warning: solute dielectric=" << getSoluteDielectric() << " is large.";
}
if( getElectricConstant() >= 0.0 ){
errors++;
message << "\n electric constant=" << getElectricConstant() << " is invalid.";
}
if( getElectricConstant() >= 1000.0 ){
warning++;
message << "\n Warning: electric constant=" << getElectricConstant() << " is large.";
}
if( getProbeRadius() <= 0.0 ){
errors++;
message << "\n probe radius=" << getProbeRadius() << " is invalid.";
}
if( getProbeRadius() >= 10.0 ){
warning++;
message << "\n Warning: probe radius=" << getProbeRadius() << " is large.";
}
/*
if( getPi4Asolv() <= 0.0 ){
errors++;
message << "\n Pi4Asolv=" << getPi4Asolv() << " is invalid.";
}
if( getPi4Asolv() >= 1000.0 ){
warning++;
message << "\n Warning: Pi4Asolv=" << getPi4Asolv() << " is large.";
}
*/
if( errors || warning ){
message << std::endl;
SimTKOpenMMLog::printMessage( message );
}
return errors;
}
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
Get string tab -- centralized Get string tab -- centralized
......
...@@ -367,16 +367,6 @@ class OPENMM_EXPORT ImplicitSolventParameters { ...@@ -367,16 +367,6 @@ class OPENMM_EXPORT ImplicitSolventParameters {
std::string getStringTab( void ) const; std::string getStringTab( void ) const;
/**---------------------------------------------------------------------------------------
Return nonzero value errors
@return ready status
--------------------------------------------------------------------------------------- */
virtual int isNotReady( void ) const;
}; };
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
......
...@@ -570,58 +570,6 @@ std::string ObcParameters::getStateString( const char* title ) const { ...@@ -570,58 +570,6 @@ std::string ObcParameters::getStateString( const char* title ) const {
} }
/**---------------------------------------------------------------------------------------
Return zero value if all parameters set; else return nonzero
@return ready status
--------------------------------------------------------------------------------------- */
int ObcParameters::isNotReady( void ) const {
// ---------------------------------------------------------------------------------------
static const char* methodName = "\nObcParameters::isNotReady";
// ---------------------------------------------------------------------------------------
int isReady = ImplicitSolventParameters::isNotReady();
int errors = 0;
std::stringstream message;
message << methodName;
const RealOpenMM* scaledRadiusFactors = getScaledRadiusFactors();
if( scaledRadiusFactors == NULL || scaledRadiusFactors[0] <= 0.0 ){
errors++;
message << "\n scaledRadiusFactors is not set";
}
// check scale factors are in correct units
RealOpenMM average, stdDev, maxValue, minValue;
int minIndex, maxIndex;
SimTKOpenMMUtilities::getArrayStatistics( getNumberOfAtoms(), scaledRadiusFactors, &average,
&stdDev, &minValue, &minIndex,
&maxValue, &maxIndex );
if( average < 0.3 || average > 2.0 || minValue < 0.1 ){
errors++;
message << "\n scale factors for atomic radii appear not to be set correctly -- radii should be in nm";
message << "\n average radius=" << average << " min radius=" << minValue << " at atom index=" << minIndex;
}
if( errors ){
message << std::endl;
SimTKOpenMMLog::printMessage( message );
}
errors += isReady;
return errors;
}
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
Set the force to use a cutoff. Set the force to use a cutoff.
......
...@@ -281,16 +281,6 @@ class ObcParameters : public ImplicitSolventParameters { ...@@ -281,16 +281,6 @@ class ObcParameters : public ImplicitSolventParameters {
std::string getStateString( const char* title ) const; std::string getStateString( const char* title ) const;
/**---------------------------------------------------------------------------------------
Return zero value if all parameters set; else return nonzero
@return ready status
--------------------------------------------------------------------------------------- */
int isNotReady( void ) const;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
Set the force to use a cutoff. Set the force to use a cutoff.
......
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