All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CustomCompoundBondForce.h
#ifndef OPENMM_CUSTOMCOMPOUNDBONDFORCE_H_
#define OPENMM_CUSTOMCOMPOUNDBONDFORCE_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-2014 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 "TabulatedFunction.h"
#include "Force.h"
#include "Vec3.h"
#include <vector>
#include "internal/windowsExport.h"
namespace OpenMM {
class OPENMM_EXPORT CustomCompoundBondForce : public Force {
public:
explicit CustomCompoundBondForce(int numParticles, const std::string& energy);
~CustomCompoundBondForce();
int getNumParticlesPerBond() const {
return particlesPerBond;
}
int getNumBonds() const {
return bonds.size();
}
int getNumPerBondParameters() const {
return bondParameters.size();
}
int getNumGlobalParameters() const {
return globalParameters.size();
}
int getNumTabulatedFunctions() const {
return functions.size();
}
int getNumFunctions() const {
return functions.size();
}
const std::string& getEnergyFunction() const;
void setEnergyFunction(const std::string& energy);
int addPerBondParameter(const std::string& name);
const std::string& getPerBondParameterName(int index) const;
void setPerBondParameterName(int index, const std::string& name);
int addGlobalParameter(const std::string& name, double defaultValue);
const std::string& getGlobalParameterName(int index) const;
void setGlobalParameterName(int index, const std::string& name);
double getGlobalParameterDefaultValue(int index) const;
void setGlobalParameterDefaultValue(int index, double defaultValue);
int addBond(const std::vector<int>& particles, const std::vector<double>& parameters);
void getBondParameters(int index, std::vector<int>& particles, std::vector<double>& parameters) const;
void setBondParameters(int index, const std::vector<int>& particles, const std::vector<double>& parameters);
int addTabulatedFunction(const std::string& name, TabulatedFunction* function);
const TabulatedFunction& getTabulatedFunction(int index) const;
TabulatedFunction& getTabulatedFunction(int index);
const std::string& getTabulatedFunctionName(int index) const;
int addFunction(const std::string& name, const std::vector<double>& values, double min, double max);
void getFunctionParameters(int index, std::string& name, std::vector<double>& values, double& min, double& max) const;
void setFunctionParameters(int index, const std::string& name, const std::vector<double>& values, double min, double max);
void updateParametersInContext(Context& context);
bool usesPeriodicBoundaryConditions() const {
return false;
}
protected:
ForceImpl* createImpl() const;
private:
class BondInfo;
class BondParameterInfo;
class GlobalParameterInfo;
class FunctionInfo;
int particlesPerBond;
std::string energyExpression;
std::vector<BondParameterInfo> bondParameters;
std::vector<GlobalParameterInfo> globalParameters;
std::vector<BondInfo> bonds;
std::vector<FunctionInfo> functions;
};
class CustomCompoundBondForce::BondInfo {
public:
std::vector<int> particles;
std::vector<double> parameters;
BondInfo() {
}
BondInfo(const std::vector<int>& particles, const std::vector<double>& parameters) :
particles(particles), parameters(parameters) {
}
};
class CustomCompoundBondForce::BondParameterInfo {
public:
std::string name;
BondParameterInfo() {
}
BondParameterInfo(const std::string& name) : name(name) {
}
};
class CustomCompoundBondForce::GlobalParameterInfo {
public:
std::string name;
double defaultValue;
GlobalParameterInfo() {
}
GlobalParameterInfo(const std::string& name, double defaultValue) : name(name), defaultValue(defaultValue) {
}
};
class CustomCompoundBondForce::FunctionInfo {
public:
std::string name;
TabulatedFunction* function;
FunctionInfo() {
}
FunctionInfo(const std::string& name, TabulatedFunction* function) : name(name), function(function) {
}
};
} // namespace OpenMM
#endif /*OPENMM_CUSTOMCOMPOUNDBONDFORCE_H_*/
OpenMM::CustomCompoundBondForce::usesPeriodicBoundaryConditions
bool usesPeriodicBoundaryConditions() const
Returns whether or not this force makes use of periodic boundary conditions.
Definition: CustomCompoundBondForce.h:307
OpenMM::TabulatedFunction
A TabulatedFunction uses a set of tabulated values to define a mathematical function.
Definition: TabulatedFunction.h:58
OpenMM::Context
A Context stores the complete state of a simulation.
Definition: Context.h:67
OpenMM::CustomCompoundBondForce::getNumPerBondParameters
int getNumPerBondParameters() const
Get the number of per-bond parameters that the interaction depends on.
Definition: CustomCompoundBondForce.h:127
OpenMM::CustomCompoundBondForce::getNumTabulatedFunctions
int getNumTabulatedFunctions() const
Get the number of tabulated functions that have been defined.
Definition: CustomCompoundBondForce.h:139
OpenMM::Force
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
OpenMM::CustomCompoundBondForce::getNumBonds
int getNumBonds() const
Get the number of bonds for which force field parameters have been defined.
Definition: CustomCompoundBondForce.h:121
OpenMM::CustomCompoundBondForce::getNumParticlesPerBond
int getNumParticlesPerBond() const
Get the number of particles used to define each bond.
Definition: CustomCompoundBondForce.h:115
OpenMM::CustomCompoundBondForce::getNumFunctions
int getNumFunctions() const
Get the number of tabulated functions that have been defined.
Definition: CustomCompoundBondForce.h:147
OpenMM::CustomCompoundBondForce::getNumGlobalParameters
int getNumGlobalParameters() const
Get the number of global parameters that the interaction depends on.
Definition: CustomCompoundBondForce.h:133
OpenMM::CustomCompoundBondForce
This class supports a wide variety of bonded interactions.
Definition: CustomCompoundBondForce.h:100
OpenMM
Definition: AndersenThermostat.h:40