"vscode:/vscode.git/clone" did not exist on "eeaf98b0b164e7213596be7afcb848f4d5306080"
Commit a587c652 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Minor mods

parent 7f561d68
......@@ -42,11 +42,7 @@ using OpenMM::RealVec;
--------------------------------------------------------------------------------------- */
CpuGBVISoftcore::CpuGBVISoftcore( GBVISoftcoreParameters* gbviParameters ){
// ---------------------------------------------------------------------------------------
_gbviParameters = gbviParameters;
CpuGBVISoftcore::CpuGBVISoftcore( GBVISoftcoreParameters* gbviParameters ) : _gbviParameters(gbviParameters) {
_switchDeriviative.resize(_gbviParameters->getNumberOfAtoms());
}
......@@ -69,9 +65,6 @@ CpuGBVISoftcore::~CpuGBVISoftcore( ){
--------------------------------------------------------------------------------------- */
GBVISoftcoreParameters* CpuGBVISoftcore::getGBVISoftcoreParameters( void ) const {
// ---------------------------------------------------------------------------------------
return _gbviParameters;
}
......
......@@ -44,10 +44,12 @@ using OpenMM::RealVec;
--------------------------------------------------------------------------------------- */
CpuObcSoftcore::CpuObcSoftcore( ObcSoftcoreParameters* obcSoftcoreParameters ){
_obcSoftcoreParameters = obcSoftcoreParameters;
_includeAceApproximation = 1;
CpuObcSoftcore::CpuObcSoftcore( ObcSoftcoreParameters* obcSoftcoreParameters ) :
_obcSoftcoreParameters(obcSoftcoreParameters),
_includeAceApproximation(1) {
_obcChain.resize(_obcSoftcoreParameters->getNumberOfAtoms());
}
/**---------------------------------------------------------------------------------------
......@@ -132,7 +134,7 @@ void CpuObcSoftcore::setIncludeAceApproximation( int includeAceApproximation ){
--------------------------------------------------------------------------------------- */
void CpuObcSoftcore::computeBornRadii( vector<RealVec>& atomCoordinates, RealOpenMMVector& bornRadii ){
void CpuObcSoftcore::computeBornRadii( const vector<RealVec>& atomCoordinates, RealOpenMMVector& bornRadii ){
// ---------------------------------------------------------------------------------------
......@@ -191,6 +193,7 @@ void CpuObcSoftcore::computeBornRadii( vector<RealVec>& atomCoordinates, RealOp
RealOpenMM rScaledRadiusJ = r + scaledRadiusJ;
if( offsetRadiusI < rScaledRadiusJ ){
RealOpenMM rInverse = one/r;
RealOpenMM l_ij = offsetRadiusI > FABS( r - scaledRadiusJ ) ? offsetRadiusI : FABS( r - scaledRadiusJ );
l_ij = one/l_ij;
......@@ -248,7 +251,8 @@ void CpuObcSoftcore::computeAceNonPolarForce( const ObcSoftcoreParameters* obcSo
const vector<RealOpenMM>& bornRadii, RealOpenMM* energy,
vector<RealOpenMM>& forces ) const {
static const RealOpenMM minusSix = -6.0;
static const RealOpenMM zero = 0.0;
static const RealOpenMM six = 6.0;
// ---------------------------------------------------------------------------------------
......@@ -277,12 +281,12 @@ void CpuObcSoftcore::computeAceNonPolarForce( const ObcSoftcoreParameters* obcSo
// no paper to cite.
for( int atomI = 0; atomI < numberOfAtoms; atomI++ ){
if( bornRadii[atomI] > 0.0 ){
if( bornRadii[atomI] > zero ){
RealOpenMM r = atomicRadii[atomI] + probeRadius;
RealOpenMM ratio6 = POW( atomicRadii[atomI]/bornRadii[atomI], static_cast<RealOpenMM>( 6.0 ) );
RealOpenMM ratio6 = POW( atomicRadii[atomI]/bornRadii[atomI], six );
RealOpenMM saTerm = nonPolarScaleFactors[atomI]*surfaceAreaFactor*r*r*ratio6;
*energy += saTerm;
forces[atomI] += minusSix*saTerm/bornRadii[atomI];
forces[atomI] -= six*saTerm/bornRadii[atomI];
}
}
}
......@@ -295,7 +299,7 @@ void CpuObcSoftcore::computeAceNonPolarForce( const ObcSoftcoreParameters* obcSo
@param partialCharges partial charges
@param forces forces
The array bornRadii is also updated and the obcEnergy
@return energy
--------------------------------------------------------------------------------------- */
......@@ -369,6 +373,7 @@ RealOpenMM CpuObcSoftcore::computeBornEnergyForces( vector<RealVec>& atomCoordin
ReferenceForce::getDeltaR( atomCoordinates[atomI], atomCoordinates[atomJ], deltaR );
if (_obcSoftcoreParameters->getUseCutoff() && deltaR[ReferenceForce::RIndex] > _obcSoftcoreParameters->getCutoffDistance())
continue;
RealOpenMM r2 = deltaR[ReferenceForce::R2Index];
RealOpenMM deltaX = deltaR[ReferenceForce::XIndex];
RealOpenMM deltaY = deltaR[ReferenceForce::YIndex];
......
......@@ -26,7 +26,6 @@
#define __CpuObcSoftcore_H__
#include "ObcSoftcoreParameters.h"
#include "gbsa/CpuImplicitSolvent.h"
// ---------------------------------------------------------------------------------------
......@@ -109,17 +108,6 @@ class CpuObcSoftcore {
void setIncludeAceApproximation( int includeAceApproximation );
/**---------------------------------------------------------------------------------------
Get energy
@return energy
--------------------------------------------------------------------------------------- */
RealOpenMM getEnergy( void ) const;
/**---------------------------------------------------------------------------------------
Return OBC chain derivative: size = _implicitSolventParameters->getNumberOfAtoms()
......@@ -142,7 +130,7 @@ class CpuObcSoftcore {
--------------------------------------------------------------------------------------- */
void computeBornRadii( std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMMVector& bornRadii );
void computeBornRadii( const std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMMVector& bornRadii );
/**---------------------------------------------------------------------------------------
......
......@@ -41,10 +41,16 @@
ObcSoftcoreParameters::ObcSoftcoreParameters( int numberOfAtoms, ObcSoftcoreParameters::ObcType obcType ) :
_numberOfAtoms(numberOfAtoms),
_obcType(obcType), _dielectricOffset(0.009), _nonPolarPreFactor(2.25936),
_soluteDielectric(1.0), _solventDielectric(78.3), _probeRadius(0.14),
_electricConstant(-0.5*ONE_4PI_EPS0), _pi4Asolv( 28.3919551),
_cutoff(false), _periodic(false) {
_obcType(obcType),
_dielectricOffset(0.009),
_nonPolarPreFactor(2.25936),
_soluteDielectric(1.0),
_solventDielectric(78.3),
_probeRadius(0.14),
_electricConstant(-0.5*ONE_4PI_EPS0),
_pi4Asolv( 28.3919551),
_cutoff(false),
_periodic(false) {
_atomicRadii.resize( numberOfAtoms );
_scaledRadiusFactors.resize( numberOfAtoms );
......@@ -156,6 +162,7 @@ RealOpenMM ObcSoftcoreParameters::getBetaObc( void ) const {
RealOpenMM ObcSoftcoreParameters::getGammaObc( void ) const {
return _gammaObc;
}
/**---------------------------------------------------------------------------------------
Get solvent dielectric
......
......@@ -77,7 +77,7 @@ class ObcSoftcoreParameters {
/**---------------------------------------------------------------------------------------
ObcSoftcoreParameters constructor (Simbios)
ObcSoftcoreParameters constructor
@param numberOfAtoms number of atoms
......@@ -87,7 +87,7 @@ class ObcSoftcoreParameters {
/**---------------------------------------------------------------------------------------
ObcSoftcoreParameters destructor (Simbios)
ObcSoftcoreParameters destructor
--------------------------------------------------------------------------------------- */
......@@ -115,7 +115,7 @@ class ObcSoftcoreParameters {
/**---------------------------------------------------------------------------------------
Get probe radius (Simbios)
Get probe radius
@return probeRadius
......@@ -125,7 +125,7 @@ class ObcSoftcoreParameters {
/**---------------------------------------------------------------------------------------
Set probe radius (Simbios)
Set probe radius
@param probeRadius probe radius
......@@ -136,7 +136,7 @@ class ObcSoftcoreParameters {
/**---------------------------------------------------------------------------------------
Get pi4Asolv: used in ACE approximation for nonpolar term
((RealOpenMM) M_PI)*4.0f*0.0049f*1000.0f; (Simbios)
((RealOpenMM) M_PI)*4.0f*0.0049f*1000.0f;
@return pi4Asolv
......@@ -236,7 +236,7 @@ class ObcSoftcoreParameters {
/**---------------------------------------------------------------------------------------
Get solvent dielectric (Simbios)
Get solvent dielectric
@return dielectricOffset dielectric offset
......
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