mirror of
https://github.com/openmm/openmm
synced 2026-06-03 06:39:48 +09:00
360 lines
12 KiB
C++
360 lines
12 KiB
C++
|
|
/* Portions copyright (c) 2006-2009 Stanford University and Simbios.
|
|
* Contributors: Pande Group
|
|
*
|
|
* 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.
|
|
*/
|
|
|
|
#ifndef __ObcParameters_H__
|
|
#define __ObcParameters_H__
|
|
|
|
#include "openmm/Vec3.h"
|
|
#include <vector>
|
|
|
|
namespace OpenMM {
|
|
|
|
class ObcParameters {
|
|
|
|
public:
|
|
|
|
// OBC types
|
|
|
|
enum ObcType { ObcTypeI, ObcTypeII };
|
|
|
|
private:
|
|
|
|
// OBC constants & parameters
|
|
|
|
int _numberOfAtoms;
|
|
|
|
double _solventDielectric;
|
|
double _soluteDielectric;
|
|
double _electricConstant;
|
|
double _probeRadius;
|
|
double _pi4Asolv;
|
|
|
|
double _dielectricOffset;
|
|
double _alphaObc;
|
|
double _betaObc;
|
|
double _gammaObc;
|
|
ObcType _obcType;
|
|
|
|
// scaled radius factors (S_kk in HCT paper)
|
|
|
|
std::vector<double> _atomicRadii;
|
|
std::vector<double> _scaledRadiusFactors;
|
|
|
|
// cutoff and periodic boundary conditions
|
|
|
|
bool _cutoff;
|
|
bool _periodic;
|
|
OpenMM::Vec3 _periodicBoxVectors[3];
|
|
double _cutoffDistance;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Set solvent dielectric
|
|
|
|
@param dielectricOffset solvent dielectric
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
void setDielectricOffset(double dielectricOffset);
|
|
|
|
public:
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
ObcParameters constructor
|
|
|
|
@param numberOfAtoms number of atoms
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
ObcParameters(int numberOfAtoms, ObcParameters::ObcType obcType = ObcTypeII);
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
ObcParameters destructor
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
~ObcParameters();
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get number of atoms
|
|
|
|
@return number of atoms
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
int getNumberOfAtoms() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get electric constant
|
|
|
|
@return electric constant
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
double getElectricConstant() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get probe radius (Simbios)
|
|
|
|
@return probeRadius
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
double getProbeRadius() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Set probe radius (Simbios)
|
|
|
|
@param probeRadius probe radius
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
void setProbeRadius(double probeRadius);
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get pi4Asolv: used in ACE approximation for nonpolar term
|
|
M_PI*4.0f*0.0049f*1000.0f; (Simbios)
|
|
|
|
@return pi4Asolv
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
double getPi4Asolv() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Set pi4Asolv
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
void setPi4Asolv(double pi4Asolv);
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get solvent dielectric
|
|
|
|
@return solvent dielectric
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
double getSolventDielectric() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Set solvent dielectric
|
|
|
|
@param solventDielectric solvent dielectric
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
void setSolventDielectric(double solventDielectric);
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get solute dielectric
|
|
|
|
@return soluteDielectric
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
double getSoluteDielectric() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Set solute dielectric
|
|
|
|
@param soluteDielectric solute dielectric
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
void setSoluteDielectric(double soluteDielectric);
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get OBC type
|
|
|
|
@return OBC type
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
ObcParameters::ObcType getObcType() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Set OBC type specific parameters
|
|
|
|
@param obcType OBC type (ObcTypeI or ObcTypeII -- Eq. 7 or 8)
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
void setObcTypeParameters(ObcParameters::ObcType obcType);
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get alpha OBC (Eqs. 6 & 7) in Proteins paper
|
|
|
|
@return alphaObc
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
double getAlphaObc() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get beta OBC (Eqs. 6 & 7) in Proteins paper
|
|
|
|
@return betaObc
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
double getBetaObc() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get gamma OBC (Eqs. 6 & 7) in Proteins paper
|
|
|
|
@return gammaObc
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
double getGammaObc() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get solvent dielectric
|
|
|
|
@return dielectricOffset dielectric offset
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
double getDielectricOffset() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Return OBC scale factors
|
|
|
|
@return array
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
const std::vector<double>& getScaledRadiusFactors() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Return OBC scale factors
|
|
|
|
@return array
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
void setScaledRadiusFactors(const std::vector<double>& scaledRadiusFactors);
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get AtomicRadii array w/ dielectric offset applied
|
|
|
|
@return array of atom volumes
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
const std::vector<double>& getAtomicRadii() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Set AtomicRadii array
|
|
|
|
@param atomicRadii vector of atomic radii
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
void setAtomicRadii(const std::vector<double>& atomicRadii);
|
|
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Set the force to use a cutoff.
|
|
|
|
@param distance the cutoff distance
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
void setUseCutoff(double distance);
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get whether to use a cutoff.
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
bool getUseCutoff() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get the cutoff distance.
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
double getCutoffDistance() const;
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Set the force to use periodic boundary conditions. This requires that a cutoff has
|
|
already been set, and the smallest side of the periodic box is at least twice the cutoff
|
|
distance.
|
|
|
|
@param vectors the vectors defining the periodic box
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
void setPeriodic(OpenMM::Vec3* vectors);
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get whether to use periodic boundary conditions.
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
bool getPeriodic();
|
|
|
|
/**---------------------------------------------------------------------------------------
|
|
|
|
Get the periodic box vectors
|
|
|
|
--------------------------------------------------------------------------------------- */
|
|
|
|
const OpenMM::Vec3* getPeriodicBox();
|
|
|
|
};
|
|
|
|
} // namespace OpenMM
|
|
|
|
#endif // __ObcParameters_H__
|