From c41bf0f82bf5b8105638dd78eebd352eff3f0b35 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 3 Apr 2025 15:57:45 +0100 Subject: [PATCH 01/10] Initial commit for inverse distance restraint --- corelib/src/libs/SireMM/CMakeLists.txt | 2 + .../src/libs/SireMM/inversebondrestraints.cpp | 680 ++++++++++++++++++ .../src/libs/SireMM/inversebondrestraints.h | 209 ++++++ src/sire/mm/__init__.py | 5 + src/sire/restraints/__init__.py | 23 +- src/sire/restraints/_restraints.py | 114 +++ .../SireOpenMM/sire_to_openmm_system.cpp | 73 ++ wrapper/MM/CMakeAutogenFile.txt | 2 + wrapper/MM/InverseBondRestraint.pypp.cpp | 219 ++++++ wrapper/MM/InverseBondRestraint.pypp.hpp | 10 + wrapper/MM/InverseBondRestraints.pypp.cpp | 314 ++++++++ wrapper/MM/InverseBondRestraints.pypp.hpp | 10 + wrapper/MM/SireMM_registrars.cpp | 3 + wrapper/MM/_MM.main.cpp | 8 + wrapper/MM/active_headers.h | 1 + 15 files changed, 1671 insertions(+), 2 deletions(-) create mode 100644 corelib/src/libs/SireMM/inversebondrestraints.cpp create mode 100644 corelib/src/libs/SireMM/inversebondrestraints.h create mode 100644 wrapper/MM/InverseBondRestraint.pypp.cpp create mode 100644 wrapper/MM/InverseBondRestraint.pypp.hpp create mode 100644 wrapper/MM/InverseBondRestraints.pypp.cpp create mode 100644 wrapper/MM/InverseBondRestraints.pypp.hpp diff --git a/corelib/src/libs/SireMM/CMakeLists.txt b/corelib/src/libs/SireMM/CMakeLists.txt index f0e650fba..3e72a93f9 100644 --- a/corelib/src/libs/SireMM/CMakeLists.txt +++ b/corelib/src/libs/SireMM/CMakeLists.txt @@ -69,6 +69,7 @@ set ( SIREMM_HEADERS intragroupff.h intraljff.h intrasoftcljff.h + inversebondrestraints.h lj1264parameter.h ljfunction.h ljpair.h @@ -161,6 +162,7 @@ set ( SIREMM_SOURCES intragroupff.cpp intraljff.cpp intrasoftcljff.cpp + inversebondrestraints.cpp lj1264parameter.cpp ljpair.cpp ljparameter.cpp diff --git a/corelib/src/libs/SireMM/inversebondrestraints.cpp b/corelib/src/libs/SireMM/inversebondrestraints.cpp new file mode 100644 index 000000000..b3ee45068 --- /dev/null +++ b/corelib/src/libs/SireMM/inversebondrestraints.cpp @@ -0,0 +1,680 @@ +/********************************************\ + * + * Sire - Molecular Simulation Framework + * + * Copyright (C) 2023 Christopher Woods + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * For full details of the license please see the COPYING file + * that should have come with this distribution. + * + * You can contact the authors via the website + * at https://sire.openbiosim.org + * +\*********************************************/ + +#include "inversebondrestraints.h" + +#include "SireUnits/units.h" + +#include "SireID/index.h" + +#include "SireError/errors.h" + +#include "SireStream/datastream.h" +#include "SireStream/shareddatastream.h" + +#include + +using namespace SireMM; +using namespace SireMaths; +using namespace SireBase; +using namespace SireUnits; +using namespace SireUnits::Dimension; +using namespace SireStream; + +/////// +/////// Implementation of InverseBondRestraint +/////// + +static const RegisterMetaType r_bndrest; + +QDataStream &operator<<(QDataStream &ds, const InverseBondRestraint &bndrest) +{ + writeHeader(ds, r_bndrest, 1); + + SharedDataStream sds(ds); + + sds << bndrest.atms0 << bndrest.atms1 << bndrest._k << bndrest._r0 + << static_cast(bndrest); + + return ds; +} + +QDataStream &operator>>(QDataStream &ds, InverseBondRestraint &bndrest) +{ + VersionID v = readHeader(ds, r_bndrest); + + if (v == 1) + { + SharedDataStream sds(ds); + + sds >> bndrest.atms0 >> bndrest.atms1 >> bndrest._k >> bndrest._r0 >> static_cast(bndrest); + } + else + throw version_error(v, "1", r_bndrest, CODELOC); + + return ds; +} + +/** Null constructor */ +InverseBondRestraint::InverseBondRestraint() + : ConcreteProperty(), + _k(0), _r0(0) +{ +} + +/** Construct to restrain the atom at index 'atom' to the specified position + * using the specified force constant and flat-bottom well-width + */ +InverseBondRestraint::InverseBondRestraint(qint64 atom0, qint64 atom1, + const SireUnits::Dimension::HarmonicBondConstant &k, + const SireUnits::Dimension::Length &r0) + : ConcreteProperty(), + _k(k), _r0(r0) +{ + if (atom0 == atom1) + throw SireError::invalid_arg(QObject::tr( + "You cannot create a bond restraint between identical atoms! %1-%2") + .arg(atom0) + .arg(atom1), + CODELOC); + + atms0 = QVector(1, atom0); + atms0.squeeze(); + + atms1 = QVector(1, atom1); + atms1.squeeze(); +} + +/** Construct to restrain the centroid of the atoms whose indicies are + * in 'atoms' to the specified position using the specified force constant + * and flat-bottom well width + */ +InverseBondRestraint::InverseBondRestraint(const QList &atoms0, + const QList &atoms1, + const SireUnits::Dimension::HarmonicBondConstant &k, + const SireUnits::Dimension::Length &r0) + : ConcreteProperty(), + _k(k), _r0(r0) +{ + if (atoms0.isEmpty() or atoms1.isEmpty()) + return; + + // remove duplicates + atms0.reserve(atoms0.count()); + + auto sorted = atoms0; + std::sort(sorted.begin(), sorted.end()); + + atms0.append(sorted.at(0)); + + for (const auto &atom : sorted) + { + if (atom != atms0.last()) + atms0.append(atom); + } + + atms0.squeeze(); + + // now the same for atoms1 + atms1.reserve(atoms1.count()); + + sorted = atoms1; + std::sort(sorted.begin(), sorted.end()); + + if (atms0.indexOf(sorted.at(0)) != -1) + throw SireError::invalid_arg(QObject::tr( + "You cannot have an overlap in atoms between the two groups. Atom " + "%1 appears in both!") + .arg(sorted.at(0)), + CODELOC); + + atms1.append(sorted.at(0)); + + for (const auto &atom : sorted) + { + if (atom != atms1.last()) + { + if (atms0.indexOf(atom) != -1) + throw SireError::invalid_arg(QObject::tr( + "You cannot have an overlap in atoms between the two groups. Atom " + "%1 appears in both!") + .arg(sorted.at(0)), + CODELOC); + + atms1.append(atom); + } + + atms1.squeeze(); + } +} + +/** Copy constructor */ +InverseBondRestraint::InverseBondRestraint(const InverseBondRestraint &other) + : ConcreteProperty(other), + atms0(other.atms0), atms1(other.atms1), _k(other._k), _r0(other._r0) +{ +} + +InverseBondRestraint::~InverseBondRestraint() +{ +} + +InverseBondRestraint &InverseBondRestraint::operator=(const InverseBondRestraint &other) +{ + if (this != &other) + { + atms0 = other.atms0; + atms1 = other.atms1; + _k = other._k; + _r0 = other._r0; + } + + return *this; +} + +bool InverseBondRestraint::operator==(const InverseBondRestraint &other) const +{ + return atms0 == other.atms0 and atms1 == other.atms1 and + _k == other._k and _r0 == other._r0; +} + +bool InverseBondRestraint::operator!=(const InverseBondRestraint &other) const +{ + return not operator==(other); +} + +InverseBondRestraints InverseBondRestraint::operator+(const InverseBondRestraint &other) const +{ + return InverseBondRestraints(*this) + other; +} + +InverseBondRestraints InverseBondRestraint::operator+(const InverseBondRestraints &other) const +{ + return InverseBondRestraints(*this) + other; +} + +const char *InverseBondRestraint::typeName() +{ + return QMetaType::typeName(qMetaTypeId()); +} + +const char *InverseBondRestraint::what() const +{ + return InverseBondRestraint::typeName(); +} + +InverseBondRestraint *InverseBondRestraint::clone() const +{ + return new InverseBondRestraint(*this); +} + +bool InverseBondRestraint::isNull() const +{ + return atms0.isEmpty() or atms1.isEmpty(); +} + +QString InverseBondRestraint::toString() const +{ + if (this->isNull()) + return QObject::tr("InverseBondRestraint::null"); + + else if (this->isAtomRestraint()) + { + return QString("InverseBondRestraint( %1 <=> %2, k=%3 : r0=%4 )") + .arg(this->atom0()) + .arg(this->atom1()) + .arg(_k.toString()) + .arg(_r0.toString()); + } + else + { + QStringList a0, a1; + + for (const auto &atom : atms0) + { + a0.append(QString::number(atom)); + } + + for (const auto &atom : atms1) + { + a1.append(QString::number(atom)); + } + + return QString("InverseBondRestraint( [%1] <=> [%2], k=%3 : r0=%4 )") + .arg(a0.join(", ")) + .arg(a1.join(", ")) + .arg(_k.toString()) + .arg(_r0.toString()); + } +} + +/** Return whether this is a single-atom restraint */ +bool InverseBondRestraint::isAtomRestraint() const +{ + return atms0.count() == 1 and atms1.count() == 1; +} + +/** Return whether this restraint acts on the centroid of a group + * of atoms */ +bool InverseBondRestraint::isCentroidRestraint() const +{ + return atms0.count() > 1 or atms1.count() > 1; +} + +/** Return the index of the atom if this is a single-atom restraint */ +qint64 InverseBondRestraint::atom0() const +{ + if (not this->isAtomRestraint()) + throw SireError::incompatible_error(QObject::tr( + "You cannot get the atom when this isn't a single-atom restraint!"), + CODELOC); + + return this->atms0.at(0); +} + +/** Return the index of the atom if this is a single-atom restraint */ +qint64 InverseBondRestraint::atom1() const +{ + if (not this->isAtomRestraint()) + throw SireError::incompatible_error(QObject::tr( + "You cannot get the atom when this isn't a single-atom restraint!"), + CODELOC); + + return this->atms1.at(0); +} + +/** Return the indexes of the atoms whose centroid is to be restrained */ +QVector InverseBondRestraint::atoms0() const +{ + if (not this->isCentroidRestraint()) + throw SireError::incompatible_error(QObject::tr( + "You cannot get the atoms when this isn't a centroid restraint!"), + CODELOC); + + return this->atms0; +} + +/** Return the indexes of the atoms whose centroid is to be restrained */ +QVector InverseBondRestraint::atoms1() const +{ + if (not this->isCentroidRestraint()) + throw SireError::incompatible_error(QObject::tr( + "You cannot get the atoms when this isn't a centroid restraint!"), + CODELOC); + + return this->atms1; +} + +/** Return the force constant for the restraint */ +SireUnits::Dimension::HarmonicBondConstant InverseBondRestraint::k() const +{ + return this->_k; +} + +/** Return the width of the harmonic bond. */ +SireUnits::Dimension::Length InverseBondRestraint::r0() const +{ + return this->_r0; +} + +/////// +/////// Implementation of InverseBondRestraints +/////// + +static const RegisterMetaType r_bndrests; + +QDataStream &operator<<(QDataStream &ds, const InverseBondRestraints &bndrests) +{ + writeHeader(ds, r_bndrests, 1); + + SharedDataStream sds(ds); + + sds << bndrests.r + << static_cast(bndrests); + + return ds; +} + +QDataStream &operator>>(QDataStream &ds, InverseBondRestraints &bndrests) +{ + VersionID v = readHeader(ds, r_bndrests); + + if (v == 1) + { + SharedDataStream sds(ds); + + sds >> bndrests.r >> static_cast(bndrests); + } + else + throw version_error(v, "1", r_bndrests, CODELOC); + + return ds; +} + +/** Null constructor */ +InverseBondRestraints::InverseBondRestraints() + : ConcreteProperty() +{ +} + +InverseBondRestraints::InverseBondRestraints(const QString &name) + : ConcreteProperty(name) +{ +} + +InverseBondRestraints::InverseBondRestraints(const InverseBondRestraint &restraint) + : ConcreteProperty() +{ + if (not restraint.isNull()) + r.append(restraint); +} + +InverseBondRestraints::InverseBondRestraints(const QList &restraints) + : ConcreteProperty() +{ + for (const auto &restraint : restraints) + { + if (not restraint.isNull()) + r.append(restraint); + } +} + +InverseBondRestraints::InverseBondRestraints(const QString &name, + const InverseBondRestraint &restraint) + : ConcreteProperty(name) +{ + if (not restraint.isNull()) + r.append(restraint); +} + +InverseBondRestraints::InverseBondRestraints(const QString &name, + const QList &restraints) + : ConcreteProperty(name) +{ + for (const auto &restraint : restraints) + { + if (not restraint.isNull()) + r.append(restraint); + } +} + +InverseBondRestraints::InverseBondRestraints(const InverseBondRestraints &other) + : ConcreteProperty(other), r(other.r) +{ +} + +InverseBondRestraints::~InverseBondRestraints() +{ +} + +InverseBondRestraints &InverseBondRestraints::operator=(const InverseBondRestraints &other) +{ + r = other.r; + Restraints::operator=(other); + return *this; +} + +bool InverseBondRestraints::operator==(const InverseBondRestraints &other) const +{ + return r == other.r and Restraints::operator==(other); +} + +bool InverseBondRestraints::operator!=(const InverseBondRestraints &other) const +{ + return not operator==(other); +} + +const char *InverseBondRestraints::typeName() +{ + return QMetaType::typeName(qMetaTypeId()); +} + +const char *InverseBondRestraints::what() const +{ + return InverseBondRestraints::typeName(); +} + +InverseBondRestraints *InverseBondRestraints::clone() const +{ + return new InverseBondRestraints(*this); +} + +QString InverseBondRestraints::toString() const +{ + if (this->isEmpty()) + return QObject::tr("InverseBondRestraints::null"); + + QStringList parts; + + const auto n = this->count(); + + if (n <= 10) + { + for (int i = 0; i < n; ++i) + { + parts.append(QObject::tr("%1: %2").arg(i).arg(this->r.at(i).toString())); + } + } + else + { + for (int i = 0; i < 5; ++i) + { + parts.append(QObject::tr("%1: %2").arg(i).arg(this->r.at(i).toString())); + } + + parts.append("..."); + + for (int i = n - 5; i < n; ++i) + { + parts.append(QObject::tr("%1: %2").arg(i).arg(this->r.at(i).toString())); + } + } + + return QObject::tr("InverseBondRestraints( name=%1, size=%2\n%3\n)").arg(this->name()).arg(n).arg(parts.join("\n")); +} + +/** Return whether or not this is empty */ +bool InverseBondRestraints::isEmpty() const +{ + return this->r.isEmpty(); +} + +/** Return whether or not this is empty */ +bool InverseBondRestraints::isNull() const +{ + return this->isEmpty(); +} + +/** Return the number of restraints */ +int InverseBondRestraints::nRestraints() const +{ + return this->r.count(); +} + +/** Return the number of restraints */ +int InverseBondRestraints::count() const +{ + return this->nRestraints(); +} + +/** Return the number of restraints */ +int InverseBondRestraints::size() const +{ + return this->nRestraints(); +} + +/** Return the number of atom restraints */ +int InverseBondRestraints::nAtomRestraints() const +{ + int n = 0; + + for (const auto &restraint : this->r) + { + n += int(restraint.isAtomRestraint()); + } + + return n; +} + +/** Return the number of centroid restraints */ +int InverseBondRestraints::nCentroidRestraints() const +{ + int n = 0; + + for (const auto &restraint : this->r) + { + n += int(restraint.isCentroidRestraint()); + } + + return n; +} + +/** Return whether or not there are any atom restraints */ +bool InverseBondRestraints::hasAtomRestraints() const +{ + for (const auto &restraint : this->r) + { + if (restraint.isAtomRestraint()) + return true; + } + + return false; +} + +/** Return whether or not there are any centroid restraints */ +bool InverseBondRestraints::hasCentroidRestraints() const +{ + for (const auto &restraint : this->r) + { + if (restraint.isCentroidRestraint()) + return true; + } + + return false; +} + +/** Return the ith restraint */ +const InverseBondRestraint &InverseBondRestraints::at(int i) const +{ + i = SireID::Index(i).map(this->r.count()); + + return this->r.at(i); +} + +/** Return the ith restraint */ +const InverseBondRestraint &InverseBondRestraints::operator[](int i) const +{ + return this->at(i); +} + +/** Return all of the restraints */ +QList InverseBondRestraints::restraints() const +{ + return this->r; +} + +/** Return all of the atom restraints */ +QList InverseBondRestraints::atomRestraints() const +{ + if (this->hasCentroidRestraints()) + { + QList ar; + + for (const auto &restraint : this->r) + { + if (restraint.isAtomRestraint()) + ar.append(restraint); + } + + return ar; + } + else + return this->restraints(); +} + +/** Return all of the centroid restraints */ +QList InverseBondRestraints::centroidRestraints() const +{ + if (this->hasAtomRestraints()) + { + QList cr; + + for (const auto &restraint : this->r) + { + if (restraint.isCentroidRestraint()) + cr.append(restraint); + } + + return cr; + } + else + return this->restraints(); +} + +/** Add a restraint onto the list */ +void InverseBondRestraints::add(const InverseBondRestraint &restraint) +{ + if (not restraint.isNull()) + this->r.append(restraint); +} + +/** Add a restraint onto the list */ +void InverseBondRestraints::add(const InverseBondRestraints &restraints) +{ + this->r += restraints.r; +} + +/** Add a restraint onto the list */ +InverseBondRestraints &InverseBondRestraints::operator+=(const InverseBondRestraint &restraint) +{ + this->add(restraint); + return *this; +} + +/** Add a restraint onto the list */ +InverseBondRestraints InverseBondRestraints::operator+(const InverseBondRestraint &restraint) const +{ + InverseBondRestraints ret(*this); + ret += restraint; + return *this; +} + +/** Add restraints onto the list */ +InverseBondRestraints &InverseBondRestraints::operator+=(const InverseBondRestraints &restraints) +{ + this->add(restraints); + return *this; +} + +/** Add restraints onto the list */ +InverseBondRestraints InverseBondRestraints::operator+(const InverseBondRestraints &restraints) const +{ + InverseBondRestraints ret(*this); + ret += restraints; + return *this; +} diff --git a/corelib/src/libs/SireMM/inversebondrestraints.h b/corelib/src/libs/SireMM/inversebondrestraints.h new file mode 100644 index 000000000..a3369ed3d --- /dev/null +++ b/corelib/src/libs/SireMM/inversebondrestraints.h @@ -0,0 +1,209 @@ +/********************************************\ + * + * Sire - Molecular Simulation Framework + * + * Copyright (C) 2023 Christopher Woods + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * For full details of the license please see the COPYING file + * that should have come with this distribution. + * + * You can contact the authors via the website + * at https://sire.openbiosim.org + * +\*********************************************/ + +#ifndef SIREMM_BONDRESTRAINTS_H +#define SIREMM_BONDRESTRAINTS_H + +#include "restraints.h" + +#include "SireUnits/dimensions.h" +#include "SireUnits/generalunit.h" + +SIRE_BEGIN_HEADER + +namespace SireMM +{ + class InverseBondRestraint; + class InverseBondRestraints; +} + +SIREMM_EXPORT QDataStream &operator<<(QDataStream &, const SireMM::InverseBondRestraint &); +SIREMM_EXPORT QDataStream &operator>>(QDataStream &, SireMM::InverseBondRestraint &); + +SIREMM_EXPORT QDataStream &operator<<(QDataStream &, const SireMM::InverseBondRestraints &); +SIREMM_EXPORT QDataStream &operator>>(QDataStream &, SireMM::InverseBondRestraints &); + +namespace SireMM +{ + + /** This class represents a single bond restraint between any two + * atoms in a system (or between the centroids of any two groups + * of atoms in a system) + */ + class SIREMM_EXPORT InverseBondRestraint + : public SireBase::ConcreteProperty + { + friend QDataStream & ::operator<<(QDataStream &, const SireMM::InverseBondRestraint &); + friend QDataStream & ::operator>>(QDataStream &, SireMM::InverseBondRestraint &); + + public: + InverseBondRestraint(); + InverseBondRestraint(qint64 atom0, qint64 atom1, + const SireUnits::Dimension::HarmonicBondConstant &k, + const SireUnits::Dimension::Length &r0); + + InverseBondRestraint(const QList &atoms0, + const QList &atoms1, + const SireUnits::Dimension::HarmonicBondConstant &k, + const SireUnits::Dimension::Length &r0); + + InverseBondRestraint(const InverseBondRestraint &other); + + ~InverseBondRestraint(); + + InverseBondRestraint &operator=(const InverseBondRestraint &other); + + bool operator==(const InverseBondRestraint &other) const; + bool operator!=(const InverseBondRestraint &other) const; + + InverseBondRestraints operator+(const InverseBondRestraint &other) const; + InverseBondRestraints operator+(const InverseBondRestraints &other) const; + + static const char *typeName(); + const char *what() const; + + InverseBondRestraint *clone() const; + + QString toString() const; + + bool isNull() const; + + bool isAtomRestraint() const; + bool isCentroidRestraint() const; + + qint64 atom0() const; + qint64 atom1() const; + + QVector atoms0() const; + QVector atoms1() const; + + SireUnits::Dimension::HarmonicBondConstant k() const; + SireUnits::Dimension::Length r0() const; + + private: + /** The first set of atoms involved in the restraint */ + QVector atms0; + + /** The second set of atoms involved in the restraint */ + QVector atms1; + + /** The force constant */ + SireUnits::Dimension::HarmonicBondConstant _k; + + /** The equilibrium distance for the restraint */ + SireUnits::Dimension::Length _r0; + }; + + /** This class provides the information for a collection of bond + * restraints that can be added to a collection of molecues. Each + * restraint can act on a pair of particles or a pair of the + * centroids of two collections of particles. + * The restaints are spherically symmetric, and + * are simple harmonic potentials + */ + class SIREMM_EXPORT InverseBondRestraints + : public SireBase::ConcreteProperty + { + friend QDataStream & ::operator<<(QDataStream &, const SireMM::InverseBondRestraints &); + friend QDataStream & ::operator>>(QDataStream &, SireMM::InverseBondRestraints &); + + public: + InverseBondRestraints(); + InverseBondRestraints(const QString &name); + + InverseBondRestraints(const InverseBondRestraint &restraint); + InverseBondRestraints(const QList &restraints); + + InverseBondRestraints(const QString &name, + const InverseBondRestraint &restraint); + + InverseBondRestraints(const QString &name, + const QList &restraints); + + InverseBondRestraints(const InverseBondRestraints &other); + + ~InverseBondRestraints(); + + InverseBondRestraints &operator=(const InverseBondRestraints &other); + + bool operator==(const InverseBondRestraints &other) const; + bool operator!=(const InverseBondRestraints &other) const; + + static const char *typeName(); + const char *what() const; + + InverseBondRestraints *clone() const; + + QString toString() const; + + bool isEmpty() const; + bool isNull() const; + + int count() const; + int size() const; + int nRestraints() const; + + int nAtomRestraints() const; + int nCentroidRestraints() const; + + bool hasAtomRestraints() const; + bool hasCentroidRestraints() const; + + const InverseBondRestraint &at(int i) const; + const InverseBondRestraint &operator[](int i) const; + + QList restraints() const; + + QList atomRestraints() const; + QList centroidRestraints() const; + + void add(const InverseBondRestraint &restraint); + void add(const InverseBondRestraints &restraints); + + InverseBondRestraints &operator+=(const InverseBondRestraint &restraint); + InverseBondRestraints &operator+=(const InverseBondRestraints &restraints); + + InverseBondRestraints operator+(const InverseBondRestraint &restraint) const; + InverseBondRestraints operator+(const InverseBondRestraints &restraints) const; + + private: + /** The actual list of restraints*/ + QList r; + }; + +} + +Q_DECLARE_METATYPE(SireMM::InverseBondRestraint) +Q_DECLARE_METATYPE(SireMM::InverseBondRestraints) + +SIRE_EXPOSE_CLASS(SireMM::InverseBondRestraint) +SIRE_EXPOSE_CLASS(SireMM::InverseBondRestraints) + +SIRE_END_HEADER + +#endif diff --git a/src/sire/mm/__init__.py b/src/sire/mm/__init__.py index 9df64e5d1..88125fec3 100644 --- a/src/sire/mm/__init__.py +++ b/src/sire/mm/__init__.py @@ -9,6 +9,8 @@ "Bond", "BondRestraint", "BondRestraints", + "InverseBondRestraint", + "InverseBondRestraints", "Dihedral", "Improper", "PositionRestraint", @@ -41,6 +43,9 @@ BondRestraint = _MM.BondRestraint BondRestraints = _MM.BondRestraints +InverseBondRestraint = _MM.InverseBondRestraint +InverseBondRestraints = _MM.InverseBondRestraints + BoreschRestraint = _MM.BoreschRestraint BoreschRestraints = _MM.BoreschRestraints diff --git a/src/sire/restraints/__init__.py b/src/sire/restraints/__init__.py index 166cb985c..456d9de4b 100644 --- a/src/sire/restraints/__init__.py +++ b/src/sire/restraints/__init__.py @@ -1,4 +1,23 @@ -__all__ = ["angle", "positional", "bond", "dihedral", "distance", "boresch", "get_standard_state_correction"] +__all__ = [ + "angle", + "positional", + "bond", + "dihedral", + "distance", + "boresch", + "get_standard_state_correction", + "inverse_distance", + "inverse_bond", +] -from ._restraints import angle, bond, boresch, dihedral, distance, positional +from ._restraints import ( + angle, + bond, + boresch, + dihedral, + distance, + inverse_bond, + inverse_distance, + positional, +) from ._standard_state_correction import get_standard_state_correction diff --git a/src/sire/restraints/_restraints.py b/src/sire/restraints/_restraints.py index 6e4d5d050..038c6563e 100644 --- a/src/sire/restraints/_restraints.py +++ b/src/sire/restraints/_restraints.py @@ -4,6 +4,8 @@ "bond", "dihedral", "distance", + "inverse_bond", + "inverse_distance", "positional", ] @@ -671,6 +673,118 @@ def bond(*args, **kwargs): return distance(*args, **kwargs) +def inverse_distance(mols, atoms0, atoms1, r0=None, k=None, name=None, map=None): + """ + Create a set of inverse distance restraints from all of the atoms in 'atoms0' + to all of the atoms in 'atoms1' where all atoms are + contained in the container 'mols', using the + passed values of 'k' and radius r0. + Note that 'k' corresponds to half the force constant, because + the restraint energy is defined as k*(r - r0)**2 (hence the force is + defined as 2*k*(r-r0)). + + These restraints will be per atom-atom distance. If a list of k and/or r0 + values are passed, then different values could be used for + different atom-atom distances (assuming the same number as the number of + atom-atom distances). Otherwise, all atom-atom distances will use the + same parameters. + + If r0 is None, then the current atom-atom distance for + each atom-atom pair will be used as the equilibium value. + + If k is None, then a default value of 150 kcal mol-1 A-2 will be used + """ + from .. import u + from ..base import create_map + from ..mm import InverseBondRestraint, InverseBondRestraints + + map = create_map(map) + + if k is None: + k = [u("150 kcal mol-1 A-2")] + elif type(k) is list: + k = [u(x) for x in k] + else: + k = [u(k)] + + atoms0 = _to_atoms(mols, atoms0) + atoms1 = _to_atoms(mols, atoms1) + + if atoms0.is_empty() or atoms1.is_empty(): + raise ValueError("We need at least one atom in each group") + + while len(atoms0) < len(atoms1): + atoms0 += atoms0[-1] + + while len(atoms1) < len(atoms0): + atoms1 += atoms1[-1] + + if r0 is None: + # calculate all of the current distances + from .. import measure + + r0 = [] + for atom0, atom1 in zip(atoms0, atoms1): + r0.append(measure(atom0, atom1)) + elif type(r0) is list: + r0 = [u(x) for x in r0] + else: + r0 = [u(r0)] + + mols = mols.atoms() + + if name is None: + restraints = InverseBondRestraints() + else: + restraints = InverseBondRestraints(name=name) + + for i, (atom0, atom1) in enumerate(zip(atoms0, atoms1)): + idxs0 = mols.find(atom0) + idxs1 = mols.find(atom1) + + if type(idxs0) is int: + idxs0 = [idxs0] + + if type(idxs1) is int: + idxs1 = [idxs1] + + if len(idxs0) == 0: + raise KeyError( + f"Could not find atom {atom0} in the molecules. Please ensure " + "that 'mols' contains all of that atoms, or else we can't " + "add the positional restraints." + ) + + if len(idxs1) == 0: + raise KeyError( + f"Could not find atom {atom1} in the molecules. Please ensure " + "that 'mols' contains all of that atoms, or else we can't " + "add the positional restraints." + ) + + if i < len(k): + ik = k[i] + else: + ik = k[-1] + + if i < len(r0): + ir0 = r0[i] + else: + ir0 = r0[-1] + + restraints.add(InverseBondRestraint(idxs0[0], idxs1[0], ik, ir0)) + + return restraints + + +def inverse_bond(*args, **kwargs): + """ + Synonym for distance(), as a bond restraint is treated the same + as a distance restraint + """ + return inverse_distance(*args, **kwargs) + + def positional(mols, atoms, k=None, r0=None, position=None, name=None, map=None): """ Create a set of position restraints for the atoms specified in diff --git a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp index 7016e7c7a..fcb97c15f 100644 --- a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp +++ b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp @@ -24,6 +24,7 @@ #include "SireMM/anglerestraints.h" #include "SireMM/atomljs.h" #include "SireMM/bondrestraints.h" +#include "SireMM/inversebondrestraints.h" #include "SireMM/boreschrestraints.h" #include "SireMM/dihedralrestraints.h" #include "SireMM/positionalrestraints.h" @@ -259,6 +260,73 @@ void _add_bond_restraints(const SireMM::BondRestraints &restraints, } } +void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraints, + OpenMM::System &system, LambdaLever &lambda_lever, + int natoms) +{ + if (inverserestraints.isEmpty()) + return; + + if (restraints.hasCentroidRestraints()) + { + throw SireError::unsupported(QObject::tr( + "Centroid bond restraints aren't yet supported..."), + CODELOC); + } + + const auto energy_expression = QString( + "rho*k*delta*delta*step;" + "delta=(r-r0);" + "step=max(0,min(1,(r - r0)))") + .toStdString(); + + auto *restraintff = new OpenMM::CustomBondForce(energy_expression); + restraintff->setName("InverseBondRestraintForce"); + + restraintff->addPerBondParameter("rho"); + restraintff->addPerBondParameter("k"); + restraintff->addPerBondParameter("r0"); + + restraintff->setUsesPeriodicBoundaryConditions(true); + + lambda_lever.addRestraintIndex(restraints.name(), + system.addForce(restraintff)); + + const auto atom_restraints = restraints.atomRestraints(); + + const double internal_to_nm = (1 * SireUnits::angstrom).to(SireUnits::nanometer); + const double internal_to_k = (1 * SireUnits::kcal_per_mol / (SireUnits::angstrom2)).to(SireUnits::kJ_per_mol / (SireUnits::nanometer2)); + + auto cljff = lambda_lever.getForce("clj", system); + + std::vector custom_params = {1.0, 0.0, 0.0}; + + for (const auto &restraint : atom_restraints) + { + int atom0_index = restraint.atom0(); + int atom1_index = restraint.atom1(); + + if (atom0_index < 0 or atom0_index >= natoms) + throw SireError::invalid_index(QObject::tr( + "Invalid particle index! %1 from %2") + .arg(atom0_index) + .arg(natoms), + CODELOC); + + if (atom1_index < 0 or atom1_index >= natoms) + throw SireError::invalid_index(QObject::tr( + "Invalid particle index! %1 from %2") + .arg(atom1_index) + .arg(natoms), + CODELOC); + + custom_params[0] = 1.0; // rho - always equal to 1 (scaled by lever) + custom_params[1] = restraint.k().value() * internal_to_k; // k + custom_params[2] = restraint.r0().value() * internal_to_nm; // rb + + restraintff->addBond(atom0_index, atom1_index, custom_params); + } +} /** Add all of the positional restraints from 'restraints' to the passed * system, which is acted on by the passed LambdaLever. All of the * existing anchor atoms are in 'anchor_coords', which this function @@ -1838,6 +1906,11 @@ OpenMMMetaData SireOpenMM::sire_to_openmm_system(OpenMM::System &system, _add_bond_restraints(prop.read().asA(), system, lambda_lever, start_index); } + else if (prop.read().isA()) + { + _add_bond_restraints(prop.read().asA(), + system, lambda_lever, start_index); + } else if (prop.read().isA()) { _add_boresch_restraints(prop.read().asA(), diff --git a/wrapper/MM/CMakeAutogenFile.txt b/wrapper/MM/CMakeAutogenFile.txt index 3c3a4985a..3c9b643d3 100644 --- a/wrapper/MM/CMakeAutogenFile.txt +++ b/wrapper/MM/CMakeAutogenFile.txt @@ -1,6 +1,7 @@ # WARNING - AUTOGENERATED FILE - CONTENTS WILL BE OVERWRITTEN! set ( PYPP_SOURCES BondRestraints.pypp.cpp + InverseBondRestraints.pypp.cpp SoftCLJPotentialInterface_IntraSoftCLJPotential_.pypp.cpp CLJRFFunction.pypp.cpp SoftCLJPotentialInterface_InterSoftCLJPotential_.pypp.cpp @@ -79,6 +80,7 @@ set ( PYPP_SOURCES Mover_SelectorBond_.pypp.cpp CoulombPotentialInterface_InterCoulombPotential_.pypp.cpp BondRestraint.pypp.cpp + InverseBondRestraint.pypp.cpp BoreschRestraint.pypp.cpp InternalSymbols.pypp.cpp CLJWorkspace.pypp.cpp diff --git a/wrapper/MM/InverseBondRestraint.pypp.cpp b/wrapper/MM/InverseBondRestraint.pypp.cpp new file mode 100644 index 000000000..ce86a5f7c --- /dev/null +++ b/wrapper/MM/InverseBondRestraint.pypp.cpp @@ -0,0 +1,219 @@ +// This file has been generated by Py++. + +// (C) Christopher Woods, GPL >= 3 License + +#include "boost/python.hpp" +#include "InverseBondRestraint.pypp.hpp" + +namespace bp = boost::python; + +#include "SireError/errors.h" + +#include "SireID/index.h" + +#include "SireStream/datastream.h" + +#include "SireStream/shareddatastream.h" + +#include "SireUnits/units.h" + +#include "inversebondrestraints.h" + +#include + +#include "inversebondrestraints.h" + +SireMM::InverseBondRestraint __copy__(const SireMM::InverseBondRestraint &other){ return SireMM::InverseBondRestraint(other); } + +#include "Helpers/copy.hpp" + +#include "Qt/qdatastream.hpp" + +#include "Helpers/str.hpp" + +#include "Helpers/release_gil_policy.hpp" + +void register_InverseBondRestraint_class(){ + + { //::SireMM::InverseBondRestraint + typedef bp::class_< SireMM::InverseBondRestraint, bp::bases< SireBase::Property > > InverseBondRestraint_exposer_t; + InverseBondRestraint_exposer_t InverseBondRestraint_exposer = InverseBondRestraint_exposer_t( "InverseBondRestraint", "This class represents a single inverse bond restraint between any two\natoms in a system (or between the centroids of any two groups\nof atoms in a system)\n", bp::init< >("Null constructor") ); + bp::scope InverseBondRestraint_scope( InverseBondRestraint_exposer ); + InverseBondRestraint_exposer.def( bp::init< qint64, qint64, SireUnits::Dimension::HarmonicBondConstant const &, SireUnits::Dimension::Length const & >(( bp::arg("atom0"), bp::arg("atom1"), bp::arg("k"), bp::arg("r0") ), "Construct to restrain the atom at index atom to the specified position\n using the specified force constant and flat-bottom well-width\n") ); + InverseBondRestraint_exposer.def( bp::init< QList< long long > const &, QList< long long > const &, SireUnits::Dimension::HarmonicBondConstant const &, SireUnits::Dimension::Length const & >(( bp::arg("atoms0"), bp::arg("atoms1"), bp::arg("k"), bp::arg("r0") ), "Construct to restrain the centroid of the atoms whose indicies are\n in atoms to the specified position using the specified force constant\n and flat-bottom well width\n") ); + InverseBondRestraint_exposer.def( bp::init< SireMM::InverseBondRestraint const & >(( bp::arg("other") ), "Copy constructor") ); + { //::SireMM::InverseBondRestraint::atom0 + + typedef ::qint64 ( ::SireMM::InverseBondRestraint::*atom0_function_type)( ) const; + atom0_function_type atom0_function_value( &::SireMM::InverseBondRestraint::atom0 ); + + InverseBondRestraint_exposer.def( + "atom0" + , atom0_function_value + , bp::release_gil_policy() + , "Return the index of the atom if this is a single-atom restraint" ); + + } + { //::SireMM::InverseBondRestraint::atom1 + + typedef ::qint64 ( ::SireMM::InverseBondRestraint::*atom1_function_type)( ) const; + atom1_function_type atom1_function_value( &::SireMM::InverseBondRestraint::atom1 ); + + InverseBondRestraint_exposer.def( + "atom1" + , atom1_function_value + , bp::release_gil_policy() + , "Return the index of the atom if this is a single-atom restraint" ); + + } + { //::SireMM::InverseBondRestraint::atoms0 + + typedef ::QVector< long long > ( ::SireMM::InverseBondRestraint::*atoms0_function_type)( ) const; + atoms0_function_type atoms0_function_value( &::SireMM::InverseBondRestraint::atoms0 ); + + InverseBondRestraint_exposer.def( + "atoms0" + , atoms0_function_value + , bp::release_gil_policy() + , "Return the indexes of the atoms whose centroid is to be restrained" ); + + } + { //::SireMM::InverseBondRestraint::atoms1 + + typedef ::QVector< long long > ( ::SireMM::InverseBondRestraint::*atoms1_function_type)( ) const; + atoms1_function_type atoms1_function_value( &::SireMM::InverseBondRestraint::atoms1 ); + + InverseBondRestraint_exposer.def( + "atoms1" + , atoms1_function_value + , bp::release_gil_policy() + , "Return the indexes of the atoms whose centroid is to be restrained" ); + + } + { //::SireMM::InverseBondRestraint::isAtomRestraint + + typedef bool ( ::SireMM::InverseBondRestraint::*isAtomRestraint_function_type)( ) const; + isAtomRestraint_function_type isAtomRestraint_function_value( &::SireMM::InverseBondRestraint::isAtomRestraint ); + + InverseBondRestraint_exposer.def( + "isAtomRestraint" + , isAtomRestraint_function_value + , bp::release_gil_policy() + , "Return whether this is a single-atom restraint" ); + + } + { //::SireMM::InverseBondRestraint::isCentroidRestraint + + typedef bool ( ::SireMM::InverseBondRestraint::*isCentroidRestraint_function_type)( ) const; + isCentroidRestraint_function_type isCentroidRestraint_function_value( &::SireMM::InverseBondRestraint::isCentroidRestraint ); + + InverseBondRestraint_exposer.def( + "isCentroidRestraint" + , isCentroidRestraint_function_value + , bp::release_gil_policy() + , "Return whether this restraint acts on the centroid of a group\n of atoms" ); + + } + { //::SireMM::InverseBondRestraint::isNull + + typedef bool ( ::SireMM::InverseBondRestraint::*isNull_function_type)( ) const; + isNull_function_type isNull_function_value( &::SireMM::InverseBondRestraint::isNull ); + + InverseBondRestraint_exposer.def( + "isNull" + , isNull_function_value + , bp::release_gil_policy() + , "" ); + + } + { //::SireMM::InverseBondRestraint::k + + typedef ::SireUnits::Dimension::HarmonicBondConstant ( ::SireMM::InverseBondRestraint::*k_function_type)( ) const; + k_function_type k_function_value( &::SireMM::InverseBondRestraint::k ); + + InverseBondRestraint_exposer.def( + "k" + , k_function_value + , bp::release_gil_policy() + , "Return the force constant for the restraint" ); + + } + InverseBondRestraint_exposer.def( bp::self != bp::self ); + InverseBondRestraint_exposer.def( bp::self + bp::self ); + InverseBondRestraint_exposer.def( bp::self + bp::other< SireMM::InverseBondRestraints >() ); + { //::SireMM::InverseBondRestraint::operator= + + typedef ::SireMM::InverseBondRestraint & ( ::SireMM::InverseBondRestraint::*assign_function_type)( ::SireMM::InverseBondRestraint const & ) ; + assign_function_type assign_function_value( &::SireMM::InverseBondRestraint::operator= ); + + InverseBondRestraint_exposer.def( + "assign" + , assign_function_value + , ( bp::arg("other") ) + , bp::return_self< >() + , "" ); + + } + InverseBondRestraint_exposer.def( bp::self == bp::self ); + { //::SireMM::InverseBondRestraint::r0 + + typedef ::SireUnits::Dimension::Length ( ::SireMM::InverseBondRestraint::*r0_function_type)( ) const; + r0_function_type r0_function_value( &::SireMM::InverseBondRestraint::r0 ); + + InverseBondRestraint_exposer.def( + "r0" + , r0_function_value + , bp::release_gil_policy() + , "Return the width of the harmonic bond." ); + + } + { //::SireMM::InverseBondRestraint::toString + + typedef ::QString ( ::SireMM::InverseBondRestraint::*toString_function_type)( ) const; + toString_function_type toString_function_value( &::SireMM::InverseBondRestraint::toString ); + + InverseBondRestraint_exposer.def( + "toString" + , toString_function_value + , bp::release_gil_policy() + , "" ); + + } + { //::SireMM::InverseBondRestraint::typeName + + typedef char const * ( *typeName_function_type )( ); + typeName_function_type typeName_function_value( &::SireMM::InverseBondRestraint::typeName ); + + InverseBondRestraint_exposer.def( + "typeName" + , typeName_function_value + , bp::release_gil_policy() + , "" ); + + } + { //::SireMM::InverseBondRestraint::what + + typedef char const * ( ::SireMM::InverseBondRestraint::*what_function_type)( ) const; + what_function_type what_function_value( &::SireMM::InverseBondRestraint::what ); + + InverseBondRestraint_exposer.def( + "what" + , what_function_value + , bp::release_gil_policy() + , "" ); + + } + InverseBondRestraint_exposer.staticmethod( "typeName" ); + InverseBondRestraint_exposer.def( "__copy__", &__copy__); + InverseBondRestraint_exposer.def( "__deepcopy__", &__copy__); + InverseBondRestraint_exposer.def( "clone", &__copy__); + InverseBondRestraint_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireMM::InverseBondRestraint >, + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + InverseBondRestraint_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireMM::InverseBondRestraint >, + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + InverseBondRestraint_exposer.def_pickle(sire_pickle_suite< ::SireMM::InverseBondRestraint >()); + InverseBondRestraint_exposer.def( "__str__", &__str__< ::SireMM::InverseBondRestraint > ); + InverseBondRestraint_exposer.def( "__repr__", &__str__< ::SireMM::InverseBondRestraint > ); + } + +} diff --git a/wrapper/MM/InverseBondRestraint.pypp.hpp b/wrapper/MM/InverseBondRestraint.pypp.hpp new file mode 100644 index 000000000..6d5132e38 --- /dev/null +++ b/wrapper/MM/InverseBondRestraint.pypp.hpp @@ -0,0 +1,10 @@ +// This file has been generated by Py++. + +// (C) Christopher Woods, GPL >= 3 License + +#ifndef InverseBondRestraint_hpp__pyplusplus_wrapper +#define InverseBondRestraint_hpp__pyplusplus_wrapper + +void register_InverseBondRestraint_class(); + +#endif//InverseBondRestraint_hpp__pyplusplus_wrapper diff --git a/wrapper/MM/InverseBondRestraints.pypp.cpp b/wrapper/MM/InverseBondRestraints.pypp.cpp new file mode 100644 index 000000000..c07bc1ec0 --- /dev/null +++ b/wrapper/MM/InverseBondRestraints.pypp.cpp @@ -0,0 +1,314 @@ +// This file has been generated by Py++. + +// (C) Christopher Woods, GPL >= 3 License + +#include "boost/python.hpp" +#include "Helpers/clone_const_reference.hpp" +#include "InverseBondRestraints.pypp.hpp" + +namespace bp = boost::python; + +#include "SireError/errors.h" + +#include "SireID/index.h" + +#include "SireStream/datastream.h" + +#include "SireStream/shareddatastream.h" + +#include "SireUnits/units.h" + +#include "inversebondrestraints.h" + +#include + +#include "inversebondrestraints.h" + +SireMM::InverseBondRestraints __copy__(const SireMM::InverseBondRestraints &other){ return SireMM::InverseBondRestraints(other); } + +#include "Helpers/copy.hpp" + +#include "Qt/qdatastream.hpp" + +#include "Helpers/str.hpp" + +#include "Helpers/release_gil_policy.hpp" + +#include "Helpers/len.hpp" + +void register_InverseBondRestraints_class(){ + + { //::SireMM::InverseBondRestraints + typedef bp::class_< SireMM::InverseBondRestraints, bp::bases< SireMM::Restraints, SireBase::Property > > InverseBondRestraints_exposer_t; + InverseBondRestraints_exposer_t InverseBondRestraints_exposer = InverseBondRestraints_exposer_t( "InverseBondRestraints", "This class provides the information for a collection of inverse bond\nrestraints that can be added to a collection of molecues. Each\nrestraint can act on a pair of particles or a pair of the\ncentroids of two collections of particles.\nThe restaints are spherically symmetric, and\nare simple harmonic potentials\n", bp::init< >("Null constructor") ); + bp::scope InverseBondRestraints_scope( InverseBondRestraints_exposer ); + InverseBondRestraints_exposer.def( bp::init< QString const & >(( bp::arg("name") ), "") ); + InverseBondRestraints_exposer.def( bp::init< SireMM::InverseBondRestraint const & >(( bp::arg("restraint") ), "") ); + InverseBondRestraints_exposer.def( bp::init< QList< SireMM::InverseBondRestraint > const & >(( bp::arg("restraints") ), "") ); + InverseBondRestraints_exposer.def( bp::init< QString const &, SireMM::InverseBondRestraint const & >(( bp::arg("name"), bp::arg("restraint") ), "") ); + InverseBondRestraints_exposer.def( bp::init< QString const &, QList< SireMM::InverseBondRestraint > const & >(( bp::arg("name"), bp::arg("restraints") ), "") ); + InverseBondRestraints_exposer.def( bp::init< SireMM::InverseBondRestraints const & >(( bp::arg("other") ), "") ); + { //::SireMM::InverseBondRestraints::add + + typedef void ( ::SireMM::InverseBondRestraints::*add_function_type)( ::SireMM::InverseBondRestraint const & ) ; + add_function_type add_function_value( &::SireMM::InverseBondRestraints::add ); + + InverseBondRestraints_exposer.def( + "add" + , add_function_value + , ( bp::arg("restraint") ) + , bp::release_gil_policy() + , "Add a restraint onto the list" ); + + } + { //::SireMM::InverseBondRestraints::add + + typedef void ( ::SireMM::InverseBondRestraints::*add_function_type)( ::SireMM::InverseBondRestraints const & ) ; + add_function_type add_function_value( &::SireMM::InverseBondRestraints::add ); + + InverseBondRestraints_exposer.def( + "add" + , add_function_value + , ( bp::arg("restraints") ) + , bp::release_gil_policy() + , "Add a restraint onto the list" ); + + } + { //::SireMM::InverseBondRestraints::at + + typedef ::SireMM::InverseBondRestraint const & ( ::SireMM::InverseBondRestraints::*at_function_type)( int ) const; + at_function_type at_function_value( &::SireMM::InverseBondRestraints::at ); + + InverseBondRestraints_exposer.def( + "at" + , at_function_value + , ( bp::arg("i") ) + , bp::return_value_policy() + , "Return the ith restraint" ); + + } + { //::SireMM::InverseBondRestraints::atomRestraints + + typedef ::QList< SireMM::InverseBondRestraint > ( ::SireMM::InverseBondRestraints::*atomRestraints_function_type)( ) const; + atomRestraints_function_type atomRestraints_function_value( &::SireMM::InverseBondRestraints::atomRestraints ); + + InverseBondRestraints_exposer.def( + "atomRestraints" + , atomRestraints_function_value + , bp::release_gil_policy() + , "Return all of the atom restraints" ); + + } + { //::SireMM::InverseBondRestraints::centroidRestraints + + typedef ::QList< SireMM::InverseBondRestraint > ( ::SireMM::InverseBondRestraints::*centroidRestraints_function_type)( ) const; + centroidRestraints_function_type centroidRestraints_function_value( &::SireMM::InverseBondRestraints::centroidRestraints ); + + InverseBondRestraints_exposer.def( + "centroidRestraints" + , centroidRestraints_function_value + , bp::release_gil_policy() + , "Return all of the centroid restraints" ); + + } + { //::SireMM::InverseBondRestraints::count + + typedef int ( ::SireMM::InverseBondRestraints::*count_function_type)( ) const; + count_function_type count_function_value( &::SireMM::InverseBondRestraints::count ); + + InverseBondRestraints_exposer.def( + "count" + , count_function_value + , bp::release_gil_policy() + , "Return the number of restraints" ); + + } + { //::SireMM::InverseBondRestraints::hasAtomRestraints + + typedef bool ( ::SireMM::InverseBondRestraints::*hasAtomRestraints_function_type)( ) const; + hasAtomRestraints_function_type hasAtomRestraints_function_value( &::SireMM::InverseBondRestraints::hasAtomRestraints ); + + InverseBondRestraints_exposer.def( + "hasAtomRestraints" + , hasAtomRestraints_function_value + , bp::release_gil_policy() + , "Return whether or not there are any atom restraints" ); + + } + { //::SireMM::InverseBondRestraints::hasCentroidRestraints + + typedef bool ( ::SireMM::InverseBondRestraints::*hasCentroidRestraints_function_type)( ) const; + hasCentroidRestraints_function_type hasCentroidRestraints_function_value( &::SireMM::InverseBondRestraints::hasCentroidRestraints ); + + InverseBondRestraints_exposer.def( + "hasCentroidRestraints" + , hasCentroidRestraints_function_value + , bp::release_gil_policy() + , "Return whether or not there are any centroid restraints" ); + + } + { //::SireMM::InverseBondRestraints::isEmpty + + typedef bool ( ::SireMM::InverseBondRestraints::*isEmpty_function_type)( ) const; + isEmpty_function_type isEmpty_function_value( &::SireMM::InverseBondRestraints::isEmpty ); + + InverseBondRestraints_exposer.def( + "isEmpty" + , isEmpty_function_value + , bp::release_gil_policy() + , "Return whether or not this is empty" ); + + } + { //::SireMM::InverseBondRestraints::isNull + + typedef bool ( ::SireMM::InverseBondRestraints::*isNull_function_type)( ) const; + isNull_function_type isNull_function_value( &::SireMM::InverseBondRestraints::isNull ); + + InverseBondRestraints_exposer.def( + "isNull" + , isNull_function_value + , bp::release_gil_policy() + , "Return whether or not this is empty" ); + + } + { //::SireMM::InverseBondRestraints::nAtomRestraints + + typedef int ( ::SireMM::InverseBondRestraints::*nAtomRestraints_function_type)( ) const; + nAtomRestraints_function_type nAtomRestraints_function_value( &::SireMM::InverseBondRestraints::nAtomRestraints ); + + InverseBondRestraints_exposer.def( + "nAtomRestraints" + , nAtomRestraints_function_value + , bp::release_gil_policy() + , "Return the number of atom restraints" ); + + } + { //::SireMM::InverseBondRestraints::nCentroidRestraints + + typedef int ( ::SireMM::InverseBondRestraints::*nCentroidRestraints_function_type)( ) const; + nCentroidRestraints_function_type nCentroidRestraints_function_value( &::SireMM::InverseBondRestraints::nCentroidRestraints ); + + InverseBondRestraints_exposer.def( + "nCentroidRestraints" + , nCentroidRestraints_function_value + , bp::release_gil_policy() + , "Return the number of centroid restraints" ); + + } + { //::SireMM::InverseBondRestraints::nRestraints + + typedef int ( ::SireMM::InverseBondRestraints::*nRestraints_function_type)( ) const; + nRestraints_function_type nRestraints_function_value( &::SireMM::InverseBondRestraints::nRestraints ); + + InverseBondRestraints_exposer.def( + "nRestraints" + , nRestraints_function_value + , bp::release_gil_policy() + , "Return the number of restraints" ); + + } + InverseBondRestraints_exposer.def( bp::self != bp::self ); + InverseBondRestraints_exposer.def( bp::self + bp::other< SireMM::InverseBondRestraint >() ); + InverseBondRestraints_exposer.def( bp::self + bp::self ); + { //::SireMM::InverseBondRestraints::operator= + + typedef ::SireMM::InverseBondRestraints & ( ::SireMM::InverseBondRestraints::*assign_function_type)( ::SireMM::InverseBondRestraints const & ) ; + assign_function_type assign_function_value( &::SireMM::InverseBondRestraints::operator= ); + + InverseBondRestraints_exposer.def( + "assign" + , assign_function_value + , ( bp::arg("other") ) + , bp::return_self< >() + , "" ); + + } + InverseBondRestraints_exposer.def( bp::self == bp::self ); + { //::SireMM::InverseBondRestraints::operator[] + + typedef ::SireMM::InverseBondRestraint const & ( ::SireMM::InverseBondRestraints::*__getitem___function_type)( int ) const; + __getitem___function_type __getitem___function_value( &::SireMM::InverseBondRestraints::operator[] ); + + InverseBondRestraints_exposer.def( + "__getitem__" + , __getitem___function_value + , ( bp::arg("i") ) + , bp::return_value_policy() + , "" ); + + } + { //::SireMM::InverseBondRestraints::restraints + + typedef ::QList< SireMM::InverseBondRestraint > ( ::SireMM::InverseBondRestraints::*restraints_function_type)( ) const; + restraints_function_type restraints_function_value( &::SireMM::InverseBondRestraints::restraints ); + + InverseBondRestraints_exposer.def( + "restraints" + , restraints_function_value + , bp::release_gil_policy() + , "Return all of the restraints" ); + + } + { //::SireMM::InverseBondRestraints::size + + typedef int ( ::SireMM::InverseBondRestraints::*size_function_type)( ) const; + size_function_type size_function_value( &::SireMM::InverseBondRestraints::size ); + + InverseBondRestraints_exposer.def( + "size" + , size_function_value + , bp::release_gil_policy() + , "Return the number of restraints" ); + + } + { //::SireMM::InverseBondRestraints::toString + + typedef ::QString ( ::SireMM::InverseBondRestraints::*toString_function_type)( ) const; + toString_function_type toString_function_value( &::SireMM::InverseBondRestraints::toString ); + + InverseBondRestraints_exposer.def( + "toString" + , toString_function_value + , bp::release_gil_policy() + , "" ); + + } + { //::SireMM::InverseBondRestraints::typeName + + typedef char const * ( *typeName_function_type )( ); + typeName_function_type typeName_function_value( &::SireMM::InverseBondRestraints::typeName ); + + InverseBondRestraints_exposer.def( + "typeName" + , typeName_function_value + , bp::release_gil_policy() + , "" ); + + } + { //::SireMM::InverseBondRestraints::what + + typedef char const * ( ::SireMM::InverseBondRestraints::*what_function_type)( ) const; + what_function_type what_function_value( &::SireMM::InverseBondRestraints::what ); + + InverseBondRestraints_exposer.def( + "what" + , what_function_value + , bp::release_gil_policy() + , "" ); + + } + InverseBondRestraints_exposer.staticmethod( "typeName" ); + InverseBondRestraints_exposer.def( "__copy__", &__copy__); + InverseBondRestraints_exposer.def( "__deepcopy__", &__copy__); + InverseBondRestraints_exposer.def( "clone", &__copy__); + InverseBondRestraints_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireMM::InverseBondRestraints >, + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + InverseBondRestraints_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireMM::InverseBondRestraints >, + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + InverseBondRestraints_exposer.def_pickle(sire_pickle_suite< ::SireMM::InverseBondRestraints >()); + InverseBondRestraints_exposer.def( "__str__", &__str__< ::SireMM::InverseBondRestraints > ); + InverseBondRestraints_exposer.def( "__repr__", &__str__< ::SireMM::InverseBondRestraints > ); + InverseBondRestraints_exposer.def( "__len__", &__len_size< ::SireMM::InverseBondRestraints > ); + } + +} diff --git a/wrapper/MM/InverseBondRestraints.pypp.hpp b/wrapper/MM/InverseBondRestraints.pypp.hpp new file mode 100644 index 000000000..0726c04ae --- /dev/null +++ b/wrapper/MM/InverseBondRestraints.pypp.hpp @@ -0,0 +1,10 @@ +// This file has been generated by Py++. + +// (C) Christopher Woods, GPL >= 3 License + +#ifndef InverseBondRestraints_hpp__pyplusplus_wrapper +#define InverseBondRestraints_hpp__pyplusplus_wrapper + +void register_InverseBondRestraints_class(); + +#endif//InverseBondRestraints_hpp__pyplusplus_wrapper diff --git a/wrapper/MM/SireMM_registrars.cpp b/wrapper/MM/SireMM_registrars.cpp index 9dabd1bd9..4b5f14448 100644 --- a/wrapper/MM/SireMM_registrars.cpp +++ b/wrapper/MM/SireMM_registrars.cpp @@ -18,6 +18,7 @@ #include "improper.h" #include "anglerestraints.h" #include "bondrestraints.h" +#include "inversebondrestraints.h" #include "twoatomfunctions.h" #include "boreschrestraints.h" #include "ljparameter.h" @@ -115,6 +116,8 @@ void register_SireMM_objects() ObjectRegistry::registerConverterFor< SireMM::AngleRestraints >(); ObjectRegistry::registerConverterFor< SireMM::BondRestraint >(); ObjectRegistry::registerConverterFor< SireMM::BondRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::InverseBondRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::InverseBondRestraints >(); ObjectRegistry::registerConverterFor< SireMM::TwoAtomFunctions >(); ObjectRegistry::registerConverterFor< SireMM::BoreschRestraint >(); ObjectRegistry::registerConverterFor< SireMM::BoreschRestraints >(); diff --git a/wrapper/MM/_MM.main.cpp b/wrapper/MM/_MM.main.cpp index addf5ef01..a3a5b9a15 100644 --- a/wrapper/MM/_MM.main.cpp +++ b/wrapper/MM/_MM.main.cpp @@ -59,6 +59,10 @@ #include "BondRestraints.pypp.hpp" +#include "InverseBondRestraint.pypp.hpp" + +#include "InverseBondRestraints.pypp.hpp" + #include "BondSymbols.pypp.hpp" #include "BoreschRestraint.pypp.hpp" @@ -596,6 +600,10 @@ BOOST_PYTHON_MODULE(_MM){ register_BondRestraints_class(); + register_InverseBondRestraint_class(); + + register_InverseBondRestraints_class(); + register_BondSymbols_class(); register_BoreschRestraint_class(); diff --git a/wrapper/MM/active_headers.h b/wrapper/MM/active_headers.h index c50bbe8c8..e570fb68c 100644 --- a/wrapper/MM/active_headers.h +++ b/wrapper/MM/active_headers.h @@ -10,6 +10,7 @@ #include "atomljs.h" #include "bond.h" #include "bondrestraints.h" +#include "inversebondrestraints.h" #include "boreschrestraints.h" #include "clj14group.h" #include "cljatoms.h" From 37f77594e3a3056a86810ffda58efb082485abd8 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 4 Apr 2025 12:12:22 +0100 Subject: [PATCH 02/10] fixes for wrappers, openMM potential and lambda lever --- .../src/libs/SireMM/inversebondrestraints.h | 4 +- wrapper/Convert/SireOpenMM/lambdalever.cpp | 2 +- .../SireOpenMM/sire_to_openmm_system.cpp | 6 +- wrapper/MM/AngleRestraint.pypp.cpp | 4 +- wrapper/MM/AngleRestraints.pypp.cpp | 4 +- wrapper/MM/CMakeAutogenFile.txt | 382 +++++++++--------- wrapper/MM/DihedralRestraint.pypp.cpp | 6 +- wrapper/MM/DihedralRestraints.pypp.cpp | 4 +- wrapper/MM/InverseBondRestraint.pypp.cpp | 2 +- wrapper/MM/InverseBondRestraints.pypp.cpp | 2 +- wrapper/MM/SireMM_properties.cpp | 32 +- wrapper/MM/SireMM_registrars.cpp | 344 ++++++++-------- wrapper/MM/_MM.main.cpp | 24 +- wrapper/MM/active_headers.h | 2 +- 14 files changed, 409 insertions(+), 409 deletions(-) diff --git a/corelib/src/libs/SireMM/inversebondrestraints.h b/corelib/src/libs/SireMM/inversebondrestraints.h index a3369ed3d..50ef78c12 100644 --- a/corelib/src/libs/SireMM/inversebondrestraints.h +++ b/corelib/src/libs/SireMM/inversebondrestraints.h @@ -26,8 +26,8 @@ * \*********************************************/ -#ifndef SIREMM_BONDRESTRAINTS_H -#define SIREMM_BONDRESTRAINTS_H +#ifndef SIREMM_INVERSEBONDRESTRAINTS_H +#define SIREMM_INVERSEBONDRESTRAINTS_H #include "restraints.h" diff --git a/wrapper/Convert/SireOpenMM/lambdalever.cpp b/wrapper/Convert/SireOpenMM/lambdalever.cpp index acc3d9de6..0adc87330 100644 --- a/wrapper/Convert/SireOpenMM/lambdalever.cpp +++ b/wrapper/Convert/SireOpenMM/lambdalever.cpp @@ -2072,7 +2072,7 @@ void LambdaLever::updateRestraintInContext(OpenMM::Force &ff, double rho, // what is the type of this force...? const auto ff_type = ff.getName(); - if (ff_type == "BondRestraintForce" or ff_type == "PositionalRestraintForce") + if (ff_type == "BondRestraintForce" or ff_type == "PositionalRestraintForce" or ff_type=="InverseBondRestraintForce") { _update_restraint_in_context( dynamic_cast(&ff), diff --git a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp index fcb97c15f..1b067974c 100644 --- a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp +++ b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp @@ -264,7 +264,7 @@ void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraint OpenMM::System &system, LambdaLever &lambda_lever, int natoms) { - if (inverserestraints.isEmpty()) + if (restraints.isEmpty()) return; if (restraints.hasCentroidRestraints()) @@ -277,7 +277,7 @@ void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraint const auto energy_expression = QString( "rho*k*delta*delta*step;" "delta=(r-r0);" - "step=max(0,min(1,(r - r0)))") + "step=max(0,min(1,(r0 - r)))") .toStdString(); auto *restraintff = new OpenMM::CustomBondForce(energy_expression); @@ -1908,7 +1908,7 @@ OpenMMMetaData SireOpenMM::sire_to_openmm_system(OpenMM::System &system, } else if (prop.read().isA()) { - _add_bond_restraints(prop.read().asA(), + _add_inverse_bond_restraints(prop.read().asA(), system, lambda_lever, start_index); } else if (prop.read().isA()) diff --git a/wrapper/MM/AngleRestraint.pypp.cpp b/wrapper/MM/AngleRestraint.pypp.cpp index b90320621..c9455fef6 100644 --- a/wrapper/MM/AngleRestraint.pypp.cpp +++ b/wrapper/MM/AngleRestraint.pypp.cpp @@ -147,9 +147,9 @@ void register_AngleRestraint_class(){ AngleRestraint_exposer.def( "__deepcopy__", &__copy__); AngleRestraint_exposer.def( "clone", &__copy__); AngleRestraint_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireMM::AngleRestraint >, - bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); AngleRestraint_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireMM::AngleRestraint >, - bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); AngleRestraint_exposer.def_pickle(sire_pickle_suite< ::SireMM::AngleRestraint >()); AngleRestraint_exposer.def( "__str__", &__str__< ::SireMM::AngleRestraint > ); AngleRestraint_exposer.def( "__repr__", &__str__< ::SireMM::AngleRestraint > ); diff --git a/wrapper/MM/AngleRestraints.pypp.cpp b/wrapper/MM/AngleRestraints.pypp.cpp index 07edf38ca..13bb30886 100644 --- a/wrapper/MM/AngleRestraints.pypp.cpp +++ b/wrapper/MM/AngleRestraints.pypp.cpp @@ -230,9 +230,9 @@ void register_AngleRestraints_class(){ AngleRestraints_exposer.def( "__deepcopy__", &__copy__); AngleRestraints_exposer.def( "clone", &__copy__); AngleRestraints_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireMM::AngleRestraints >, - bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); AngleRestraints_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireMM::AngleRestraints >, - bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); AngleRestraints_exposer.def_pickle(sire_pickle_suite< ::SireMM::AngleRestraints >()); AngleRestraints_exposer.def( "__str__", &__str__< ::SireMM::AngleRestraints > ); AngleRestraints_exposer.def( "__repr__", &__str__< ::SireMM::AngleRestraints > ); diff --git a/wrapper/MM/CMakeAutogenFile.txt b/wrapper/MM/CMakeAutogenFile.txt index 3c9b643d3..762220adb 100644 --- a/wrapper/MM/CMakeAutogenFile.txt +++ b/wrapper/MM/CMakeAutogenFile.txt @@ -1,221 +1,221 @@ # WARNING - AUTOGENERATED FILE - CONTENTS WILL BE OVERWRITTEN! set ( PYPP_SOURCES - BondRestraints.pypp.cpp - InverseBondRestraints.pypp.cpp - SoftCLJPotentialInterface_IntraSoftCLJPotential_.pypp.cpp - CLJRFFunction.pypp.cpp - SoftCLJPotentialInterface_InterSoftCLJPotential_.pypp.cpp - InternalParameterNames.pypp.cpp - CLJBoxes.pypp.cpp - CLJ14Group.pypp.cpp - InterGroupCoulombFFBase.pypp.cpp - AtomPairs_CoulombScaleFactor_.pypp.cpp - CLJSoftRFFunction.pypp.cpp - TripleDistanceRestraint.pypp.cpp - IntraCoulombFF.pypp.cpp - SelectorImproper.pypp.cpp - Mover_SelectorDihedral_.pypp.cpp - ThreeAtomPerturbation.pypp.cpp - LJException.pypp.cpp - MultiCLJComponent.pypp.cpp - LJProbe.pypp.cpp - InterCLJFF.pypp.cpp - InterCLJFFBase.pypp.cpp - InternalFF.pypp.cpp - CLJPotentialInterface_IntraCLJPotential_.pypp.cpp - CHARMMSwitchingFunction.pypp.cpp - CoulombScaleFactor.pypp.cpp - IntraGroupCoulombFF.pypp.cpp - StretchBendTorsionParameterName.pypp.cpp - AmberDihPart.pypp.cpp - InternalParameters.pypp.cpp UreyBradleyComponent.pypp.cpp - IntraGroupCLJFF.pypp.cpp - InterLJFF.pypp.cpp - CoulombProbe.pypp.cpp - InterGroupSoftCLJFF.pypp.cpp - Mover_Dihedral_.pypp.cpp - AngleParameterName.pypp.cpp + CLJBox.pypp.cpp + CLJNBPairs.pypp.cpp SoftCLJComponent.pypp.cpp - InterGroupSoftCLJFFBase.pypp.cpp - StretchBendTorsionSymbols.pypp.cpp - AtomFunction.pypp.cpp - CoulombComponent.pypp.cpp - AtomFunctions.pypp.cpp - CLJAtoms.pypp.cpp - InterGroupLJFF.pypp.cpp - Mover_Improper_.pypp.cpp - RestraintComponent.pypp.cpp - Mover_Angle_.pypp.cpp - CLJSoftFunction.pypp.cpp - IntraSoftCLJFF.pypp.cpp - AmberAngle.pypp.cpp - StretchStretchParameterName.pypp.cpp + BoreschRestraints.pypp.cpp + InternalSymbols.pypp.cpp + SelectorMDihedral.pypp.cpp + InterCLJFF.pypp.cpp + InternalSymbolsBase.pypp.cpp + LJProbe.pypp.cpp + IntraSoftCLJFFBase.pypp.cpp + AngleParameterName.pypp.cpp + CLJSoftShiftFunction.pypp.cpp + HarmonicSwitchingFunction.pypp.cpp + InterLJFF.pypp.cpp + LJException.pypp.cpp + AngleRestraints.pypp.cpp CLJFunction.pypp.cpp - Restraint.pypp.cpp - TwoAtomFunction.pypp.cpp - InternalParameters3D.pypp.cpp - InterGroupLJFFBase.pypp.cpp - CLJParameterNames3D.pypp.cpp - LJParameterName3D.pypp.cpp - InterCoulombFFBase.pypp.cpp - CLJParameterNames.pypp.cpp - SelectorMBond.pypp.cpp + FourAtomFunctions.pypp.cpp + IntraGroupLJFF.pypp.cpp + IntraGroupCoulombFF.pypp.cpp + IntraLJFFBase.pypp.cpp + DoubleDistanceRestraint.pypp.cpp + IntraGroupCLJFF.pypp.cpp + DistanceRestraint.pypp.cpp SelectorDihedral.pypp.cpp - LJParameterName.pypp.cpp + Mover_SelectorAngle_.pypp.cpp + AmberDihPart.pypp.cpp + StretchBendTorsionComponent.pypp.cpp + ChargeParameterName.pypp.cpp + IntraSoftCLJFF.pypp.cpp + LJ1264Parameter.pypp.cpp CLJScaleFactor.pypp.cpp - AmberBond.pypp.cpp - ImproperComponent.pypp.cpp - PositionalRestraints.pypp.cpp - IntraGroupFF.pypp.cpp - DihedralRestraint.pypp.cpp - DihedralRestraints.pypp.cpp - IntraFF.pypp.cpp - DihedralComponent.pypp.cpp - ScaledChargeParameterNames3D.pypp.cpp - InternalSymbolsBase.pypp.cpp + ThreeAtomFunction.pypp.cpp + GridFF2.pypp.cpp + CLJBoxDistance.pypp.cpp + CLJPotentialInterface_InterCLJPotential_.pypp.cpp + MultiCLJComponent.pypp.cpp BondComponent.pypp.cpp + Mover_SelectorImproper_.pypp.cpp + CLJCalculator.pypp.cpp + CLJ14Group.pypp.cpp + ScaledLJParameterNames3D.pypp.cpp + BondSymbols.pypp.cpp + AtomPairs_CoulombScaleFactor_.pypp.cpp + AngleRestraint.pypp.cpp + DihedralComponent.pypp.cpp + Angle.pypp.cpp + IntraCLJFF.pypp.cpp + AtomPairs_CLJScaleFactor_.pypp.cpp + InterGroupFF.pypp.cpp + IntraGroupSoftCLJFF.pypp.cpp + CLJParameterNames3D.pypp.cpp + TwoAtomFunctions.pypp.cpp CoulombPotentialInterface_IntraCoulombPotential_.pypp.cpp - ScaledCLJParameterNames3D.pypp.cpp + TripleDistanceRestraint.pypp.cpp + AmberDihedral.pypp.cpp + StretchBendTorsionSymbols.pypp.cpp + CLJPotentialInterface_IntraSoftCLJPotential_.pypp.cpp Mover_SelectorBond_.pypp.cpp + InterLJFFBase.pypp.cpp + ImproperSymbols.pypp.cpp + LJPotentialInterface_IntraLJPotential_.pypp.cpp + IntraGroupLJFFBase.pypp.cpp + IntraCLJFFBase.pypp.cpp + InterGroupSoftCLJFFBase.pypp.cpp + CLJPotentialInterface_InterSoftCLJPotential_.pypp.cpp CoulombPotentialInterface_InterCoulombPotential_.pypp.cpp - BondRestraint.pypp.cpp + SelectorBond.pypp.cpp + SelectorImproper.pypp.cpp + Mover_Angle_.pypp.cpp + CoulombNBPairs.pypp.cpp + StretchBendParameterName.pypp.cpp + CLJShiftFunction.pypp.cpp + IntraGroupFF.pypp.cpp + MMDetail.pypp.cpp + SelectorMImproper.pypp.cpp + AtomFunction.pypp.cpp + FourAtomPerturbation.pypp.cpp + CLJWorkspace.pypp.cpp + InterGroupLJFF.pypp.cpp + IntraGroupSoftCLJFFBase.pypp.cpp + StretchBendComponent.pypp.cpp + AmberAngle.pypp.cpp + InterCLJFFBase.pypp.cpp + CLJIntraShiftFunction.pypp.cpp + RestraintComponent.pypp.cpp + CLJSoftIntraRFFunction.pypp.cpp + Restraints.pypp.cpp + InterGroupCLJFF.pypp.cpp + AmberBond.pypp.cpp + LJPotentialInterface_InterLJPotential_.pypp.cpp + SelectorMBond.pypp.cpp + AtomPairs_LJScaleFactor_.pypp.cpp + InterGroupCoulombFFBase.pypp.cpp + Mover_Bond_.pypp.cpp + CoulombComponent.pypp.cpp + LJParameterName3D.pypp.cpp + SoftCLJPotentialInterface_InterSoftCLJPotential_.pypp.cpp + Mover_Improper_.pypp.cpp + LJNBPairs.pypp.cpp + CLJSoftFunction.pypp.cpp + CLJAtom.pypp.cpp + InternalParameterNames.pypp.cpp + ScaledChargeParameterNames3D.pypp.cpp + CLJParameterNames.pypp.cpp + InterFF.pypp.cpp + InterGroupCLJFFBase.pypp.cpp InverseBondRestraint.pypp.cpp + ScaledCLJParameterNames3D.pypp.cpp + LJParameterName.pypp.cpp + TwoAtomFunction.pypp.cpp + NullRestraint.pypp.cpp + InternalGroupFF.pypp.cpp + InverseBondRestraints.pypp.cpp + SelectorMAngle.pypp.cpp + CLJDelta.pypp.cpp + InternalParameterNames3D.pypp.cpp + CLJSoftRFFunction.pypp.cpp + IntraLJFF.pypp.cpp + ChargeParameterName3D.pypp.cpp + StretchStretchParameterName.pypp.cpp + CoulombScaleFactor.pypp.cpp + BondRestraints.pypp.cpp BoreschRestraint.pypp.cpp - InternalSymbols.pypp.cpp - CLJWorkspace.pypp.cpp - BoreschRestraints.pypp.cpp + LJComponent.pypp.cpp + CLJExtractor.pypp.cpp ImproperParameterName.pypp.cpp - Intra14CoulombComponent.pypp.cpp + Dihedral.pypp.cpp + IntraGroupCoulombFFBase.pypp.cpp TestFF.pypp.cpp - ScaledLJParameterNames3D.pypp.cpp - LJPotentialInterface_IntraLJPotential_.pypp.cpp + LJPerturbation.pypp.cpp + CLJGroup.pypp.cpp + StretchBendTorsionParameterName.pypp.cpp + AmberParams.pypp.cpp + DihedralSymbols.pypp.cpp + LJParameter.pypp.cpp + InterSoftCLJFF.pypp.cpp + BendBendComponent.pypp.cpp + IntraGroupCLJFFBase.pypp.cpp PositionalRestraint.pypp.cpp - Mover_SelectorImproper_.pypp.cpp + CLJProbe.pypp.cpp + AngleComponent.pypp.cpp + InternalParameters.pypp.cpp + CLJSoftIntraShiftFunction.pypp.cpp + IntraCoulombFF.pypp.cpp + InterCoulombFFBase.pypp.cpp + CLJGrid.pypp.cpp + UreyBradleyParameterName.pypp.cpp + CLJComponent.pypp.cpp + Bond.pypp.cpp + ExcludedPairs.pypp.cpp + Intra14Component.pypp.cpp + BendBendSymbols.pypp.cpp + BondParameterName.pypp.cpp + Improper.pypp.cpp + CLJRFFunction.pypp.cpp + GridFF.pypp.cpp + DihedralRestraint.pypp.cpp + RestraintFF.pypp.cpp + SelectorAngle.pypp.cpp SwitchingFunction.pypp.cpp - AtomLJs.pypp.cpp - DoubleDistanceRestraint.pypp.cpp - CLJShiftFunction.pypp.cpp - IntraGroupSoftCLJFF.pypp.cpp - IntraCLJFF.pypp.cpp - LJComponent.pypp.cpp - ChargeParameterName.pypp.cpp + DihedralParameterName.pypp.cpp + BondRestraint.pypp.cpp + AngleSymbols.pypp.cpp + Intra14CoulombComponent.pypp.cpp + GroupInternalParameters.pypp.cpp + CLJIntraFunction.pypp.cpp + CLJCutoffFunction.pypp.cpp + CHARMMSwitchingFunction.pypp.cpp + Restraint.pypp.cpp FourAtomFunction.pypp.cpp - Restraint3D.pypp.cpp - InterSoftCLJFFBase.pypp.cpp - CLJNBPairs.pypp.cpp + InternalPerturbation.pypp.cpp + InterGroupLJFFBase.pypp.cpp + NoCutoff.pypp.cpp + InternalParameters3D.pypp.cpp + GromacsAtomType.pypp.cpp AmberNB14.pypp.cpp - RestraintFF.pypp.cpp - LJParameter.pypp.cpp - FourAtomFunctions.pypp.cpp - InternalComponent.pypp.cpp + CLJBoxes.pypp.cpp + AtomLJs.pypp.cpp + InterSoftCLJFFBase.pypp.cpp + LJScaleFactor.pypp.cpp + InterGroupSoftCLJFF.pypp.cpp + IntraFF.pypp.cpp InterGroupCoulombFF.pypp.cpp - CLJIntraFunction.pypp.cpp - CLJAtom.pypp.cpp - CLJSoftIntraRFFunction.pypp.cpp + StretchStretchComponent.pypp.cpp + AtomFunctions.pypp.cpp + InternalComponent.pypp.cpp + InternalFF.pypp.cpp CLJIntraRFFunction.pypp.cpp - Intra14LJComponent.pypp.cpp - AtomPairs_CLJScaleFactor_.pypp.cpp - InternalGroupFF.pypp.cpp - ChargeParameterName3D.pypp.cpp GromacsAngle.pypp.cpp - CLJPotentialInterface_InterCLJPotential_.pypp.cpp - SelectorMDihedral.pypp.cpp - LJ1264Parameter.pypp.cpp - InterSoftCLJFF.pypp.cpp - AtomPairs_LJScaleFactor_.pypp.cpp - BondParameterName.pypp.cpp - SelectorAngle.pypp.cpp - DihedralSymbols.pypp.cpp - CLJCutoffFunction.pypp.cpp - CLJComponent.pypp.cpp - Mover_SelectorAngle_.pypp.cpp - StretchBendTorsionComponent.pypp.cpp - CLJBoxIndex.pypp.cpp - IntraGroupCoulombFFBase.pypp.cpp - HarmonicSwitchingFunction.pypp.cpp - StretchBendParameterName.pypp.cpp - CLJGrid.pypp.cpp - LJPotentialInterface_InterLJPotential_.pypp.cpp - InterGroupCLJFFBase.pypp.cpp - CLJSoftIntraShiftFunction.pypp.cpp - ImproperSymbols.pypp.cpp - MMDetail.pypp.cpp - StretchBendComponent.pypp.cpp - CLJSoftShiftFunction.pypp.cpp - IntraGroupSoftCLJFFBase.pypp.cpp - Dihedral.pypp.cpp + ImproperComponent.pypp.cpp + ThreeAtomPerturbation.pypp.cpp + ThreeAtomFunctions.pypp.cpp + PositionalRestraints.pypp.cpp + CoulombProbe.pypp.cpp + GromacsDihedral.pypp.cpp StretchBendSymbols.pypp.cpp - IntraLJFF.pypp.cpp - FourAtomPerturbation.pypp.cpp + CLJAtoms.pypp.cpp + TwoAtomPerturbation.pypp.cpp + CLJBoxIndex.pypp.cpp + Restraint3D.pypp.cpp + Mover_Dihedral_.pypp.cpp CLJSoftIntraFunction.pypp.cpp - LJScaleFactor.pypp.cpp - Restraints.pypp.cpp - DihedralParameterName.pypp.cpp - Bond.pypp.cpp - GromacsBond.pypp.cpp - NoCutoff.pypp.cpp - InterGroupCLJFF.pypp.cpp - GridFF2.pypp.cpp - CLJIntraShiftFunction.pypp.cpp - InternalParameterNames3D.pypp.cpp - InterCoulombFF.pypp.cpp - IntraLJFFBase.pypp.cpp - BendBendComponent.pypp.cpp - BendBendSymbols.pypp.cpp - Intra14Component.pypp.cpp - Angle.pypp.cpp - AmberParams.pypp.cpp - CLJDelta.pypp.cpp - InterLJFFBase.pypp.cpp - InterGroupFF.pypp.cpp - CLJProbe.pypp.cpp - SelectorMImproper.pypp.cpp StretchStretchSymbols.pypp.cpp - IntraCLJFFBase.pypp.cpp - ExcludedPairs.pypp.cpp - LJNBPairs.pypp.cpp + NullCLJFunction.pypp.cpp + InterCoulombFF.pypp.cpp + IntraCoulombFFBase.pypp.cpp + DihedralRestraints.pypp.cpp + SoftCLJPotentialInterface_IntraSoftCLJPotential_.pypp.cpp + CLJPotentialInterface_IntraCLJPotential_.pypp.cpp + Intra14LJComponent.pypp.cpp + Mover_SelectorDihedral_.pypp.cpp + GromacsBond.pypp.cpp BendBendParameterName.pypp.cpp - AngleSymbols.pypp.cpp - Mover_Bond_.pypp.cpp - ThreeAtomFunctions.pypp.cpp - ThreeAtomFunction.pypp.cpp - AngleComponent.pypp.cpp - CoulombNBPairs.pypp.cpp - AmberDihedral.pypp.cpp - AngleRestraint.pypp.cpp - AngleRestraints.pypp.cpp - TwoAtomFunctions.pypp.cpp - IntraSoftCLJFFBase.pypp.cpp - BondSymbols.pypp.cpp LJExceptionID.pypp.cpp - CLJBoxDistance.pypp.cpp - IntraGroupLJFFBase.pypp.cpp - GroupInternalParameters.pypp.cpp - IntraCoulombFFBase.pypp.cpp - DistanceRestraint.pypp.cpp - UreyBradleyParameterName.pypp.cpp - TwoAtomPerturbation.pypp.cpp - InterFF.pypp.cpp - SelectorMAngle.pypp.cpp - SelectorBond.pypp.cpp - CLJExtractor.pypp.cpp - InternalPerturbation.pypp.cpp - GridFF.pypp.cpp - StretchStretchComponent.pypp.cpp - Improper.pypp.cpp - IntraGroupLJFF.pypp.cpp - GromacsAtomType.pypp.cpp - CLJPotentialInterface_IntraSoftCLJPotential_.pypp.cpp - GromacsDihedral.pypp.cpp - CLJCalculator.pypp.cpp - NullRestraint.pypp.cpp - CLJPotentialInterface_InterSoftCLJPotential_.pypp.cpp - CLJGroup.pypp.cpp - NullCLJFunction.pypp.cpp - CLJBox.pypp.cpp - LJPerturbation.pypp.cpp - IntraGroupCLJFFBase.pypp.cpp SireMM_containers.cpp SireMM_properties.cpp SireMM_registrars.cpp diff --git a/wrapper/MM/DihedralRestraint.pypp.cpp b/wrapper/MM/DihedralRestraint.pypp.cpp index a5d04277e..c35498a4a 100644 --- a/wrapper/MM/DihedralRestraint.pypp.cpp +++ b/wrapper/MM/DihedralRestraint.pypp.cpp @@ -37,7 +37,7 @@ void register_DihedralRestraint_class(){ { //::SireMM::DihedralRestraint typedef bp::class_< SireMM::DihedralRestraint, bp::bases< SireBase::Property > > DihedralRestraint_exposer_t; - DihedralRestraint_exposer_t DihedralRestraint_exposer = DihedralRestraint_exposer_t( "DihedralRestraint", "This class represents a single angle restraint between any three\natoms in a system\nAuthor: Christopher Woods\n", bp::init< >("Null constructor") ); + DihedralRestraint_exposer_t DihedralRestraint_exposer = DihedralRestraint_exposer_t( "DihedralRestraint", "This class represents a single torsion restraint between any four\natoms in a system\nAuthor: Christopher Woods\n", bp::init< >("Null constructor") ); bp::scope DihedralRestraint_scope( DihedralRestraint_exposer ); DihedralRestraint_exposer.def( bp::init< QList< long long > const &, SireUnits::Dimension::Angle const &, SireUnits::Dimension::HarmonicAngleConstant const & >(( bp::arg("atoms"), bp::arg("phi0"), bp::arg("kphi") ), "Construct a restraint that acts on the angle within the\nfour atoms atom0, atom1, atom2 atom3 (phi == a(0123)),\nrestraining the angle within these atoms") ); DihedralRestraint_exposer.def( bp::init< SireMM::DihedralRestraint const & >(( bp::arg("other") ), "Copy constructor") ); @@ -147,9 +147,9 @@ void register_DihedralRestraint_class(){ DihedralRestraint_exposer.def( "__deepcopy__", &__copy__); DihedralRestraint_exposer.def( "clone", &__copy__); DihedralRestraint_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireMM::DihedralRestraint >, - bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); DihedralRestraint_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireMM::DihedralRestraint >, - bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); DihedralRestraint_exposer.def_pickle(sire_pickle_suite< ::SireMM::DihedralRestraint >()); DihedralRestraint_exposer.def( "__str__", &__str__< ::SireMM::DihedralRestraint > ); DihedralRestraint_exposer.def( "__repr__", &__str__< ::SireMM::DihedralRestraint > ); diff --git a/wrapper/MM/DihedralRestraints.pypp.cpp b/wrapper/MM/DihedralRestraints.pypp.cpp index 44d49c86a..ede6aafef 100644 --- a/wrapper/MM/DihedralRestraints.pypp.cpp +++ b/wrapper/MM/DihedralRestraints.pypp.cpp @@ -230,9 +230,9 @@ void register_DihedralRestraints_class(){ DihedralRestraints_exposer.def( "__deepcopy__", &__copy__); DihedralRestraints_exposer.def( "clone", &__copy__); DihedralRestraints_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireMM::DihedralRestraints >, - bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); DihedralRestraints_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireMM::DihedralRestraints >, - bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); + bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); DihedralRestraints_exposer.def_pickle(sire_pickle_suite< ::SireMM::DihedralRestraints >()); DihedralRestraints_exposer.def( "__str__", &__str__< ::SireMM::DihedralRestraints > ); DihedralRestraints_exposer.def( "__repr__", &__str__< ::SireMM::DihedralRestraints > ); diff --git a/wrapper/MM/InverseBondRestraint.pypp.cpp b/wrapper/MM/InverseBondRestraint.pypp.cpp index ce86a5f7c..7e84163fd 100644 --- a/wrapper/MM/InverseBondRestraint.pypp.cpp +++ b/wrapper/MM/InverseBondRestraint.pypp.cpp @@ -37,7 +37,7 @@ void register_InverseBondRestraint_class(){ { //::SireMM::InverseBondRestraint typedef bp::class_< SireMM::InverseBondRestraint, bp::bases< SireBase::Property > > InverseBondRestraint_exposer_t; - InverseBondRestraint_exposer_t InverseBondRestraint_exposer = InverseBondRestraint_exposer_t( "InverseBondRestraint", "This class represents a single inverse bond restraint between any two\natoms in a system (or between the centroids of any two groups\nof atoms in a system)\n", bp::init< >("Null constructor") ); + InverseBondRestraint_exposer_t InverseBondRestraint_exposer = InverseBondRestraint_exposer_t( "InverseBondRestraint", "This class represents a single bond restraint between any two\natoms in a system (or between the centroids of any two groups\nof atoms in a system)\n", bp::init< >("Null constructor") ); bp::scope InverseBondRestraint_scope( InverseBondRestraint_exposer ); InverseBondRestraint_exposer.def( bp::init< qint64, qint64, SireUnits::Dimension::HarmonicBondConstant const &, SireUnits::Dimension::Length const & >(( bp::arg("atom0"), bp::arg("atom1"), bp::arg("k"), bp::arg("r0") ), "Construct to restrain the atom at index atom to the specified position\n using the specified force constant and flat-bottom well-width\n") ); InverseBondRestraint_exposer.def( bp::init< QList< long long > const &, QList< long long > const &, SireUnits::Dimension::HarmonicBondConstant const &, SireUnits::Dimension::Length const & >(( bp::arg("atoms0"), bp::arg("atoms1"), bp::arg("k"), bp::arg("r0") ), "Construct to restrain the centroid of the atoms whose indicies are\n in atoms to the specified position using the specified force constant\n and flat-bottom well width\n") ); diff --git a/wrapper/MM/InverseBondRestraints.pypp.cpp b/wrapper/MM/InverseBondRestraints.pypp.cpp index c07bc1ec0..8c0a78027 100644 --- a/wrapper/MM/InverseBondRestraints.pypp.cpp +++ b/wrapper/MM/InverseBondRestraints.pypp.cpp @@ -40,7 +40,7 @@ void register_InverseBondRestraints_class(){ { //::SireMM::InverseBondRestraints typedef bp::class_< SireMM::InverseBondRestraints, bp::bases< SireMM::Restraints, SireBase::Property > > InverseBondRestraints_exposer_t; - InverseBondRestraints_exposer_t InverseBondRestraints_exposer = InverseBondRestraints_exposer_t( "InverseBondRestraints", "This class provides the information for a collection of inverse bond\nrestraints that can be added to a collection of molecues. Each\nrestraint can act on a pair of particles or a pair of the\ncentroids of two collections of particles.\nThe restaints are spherically symmetric, and\nare simple harmonic potentials\n", bp::init< >("Null constructor") ); + InverseBondRestraints_exposer_t InverseBondRestraints_exposer = InverseBondRestraints_exposer_t( "InverseBondRestraints", "This class provides the information for a collection of bond\nrestraints that can be added to a collection of molecues. Each\nrestraint can act on a pair of particles or a pair of the\ncentroids of two collections of particles.\nThe restaints are spherically symmetric, and\nare simple harmonic potentials\n", bp::init< >("Null constructor") ); bp::scope InverseBondRestraints_scope( InverseBondRestraints_exposer ); InverseBondRestraints_exposer.def( bp::init< QString const & >(( bp::arg("name") ), "") ); InverseBondRestraints_exposer.def( bp::init< SireMM::InverseBondRestraint const & >(( bp::arg("restraint") ), "") ); diff --git a/wrapper/MM/SireMM_properties.cpp b/wrapper/MM/SireMM_properties.cpp index 8728c6ce2..825016961 100644 --- a/wrapper/MM/SireMM_properties.cpp +++ b/wrapper/MM/SireMM_properties.cpp @@ -4,20 +4,6 @@ #include "Base/convertproperty.hpp" #include "SireMM_properties.h" -#include "SireCAS/errors.h" -#include "SireCAS/expression.h" -#include "SireCAS/symbols.h" -#include "SireCAS/values.h" -#include "SireError/errors.h" -#include "SireFF/forcetable.h" -#include "SireMol/moleculedata.h" -#include "SireMol/molecules.h" -#include "SireMol/molid.h" -#include "SireMol/molnum.h" -#include "SireStream/datastream.h" -#include "SireStream/shareddatastream.h" -#include "restraint.h" -#include "restraint.h" #include "SireFF/errors.h" #include "SireMaths/maths.h" #include "SireStream/datastream.h" @@ -50,10 +36,24 @@ #include "tostring.h" #include #include "cljfunction.h" +#include "SireCAS/errors.h" +#include "SireCAS/expression.h" +#include "SireCAS/symbols.h" +#include "SireCAS/values.h" +#include "SireError/errors.h" +#include "SireFF/forcetable.h" +#include "SireMol/moleculedata.h" +#include "SireMol/molecules.h" +#include "SireMol/molid.h" +#include "SireMol/molnum.h" +#include "SireStream/datastream.h" +#include "SireStream/shareddatastream.h" +#include "restraint.h" +#include "restraint.h" void register_SireMM_properties() { - register_property_container< SireMM::RestraintPtr, SireMM::Restraint >(); - register_property_container< SireMM::Restraint3DPtr, SireMM::Restraint3D >(); register_property_container< SireMM::SwitchFuncPtr, SireMM::SwitchingFunction >(); register_property_container< SireMM::CLJFunctionPtr, SireMM::CLJFunction >(); + register_property_container< SireMM::RestraintPtr, SireMM::Restraint >(); + register_property_container< SireMM::Restraint3DPtr, SireMM::Restraint3D >(); } diff --git a/wrapper/MM/SireMM_registrars.cpp b/wrapper/MM/SireMM_registrars.cpp index 4b5f14448..0f5603838 100644 --- a/wrapper/MM/SireMM_registrars.cpp +++ b/wrapper/MM/SireMM_registrars.cpp @@ -3,155 +3,127 @@ #include "SireMM_registrars.h" -#include "excludedpairs.h" -#include "selectormangle.h" -#include "atomljs.h" -#include "intercljff.h" +#include "internalff.h" +#include "gridff2.h" +#include "multicljcomponent.h" +#include "softcljcomponent.h" +#include "cljworkspace.h" +#include "intragroupff.h" #include "selectormimproper.h" -#include "intraljff.h" -#include "intracoulombff.h" -#include "cljshiftfunction.h" -#include "cljcalculator.h" -#include "distancerestraint.h" -#include "selectordihedral.h" -#include "clj14group.h" -#include "improper.h" -#include "anglerestraints.h" #include "bondrestraints.h" -#include "inversebondrestraints.h" -#include "twoatomfunctions.h" -#include "boreschrestraints.h" #include "ljparameter.h" -#include "internalperturbation.h" -#include "restraintff.h" +#include "intraljff.h" +#include "cljextractor.h" +#include "intergroupff.h" +#include "cljnbpairs.h" +#include "excludedpairs.h" +#include "intrasoftcljff.h" +#include "internalparameters.h" #include "selectormbond.h" -#include "restraint.h" -#include "intraff.h" +#include "distancerestraint.h" #include "cljdelta.h" -#include "intrasoftcljff.h" -#include "gridff2.h" -#include "selectorangle.h" -#include "interljff.h" -#include "threeatomfunctions.h" -#include "cljprobe.h" -#include "intragroupff.h" -#include "cljextractor.h" -#include "angle.h" +#include "intersoftcljff.h" +#include "cljcomponent.h" +#include "interff.h" #include "cljgroup.h" -#include "selectormdihedral.h" -#include "cljgrid.h" #include "amberparams.h" -#include "cljparam.h" #include "intercoulombff.h" -#include "cljcomponent.h" -#include "cljatoms.h" -#include "fouratomfunctions.h" -#include "cljrffunction.h" -#include "intracljff.h" -#include "interff.h" -#include "switchingfunction.h" -#include "internalff.h" -#include "gridff.h" -#include "cljboxes.h" #include "internalgroupff.h" -#include "internalcomponent.h" #include "dihedralrestraints.h" -#include "selectorimproper.h" -#include "intergroupff.h" -#include "dihedral.h" -#include "multicljcomponent.h" -#include "ljperturbation.h" -#include "cljnbpairs.h" -#include "ljpair.h" +#include "cljshiftfunction.h" +#include "switchingfunction.h" +#include "twoatomfunctions.h" +#include "selectordihedral.h" +#include "intraff.h" +#include "cljparam.h" +#include "interljff.h" #include "cljfunction.h" -#include "softcljcomponent.h" +#include "angle.h" +#include "intracljff.h" #include "selectorbond.h" -#include "positionalrestraints.h" -#include "mmdetail.h" -#include "cljworkspace.h" -#include "intersoftcljff.h" +#include "gromacsparams.h" #include "restraintcomponent.h" +#include "positionalrestraints.h" +#include "cljatoms.h" +#include "inversebondrestraints.h" +#include "intercljff.h" +#include "dihedral.h" +#include "selectormangle.h" +#include "clj14group.h" +#include "ljpair.h" +#include "selectorangle.h" #include "lj1264parameter.h" -#include "gromacsparams.h" -#include "internalparameters.h" +#include "mmdetail.h" +#include "internalperturbation.h" #include "bond.h" +#include "gridff.h" +#include "cljgrid.h" +#include "cljboxes.h" +#include "restraintff.h" +#include "fouratomfunctions.h" +#include "atomljs.h" +#include "cljrffunction.h" +#include "threeatomfunctions.h" +#include "ljperturbation.h" +#include "selectormdihedral.h" +#include "restraint.h" +#include "improper.h" +#include "boreschrestraints.h" +#include "internalcomponent.h" +#include "selectorimproper.h" +#include "anglerestraints.h" +#include "intracoulombff.h" +#include "cljprobe.h" +#include "cljcalculator.h" #include "Helpers/objectregistry.hpp" void register_SireMM_objects() { - ObjectRegistry::registerConverterFor< SireMM::ExcludedPairs >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorMAngle >(); - ObjectRegistry::registerConverterFor< SireMM::AtomLJs >(); - ObjectRegistry::registerConverterFor< SireMM::LJException >(); - ObjectRegistry::registerConverterFor< SireMM::LJExceptionID >(); - ObjectRegistry::registerConverterFor< SireMM::InterCLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::InterCLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupCLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupCLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::InternalFF >(); + ObjectRegistry::registerConverterFor< SireMM::GridFF2 >(); + ObjectRegistry::registerConverterFor< SireMM::MultiCLJComponent >(); + ObjectRegistry::registerConverterFor< SireMM::SoftCLJComponent >(); + ObjectRegistry::registerConverterFor< SireMM::CLJWorkspace >(); + ObjectRegistry::registerConverterFor< SireMM::IntraGroupFF >(); ObjectRegistry::registerConverterFor< SireMM::SelectorMImproper >(); + ObjectRegistry::registerConverterFor< SireMM::BondRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::BondRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::LJParameter >(); ObjectRegistry::registerConverterFor< SireMM::IntraLJFFBase >(); ObjectRegistry::registerConverterFor< SireMM::IntraLJFF >(); ObjectRegistry::registerConverterFor< SireMM::IntraGroupLJFFBase >(); ObjectRegistry::registerConverterFor< SireMM::IntraGroupLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::IntraCoulombFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::IntraCoulombFF >(); - ObjectRegistry::registerConverterFor< SireMM::IntraGroupCoulombFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::IntraGroupCoulombFF >(); - ObjectRegistry::registerConverterFor< SireMM::CLJShiftFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJIntraShiftFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJSoftShiftFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJSoftIntraShiftFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJCalculator >(); - ObjectRegistry::registerConverterFor< SireMM::DistanceRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::DoubleDistanceRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::TripleDistanceRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorDihedral >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::CLJ14Group >(); - ObjectRegistry::registerConverterFor< SireMM::Improper >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::AngleRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::AngleRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::BondRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::BondRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::InverseBondRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::InverseBondRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::TwoAtomFunctions >(); - ObjectRegistry::registerConverterFor< SireMM::BoreschRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::BoreschRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::LJParameter >(); - ObjectRegistry::registerConverterFor< SireMM::TwoAtomPerturbation >(); - ObjectRegistry::registerConverterFor< SireMM::ThreeAtomPerturbation >(); - ObjectRegistry::registerConverterFor< SireMM::FourAtomPerturbation >(); - ObjectRegistry::registerConverterFor< SireMM::RestraintFF >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorMBond >(); - ObjectRegistry::registerConverterFor< SireMM::NullRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::IntraFF >(); - ObjectRegistry::registerConverterFor< SireMM::CLJDelta >(); + ObjectRegistry::registerConverterFor< SireMM::CLJExtractor >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupFF >(); + ObjectRegistry::registerConverterFor< SireMM::CoulombScaleFactor >(); + ObjectRegistry::registerConverterFor< SireMM::LJScaleFactor >(); + ObjectRegistry::registerConverterFor< SireMM::CLJScaleFactor >(); + ObjectRegistry::registerConverterFor< SireMM::CLJNBPairs >(); + ObjectRegistry::registerConverterFor< SireMM::CoulombNBPairs >(); + ObjectRegistry::registerConverterFor< SireMM::LJNBPairs >(); + ObjectRegistry::registerConverterFor< SireMM::ExcludedPairs >(); ObjectRegistry::registerConverterFor< SireMM::IntraSoftCLJFFBase >(); ObjectRegistry::registerConverterFor< SireMM::IntraSoftCLJFF >(); ObjectRegistry::registerConverterFor< SireMM::IntraGroupSoftCLJFFBase >(); ObjectRegistry::registerConverterFor< SireMM::IntraGroupSoftCLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::GridFF2 >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorAngle >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::InterLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::InterLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::ThreeAtomFunctions >(); - ObjectRegistry::registerConverterFor< SireMM::CoulombProbe >(); - ObjectRegistry::registerConverterFor< SireMM::LJProbe >(); - ObjectRegistry::registerConverterFor< SireMM::CLJProbe >(); - ObjectRegistry::registerConverterFor< SireMM::IntraGroupFF >(); - ObjectRegistry::registerConverterFor< SireMM::CLJExtractor >(); - ObjectRegistry::registerConverterFor< SireMM::Angle >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::InternalParameters >(); + ObjectRegistry::registerConverterFor< SireMM::InternalParameters3D >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorMBond >(); + ObjectRegistry::registerConverterFor< SireMM::DistanceRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::DoubleDistanceRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::TripleDistanceRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::CLJDelta >(); + ObjectRegistry::registerConverterFor< SireMM::InterSoftCLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::InterSoftCLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupSoftCLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupSoftCLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::CoulombComponent >(); + ObjectRegistry::registerConverterFor< SireMM::LJComponent >(); + ObjectRegistry::registerConverterFor< SireMM::CLJComponent >(); + ObjectRegistry::registerConverterFor< SireMM::InterFF >(); ObjectRegistry::registerConverterFor< SireMM::CLJGroup >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorMDihedral >(); - ObjectRegistry::registerConverterFor< SireMM::CLJGrid >(); ObjectRegistry::registerConverterFor< SireMM::AmberParams >(); ObjectRegistry::registerConverterFor< SireMM::AmberBond >(); ObjectRegistry::registerConverterFor< SireMM::AmberAngle >(); @@ -159,37 +131,91 @@ void register_SireMM_objects() ObjectRegistry::registerConverterFor< SireMM::AmberDihedral >(); ObjectRegistry::registerConverterFor< SireMM::AmberNB14 >(); ObjectRegistry::registerConverterFor< SireMM::AmberNBDihPart >(); - ObjectRegistry::registerConverterFor< SireMM::CLJParams >(); - ObjectRegistry::registerConverterFor< SireMM::CLJParamsArray >(); ObjectRegistry::registerConverterFor< SireMM::InterCoulombFFBase >(); ObjectRegistry::registerConverterFor< SireMM::InterCoulombFF >(); ObjectRegistry::registerConverterFor< SireMM::InterGroupCoulombFFBase >(); ObjectRegistry::registerConverterFor< SireMM::InterGroupCoulombFF >(); - ObjectRegistry::registerConverterFor< SireMM::CoulombComponent >(); - ObjectRegistry::registerConverterFor< SireMM::LJComponent >(); - ObjectRegistry::registerConverterFor< SireMM::CLJComponent >(); - ObjectRegistry::registerConverterFor< SireMM::CLJAtom >(); - ObjectRegistry::registerConverterFor< SireMM::CLJAtoms >(); - ObjectRegistry::registerConverterFor< SireMM::FourAtomFunctions >(); - ObjectRegistry::registerConverterFor< SireMM::CLJRFFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJIntraRFFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJSoftRFFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJSoftIntraRFFunction >(); + ObjectRegistry::registerConverterFor< SireMM::InternalGroupFF >(); + ObjectRegistry::registerConverterFor< SireMM::DihedralRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::DihedralRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::CLJShiftFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJIntraShiftFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJSoftShiftFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJSoftIntraShiftFunction >(); + ObjectRegistry::registerConverterFor< SireMM::NoCutoff >(); + ObjectRegistry::registerConverterFor< SireMM::HarmonicSwitchingFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CHARMMSwitchingFunction >(); + ObjectRegistry::registerConverterFor< SireMM::TwoAtomFunctions >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorDihedral >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::IntraFF >(); + ObjectRegistry::registerConverterFor< SireMM::CLJParams >(); + ObjectRegistry::registerConverterFor< SireMM::CLJParamsArray >(); + ObjectRegistry::registerConverterFor< SireMM::InterLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::InterLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::NullCLJFunction >(); + ObjectRegistry::registerConverterFor< SireMM::Angle >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); ObjectRegistry::registerConverterFor< SireMM::IntraCLJFFBase >(); ObjectRegistry::registerConverterFor< SireMM::IntraCLJFF >(); ObjectRegistry::registerConverterFor< SireMM::IntraGroupCLJFFBase >(); ObjectRegistry::registerConverterFor< SireMM::IntraGroupCLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::InterFF >(); - ObjectRegistry::registerConverterFor< SireMM::NoCutoff >(); - ObjectRegistry::registerConverterFor< SireMM::HarmonicSwitchingFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CHARMMSwitchingFunction >(); - ObjectRegistry::registerConverterFor< SireMM::InternalFF >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorBond >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::GromacsAtomType >(); + ObjectRegistry::registerConverterFor< SireMM::GromacsBond >(); + ObjectRegistry::registerConverterFor< SireMM::GromacsAngle >(); + ObjectRegistry::registerConverterFor< SireMM::GromacsDihedral >(); + ObjectRegistry::registerConverterFor< SireMM::RestraintComponent >(); + ObjectRegistry::registerConverterFor< SireMM::PositionalRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::PositionalRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::CLJAtom >(); + ObjectRegistry::registerConverterFor< SireMM::CLJAtoms >(); + ObjectRegistry::registerConverterFor< SireMM::InverseBondRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::InverseBondRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::InterCLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::InterCLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupCLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupCLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::Dihedral >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorMAngle >(); + ObjectRegistry::registerConverterFor< SireMM::CLJ14Group >(); + ObjectRegistry::registerConverterFor< SireMM::LJPair >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorAngle >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::LJ1264Parameter >(); + ObjectRegistry::registerConverterFor< SireMM::MMDetail >(); + ObjectRegistry::registerConverterFor< SireMM::TwoAtomPerturbation >(); + ObjectRegistry::registerConverterFor< SireMM::ThreeAtomPerturbation >(); + ObjectRegistry::registerConverterFor< SireMM::FourAtomPerturbation >(); + ObjectRegistry::registerConverterFor< SireMM::Bond >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); ObjectRegistry::registerConverterFor< SireMM::GridFF >(); + ObjectRegistry::registerConverterFor< SireMM::CLJGrid >(); ObjectRegistry::registerConverterFor< SireMM::CLJBox >(); ObjectRegistry::registerConverterFor< SireMM::CLJBoxIndex >(); ObjectRegistry::registerConverterFor< SireMM::CLJBoxes >(); ObjectRegistry::registerConverterFor< SireMM::CLJBoxDistance >(); - ObjectRegistry::registerConverterFor< SireMM::InternalGroupFF >(); + ObjectRegistry::registerConverterFor< SireMM::RestraintFF >(); + ObjectRegistry::registerConverterFor< SireMM::FourAtomFunctions >(); + ObjectRegistry::registerConverterFor< SireMM::AtomLJs >(); + ObjectRegistry::registerConverterFor< SireMM::LJException >(); + ObjectRegistry::registerConverterFor< SireMM::LJExceptionID >(); + ObjectRegistry::registerConverterFor< SireMM::CLJRFFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJIntraRFFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJSoftRFFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJSoftIntraRFFunction >(); + ObjectRegistry::registerConverterFor< SireMM::ThreeAtomFunctions >(); + ObjectRegistry::registerConverterFor< SireMM::LJPerturbation >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorMDihedral >(); + ObjectRegistry::registerConverterFor< SireMM::NullRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::Improper >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::BoreschRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::BoreschRestraints >(); ObjectRegistry::registerConverterFor< SireMM::BondComponent >(); ObjectRegistry::registerConverterFor< SireMM::AngleComponent >(); ObjectRegistry::registerConverterFor< SireMM::DihedralComponent >(); @@ -203,44 +229,18 @@ void register_SireMM_objects() ObjectRegistry::registerConverterFor< SireMM::Intra14LJComponent >(); ObjectRegistry::registerConverterFor< SireMM::Intra14Component >(); ObjectRegistry::registerConverterFor< SireMM::InternalComponent >(); - ObjectRegistry::registerConverterFor< SireMM::DihedralRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::DihedralRestraints >(); ObjectRegistry::registerConverterFor< SireMM::SelectorImproper >(); ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupFF >(); - ObjectRegistry::registerConverterFor< SireMM::Dihedral >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::MultiCLJComponent >(); - ObjectRegistry::registerConverterFor< SireMM::LJPerturbation >(); - ObjectRegistry::registerConverterFor< SireMM::CoulombScaleFactor >(); - ObjectRegistry::registerConverterFor< SireMM::LJScaleFactor >(); - ObjectRegistry::registerConverterFor< SireMM::CLJScaleFactor >(); - ObjectRegistry::registerConverterFor< SireMM::CLJNBPairs >(); - ObjectRegistry::registerConverterFor< SireMM::CoulombNBPairs >(); - ObjectRegistry::registerConverterFor< SireMM::LJNBPairs >(); - ObjectRegistry::registerConverterFor< SireMM::LJPair >(); - ObjectRegistry::registerConverterFor< SireMM::NullCLJFunction >(); - ObjectRegistry::registerConverterFor< SireMM::SoftCLJComponent >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorBond >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::PositionalRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::PositionalRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::MMDetail >(); - ObjectRegistry::registerConverterFor< SireMM::CLJWorkspace >(); - ObjectRegistry::registerConverterFor< SireMM::InterSoftCLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::InterSoftCLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupSoftCLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupSoftCLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::RestraintComponent >(); - ObjectRegistry::registerConverterFor< SireMM::LJ1264Parameter >(); - ObjectRegistry::registerConverterFor< SireMM::GromacsAtomType >(); - ObjectRegistry::registerConverterFor< SireMM::GromacsBond >(); - ObjectRegistry::registerConverterFor< SireMM::GromacsAngle >(); - ObjectRegistry::registerConverterFor< SireMM::GromacsDihedral >(); - ObjectRegistry::registerConverterFor< SireMM::InternalParameters >(); - ObjectRegistry::registerConverterFor< SireMM::InternalParameters3D >(); - ObjectRegistry::registerConverterFor< SireMM::Bond >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::AngleRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::AngleRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::IntraCoulombFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::IntraCoulombFF >(); + ObjectRegistry::registerConverterFor< SireMM::IntraGroupCoulombFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::IntraGroupCoulombFF >(); + ObjectRegistry::registerConverterFor< SireMM::CoulombProbe >(); + ObjectRegistry::registerConverterFor< SireMM::LJProbe >(); + ObjectRegistry::registerConverterFor< SireMM::CLJProbe >(); + ObjectRegistry::registerConverterFor< SireMM::CLJCalculator >(); } diff --git a/wrapper/MM/_MM.main.cpp b/wrapper/MM/_MM.main.cpp index a3a5b9a15..27d308ddc 100644 --- a/wrapper/MM/_MM.main.cpp +++ b/wrapper/MM/_MM.main.cpp @@ -59,10 +59,6 @@ #include "BondRestraints.pypp.hpp" -#include "InverseBondRestraint.pypp.hpp" - -#include "InverseBondRestraints.pypp.hpp" - #include "BondSymbols.pypp.hpp" #include "BoreschRestraint.pypp.hpp" @@ -305,6 +301,10 @@ #include "IntraSoftCLJFFBase.pypp.hpp" +#include "InverseBondRestraint.pypp.hpp" + +#include "InverseBondRestraints.pypp.hpp" + #include "LJ1264Parameter.pypp.hpp" #include "LJComponent.pypp.hpp" @@ -554,10 +554,6 @@ BOOST_PYTHON_MODULE(_MM){ register_AngleParameterName_class(); - register_Restraint_class(); - - register_Restraint3D_class(); - register_AngleRestraint_class(); register_Restraints_class(); @@ -600,10 +596,6 @@ BOOST_PYTHON_MODULE(_MM){ register_BondRestraints_class(); - register_InverseBondRestraint_class(); - - register_InverseBondRestraints_class(); - register_BondSymbols_class(); register_BoreschRestraint_class(); @@ -700,6 +692,10 @@ BOOST_PYTHON_MODULE(_MM){ register_DihedralSymbols_class(); + register_Restraint_class(); + + register_Restraint3D_class(); + register_DistanceRestraint_class(); register_DoubleDistanceRestraint_class(); @@ -776,6 +772,10 @@ BOOST_PYTHON_MODULE(_MM){ register_IntraGroupFF_class(); + register_InverseBondRestraint_class(); + + register_InverseBondRestraints_class(); + register_LJ1264Parameter_class(); register_LJComponent_class(); diff --git a/wrapper/MM/active_headers.h b/wrapper/MM/active_headers.h index e570fb68c..6a66b22b1 100644 --- a/wrapper/MM/active_headers.h +++ b/wrapper/MM/active_headers.h @@ -10,7 +10,6 @@ #include "atomljs.h" #include "bond.h" #include "bondrestraints.h" -#include "inversebondrestraints.h" #include "boreschrestraints.h" #include "clj14group.h" #include "cljatoms.h" @@ -56,6 +55,7 @@ #include "intragroupff.h" #include "intraljff.h" #include "intrasoftcljff.h" +#include "inversebondrestraints.h" #include "lj1264parameter.h" #include "ljpair.h" #include "ljparameter.h" From fea7036481d6f383ea46508564186d8c9ec52492 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Mon, 3 Nov 2025 15:54:50 +0000 Subject: [PATCH 03/10] Update CHANGELOG. --- doc/source/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 2d225b595..0f1d3afe6 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -38,6 +38,8 @@ organisation on `GitHub `__. * Add support for writing trajectory frames to user-defined file names. +* Add inverse distance restraint to keep atoms apart during OpenMM dyanmics. + `2025.2.0 `__ - October 2025 -------------------------------------------------------------------------------------------- From 6d7177aec27cfdf314cb1e25cdb0a9237a2e5114 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Mon, 3 Nov 2025 16:13:10 +0000 Subject: [PATCH 04/10] Disable periodic boundary conditions for OpenMM bonded restraints. [ref #379] --- doc/source/changelog.rst | 2 ++ .../Convert/SireOpenMM/sire_to_openmm_system.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 0f1d3afe6..278ade08c 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -40,6 +40,8 @@ organisation on `GitHub `__. * Add inverse distance restraint to keep atoms apart during OpenMM dyanmics. +* Disable periodic boundary conditions for OpenMM bonded restraints. + `2025.2.0 `__ - October 2025 -------------------------------------------------------------------------------------------- diff --git a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp index 1e72ba5bd..0f2f24667 100644 --- a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp +++ b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp @@ -134,7 +134,7 @@ void _add_boresch_restraints(const SireMM::BoreschRestraints &restraints, restraintff->addPerBondParameter("kphi_C"); restraintff->addPerBondParameter("phi0_C"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(false); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -221,7 +221,7 @@ void _add_bond_restraints(const SireMM::BondRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("r0"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(false); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -287,7 +287,7 @@ void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraint restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("r0"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(false); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -365,7 +365,7 @@ void _add_morse_potential_restraints(const SireMM::MorsePotentialRestraints &res restraintff->addPerBondParameter("r0"); restraintff->addPerBondParameter("de"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(false); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -439,7 +439,7 @@ void _add_positional_restraints(const SireMM::PositionalRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("rb"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(false); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -669,7 +669,7 @@ void _add_angle_restraints(const SireMM::AngleRestraints &restraints, restraintff->addPerAngleParameter("k"); restraintff->addPerAngleParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(false); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -732,7 +732,7 @@ void _add_dihedral_restraints(const SireMM::DihedralRestraints &restraints, restraintff->addPerTorsionParameter("k"); restraintff->addPerTorsionParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(false); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); From 9db288d7ddec61f102a7d1a4c304ab87f2a113c0 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Mon, 3 Nov 2025 20:47:33 +0000 Subject: [PATCH 05/10] Allow user to specify whether OpenMM restraints use PBC. --- doc/source/changelog.rst | 2 +- doc/source/tutorial/part06/03_restraints.rst | 8 +- src/sire/mol/_dynamics.py | 6 + src/sire/mol/_minimisation.py | 6 + src/sire/restraints/_restraints.py | 112 ++++++++++++++++-- tests/convert/test_openmm_restraints.py | 61 ++++++++++ tests/io/test_pdb2.py | 1 + .../SireOpenMM/sire_to_openmm_system.cpp | 49 ++++---- 8 files changed, 211 insertions(+), 34 deletions(-) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 278ade08c..edd78f0e6 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -40,7 +40,7 @@ organisation on `GitHub `__. * Add inverse distance restraint to keep atoms apart during OpenMM dyanmics. -* Disable periodic boundary conditions for OpenMM bonded restraints. +* Allow user to specify whether OpenMM restraints use periodic boundary conditions. `2025.2.0 `__ - October 2025 -------------------------------------------------------------------------------------------- diff --git a/doc/source/tutorial/part06/03_restraints.rst b/doc/source/tutorial/part06/03_restraints.rst index 8b4c0766f..7a43feeea 100644 --- a/doc/source/tutorial/part06/03_restraints.rst +++ b/doc/source/tutorial/part06/03_restraints.rst @@ -20,6 +20,12 @@ needs to be passed to OpenMM to add the restraints to the system. ``k`` values supplied to the restraints functions are half the value of the force constants. +.. note:: + + Where appropriate, whether periodic boundary conditions are applied to the restraints + can be controlled via the ``use_pbc`` keyword argument. By default, this is set to + ``True`` for positional and distance restraints, and ``False`` for all bonded restraints. + Positional Restraints --------------------- @@ -156,7 +162,7 @@ SireMol::SelectorM( size=358 ) RMSD Restraints ---------------------- +--------------- RMSD restraints are similar to positional restraints, but rather than atoms being restrained with respect to fixed positions in space, they are restrained relative diff --git a/src/sire/mol/_dynamics.py b/src/sire/mol/_dynamics.py index 0344e5900..6f08d9046 100644 --- a/src/sire/mol/_dynamics.py +++ b/src/sire/mol/_dynamics.py @@ -1579,6 +1579,12 @@ def __init__( _add_extra(extras, "qm_engine", qm_engine) _add_extra(extras, "lambda_interpolate", lambda_interpolate) + if restraints is not None: + if hasattr(restraints, "_use_pbc"): + extras["use_pbc"] = restraints._use_pbc + else: + extras["use_pbc"] = True + map = create_map(map, extras) self._d = DynamicsData(mols=mols, map=map) diff --git a/src/sire/mol/_minimisation.py b/src/sire/mol/_minimisation.py index b6c89b9fe..2b1f36bfb 100644 --- a/src/sire/mol/_minimisation.py +++ b/src/sire/mol/_minimisation.py @@ -50,6 +50,12 @@ def __init__( _add_extra(extras, "restraints", restraints) _add_extra(extras, "fixed", fixed) + if restraints is not None: + if hasattr(restraints, "_use_pbc"): + extras["use_pbc"] = restraints._use_pbc + else: + extras["use_pbc"] = True + map = create_map(map, extras) self._d = DynamicsData(mols=mols, map=map) diff --git a/src/sire/restraints/_restraints.py b/src/sire/restraints/_restraints.py index 6b3cf8993..de9e74134 100644 --- a/src/sire/restraints/_restraints.py +++ b/src/sire/restraints/_restraints.py @@ -24,7 +24,7 @@ def _to_atoms(mols, atoms): return selection_to_atoms(mols, atoms) -def angle(mols, atoms, theta0=None, ktheta=None, name=None, map=None): +def angle(mols, atoms, theta0=None, ktheta=None, use_pbc=None, name=None, map=None): """ Create a set of angle restraints from all of the atoms in 'atoms' where all atoms are contained in the container 'mols', using the @@ -54,6 +54,10 @@ def angle(mols, atoms, theta0=None, ktheta=None, name=None, map=None): will be measured from the current coordinates of the atoms. Default is None. + use_pbc : bool, optional + Whether to use periodic boundary conditions when calculating + the angle. Default is None. + Returns ------- AngleRestraints : SireMM::AngleRestraints @@ -69,8 +73,15 @@ def angle(mols, atoms, theta0=None, ktheta=None, name=None, map=None): map_dict = map.to_dict() ktheta = ktheta if ktheta is not None else map_dict.get("ktheta", None) theta0 = theta0 if theta0 is not None else map_dict.get("theta0", None) + use_pbc = use_pbc if use_pbc is not None else map_dict.get("use_pbc", None) name = name if name is not None else map_dict.get("name", None) + if use_pbc is not None: + if not isinstance(use_pbc, bool): + raise ValueError("'use_pbc' must be of type 'bool'") + else: + use_pbc = False + atoms = _to_atoms(mols, atoms) if len(atoms) != 3: @@ -111,6 +122,10 @@ def angle(mols, atoms, theta0=None, ktheta=None, name=None, map=None): restraints = AngleRestraints(name=name) restraints.add(AngleRestraint(mols.find(atoms), theta0, ktheta)) + + # Set the use_pbc flag. + restraints._use_pbc = use_pbc + return restraints @@ -124,6 +139,7 @@ def boresch( r0=None, theta0=None, phi0=None, + use_pbc=None, name=None, map=None, temperature=u("298 K"), @@ -198,6 +214,10 @@ def boresch( list, then this should be a list of length 3 containing the equilibrium angles for the three torsion restraints. Default is None. + use_pbc : bool, optional + Whether to use periodic boundary conditions when calculating + the distance, angles, and torsions. Default is None. + name : str, optional The name of the restraint. If None, then a default name will be used. Default is None. @@ -252,6 +272,7 @@ def boresch( r0 = r0 if r0 is not None else map_dict.get("r0", None) theta0 = theta0 if theta0 is not None else map_dict.get("theta0", None) phi0 = phi0 if phi0 is not None else map_dict.get("phi0", None) + use_pbc = use_pbc if use_pbc is not None else map_dict.get("use_pbc", None) name = name if name is not None else map_dict.get("name", None) temperature = ( temperature if temperature is not None else map_dict.get("temperature", None) @@ -269,6 +290,12 @@ def boresch( f"ligand atoms were provided." ) + if use_pbc is not None: + if not isinstance(use_pbc, bool): + raise ValueError("'use_pbc' must be of type 'bool'") + else: + use_pbc = False + from .. import measure default_distance_k = u("5 kcal mol-1 A-2") @@ -415,9 +442,14 @@ def boresch( ) if name is None: - return BoreschRestraints(b) + b = BoreschRestraints(b) else: - return BoreschRestraints(name, b) + b = BoreschRestraints(name, b) + + # Set the use_pbc flag. + b._use_pbc = use_pbc + + return b def _check_stability_boresch_restraint(restraint_components, temperature=u("298 K")): @@ -473,7 +505,7 @@ def _check_stability_boresch_restraint(restraint_components, temperature=u("298 ) -def dihedral(mols, atoms, phi0=None, kphi=None, name=None, map=None): +def dihedral(mols, atoms, phi0=None, kphi=None, use_pbc=None, name=None, map=None): """ Create a set of dihedral restraints from all of the atoms in 'atoms' where all atoms are contained in the container 'mols', using the @@ -503,6 +535,10 @@ def dihedral(mols, atoms, phi0=None, kphi=None, name=None, map=None): will be measured from the current coordinates of the atoms. Default is None. + use_pbc : bool, optional + Whether to use periodic boundary conditions when calculating + the dihedral. Default is None. + Returns ------- DihedralRestraints : SireMM::DihedralRestraints @@ -518,6 +554,7 @@ def dihedral(mols, atoms, phi0=None, kphi=None, name=None, map=None): map_dict = map.to_dict() kphi = kphi if kphi is not None else map_dict.get("kphi", None) phi0 = phi0 if phi0 is not None else map_dict.get("phi0", None) + use_pbc = use_pbc if use_pbc is not None else map_dict.get("use_pbc", None) name = name if name is not None else map_dict.get("name", None) atoms = _to_atoms(mols, atoms) @@ -528,6 +565,12 @@ def dihedral(mols, atoms, phi0=None, kphi=None, name=None, map=None): f"whereas {len(atoms)} atoms were provided." ) + if use_pbc is not None: + if not isinstance(use_pbc, bool): + raise ValueError("'use_pbc' must be of type 'bool'") + else: + use_pbc = False + from .. import measure if kphi is None: @@ -560,10 +603,14 @@ def dihedral(mols, atoms, phi0=None, kphi=None, name=None, map=None): restraints = DihedralRestraints(name=name) restraints.add(DihedralRestraint(mols.find(atoms), phi0, kphi)) + + # Set the use_pbc flag. + restraints._use_pbc = use_pbc + return restraints -def distance(mols, atoms0, atoms1, r0=None, k=None, name=None, map=None): +def distance(mols, atoms0, atoms1, r0=None, k=None, use_pbc=None, name=None, map=None): """ Create a set of distance restraints from all of the atoms in 'atoms0' to all of the atoms in 'atoms1' where all atoms are @@ -600,6 +647,12 @@ def distance(mols, atoms0, atoms1, r0=None, k=None, name=None, map=None): atoms0 = _to_atoms(mols, atoms0) atoms1 = _to_atoms(mols, atoms1) + if use_pbc is not None: + if not isinstance(use_pbc, bool): + raise ValueError("'use_pbc' must be of type 'bool'") + else: + use_pbc = True + if atoms0.is_empty() or atoms1.is_empty(): raise ValueError("We need at least one atom in each group") @@ -664,6 +717,9 @@ def distance(mols, atoms0, atoms1, r0=None, k=None, name=None, map=None): restraints.add(BondRestraint(idxs0[0], idxs1[0], ik, ir0)) + # Set the use_pbc flag. + restraints._use_pbc = use_pbc + return restraints @@ -674,6 +730,7 @@ def morse_potential( r0=None, k=None, de=None, + use_pbc=None, name=None, auto_parametrise=False, map=None, @@ -721,6 +778,10 @@ def morse_potential( The well depth (dissociation energy) for the Morse potential. Default is 100 kcal mol-1. + use_pbc : bool, optional + Whether to use periodic boundary conditions when calculating + the distance. Default is None. + name : str, optional The name of the restraint. Default is None. @@ -751,6 +812,12 @@ def morse_potential( map = create_map(map) + if use_pbc is not None: + if not isinstance(use_pbc, bool): + raise ValueError("'use_pbc' must be of type 'bool'") + else: + use_pbc = False + if auto_parametrise is False: if atoms0 is None or atoms1 is None: raise ValueError( @@ -900,18 +967,23 @@ def morse_potential( restraints.add(MorsePotentialRestraint(idxs0[0], idxs1[0], ik, ir0, de)) + # Set the use_pbc flag. + restraints._use_pbc = use_pbc + return restraints -def bond(*args, **kwargs): +def bond(*args, use_pbc=False, **kwargs): """ Synonym for distance(), as a bond restraint is treated the same as a distance restraint """ - return distance(*args, **kwargs) + return distance(*args, use_pbc=use_pbc, **kwargs) -def inverse_distance(mols, atoms0, atoms1, r0=None, k=None, name=None, map=None): +def inverse_distance( + mols, atoms0, atoms1, r0=None, k=None, use_pbc=None, name=None, map=None +): """ Create a set of inverse distance restraints from all of the atoms in 'atoms0' to all of the atoms in 'atoms1' where all atoms are @@ -945,6 +1017,12 @@ def inverse_distance(mols, atoms0, atoms1, r0=None, k=None, name=None, map=None) else: k = [u(k)] + if use_pbc is not None: + if not isinstance(use_pbc, bool): + raise ValueError("'use_pbc' must be of type 'bool'") + else: + use_pbc = True + atoms0 = _to_atoms(mols, atoms0) atoms1 = _to_atoms(mols, atoms1) @@ -1012,18 +1090,23 @@ def inverse_distance(mols, atoms0, atoms1, r0=None, k=None, name=None, map=None) restraints.add(InverseBondRestraint(idxs0[0], idxs1[0], ik, ir0)) + # Set the use_pbc flag. + restraints._use_pbc = use_pbc + return restraints -def inverse_bond(*args, **kwargs): +def inverse_bond(*args, use_pbc=False, **kwargs): """ Synonym for distance(), as a bond restraint is treated the same as a distance restraint """ - return inverse_distance(*args, **kwargs) + return inverse_distance(*args, use_pbc=use_pbc, **kwargs) -def positional(mols, atoms, k=None, r0=None, position=None, name=None, map=None): +def positional( + mols, atoms, k=None, r0=None, position=None, use_pbc=None, name=None, map=None +): """ Create a set of position restraints for the atoms specified in 'atoms' that are contained in the container 'mols', using the @@ -1064,6 +1147,10 @@ def positional(mols, atoms, k=None, r0=None, position=None, name=None, map=None) else: r0 = [u(r0)] + if use_pbc is not None: + if not isinstance(use_pbc, bool): + raise ValueError("'use_pbc' must be of type 'bool'") + atoms = _to_atoms(mols, atoms) mols = mols.atoms() @@ -1113,6 +1200,9 @@ def positional(mols, atoms, k=None, r0=None, position=None, name=None, map=None) else: restraints.add(PositionalRestraint(idxs[0], position[i], ik, ir0)) + # Set the use_pbc flag. + restraints._use_pbc = use_pbc + return restraints diff --git a/tests/convert/test_openmm_restraints.py b/tests/convert/test_openmm_restraints.py index c7dcd8bf7..b79cf2d23 100644 --- a/tests/convert/test_openmm_restraints.py +++ b/tests/convert/test_openmm_restraints.py @@ -247,3 +247,64 @@ def test_openmm_named_restraints(ala_mols, openmm_platform): d.set_lambda(2.0 / 3.0) assert d.current_potential_energy().value() == pytest.approx(nrg_0.value(), 1e-6) + + +@pytest.mark.skipif( + "openmm" not in sr.convert.supported_formats(), + reason="openmm support is not available", +) +@pytest.mark.parametrize( + "restraint,default_pbc", + [ + ("distance", True), + ("bond", False), + ], +) +def test_openmm_restraints_pbc(ala_mols, restraint, default_pbc, openmm_platform): + mols = ala_mols + + # get the restraint class + restraint_class = getattr(sr.restraints, restraint) + + # create a distance restraint between the first and last atom + restraints = restraint_class( + mols, + atoms0=mols[0][0], + atoms1=mols[-1][0], + r0="5A", + ) + + # make sure the _use_pbc flag is set to the default value + assert restraints._use_pbc == default_pbc + + # create a dynamics object + d = mols.dynamics(restraints=restraints, platform=openmm_platform) + + # find the restraint force + for force in d.context().getSystem().getForces(): + if force.getName() == "BondRestraintForce": + restraint_force = force + break + + # check that the force is using periodic boundary conditions + assert restraint_force.usesPeriodicBoundaryConditions() == default_pbc + + # now create a distance restraint with _use_pbc set to the non-default value + restraints = restraint_class( + mols, atoms0=mols[0][0], atoms1=mols[-1][0], r0="5A", use_pbc=not default_pbc + ) + + # make sure the _use_pbc flag is set to False + assert restraints._use_pbc == (not default_pbc) + + # create a dynamics object + d = mols.dynamics(restraints=restraints, platform=openmm_platform) + + # find the restraint force + for force in d.context().getSystem().getForces(): + if force.getName() == "BondRestraintForce": + restraint_force = force + break + + # check that the force is not using periodic boundary conditions + assert restraint_force.usesPeriodicBoundaryConditions() == (not default_pbc) diff --git a/tests/io/test_pdb2.py b/tests/io/test_pdb2.py index f5188caa3..526268aae 100644 --- a/tests/io/test_pdb2.py +++ b/tests/io/test_pdb2.py @@ -2,6 +2,7 @@ import sire as sr import tempfile + def test_pdb_space(): """ Test that we can parse CRYST1 records in a PDB file and that they diff --git a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp index 0f2f24667..b80180828 100644 --- a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp +++ b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp @@ -71,7 +71,7 @@ using namespace SireOpenMM; */ void _add_boresch_restraints(const SireMM::BoreschRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms) + int natoms, bool use_pbc) { if (restraints.isEmpty()) return; @@ -134,7 +134,7 @@ void _add_boresch_restraints(const SireMM::BoreschRestraints &restraints, restraintff->addPerBondParameter("kphi_C"); restraintff->addPerBondParameter("phi0_C"); - restraintff->setUsesPeriodicBoundaryConditions(false); + restraintff->setUsesPeriodicBoundaryConditions(use_pbc); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -196,7 +196,7 @@ void _add_boresch_restraints(const SireMM::BoreschRestraints &restraints, */ void _add_bond_restraints(const SireMM::BondRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms) + int natoms, bool use_pbc) { if (restraints.isEmpty()) return; @@ -221,7 +221,7 @@ void _add_bond_restraints(const SireMM::BondRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("r0"); - restraintff->setUsesPeriodicBoundaryConditions(false); + restraintff->setUsesPeriodicBoundaryConditions(use_pbc); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -262,7 +262,7 @@ void _add_bond_restraints(const SireMM::BondRestraints &restraints, void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms) + int natoms, bool use_pbc) { if (restraints.isEmpty()) return; @@ -287,7 +287,7 @@ void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraint restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("r0"); - restraintff->setUsesPeriodicBoundaryConditions(false); + restraintff->setUsesPeriodicBoundaryConditions(use_pbc); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -333,7 +333,7 @@ void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraint */ void _add_morse_potential_restraints(const SireMM::MorsePotentialRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms) + int natoms, bool use_pbc) { if (restraints.isEmpty()) return; @@ -365,7 +365,7 @@ void _add_morse_potential_restraints(const SireMM::MorsePotentialRestraints &res restraintff->addPerBondParameter("r0"); restraintff->addPerBondParameter("de"); - restraintff->setUsesPeriodicBoundaryConditions(false); + restraintff->setUsesPeriodicBoundaryConditions(use_pbc); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -414,7 +414,7 @@ void _add_morse_potential_restraints(const SireMM::MorsePotentialRestraints &res void _add_positional_restraints(const SireMM::PositionalRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, std::vector &anchor_coords, - int natoms) + int natoms, bool use_pbc) { if (restraints.isEmpty()) return; @@ -439,7 +439,7 @@ void _add_positional_restraints(const SireMM::PositionalRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("rb"); - restraintff->setUsesPeriodicBoundaryConditions(false); + restraintff->setUsesPeriodicBoundaryConditions(use_pbc); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -644,7 +644,7 @@ void _add_rmsd_restraints(const SireMM::RMSDRestraints &restraints, */ void _add_angle_restraints(const SireMM::AngleRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms) + int natoms, bool use_pbc) { if (restraints.isEmpty()) return; @@ -669,7 +669,7 @@ void _add_angle_restraints(const SireMM::AngleRestraints &restraints, restraintff->addPerAngleParameter("k"); restraintff->addPerAngleParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(false); + restraintff->setUsesPeriodicBoundaryConditions(use_pbc); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -702,7 +702,7 @@ void _add_angle_restraints(const SireMM::AngleRestraints &restraints, void _add_dihedral_restraints(const SireMM::DihedralRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms) + int natoms, bool use_pbc) { if (restraints.isEmpty()) return; @@ -732,7 +732,7 @@ void _add_dihedral_restraints(const SireMM::DihedralRestraints &restraints, restraintff->addPerTorsionParameter("k"); restraintff->addPerTorsionParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(false); + restraintff->setUsesPeriodicBoundaryConditions(use_pbc); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -2086,6 +2086,13 @@ OpenMMMetaData SireOpenMM::sire_to_openmm_system(OpenMM::System &system, // PropertyList first auto all_restraints = map["restraints"].value().asAnArray(); + // whether or not to use periodic boundary conditions for restraints + bool use_pbc = false; + if (map.specified("use_pbc")) + { + use_pbc = map["use_pbc"].value().asABoolean(); + } + // loop over all of the restraints groups and add them for (const auto &prop : all_restraints.toList()) { @@ -2099,22 +2106,22 @@ OpenMMMetaData SireOpenMM::sire_to_openmm_system(OpenMM::System &system, if (prop.read().isA()) { _add_dihedral_restraints(prop.read().asA(), - system, lambda_lever, start_index); + system, lambda_lever, start_index, use_pbc); } else if (prop.read().isA()) { _add_angle_restraints(prop.read().asA(), - system, lambda_lever, start_index); + system, lambda_lever, start_index, use_pbc); } else if (prop.read().isA()) { _add_positional_restraints(prop.read().asA(), - system, lambda_lever, anchor_coords, start_index); + system, lambda_lever, anchor_coords, start_index, use_pbc); } else if (prop.read().isA()) { _add_morse_potential_restraints(prop.read().asA(), - system, lambda_lever, start_index); + system, lambda_lever, start_index, use_pbc); } else if (prop.read().isA()) { @@ -2124,17 +2131,17 @@ OpenMMMetaData SireOpenMM::sire_to_openmm_system(OpenMM::System &system, else if (prop.read().isA()) { _add_bond_restraints(prop.read().asA(), - system, lambda_lever, start_index); + system, lambda_lever, start_index, use_pbc); } else if (prop.read().isA()) { _add_inverse_bond_restraints(prop.read().asA(), - system, lambda_lever, start_index); + system, lambda_lever, start_index, use_pbc); } else if (prop.read().isA()) { _add_boresch_restraints(prop.read().asA(), - system, lambda_lever, start_index); + system, lambda_lever, start_index, use_pbc); } } } From cc16a78f60aa20dc66ecd85ba646612e20a02033 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Tue, 4 Nov 2025 08:30:41 +0000 Subject: [PATCH 06/10] Fix missing default use_pbc flag for positional restraints. --- src/sire/restraints/_restraints.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sire/restraints/_restraints.py b/src/sire/restraints/_restraints.py index de9e74134..6a29404da 100644 --- a/src/sire/restraints/_restraints.py +++ b/src/sire/restraints/_restraints.py @@ -1150,6 +1150,8 @@ def positional( if use_pbc is not None: if not isinstance(use_pbc, bool): raise ValueError("'use_pbc' must be of type 'bool'") + else: + use_pbc = True atoms = _to_atoms(mols, atoms) From f5c8f34479702aa4582e757c8876de5cc72df867 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Tue, 4 Nov 2025 11:22:16 +0000 Subject: [PATCH 07/10] Allow user to specify the OpenCL platform index. --- doc/source/changelog.rst | 2 ++ doc/source/cheatsheet/openmm.rst | 3 +++ wrapper/Convert/__init__.py | 14 ++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index edd78f0e6..1e23da33a 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -42,6 +42,8 @@ organisation on `GitHub `__. * Allow user to specify whether OpenMM restraints use periodic boundary conditions. +* Allow user to specify the OpenCL platform index when creating an OpenMM context. + `2025.2.0 `__ - October 2025 -------------------------------------------------------------------------------------------- diff --git a/doc/source/cheatsheet/openmm.rst b/doc/source/cheatsheet/openmm.rst index 4f27fccbc..9f46bdd04 100644 --- a/doc/source/cheatsheet/openmm.rst +++ b/doc/source/cheatsheet/openmm.rst @@ -168,6 +168,9 @@ Available keys and allowable values are listed below. | lambda | The λ-value at which to set up the system (assuming this | | | contains any perturbable molecules or restraints) | +------------------------------+----------------------------------------------------------+ +| opencl_platform_index | The OpenCL platform index to use if the multiple OpenCL | +| | implementations are available. | ++------------------------------+----------------------------------------------------------+ | perturbable_constraint | The constraint to use for perturbable molecules. These | | | are the same options as ``constraint``, and will | | | override that choice for perturbable molecules if this | diff --git a/wrapper/Convert/__init__.py b/wrapper/Convert/__init__.py index 34e706248..a68325e20 100644 --- a/wrapper/Convert/__init__.py +++ b/wrapper/Convert/__init__.py @@ -471,6 +471,20 @@ def sire_to_openmm(mols, map): usecpu = int(map["cpu_pme"].value().as_boolean()) platform.setPropertyDefaultValue("UseCpuPme", str(usecpu).lower()) + if "OpenCLPlatformIndex" in supported_properties and map.specified( + "opencl_platform_index" + ): + try: + opencl_platform_index = ( + map["opencl_platform_index"].value().as_integer() + ) + except Exception: + opencl_platform_index = map["opencl_platform_index"].source() + + platform.setPropertyDefaultValue( + "OpenCLPlatformIndex", str(opencl_platform_index) + ) + try: from ._sommcontext import SOMMContext From 3189d6616bfdf399b8e38b059954e41778ef433e Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Tue, 4 Nov 2025 15:40:26 +0000 Subject: [PATCH 08/10] Boilerplate for handling PBC in restraints. [ci skip] --- corelib/src/libs/SireMM/anglerestraints.cpp | 33 +++++++-- corelib/src/libs/SireMM/anglerestraints.h | 6 ++ corelib/src/libs/SireMM/bondrestraints.cpp | 34 +++++++-- corelib/src/libs/SireMM/bondrestraints.h | 6 ++ corelib/src/libs/SireMM/boreschrestraints.cpp | 37 ++++++++-- corelib/src/libs/SireMM/boreschrestraints.h | 6 ++ .../src/libs/SireMM/dihedralrestraints.cpp | 36 +++++++-- corelib/src/libs/SireMM/dihedralrestraints.h | 8 +- .../src/libs/SireMM/inversebondrestraints.cpp | 32 +++++++- .../src/libs/SireMM/inversebondrestraints.h | 6 ++ .../libs/SireMM/morsepotentialrestraints.cpp | 38 ++++++++-- .../libs/SireMM/morsepotentialrestraints.h | 6 ++ .../src/libs/SireMM/positionalrestraints.cpp | 36 +++++++-- .../src/libs/SireMM/positionalrestraints.h | 6 ++ src/sire/mol/_dynamics.py | 6 -- src/sire/mol/_minimisation.py | 6 -- src/sire/restraints/_restraints.py | 12 +-- .../SireOpenMM/sire_to_openmm_system.cpp | 74 ++++++++++++------- 18 files changed, 300 insertions(+), 88 deletions(-) diff --git a/corelib/src/libs/SireMM/anglerestraints.cpp b/corelib/src/libs/SireMM/anglerestraints.cpp index 5eaf82fc1..eee4b6751 100644 --- a/corelib/src/libs/SireMM/anglerestraints.cpp +++ b/corelib/src/libs/SireMM/anglerestraints.cpp @@ -227,11 +227,11 @@ static const RegisterMetaType r_angrests; QDataStream &operator<<(QDataStream &ds, const AngleRestraints &angrests) { - writeHeader(ds, r_angrests, 1); + writeHeader(ds, r_angrests, 2); SharedDataStream sds(ds); - sds << angrests.r + sds << angrests.r << angrests.use_pbc << static_cast(angrests); return ds; @@ -249,8 +249,15 @@ QDataStream &operator>>(QDataStream &ds, AngleRestraints &angrests) sds >> angrests.r >> static_cast(angrests); } + else if (v == 2) + { + SharedDataStream sds(ds); + + sds >> angrests.r >> angrests.use_pbc + >> static_cast(angrests); + } else - throw version_error(v, "1", r_angrests, CODELOC); + throw version_error(v, "1,2", r_angrests, CODELOC); return ds; } @@ -303,7 +310,7 @@ AngleRestraints::AngleRestraints(const QString &name, } AngleRestraints::AngleRestraints(const AngleRestraints &other) - : ConcreteProperty(other), r(other.r) + : ConcreteProperty(other), r(other.r), use_pbc(other.use_pbc) { } @@ -318,6 +325,7 @@ AngleRestraints &AngleRestraints::operator=(const AngleRestraints &other) { Restraints::operator=(other); r = other.r; + use_pbc = other.use_pbc; } return *this; @@ -325,7 +333,7 @@ AngleRestraints &AngleRestraints::operator=(const AngleRestraints &other) bool AngleRestraints::operator==(const AngleRestraints &other) const { - return r == other.r and Restraints::operator==(other); + return r == other.r and Restraints::operator==(other) and use_pbc == other.use_pbc; } bool AngleRestraints::operator!=(const AngleRestraints &other) const @@ -379,9 +387,10 @@ QString AngleRestraints::toString() const } } - return QObject::tr("AngleRestraints( name=%1, size=%2\n%3\n )") + return QObject::tr("AngleRestraints( name=%1, size=%2, use_pbc=%3\n%4\n )") .arg(this->name()) .arg(n) + .arg(this->use_pbc ? "true" : "false") .arg(parts.join("\n")); } @@ -477,3 +486,15 @@ AngleRestraints AngleRestraints::operator+(const AngleRestraints &restraints) co ret += restraints; return *this; } + +/** Set whether or not periodic boundary conditions are to be used */ +void AngleRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +bool AngleRestraints::getUsesPeriodicBoundaryConditions() const +{ + return this->use_pbc; +} diff --git a/corelib/src/libs/SireMM/anglerestraints.h b/corelib/src/libs/SireMM/anglerestraints.h index b34de4822..e774eeb8c 100644 --- a/corelib/src/libs/SireMM/anglerestraints.h +++ b/corelib/src/libs/SireMM/anglerestraints.h @@ -161,9 +161,15 @@ namespace SireMM AngleRestraints operator+(const AngleRestraint &restraint) const; AngleRestraints operator+(const AngleRestraints &restraints) const; + void setUsesPeriodicBoundaryConditions(bool use_pbc); + bool getUsesPeriodicBoundaryConditions() const; + private: /** List of restraints */ QList r; + + /** Whether the restraints use periodic boundary conditions */ + bool use_pbc = false; }; } diff --git a/corelib/src/libs/SireMM/bondrestraints.cpp b/corelib/src/libs/SireMM/bondrestraints.cpp index 11e91057e..0ca1a29ab 100644 --- a/corelib/src/libs/SireMM/bondrestraints.cpp +++ b/corelib/src/libs/SireMM/bondrestraints.cpp @@ -350,11 +350,11 @@ static const RegisterMetaType r_bndrests; QDataStream &operator<<(QDataStream &ds, const BondRestraints &bndrests) { - writeHeader(ds, r_bndrests, 1); + writeHeader(ds, r_bndrests, 2); SharedDataStream sds(ds); - sds << bndrests.r + sds << bndrests.r << bndrests.use_pbc << static_cast(bndrests); return ds; @@ -370,8 +370,15 @@ QDataStream &operator>>(QDataStream &ds, BondRestraints &bndrests) sds >> bndrests.r >> static_cast(bndrests); } + else if (v == 2) + { + SharedDataStream sds(ds); + + sds >> bndrests.r >> bndrests.use_pbc + >> static_cast(bndrests); + } else - throw version_error(v, "1", r_bndrests, CODELOC); + throw version_error(v, "1,2", r_bndrests, CODELOC); return ds; } @@ -435,13 +442,14 @@ BondRestraints::~BondRestraints() BondRestraints &BondRestraints::operator=(const BondRestraints &other) { r = other.r; + use_pbc = other.use_pbc; Restraints::operator=(other); return *this; } bool BondRestraints::operator==(const BondRestraints &other) const { - return r == other.r and Restraints::operator==(other); + return r == other.r and Restraints::operator==(other) and use_pbc == other.use_pbc; } bool BondRestraints::operator!=(const BondRestraints &other) const @@ -495,7 +503,11 @@ QString BondRestraints::toString() const } } - return QObject::tr("BondRestraints( name=%1, size=%2\n%3\n)").arg(this->name()).arg(n).arg(parts.join("\n")); + return QObject::tr("BondRestraints( name=%1, size=%2, use_pbc=$3\n%4\n)") + .arg(this->name()) + .arg(n) + .arg(this->use_pbc ? "true" : "false") + .arg(parts.join("\n")); } /** Return whether or not this is empty */ @@ -678,3 +690,15 @@ BondRestraints BondRestraints::operator+(const BondRestraints &restraints) const ret += restraints; return *this; } + +/** Set whether or not periodic boundary conditions are to be used */ +void BondRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +bool BondRestraints::getUsesPeriodicBoundaryConditions() const +{ + return this->use_pbc; +} diff --git a/corelib/src/libs/SireMM/bondrestraints.h b/corelib/src/libs/SireMM/bondrestraints.h index ccf534de9..2b7c01ce6 100644 --- a/corelib/src/libs/SireMM/bondrestraints.h +++ b/corelib/src/libs/SireMM/bondrestraints.h @@ -191,9 +191,15 @@ namespace SireMM BondRestraints operator+(const BondRestraint &restraint) const; BondRestraints operator+(const BondRestraints &restraints) const; + void setUsesPeriodicBoundaryConditions(bool use_pbc); + bool getUsesPeriodicBoundaryConditions() const; + private: /** The actual list of restraints*/ QList r; + + /** Whether the restraints use periodic boundary conditions */ + bool use_pbc = false; }; } diff --git a/corelib/src/libs/SireMM/boreschrestraints.cpp b/corelib/src/libs/SireMM/boreschrestraints.cpp index be5981a9e..b2f283029 100644 --- a/corelib/src/libs/SireMM/boreschrestraints.cpp +++ b/corelib/src/libs/SireMM/boreschrestraints.cpp @@ -343,11 +343,11 @@ static const RegisterMetaType r_borrests; QDataStream &operator<<(QDataStream &ds, const BoreschRestraints &borrests) { - writeHeader(ds, r_borrests, 1); + writeHeader(ds, r_borrests, 2); SharedDataStream sds(ds); - sds << borrests.r + sds << borrests.r << borrests.use_pbc << static_cast(borrests); return ds; @@ -363,8 +363,15 @@ QDataStream &operator>>(QDataStream &ds, BoreschRestraints &borrests) sds >> borrests.r >> static_cast(borrests); } + else if (v == 2) + { + SharedDataStream sds(ds); + + sds >> borrests.r >> borrests.use_pbc + >> static_cast(borrests); + } else - throw version_error(v, "1", r_borrests, CODELOC); + throw version_error(v, "1,2", r_borrests, CODELOC); return ds; } @@ -417,7 +424,7 @@ BoreschRestraints::BoreschRestraints(const QString &name, } BoreschRestraints::BoreschRestraints(const BoreschRestraints &other) - : ConcreteProperty(other), r(other.r) + : ConcreteProperty(other), r(other.r), use_pbc(other.use_pbc) { } @@ -428,13 +435,15 @@ BoreschRestraints::~BoreschRestraints() BoreschRestraints &BoreschRestraints::operator=(const BoreschRestraints &other) { r = other.r; + use_pbc = other.use_pbc; Restraints::operator=(other); return *this; } bool BoreschRestraints::operator==(const BoreschRestraints &other) const { - return r == other.r and Restraints::operator==(other); + return r == other.r and Restraints::operator==(other) and + use_pbc == other.use_pbc; } bool BoreschRestraints::operator!=(const BoreschRestraints &other) const @@ -488,7 +497,11 @@ QString BoreschRestraints::toString() const } } - return QObject::tr("BoreschRestraints( name=%1, size=%2\n%3\n)").arg(this->name()).arg(n).arg(parts.join("\n")); + return QObject::tr("BoreschRestraints( name=%1, size=%2, use_pbc=%3\n%4\n)") + .arg(this->name()) + .arg(n) + .arg(this->use_pbc ? "true" : "false") + .arg(parts.join("\n")); } /** Return whether or not this is empty */ @@ -583,3 +596,15 @@ BoreschRestraints BoreschRestraints::operator+(const BoreschRestraints &restrain ret += restraints; return *this; } + +/** Set whether or not periodic boundary conditions are to be used */ +void BoreschRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +bool BoreschRestraints::getUsesPeriodicBoundaryConditions() const +{ + return this->use_pbc; +} diff --git a/corelib/src/libs/SireMM/boreschrestraints.h b/corelib/src/libs/SireMM/boreschrestraints.h index 963e9e423..421e84d54 100644 --- a/corelib/src/libs/SireMM/boreschrestraints.h +++ b/corelib/src/libs/SireMM/boreschrestraints.h @@ -194,9 +194,15 @@ namespace SireMM BoreschRestraints operator+(const BoreschRestraint &restraint) const; BoreschRestraints operator+(const BoreschRestraints &restraints) const; + void setUsesPeriodicBoundaryConditions(bool use_pbc); + bool getUsesPeriodicBoundaryConditions() const; + private: /** The actual list of restraints*/ QList r; + + /** Whether the restraints use periodic boundary conditions */ + bool use_pbc = false; }; } diff --git a/corelib/src/libs/SireMM/dihedralrestraints.cpp b/corelib/src/libs/SireMM/dihedralrestraints.cpp index 70054b34c..7e5580e20 100644 --- a/corelib/src/libs/SireMM/dihedralrestraints.cpp +++ b/corelib/src/libs/SireMM/dihedralrestraints.cpp @@ -225,11 +225,11 @@ static const RegisterMetaType r_dihrests; QDataStream &operator<<(QDataStream &ds, const DihedralRestraints &dihrests) { - writeHeader(ds, r_dihrests, 1); + writeHeader(ds, r_dihrests, 2); SharedDataStream sds(ds); - sds << dihrests.r + sds << dihrests.r << dihrests.use_pbc << static_cast(dihrests); return ds; @@ -247,8 +247,15 @@ QDataStream &operator>>(QDataStream &ds, DihedralRestraints &dihrests) sds >> dihrests.r >> static_cast(dihrests); } + else if (v == 2) + { + SharedDataStream sds(ds); + + sds >> dihrests.r >> dihrests.use_pbc + >> static_cast(dihrests); + } else - throw version_error(v, "1", r_dihrests, CODELOC); + throw version_error(v, "1,2", r_dihrests, CODELOC); return ds; } @@ -301,7 +308,7 @@ DihedralRestraints::DihedralRestraints(const QString &name, } DihedralRestraints::DihedralRestraints(const DihedralRestraints &other) - : ConcreteProperty(other), r(other.r) + : ConcreteProperty(other), r(other.r), use_pbc(other.use_pbc) { } @@ -316,6 +323,7 @@ DihedralRestraints &DihedralRestraints::operator=(const DihedralRestraints &othe { Restraints::operator=(other); r = other.r; + use_pbc = other.use_pbc; } return *this; @@ -323,7 +331,8 @@ DihedralRestraints &DihedralRestraints::operator=(const DihedralRestraints &othe bool DihedralRestraints::operator==(const DihedralRestraints &other) const { - return r == other.r and Restraints::operator==(other); + return r == other.r and Restraints::operator==(other) and + use_pbc == other.use_pbc; } bool DihedralRestraints::operator!=(const DihedralRestraints &other) const @@ -377,9 +386,10 @@ QString DihedralRestraints::toString() const } } - return QObject::tr("DihedralRestraints( name=%1, size=%2\n%3\n )") + return QObject::tr("DihedralRestraints( name=%1, size=%2, use_pbc=%3\n%4\n )") .arg(this->name()) .arg(n) + .arg(this->use_pbc ? "true" : "false") .arg(parts.join("\n")); } @@ -474,4 +484,16 @@ DihedralRestraints DihedralRestraints::operator+(const DihedralRestraints &restr DihedralRestraints ret(*this); ret += restraints; return *this; -} \ No newline at end of file +} + +/** Set whether or not periodic boundary conditions are to be used */ +void DihedralRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +bool DihedralRestraints::getUsesPeriodicBoundaryConditions() const +{ + return this->use_pbc; +} diff --git a/corelib/src/libs/SireMM/dihedralrestraints.h b/corelib/src/libs/SireMM/dihedralrestraints.h index f40b03e0c..4a794fb12 100644 --- a/corelib/src/libs/SireMM/dihedralrestraints.h +++ b/corelib/src/libs/SireMM/dihedralrestraints.h @@ -161,9 +161,15 @@ namespace SireMM DihedralRestraints operator+(const DihedralRestraint &restraint) const; DihedralRestraints operator+(const DihedralRestraints &restraints) const; + void setUsesPeriodicBoundaryConditions(bool use_pbc); + bool getUsesPeriodicBoundaryConditions() const; + private: /** List of restraints */ QList r; + + /** Whether the restraints use periodic boundary conditions */ + bool use_pbc = false; }; } @@ -174,4 +180,4 @@ SIRE_EXPOSE_CLASS(SireMM::DihedralRestraint) SIRE_EXPOSE_CLASS(SireMM::DihedralRestraints) SIRE_END_HEADER -#endif \ No newline at end of file +#endif diff --git a/corelib/src/libs/SireMM/inversebondrestraints.cpp b/corelib/src/libs/SireMM/inversebondrestraints.cpp index b3ee45068..7d900d5f6 100644 --- a/corelib/src/libs/SireMM/inversebondrestraints.cpp +++ b/corelib/src/libs/SireMM/inversebondrestraints.cpp @@ -350,11 +350,11 @@ static const RegisterMetaType r_bndrests; QDataStream &operator<<(QDataStream &ds, const InverseBondRestraints &bndrests) { - writeHeader(ds, r_bndrests, 1); + writeHeader(ds, r_bndrests, 2); SharedDataStream sds(ds); - sds << bndrests.r + sds << bndrests.r << bndrests.use_pbc << static_cast(bndrests); return ds; @@ -370,6 +370,13 @@ QDataStream &operator>>(QDataStream &ds, InverseBondRestraints &bndrests) sds >> bndrests.r >> static_cast(bndrests); } + else if (v == 2) + { + SharedDataStream sds(ds); + + sds >> bndrests.r >> bndrests.use_pbc + >> static_cast(bndrests); + } else throw version_error(v, "1", r_bndrests, CODELOC); @@ -424,7 +431,7 @@ InverseBondRestraints::InverseBondRestraints(const QString &name, } InverseBondRestraints::InverseBondRestraints(const InverseBondRestraints &other) - : ConcreteProperty(other), r(other.r) + : ConcreteProperty(other), r(other.r), use_pbc(other.use_pbc) { } @@ -435,6 +442,7 @@ InverseBondRestraints::~InverseBondRestraints() InverseBondRestraints &InverseBondRestraints::operator=(const InverseBondRestraints &other) { r = other.r; + use_pbc = other.use_pbc; Restraints::operator=(other); return *this; } @@ -495,7 +503,11 @@ QString InverseBondRestraints::toString() const } } - return QObject::tr("InverseBondRestraints( name=%1, size=%2\n%3\n)").arg(this->name()).arg(n).arg(parts.join("\n")); + return QObject::tr("InverseBondRestraints( name=%1, size=%2, use_pbc=%3\n%4\n)") + .arg(this->name()) + .arg(n) + .arg(this->use_pbc ? "true" : "false") + .arg(parts.join("\n")); } /** Return whether or not this is empty */ @@ -678,3 +690,15 @@ InverseBondRestraints InverseBondRestraints::operator+(const InverseBondRestrain ret += restraints; return *this; } + +/** Set whether or not periodic boundary conditions are to be used */ +void InverseBondRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +bool InverseBondRestraints::getUsesPeriodicBoundaryConditions() const +{ + return this->use_pbc; +} diff --git a/corelib/src/libs/SireMM/inversebondrestraints.h b/corelib/src/libs/SireMM/inversebondrestraints.h index 50ef78c12..388c44175 100644 --- a/corelib/src/libs/SireMM/inversebondrestraints.h +++ b/corelib/src/libs/SireMM/inversebondrestraints.h @@ -191,9 +191,15 @@ namespace SireMM InverseBondRestraints operator+(const InverseBondRestraint &restraint) const; InverseBondRestraints operator+(const InverseBondRestraints &restraints) const; + void setUsesPeriodicBoundaryConditions(bool use_pbc); + bool getUsesPeriodicBoundaryConditions() const; + private: /** The actual list of restraints*/ QList r; + + /** Whether the restraints use periodic boundary conditions */ + bool use_pbc = false; }; } diff --git a/corelib/src/libs/SireMM/morsepotentialrestraints.cpp b/corelib/src/libs/SireMM/morsepotentialrestraints.cpp index 78e28d887..afc5dad3e 100644 --- a/corelib/src/libs/SireMM/morsepotentialrestraints.cpp +++ b/corelib/src/libs/SireMM/morsepotentialrestraints.cpp @@ -362,11 +362,11 @@ static const RegisterMetaType r_morsepotentialrests; QDataStream &operator<<(QDataStream &ds, const MorsePotentialRestraints &morser_morsepotentialrests) { - writeHeader(ds, r_morsepotentialrests, 1); + writeHeader(ds, r_morsepotentialrests, 2); SharedDataStream sds(ds); - sds << morser_morsepotentialrests.r + sds << morser_morsepotentialrests.r << morser_morsepotentialrests.use_pbc << static_cast(morser_morsepotentialrests); return ds; @@ -382,8 +382,15 @@ QDataStream &operator>>(QDataStream &ds, MorsePotentialRestraints &morser_morsep sds >> morser_morsepotentialrests.r >> static_cast(morser_morsepotentialrests); } + else if (v == 2) + { + SharedDataStream sds(ds); + + sds >> morser_morsepotentialrests.r >> morser_morsepotentialrests.use_pbc + >> static_cast(morser_morsepotentialrests); + } else - throw version_error(v, "1", r_morsepotentialrests, CODELOC); + throw version_error(v, "1,2", r_morsepotentialrests, CODELOC); return ds; } @@ -436,7 +443,7 @@ MorsePotentialRestraints::MorsePotentialRestraints(const QString &name, } MorsePotentialRestraints::MorsePotentialRestraints(const MorsePotentialRestraints &other) - : ConcreteProperty(other), r(other.r) + : ConcreteProperty(other), r(other.r), use_pbc(other.use_pbc) { } @@ -447,13 +454,14 @@ MorsePotentialRestraints::~MorsePotentialRestraints() MorsePotentialRestraints &MorsePotentialRestraints::operator=(const MorsePotentialRestraints &other) { r = other.r; + use_pbc = other.use_pbc; Restraints::operator=(other); return *this; } bool MorsePotentialRestraints::operator==(const MorsePotentialRestraints &other) const { - return r == other.r and Restraints::operator==(other); + return r == other.r and Restraints::operator==(other) and use_pbc == other.use_pbc; } bool MorsePotentialRestraints::operator!=(const MorsePotentialRestraints &other) const @@ -507,7 +515,11 @@ QString MorsePotentialRestraints::toString() const } } - return QObject::tr("MorsePotentialRestraints( name=%1, size=%2\n%3\n)").arg(this->name()).arg(n).arg(parts.join("\n")); + return QObject::tr("MorsePotentialRestraints( name=%1, size=%2, use_pbc=%3\n%4\n)") + .arg(this->name()) + .arg(n) + .arg(this->use_pbc ? "use_pbc=True" : "use_pbc=False") + .arg(parts.join("\n")); } /** Return whether or not this is empty */ @@ -689,4 +701,16 @@ MorsePotentialRestraints MorsePotentialRestraints::operator+(const MorsePotentia MorsePotentialRestraints ret(*this); ret += restraints; return *this; -} \ No newline at end of file +} + +/** Set whether or not periodic boundary conditions are to be used */ +void MorsePotentialRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +bool MorsePotentialRestraints::getUsesPeriodicBoundaryConditions() const +{ + return this->use_pbc; +} diff --git a/corelib/src/libs/SireMM/morsepotentialrestraints.h b/corelib/src/libs/SireMM/morsepotentialrestraints.h index 49add6127..5959a75dd 100644 --- a/corelib/src/libs/SireMM/morsepotentialrestraints.h +++ b/corelib/src/libs/SireMM/morsepotentialrestraints.h @@ -193,9 +193,15 @@ namespace SireMM MorsePotentialRestraints operator+(const MorsePotentialRestraint &restraint) const; MorsePotentialRestraints operator+(const MorsePotentialRestraints &restraints) const; + void setUsesPeriodicBoundaryConditions(bool use_pbc); + bool getUsesPeriodicBoundaryConditions() const; + private: /** The actual list of restraints*/ QList r; + + /** Whether the restraints use periodic boundary conditions */ + bool use_pbc = false; }; } diff --git a/corelib/src/libs/SireMM/positionalrestraints.cpp b/corelib/src/libs/SireMM/positionalrestraints.cpp index 13a53f989..7eb8b5b38 100644 --- a/corelib/src/libs/SireMM/positionalrestraints.cpp +++ b/corelib/src/libs/SireMM/positionalrestraints.cpp @@ -289,11 +289,11 @@ static const RegisterMetaType r_posrests; QDataStream &operator<<(QDataStream &ds, const PositionalRestraints &posrests) { - writeHeader(ds, r_posrests, 1); + writeHeader(ds, r_posrests, 2); SharedDataStream sds(ds); - sds << posrests.r + sds << posrests.r << posrests.use_pbc << static_cast(posrests); return ds; @@ -309,8 +309,15 @@ QDataStream &operator>>(QDataStream &ds, PositionalRestraints &posrests) sds >> posrests.r >> static_cast(posrests); } + else if (v == 2) + { + SharedDataStream sds(ds); + + sds >> posrests.r >> posrests.use_pbc + >> static_cast(posrests); + } else - throw version_error(v, "1", r_posrests, CODELOC); + throw version_error(v, "1,2", r_posrests, CODELOC); return ds; } @@ -363,7 +370,7 @@ PositionalRestraints::PositionalRestraints(const QString &name, } PositionalRestraints::PositionalRestraints(const PositionalRestraints &other) - : ConcreteProperty(other), r(other.r) + : ConcreteProperty(other), r(other.r), use_pbc(other.use_pbc) { } @@ -374,13 +381,14 @@ PositionalRestraints::~PositionalRestraints() PositionalRestraints &PositionalRestraints::operator=(const PositionalRestraints &other) { r = other.r; + use_pbc = other.use_pbc; Restraints::operator=(other); return *this; } bool PositionalRestraints::operator==(const PositionalRestraints &other) const { - return r == other.r and Restraints::operator==(other); + return r == other.r and Restraints::operator==(other) and use_pbc == other.use_pbc; } bool PositionalRestraints::operator!=(const PositionalRestraints &other) const @@ -434,7 +442,11 @@ QString PositionalRestraints::toString() const } } - return QObject::tr("PositionalRestraints( name=%1, size=%2\n%3\n)").arg(this->name()).arg(n).arg(parts.join("\n")); + return QObject::tr("PositionalRestraints( name=%1, size=%2, use_pbc=%3\n%4\n)") + .arg(this->name()) + .arg(n) + .arg(this->use_pbc ? "true" : "false") + .arg(parts.join("\n")); } /** Return whether or not this is empty */ @@ -617,3 +629,15 @@ PositionalRestraints PositionalRestraints::operator+(const PositionalRestraints ret += restraints; return *this; } + +/** Set whether or not periodic boundary conditions are to be used */ +void PositionalRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +bool PositionalRestraints::getUsesPeriodicBoundaryConditions() const +{ + return this->use_pbc; +} diff --git a/corelib/src/libs/SireMM/positionalrestraints.h b/corelib/src/libs/SireMM/positionalrestraints.h index abda2d9d7..676e3f623 100644 --- a/corelib/src/libs/SireMM/positionalrestraints.h +++ b/corelib/src/libs/SireMM/positionalrestraints.h @@ -191,9 +191,15 @@ namespace SireMM PositionalRestraints operator+(const PositionalRestraint &restraint) const; PositionalRestraints operator+(const PositionalRestraints &restraints) const; + void setUsesPeriodicBoundaryConditions(bool use_pbc); + bool getUsesPeriodicBoundaryConditions() const; + private: /** The actual list of restraints*/ QList r; + + /** Whether the restraints use periodic boundary conditions */ + bool use_pbc = true; }; } diff --git a/src/sire/mol/_dynamics.py b/src/sire/mol/_dynamics.py index 6f08d9046..0344e5900 100644 --- a/src/sire/mol/_dynamics.py +++ b/src/sire/mol/_dynamics.py @@ -1579,12 +1579,6 @@ def __init__( _add_extra(extras, "qm_engine", qm_engine) _add_extra(extras, "lambda_interpolate", lambda_interpolate) - if restraints is not None: - if hasattr(restraints, "_use_pbc"): - extras["use_pbc"] = restraints._use_pbc - else: - extras["use_pbc"] = True - map = create_map(map, extras) self._d = DynamicsData(mols=mols, map=map) diff --git a/src/sire/mol/_minimisation.py b/src/sire/mol/_minimisation.py index 2b1f36bfb..b6c89b9fe 100644 --- a/src/sire/mol/_minimisation.py +++ b/src/sire/mol/_minimisation.py @@ -50,12 +50,6 @@ def __init__( _add_extra(extras, "restraints", restraints) _add_extra(extras, "fixed", fixed) - if restraints is not None: - if hasattr(restraints, "_use_pbc"): - extras["use_pbc"] = restraints._use_pbc - else: - extras["use_pbc"] = True - map = create_map(map, extras) self._d = DynamicsData(mols=mols, map=map) diff --git a/src/sire/restraints/_restraints.py b/src/sire/restraints/_restraints.py index 6a29404da..e480537f0 100644 --- a/src/sire/restraints/_restraints.py +++ b/src/sire/restraints/_restraints.py @@ -124,7 +124,7 @@ def angle(mols, atoms, theta0=None, ktheta=None, use_pbc=None, name=None, map=No restraints.add(AngleRestraint(mols.find(atoms), theta0, ktheta)) # Set the use_pbc flag. - restraints._use_pbc = use_pbc + restraints.set_use_pbc(use_pbc) return restraints @@ -605,7 +605,7 @@ def dihedral(mols, atoms, phi0=None, kphi=None, use_pbc=None, name=None, map=Non restraints.add(DihedralRestraint(mols.find(atoms), phi0, kphi)) # Set the use_pbc flag. - restraints._use_pbc = use_pbc + restraints.set_use_pbc(use_pbc) return restraints @@ -718,7 +718,7 @@ def distance(mols, atoms0, atoms1, r0=None, k=None, use_pbc=None, name=None, map restraints.add(BondRestraint(idxs0[0], idxs1[0], ik, ir0)) # Set the use_pbc flag. - restraints._use_pbc = use_pbc + restraints.set_use_pbc(use_pbc) return restraints @@ -968,7 +968,7 @@ def morse_potential( restraints.add(MorsePotentialRestraint(idxs0[0], idxs1[0], ik, ir0, de)) # Set the use_pbc flag. - restraints._use_pbc = use_pbc + restraints.set_use_pbc(use_pbc) return restraints @@ -1091,7 +1091,7 @@ def inverse_distance( restraints.add(InverseBondRestraint(idxs0[0], idxs1[0], ik, ir0)) # Set the use_pbc flag. - restraints._use_pbc = use_pbc + restraints.set_use_pbc(use_pbc) return restraints @@ -1203,7 +1203,7 @@ def positional( restraints.add(PositionalRestraint(idxs[0], position[i], ik, ir0)) # Set the use_pbc flag. - restraints._use_pbc = use_pbc + restraints.set_use_pbc(use_pbc) return restraints diff --git a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp index b80180828..6013a588c 100644 --- a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp +++ b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp @@ -71,7 +71,7 @@ using namespace SireOpenMM; */ void _add_boresch_restraints(const SireMM::BoreschRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms, bool use_pbc) + int natoms) { if (restraints.isEmpty()) return; @@ -134,7 +134,7 @@ void _add_boresch_restraints(const SireMM::BoreschRestraints &restraints, restraintff->addPerBondParameter("kphi_C"); restraintff->addPerBondParameter("phi0_C"); - restraintff->setUsesPeriodicBoundaryConditions(use_pbc); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -196,7 +196,7 @@ void _add_boresch_restraints(const SireMM::BoreschRestraints &restraints, */ void _add_bond_restraints(const SireMM::BondRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms, bool use_pbc) + int natoms) { if (restraints.isEmpty()) return; @@ -221,7 +221,7 @@ void _add_bond_restraints(const SireMM::BondRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("r0"); - restraintff->setUsesPeriodicBoundaryConditions(use_pbc); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -262,7 +262,7 @@ void _add_bond_restraints(const SireMM::BondRestraints &restraints, void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms, bool use_pbc) + int natoms) { if (restraints.isEmpty()) return; @@ -287,7 +287,7 @@ void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraint restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("r0"); - restraintff->setUsesPeriodicBoundaryConditions(use_pbc); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -333,7 +333,7 @@ void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraint */ void _add_morse_potential_restraints(const SireMM::MorsePotentialRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms, bool use_pbc) + int natoms) { if (restraints.isEmpty()) return; @@ -365,7 +365,7 @@ void _add_morse_potential_restraints(const SireMM::MorsePotentialRestraints &res restraintff->addPerBondParameter("r0"); restraintff->addPerBondParameter("de"); - restraintff->setUsesPeriodicBoundaryConditions(use_pbc); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -414,7 +414,7 @@ void _add_morse_potential_restraints(const SireMM::MorsePotentialRestraints &res void _add_positional_restraints(const SireMM::PositionalRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, std::vector &anchor_coords, - int natoms, bool use_pbc) + int natoms) { if (restraints.isEmpty()) return; @@ -439,7 +439,7 @@ void _add_positional_restraints(const SireMM::PositionalRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("rb"); - restraintff->setUsesPeriodicBoundaryConditions(use_pbc); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -644,7 +644,7 @@ void _add_rmsd_restraints(const SireMM::RMSDRestraints &restraints, */ void _add_angle_restraints(const SireMM::AngleRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms, bool use_pbc) + int natoms) { if (restraints.isEmpty()) return; @@ -669,7 +669,7 @@ void _add_angle_restraints(const SireMM::AngleRestraints &restraints, restraintff->addPerAngleParameter("k"); restraintff->addPerAngleParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(use_pbc); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -702,7 +702,7 @@ void _add_angle_restraints(const SireMM::AngleRestraints &restraints, void _add_dihedral_restraints(const SireMM::DihedralRestraints &restraints, OpenMM::System &system, LambdaLever &lambda_lever, - int natoms, bool use_pbc) + int natoms) { if (restraints.isEmpty()) return; @@ -732,7 +732,7 @@ void _add_dihedral_restraints(const SireMM::DihedralRestraints &restraints, restraintff->addPerTorsionParameter("k"); restraintff->addPerTorsionParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(use_pbc); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -2086,13 +2086,6 @@ OpenMMMetaData SireOpenMM::sire_to_openmm_system(OpenMM::System &system, // PropertyList first auto all_restraints = map["restraints"].value().asAnArray(); - // whether or not to use periodic boundary conditions for restraints - bool use_pbc = false; - if (map.specified("use_pbc")) - { - use_pbc = map["use_pbc"].value().asABoolean(); - } - // loop over all of the restraints groups and add them for (const auto &prop : all_restraints.toList()) { @@ -2106,22 +2099,22 @@ OpenMMMetaData SireOpenMM::sire_to_openmm_system(OpenMM::System &system, if (prop.read().isA()) { _add_dihedral_restraints(prop.read().asA(), - system, lambda_lever, start_index, use_pbc); + system, lambda_lever, start_index); } else if (prop.read().isA()) { _add_angle_restraints(prop.read().asA(), - system, lambda_lever, start_index, use_pbc); + system, lambda_lever, start_index); } else if (prop.read().isA()) { _add_positional_restraints(prop.read().asA(), - system, lambda_lever, anchor_coords, start_index, use_pbc); + system, lambda_lever, anchor_coords, start_index); } else if (prop.read().isA()) { _add_morse_potential_restraints(prop.read().asA(), - system, lambda_lever, start_index, use_pbc); + system, lambda_lever, start_index); } else if (prop.read().isA()) { @@ -2131,17 +2124,42 @@ OpenMMMetaData SireOpenMM::sire_to_openmm_system(OpenMM::System &system, else if (prop.read().isA()) { _add_bond_restraints(prop.read().asA(), - system, lambda_lever, start_index, use_pbc); + system, lambda_lever, start_index); } else if (prop.read().isA()) { _add_inverse_bond_restraints(prop.read().asA(), - system, lambda_lever, start_index, use_pbc); + system, lambda_lever, start_index); } else if (prop.read().isA()) { _add_boresch_restraints(prop.read().asA(), - system, lambda_lever, start_index, use_pbc); + system, lambda_lever, start_index); + } + } + } + if (map.specified("coalchemical_restraints")) + { + // All restraints are provided via the "coalchemical_restraints" key in the map. + // This should either be a single Restraints object, or a + // PropertyList - the easiest thing is to turn this into a + // PropertyList first + auto all_restraints = map["coalchemical_restraints"].value().asAnArray(); + + // loop over all of the restraints groups and add them + for (const auto &prop : all_restraints.toList()) + { + if (not prop.read().isA()) + throw SireError::invalid_cast(QObject::tr( + "Cannot convert an object of type %1 to a SireMM::Restraints") + .arg(prop.read().what()), + CODELOC); + + // we now need to choose what to do based on the type of restraint... + if (prop.read().isA()) + { + _add_inverse_bond_restraints(prop.read().asA(), + system, lambda_lever, start_index); } } } From a1672ccf83ef6ae797244eeafc6cc42a8fdce3e9 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Tue, 4 Nov 2025 16:27:03 +0000 Subject: [PATCH 09/10] Update wrappers and restraint API calls. --- corelib/src/libs/SireMM/bondrestraints.cpp | 2 +- corelib/src/libs/SireMM/boreschrestraints.cpp | 4 +- src/sire/restraints/_restraints.py | 12 +- tests/convert/test_openmm_restraints.py | 9 +- .../SireOpenMM/sire_to_openmm_system.cpp | 14 +- wrapper/MM/AngleRestraints.pypp.cpp | 25 ++ wrapper/MM/BondRestraints.pypp.cpp | 25 ++ wrapper/MM/BoreschRestraints.pypp.cpp | 25 ++ wrapper/MM/CMakeAutogenFile.txt | 396 +++++++++--------- wrapper/MM/DihedralRestraints.pypp.cpp | 25 ++ wrapper/MM/InverseBondRestraints.pypp.cpp | 25 ++ wrapper/MM/MorsePotentialRestraint.pypp.cpp | 2 +- wrapper/MM/MorsePotentialRestraints.pypp.cpp | 27 +- wrapper/MM/PositionalRestraints.pypp.cpp | 25 ++ wrapper/MM/SireMM_properties.cpp | 46 +- wrapper/MM/SireMM_registrars.cpp | 388 ++++++++--------- 16 files changed, 614 insertions(+), 436 deletions(-) diff --git a/corelib/src/libs/SireMM/bondrestraints.cpp b/corelib/src/libs/SireMM/bondrestraints.cpp index 0ca1a29ab..8eb15abf8 100644 --- a/corelib/src/libs/SireMM/bondrestraints.cpp +++ b/corelib/src/libs/SireMM/bondrestraints.cpp @@ -431,7 +431,7 @@ BondRestraints::BondRestraints(const QString &name, } BondRestraints::BondRestraints(const BondRestraints &other) - : ConcreteProperty(other), r(other.r) + : ConcreteProperty(other), r(other.r), use_pbc(other.use_pbc) { } diff --git a/corelib/src/libs/SireMM/boreschrestraints.cpp b/corelib/src/libs/SireMM/boreschrestraints.cpp index b2f283029..4ee54e3c4 100644 --- a/corelib/src/libs/SireMM/boreschrestraints.cpp +++ b/corelib/src/libs/SireMM/boreschrestraints.cpp @@ -74,7 +74,9 @@ QDataStream &operator>>(QDataStream &ds, BoreschRestraint &borrest) { SharedDataStream sds(ds); - sds >> borrest.receptor_atms >> borrest.ligand_atms >> borrest._r0 >> borrest._theta0 >> borrest._phi0 >> borrest._kr >> borrest._ktheta >> borrest._kphi >> static_cast(borrest); + sds >> borrest.receptor_atms >> borrest.ligand_atms >> borrest._r0 + >> borrest._theta0 >> borrest._phi0 >> borrest._kr >> borrest._ktheta + >> borrest._kphi >> static_cast(borrest); } else throw version_error(v, "1", r_borrest, CODELOC); diff --git a/src/sire/restraints/_restraints.py b/src/sire/restraints/_restraints.py index e480537f0..bb84929c4 100644 --- a/src/sire/restraints/_restraints.py +++ b/src/sire/restraints/_restraints.py @@ -124,7 +124,7 @@ def angle(mols, atoms, theta0=None, ktheta=None, use_pbc=None, name=None, map=No restraints.add(AngleRestraint(mols.find(atoms), theta0, ktheta)) # Set the use_pbc flag. - restraints.set_use_pbc(use_pbc) + restraints.set_uses_periodic_boundary_conditions(use_pbc) return restraints @@ -605,7 +605,7 @@ def dihedral(mols, atoms, phi0=None, kphi=None, use_pbc=None, name=None, map=Non restraints.add(DihedralRestraint(mols.find(atoms), phi0, kphi)) # Set the use_pbc flag. - restraints.set_use_pbc(use_pbc) + restraints.set_uses_periodic_boundary_conditions(use_pbc) return restraints @@ -718,7 +718,7 @@ def distance(mols, atoms0, atoms1, r0=None, k=None, use_pbc=None, name=None, map restraints.add(BondRestraint(idxs0[0], idxs1[0], ik, ir0)) # Set the use_pbc flag. - restraints.set_use_pbc(use_pbc) + restraints.set_uses_periodic_boundary_conditions(use_pbc) return restraints @@ -968,7 +968,7 @@ def morse_potential( restraints.add(MorsePotentialRestraint(idxs0[0], idxs1[0], ik, ir0, de)) # Set the use_pbc flag. - restraints.set_use_pbc(use_pbc) + restraints.set_uses_periodic_boundary_conditions(use_pbc) return restraints @@ -1091,7 +1091,7 @@ def inverse_distance( restraints.add(InverseBondRestraint(idxs0[0], idxs1[0], ik, ir0)) # Set the use_pbc flag. - restraints.set_use_pbc(use_pbc) + restraints.set_uses_periodic_boundary_conditions(use_pbc) return restraints @@ -1203,7 +1203,7 @@ def positional( restraints.add(PositionalRestraint(idxs[0], position[i], ik, ir0)) # Set the use_pbc flag. - restraints.set_use_pbc(use_pbc) + restraints.set_uses_periodic_boundary_conditions(use_pbc) return restraints diff --git a/tests/convert/test_openmm_restraints.py b/tests/convert/test_openmm_restraints.py index b79cf2d23..0580c6ea0 100644 --- a/tests/convert/test_openmm_restraints.py +++ b/tests/convert/test_openmm_restraints.py @@ -60,7 +60,8 @@ def test_openmm_distance_restraints(ala_mols, openmm_platform): # check that we get the same result using bond restraints restraints2 = sr.restraints.bond( - mols, atoms0=mols[0][0], atoms1=mols[-1][0], r0="5A" + mols, atoms0=mols[0][0], atoms1=mols[-1][0], r0="5A", + use_pbc=True ) assert len(restraints2) == 1 @@ -275,7 +276,7 @@ def test_openmm_restraints_pbc(ala_mols, restraint, default_pbc, openmm_platform ) # make sure the _use_pbc flag is set to the default value - assert restraints._use_pbc == default_pbc + assert restraints.get_uses_periodic_boundary_conditions() == default_pbc # create a dynamics object d = mols.dynamics(restraints=restraints, platform=openmm_platform) @@ -289,13 +290,13 @@ def test_openmm_restraints_pbc(ala_mols, restraint, default_pbc, openmm_platform # check that the force is using periodic boundary conditions assert restraint_force.usesPeriodicBoundaryConditions() == default_pbc - # now create a distance restraint with _use_pbc set to the non-default value + # now create a distance restraint with use_pbc set to the non-default value restraints = restraint_class( mols, atoms0=mols[0][0], atoms1=mols[-1][0], r0="5A", use_pbc=not default_pbc ) # make sure the _use_pbc flag is set to False - assert restraints._use_pbc == (not default_pbc) + assert restraints.get_uses_periodic_boundary_conditions() == (not default_pbc) # create a dynamics object d = mols.dynamics(restraints=restraints, platform=openmm_platform) diff --git a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp index 6013a588c..46fcad1ae 100644 --- a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp +++ b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp @@ -134,7 +134,7 @@ void _add_boresch_restraints(const SireMM::BoreschRestraints &restraints, restraintff->addPerBondParameter("kphi_C"); restraintff->addPerBondParameter("phi0_C"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -221,7 +221,7 @@ void _add_bond_restraints(const SireMM::BondRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("r0"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -287,7 +287,7 @@ void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraint restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("r0"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -365,7 +365,7 @@ void _add_morse_potential_restraints(const SireMM::MorsePotentialRestraints &res restraintff->addPerBondParameter("r0"); restraintff->addPerBondParameter("de"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -439,7 +439,7 @@ void _add_positional_restraints(const SireMM::PositionalRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("rb"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -669,7 +669,7 @@ void _add_angle_restraints(const SireMM::AngleRestraints &restraints, restraintff->addPerAngleParameter("k"); restraintff->addPerAngleParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -732,7 +732,7 @@ void _add_dihedral_restraints(const SireMM::DihedralRestraints &restraints, restraintff->addPerTorsionParameter("k"); restraintff->addPerTorsionParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsePBC()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); diff --git a/wrapper/MM/AngleRestraints.pypp.cpp b/wrapper/MM/AngleRestraints.pypp.cpp index 13bb30886..61cf99fb0 100644 --- a/wrapper/MM/AngleRestraints.pypp.cpp +++ b/wrapper/MM/AngleRestraints.pypp.cpp @@ -98,6 +98,18 @@ void register_AngleRestraints_class(){ , bp::release_gil_policy() , "Return the number of restraints" ); + } + { //::SireMM::AngleRestraints::getUsesPeriodicBoundaryConditions + + typedef bool ( ::SireMM::AngleRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; + getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::AngleRestraints::getUsesPeriodicBoundaryConditions ); + + AngleRestraints_exposer.def( + "getUsesPeriodicBoundaryConditions" + , getUsesPeriodicBoundaryConditions_function_value + , bp::release_gil_policy() + , "Return whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::AngleRestraints::isEmpty @@ -176,6 +188,19 @@ void register_AngleRestraints_class(){ , bp::release_gil_policy() , "Return all of the restraints" ); + } + { //::SireMM::AngleRestraints::setUsesPeriodicBoundaryConditions + + typedef void ( ::SireMM::AngleRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; + setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::AngleRestraints::setUsesPeriodicBoundaryConditions ); + + AngleRestraints_exposer.def( + "setUsesPeriodicBoundaryConditions" + , setUsesPeriodicBoundaryConditions_function_value + , ( bp::arg("use_pbc") ) + , bp::release_gil_policy() + , "Set whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::AngleRestraints::size diff --git a/wrapper/MM/BondRestraints.pypp.cpp b/wrapper/MM/BondRestraints.pypp.cpp index 1e3cfbde4..8fc1fbc2d 100644 --- a/wrapper/MM/BondRestraints.pypp.cpp +++ b/wrapper/MM/BondRestraints.pypp.cpp @@ -122,6 +122,18 @@ void register_BondRestraints_class(){ , bp::release_gil_policy() , "Return the number of restraints" ); + } + { //::SireMM::BondRestraints::getUsesPeriodicBoundaryConditions + + typedef bool ( ::SireMM::BondRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; + getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::BondRestraints::getUsesPeriodicBoundaryConditions ); + + BondRestraints_exposer.def( + "getUsesPeriodicBoundaryConditions" + , getUsesPeriodicBoundaryConditions_function_value + , bp::release_gil_policy() + , "Return whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::BondRestraints::hasAtomRestraints @@ -248,6 +260,19 @@ void register_BondRestraints_class(){ , bp::release_gil_policy() , "Return all of the restraints" ); + } + { //::SireMM::BondRestraints::setUsesPeriodicBoundaryConditions + + typedef void ( ::SireMM::BondRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; + setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::BondRestraints::setUsesPeriodicBoundaryConditions ); + + BondRestraints_exposer.def( + "setUsesPeriodicBoundaryConditions" + , setUsesPeriodicBoundaryConditions_function_value + , ( bp::arg("use_pbc") ) + , bp::release_gil_policy() + , "Set whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::BondRestraints::size diff --git a/wrapper/MM/BoreschRestraints.pypp.cpp b/wrapper/MM/BoreschRestraints.pypp.cpp index 09ca8e9ad..e0c12a5e0 100644 --- a/wrapper/MM/BoreschRestraints.pypp.cpp +++ b/wrapper/MM/BoreschRestraints.pypp.cpp @@ -98,6 +98,18 @@ void register_BoreschRestraints_class(){ , bp::release_gil_policy() , "Return the number of restraints" ); + } + { //::SireMM::BoreschRestraints::getUsesPeriodicBoundaryConditions + + typedef bool ( ::SireMM::BoreschRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; + getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::BoreschRestraints::getUsesPeriodicBoundaryConditions ); + + BoreschRestraints_exposer.def( + "getUsesPeriodicBoundaryConditions" + , getUsesPeriodicBoundaryConditions_function_value + , bp::release_gil_policy() + , "Return whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::BoreschRestraints::isEmpty @@ -176,6 +188,19 @@ void register_BoreschRestraints_class(){ , bp::release_gil_policy() , "Return all of the restraints" ); + } + { //::SireMM::BoreschRestraints::setUsesPeriodicBoundaryConditions + + typedef void ( ::SireMM::BoreschRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; + setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::BoreschRestraints::setUsesPeriodicBoundaryConditions ); + + BoreschRestraints_exposer.def( + "setUsesPeriodicBoundaryConditions" + , setUsesPeriodicBoundaryConditions_function_value + , ( bp::arg("use_pbc") ) + , bp::release_gil_policy() + , "Set whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::BoreschRestraints::size diff --git a/wrapper/MM/CMakeAutogenFile.txt b/wrapper/MM/CMakeAutogenFile.txt index 73ccbe972..73369fa99 100644 --- a/wrapper/MM/CMakeAutogenFile.txt +++ b/wrapper/MM/CMakeAutogenFile.txt @@ -1,228 +1,228 @@ # WARNING - AUTOGENERATED FILE - CONTENTS WILL BE OVERWRITTEN! set ( PYPP_SOURCES - InterCLJFF.pypp.cpp - InterGroupCLJFFBase.pypp.cpp - TwoAtomPerturbation.pypp.cpp - IntraFF.pypp.cpp - IntraLJFFBase.pypp.cpp - CoulombProbe.pypp.cpp - BoreschRestraints.pypp.cpp - AngleParameterName.pypp.cpp - SelectorMAngle.pypp.cpp - LJParameterName.pypp.cpp - SelectorAngle.pypp.cpp - UreyBradleyComponent.pypp.cpp - LJNBPairs.pypp.cpp - Restraints.pypp.cpp - RMSDRestraints.pypp.cpp - DihedralRestraint.pypp.cpp + InterCoulombFF.pypp.cpp InternalParameters3D.pypp.cpp - Mover_Dihedral_.pypp.cpp - CLJWorkspace.pypp.cpp - UreyBradleyParameterName.pypp.cpp + InterLJFFBase.pypp.cpp + CLJPotentialInterface_InterCLJPotential_.pypp.cpp + GridFF2.pypp.cpp + BondRestraints.pypp.cpp + CLJSoftRFFunction.pypp.cpp + SoftCLJComponent.pypp.cpp + CLJBoxIndex.pypp.cpp + GromacsAngle.pypp.cpp + IntraGroupCLJFFBase.pypp.cpp + CLJSoftIntraRFFunction.pypp.cpp + CLJFunction.pypp.cpp + AngleParameterName.pypp.cpp + TripleDistanceRestraint.pypp.cpp + GroupInternalParameters.pypp.cpp + InternalSymbols.pypp.cpp + ThreeAtomFunctions.pypp.cpp + Intra14Component.pypp.cpp + InterGroupSoftCLJFFBase.pypp.cpp + InverseBondRestraints.pypp.cpp + CLJIntraRFFunction.pypp.cpp + TwoAtomFunctions.pypp.cpp CLJNBPairs.pypp.cpp - IntraLJFF.pypp.cpp - ImproperSymbols.pypp.cpp - InternalSymbolsBase.pypp.cpp - BondSymbols.pypp.cpp - LJProbe.pypp.cpp + InterGroupCoulombFFBase.pypp.cpp + ChargeParameterName.pypp.cpp + RestraintComponent.pypp.cpp + LJPotentialInterface_InterLJPotential_.pypp.cpp CLJIntraFunction.pypp.cpp - GridFF.pypp.cpp - Intra14LJComponent.pypp.cpp - CLJRFFunction.pypp.cpp - StretchBendTorsionSymbols.pypp.cpp - CHARMMSwitchingFunction.pypp.cpp - BoreschRestraint.pypp.cpp - ScaledLJParameterNames3D.pypp.cpp - ChargeParameterName3D.pypp.cpp - IntraCLJFFBase.pypp.cpp - Mover_SelectorAngle_.pypp.cpp - AmberParams.pypp.cpp - StretchStretchParameterName.pypp.cpp - CLJComponent.pypp.cpp SoftCLJPotentialInterface_IntraSoftCLJPotential_.pypp.cpp - ImproperParameterName.pypp.cpp - CLJSoftShiftFunction.pypp.cpp - Mover_SelectorImproper_.pypp.cpp - LJExceptionID.pypp.cpp - PositionalRestraints.pypp.cpp - Mover_Improper_.pypp.cpp + IntraCLJFF.pypp.cpp + CLJDelta.pypp.cpp + ScaledCLJParameterNames3D.pypp.cpp + StretchBendComponent.pypp.cpp + InterGroupSoftCLJFF.pypp.cpp + RestraintFF.pypp.cpp GromacsBond.pypp.cpp - ThreeAtomFunction.pypp.cpp - AngleSymbols.pypp.cpp - LJException.pypp.cpp - InterSoftCLJFFBase.pypp.cpp - InternalFF.pypp.cpp - InterFF.pypp.cpp - StretchStretchSymbols.pypp.cpp - StretchBendSymbols.pypp.cpp - InternalSymbols.pypp.cpp - CLJAtoms.pypp.cpp - CLJPotentialInterface_IntraCLJPotential_.pypp.cpp + BoreschRestraints.pypp.cpp + IntraGroupLJFF.pypp.cpp + InterCLJFF.pypp.cpp + IntraFF.pypp.cpp + IntraLJFFBase.pypp.cpp + CLJ14Group.pypp.cpp + BondRestraint.pypp.cpp + SelectorMImproper.pypp.cpp CLJShiftFunction.pypp.cpp - InterGroupFF.pypp.cpp - TwoAtomFunction.pypp.cpp - CMAPFunctions.pypp.cpp - InterGroupSoftCLJFFBase.pypp.cpp + CLJCutoffFunction.pypp.cpp + InternalFF.pypp.cpp + CLJParameterNames3D.pypp.cpp + CLJParameterNames.pypp.cpp + IntraCLJFFBase.pypp.cpp + ImproperParameterName.pypp.cpp + AngleRestraint.pypp.cpp + InternalParameterNames3D.pypp.cpp + NoCutoff.pypp.cpp + Restraint.pypp.cpp + AmberBond.pypp.cpp + StretchStretchParameterName.pypp.cpp + InternalPerturbation.pypp.cpp + CMAPParameter.pypp.cpp + AmberAngle.pypp.cpp InterCoulombFFBase.pypp.cpp - AtomPairs_CLJScaleFactor_.pypp.cpp - InterGroupLJFFBase.pypp.cpp + SelectorMAngle.pypp.cpp + TestFF.pypp.cpp + CLJSoftIntraShiftFunction.pypp.cpp FourAtomPerturbation.pypp.cpp - Angle.pypp.cpp + ScaledChargeParameterNames3D.pypp.cpp + BoreschRestraint.pypp.cpp + InterGroupCLJFF.pypp.cpp + InterFF.pypp.cpp + PositionalRestraint.pypp.cpp + SelectorAngle.pypp.cpp IntraCoulombFF.pypp.cpp - StretchBendComponent.pypp.cpp - AmberDihedral.pypp.cpp - DihedralRestraints.pypp.cpp - DoubleDistanceRestraint.pypp.cpp - InternalPerturbation.pypp.cpp - CoulombPotentialInterface_IntraCoulombPotential_.pypp.cpp - TwoAtomFunctions.pypp.cpp - CoulombComponent.pypp.cpp - InternalParameters.pypp.cpp - CLJCalculator.pypp.cpp - MultiCLJComponent.pypp.cpp - CLJParameterNames3D.pypp.cpp - AngleRestraint.pypp.cpp + Improper.pypp.cpp + Bond.pypp.cpp + PositionalRestraints.pypp.cpp + CoulombProbe.pypp.cpp + AtomLJs.pypp.cpp + GromacsAtomType.pypp.cpp + DistanceRestraint.pypp.cpp + Mover_Angle_.pypp.cpp + ThreeAtomPerturbation.pypp.cpp + CLJPotentialInterface_IntraSoftCLJPotential_.pypp.cpp AngleComponent.pypp.cpp - Dihedral.pypp.cpp + GridFF.pypp.cpp + Intra14CoulombComponent.pypp.cpp + LJNBPairs.pypp.cpp + Restraints.pypp.cpp + LJComponent.pypp.cpp + InternalComponent.pypp.cpp + InterSoftCLJFF.pypp.cpp LJParameter.pypp.cpp - CLJGroup.pypp.cpp - CLJSoftIntraFunction.pypp.cpp + MultiCLJComponent.pypp.cpp + CLJIntraShiftFunction.pypp.cpp + RMSDRestraints.pypp.cpp BondParameterName.pypp.cpp - InterGroupCoulombFF.pypp.cpp - CLJSoftFunction.pypp.cpp - CLJGrid.pypp.cpp - AmberDihPart.pypp.cpp - RestraintComponent.pypp.cpp - StretchBendTorsionParameterName.pypp.cpp - SwitchingFunction.pypp.cpp - SoftCLJComponent.pypp.cpp - LJPotentialInterface_InterLJPotential_.pypp.cpp - ScaledChargeParameterNames3D.pypp.cpp - AtomPairs_CoulombScaleFactor_.pypp.cpp - ThreeAtomFunctions.pypp.cpp - InterSoftCLJFF.pypp.cpp - CMAPFunction.pypp.cpp - SelectorMBond.pypp.cpp - DihedralSymbols.pypp.cpp - ExcludedPairs.pypp.cpp - ScaledCLJParameterNames3D.pypp.cpp - Mover_Angle_.pypp.cpp - CLJPotentialInterface_InterCLJPotential_.pypp.cpp - CLJSoftIntraShiftFunction.pypp.cpp - BendBendComponent.pypp.cpp - SelectorDihedral.pypp.cpp - StretchStretchComponent.pypp.cpp - Restraint.pypp.cpp + CLJBoxDistance.pypp.cpp + CoulombPotentialInterface_IntraCoulombPotential_.pypp.cpp CLJProbe.pypp.cpp - InterGroupCLJFF.pypp.cpp - Mover_SelectorDihedral_.pypp.cpp - CLJBoxIndex.pypp.cpp - InternalParameterNames3D.pypp.cpp - StretchBendTorsionComponent.pypp.cpp - InterCLJFFBase.pypp.cpp - IntraSoftCLJFF.pypp.cpp - InterGroupLJFF.pypp.cpp - CLJExtractor.pypp.cpp - CLJSoftRFFunction.pypp.cpp - CLJFunction.pypp.cpp + Mover_SelectorImproper_.pypp.cpp SelectorBond.pypp.cpp - GridFF2.pypp.cpp - DihedralParameterName.pypp.cpp - IntraGroupCLJFFBase.pypp.cpp - RestraintFF.pypp.cpp - SoftCLJPotentialInterface_InterSoftCLJPotential_.pypp.cpp - AmberAngle.pypp.cpp - IntraGroupFF.pypp.cpp - NoCutoff.pypp.cpp - InterCoulombFF.pypp.cpp - CLJAtom.pypp.cpp + LJExceptionID.pypp.cpp + StretchBendTorsionComponent.pypp.cpp + StretchBendParameterName.pypp.cpp + Angle.pypp.cpp + InterSoftCLJFFBase.pypp.cpp + TwoAtomPerturbation.pypp.cpp + DoubleDistanceRestraint.pypp.cpp + InternalSymbolsBase.pypp.cpp + LJPerturbation.pypp.cpp + CLJGroup.pypp.cpp + InternalGroupFF.pypp.cpp + DihedralRestraints.pypp.cpp + MorsePotentialRestraints.pypp.cpp + StretchBendTorsionSymbols.pypp.cpp HarmonicSwitchingFunction.pypp.cpp - CLJBoxDistance.pypp.cpp - GromacsAtomType.pypp.cpp - BondRestraint.pypp.cpp + MorsePotentialRestraint.pypp.cpp + CLJBoxes.pypp.cpp + Mover_SelectorAngle_.pypp.cpp + InterGroupCLJFFBase.pypp.cpp + LJParameterName3D.pypp.cpp + BendBendComponent.pypp.cpp + Mover_Bond_.pypp.cpp + ExcludedPairs.pypp.cpp + CLJAtom.pypp.cpp + StretchBendTorsionParameterName.pypp.cpp + CLJSoftShiftFunction.pypp.cpp + SoftCLJPotentialInterface_InterSoftCLJPotential_.pypp.cpp + IntraLJFF.pypp.cpp + UreyBradleyParameterName.pypp.cpp + StretchBendSymbols.pypp.cpp InverseBondRestraint.pypp.cpp + DihedralRestraint.pypp.cpp + InterGroupLJFFBase.pypp.cpp + DihedralComponent.pypp.cpp + Mover_SelectorBond_.pypp.cpp + IntraGroupFF.pypp.cpp + CLJComponent.pypp.cpp + InterGroupLJFF.pypp.cpp + AngleRestraints.pypp.cpp + CLJExtractor.pypp.cpp + NullCLJFunction.pypp.cpp SelectorMDihedral.pypp.cpp - IntraGroupCoulombFF.pypp.cpp - TestFF.pypp.cpp - IntraGroupSoftCLJFFBase.pypp.cpp - CLJScaleFactor.pypp.cpp - InternalGroupFF.pypp.cpp - IntraGroupCoulombFFBase.pypp.cpp - ChargeParameterName.pypp.cpp - IntraCLJFF.pypp.cpp - IntraGroupLJFF.pypp.cpp + AtomPairs_LJScaleFactor_.pypp.cpp + AtomFunction.pypp.cpp + Mover_Improper_.pypp.cpp + ThreeAtomFunction.pypp.cpp + MMDetail.pypp.cpp + CLJPotentialInterface_InterSoftCLJPotential_.pypp.cpp + LJProbe.pypp.cpp + InterGroupCoulombFF.pypp.cpp + CLJWorkspace.pypp.cpp + CLJCalculator.pypp.cpp BendBendSymbols.pypp.cpp - StretchBendParameterName.pypp.cpp - GroupInternalParameters.pypp.cpp - SelectorImproper.pypp.cpp - AngleRestraints.pypp.cpp + CoulombScaleFactor.pypp.cpp + CoulombComponent.pypp.cpp + AtomPairs_CoulombScaleFactor_.pypp.cpp + LJPotentialInterface_IntraLJPotential_.pypp.cpp + Restraint3D.pypp.cpp + Mover_Dihedral_.pypp.cpp AtomFunctions.pypp.cpp - CLJIntraRFFunction.pypp.cpp - DihedralComponent.pypp.cpp - Intra14CoulombComponent.pypp.cpp - InternalComponent.pypp.cpp - InterLJFFBase.pypp.cpp - CLJPotentialInterface_IntraSoftCLJPotential_.pypp.cpp - InternalParameterNames.pypp.cpp - NullCLJFunction.pypp.cpp + BondComponent.pypp.cpp + TwoAtomFunction.pypp.cpp + GromacsDihedral.pypp.cpp + ImproperSymbols.pypp.cpp + AmberNB14.pypp.cpp + CLJPotentialInterface_IntraCLJPotential_.pypp.cpp + SwitchingFunction.pypp.cpp + CLJRFFunction.pypp.cpp ImproperComponent.pypp.cpp - GromacsAngle.pypp.cpp - CLJCutoffFunction.pypp.cpp - LJ1264Parameter.pypp.cpp - MorsePotentialRestraint.pypp.cpp - CoulombPotentialInterface_InterCoulombPotential_.pypp.cpp - ThreeAtomPerturbation.pypp.cpp - Mover_Bond_.pypp.cpp + UreyBradleyComponent.pypp.cpp + AtomPairs_CLJScaleFactor_.pypp.cpp + CLJSoftIntraFunction.pypp.cpp + InternalParameters.pypp.cpp + IntraGroupLJFFBase.pypp.cpp InterLJFF.pypp.cpp - FourAtomFunctions.pypp.cpp - TripleDistanceRestraint.pypp.cpp - CoulombScaleFactor.pypp.cpp - LJPerturbation.pypp.cpp + IntraGroupSoftCLJFF.pypp.cpp + CoulombPotentialInterface_InterCoulombPotential_.pypp.cpp + BendBendParameterName.pypp.cpp LJScaleFactor.pypp.cpp - CLJ14Group.pypp.cpp - CLJBoxes.pypp.cpp - IntraGroupCLJFF.pypp.cpp - CoulombNBPairs.pypp.cpp - InterGroupCoulombFFBase.pypp.cpp - Restraint3D.pypp.cpp - CLJDelta.pypp.cpp - CLJPotentialInterface_InterSoftCLJPotential_.pypp.cpp - RMSDRestraint.pypp.cpp - CLJSoftIntraRFFunction.pypp.cpp - IntraCoulombFFBase.pypp.cpp - Improper.pypp.cpp - IntraGroupLJFFBase.pypp.cpp - LJPotentialInterface_IntraLJPotential_.pypp.cpp - Bond.pypp.cpp - CLJParameterNames.pypp.cpp + IntraGroupCoulombFFBase.pypp.cpp + CLJAtoms.pypp.cpp + LJ1264Parameter.pypp.cpp + ChargeParameterName3D.pypp.cpp + CLJGrid.pypp.cpp + ScaledLJParameterNames3D.pypp.cpp CLJBox.pypp.cpp - LJParameterName3D.pypp.cpp - PositionalRestraint.pypp.cpp - IntraGroupSoftCLJFF.pypp.cpp - AmberNB14.pypp.cpp - Mover_SelectorBond_.pypp.cpp - DistanceRestraint.pypp.cpp - Intra14Component.pypp.cpp - SelectorMImproper.pypp.cpp - GromacsDihedral.pypp.cpp - MorsePotentialRestraints.pypp.cpp - AmberBond.pypp.cpp - NullRestraint.pypp.cpp - LJComponent.pypp.cpp - BondComponent.pypp.cpp + Mover_SelectorDihedral_.pypp.cpp + LJException.pypp.cpp + IntraCoulombFFBase.pypp.cpp + AmberDihedral.pypp.cpp + Intra14LJComponent.pypp.cpp + IntraGroupCoulombFF.pypp.cpp IntraSoftCLJFFBase.pypp.cpp - CLJIntraShiftFunction.pypp.cpp - MMDetail.pypp.cpp - AtomFunction.pypp.cpp - InterGroupSoftCLJFF.pypp.cpp - BendBendParameterName.pypp.cpp - CMAPParameter.pypp.cpp - AtomPairs_LJScaleFactor_.pypp.cpp - BondRestraints.pypp.cpp - InverseBondRestraints.pypp.cpp + RMSDRestraint.pypp.cpp + IntraGroupCLJFF.pypp.cpp + CMAPFunctions.pypp.cpp + CMAPFunction.pypp.cpp + IntraSoftCLJFF.pypp.cpp + AngleSymbols.pypp.cpp + SelectorDihedral.pypp.cpp + LJParameterName.pypp.cpp + FourAtomFunctions.pypp.cpp + AmberDihPart.pypp.cpp + SelectorMBond.pypp.cpp + InternalParameterNames.pypp.cpp + SelectorImproper.pypp.cpp + DihedralParameterName.pypp.cpp + AmberParams.pypp.cpp + CoulombNBPairs.pypp.cpp + CLJScaleFactor.pypp.cpp + InterGroupFF.pypp.cpp FourAtomFunction.pypp.cpp - AtomLJs.pypp.cpp + DihedralSymbols.pypp.cpp + NullRestraint.pypp.cpp + Dihedral.pypp.cpp + StretchStretchSymbols.pypp.cpp + IntraGroupSoftCLJFFBase.pypp.cpp + CHARMMSwitchingFunction.pypp.cpp + BondSymbols.pypp.cpp + StretchStretchComponent.pypp.cpp + CLJSoftFunction.pypp.cpp + InterCLJFFBase.pypp.cpp SireMM_containers.cpp SireMM_properties.cpp SireMM_registrars.cpp diff --git a/wrapper/MM/DihedralRestraints.pypp.cpp b/wrapper/MM/DihedralRestraints.pypp.cpp index ede6aafef..277e0d0db 100644 --- a/wrapper/MM/DihedralRestraints.pypp.cpp +++ b/wrapper/MM/DihedralRestraints.pypp.cpp @@ -98,6 +98,18 @@ void register_DihedralRestraints_class(){ , bp::release_gil_policy() , "Return the number of restraints" ); + } + { //::SireMM::DihedralRestraints::getUsesPeriodicBoundaryConditions + + typedef bool ( ::SireMM::DihedralRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; + getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::DihedralRestraints::getUsesPeriodicBoundaryConditions ); + + DihedralRestraints_exposer.def( + "getUsesPeriodicBoundaryConditions" + , getUsesPeriodicBoundaryConditions_function_value + , bp::release_gil_policy() + , "Return whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::DihedralRestraints::isEmpty @@ -176,6 +188,19 @@ void register_DihedralRestraints_class(){ , bp::release_gil_policy() , "Return all of the restraints" ); + } + { //::SireMM::DihedralRestraints::setUsesPeriodicBoundaryConditions + + typedef void ( ::SireMM::DihedralRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; + setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::DihedralRestraints::setUsesPeriodicBoundaryConditions ); + + DihedralRestraints_exposer.def( + "setUsesPeriodicBoundaryConditions" + , setUsesPeriodicBoundaryConditions_function_value + , ( bp::arg("use_pbc") ) + , bp::release_gil_policy() + , "Set whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::DihedralRestraints::size diff --git a/wrapper/MM/InverseBondRestraints.pypp.cpp b/wrapper/MM/InverseBondRestraints.pypp.cpp index 8c0a78027..f53616610 100644 --- a/wrapper/MM/InverseBondRestraints.pypp.cpp +++ b/wrapper/MM/InverseBondRestraints.pypp.cpp @@ -122,6 +122,18 @@ void register_InverseBondRestraints_class(){ , bp::release_gil_policy() , "Return the number of restraints" ); + } + { //::SireMM::InverseBondRestraints::getUsesPeriodicBoundaryConditions + + typedef bool ( ::SireMM::InverseBondRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; + getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::InverseBondRestraints::getUsesPeriodicBoundaryConditions ); + + InverseBondRestraints_exposer.def( + "getUsesPeriodicBoundaryConditions" + , getUsesPeriodicBoundaryConditions_function_value + , bp::release_gil_policy() + , "Return whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::InverseBondRestraints::hasAtomRestraints @@ -248,6 +260,19 @@ void register_InverseBondRestraints_class(){ , bp::release_gil_policy() , "Return all of the restraints" ); + } + { //::SireMM::InverseBondRestraints::setUsesPeriodicBoundaryConditions + + typedef void ( ::SireMM::InverseBondRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; + setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::InverseBondRestraints::setUsesPeriodicBoundaryConditions ); + + InverseBondRestraints_exposer.def( + "setUsesPeriodicBoundaryConditions" + , setUsesPeriodicBoundaryConditions_function_value + , ( bp::arg("use_pbc") ) + , bp::release_gil_policy() + , "Set whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::InverseBondRestraints::size diff --git a/wrapper/MM/MorsePotentialRestraint.pypp.cpp b/wrapper/MM/MorsePotentialRestraint.pypp.cpp index 9855c9561..d268d5403 100644 --- a/wrapper/MM/MorsePotentialRestraint.pypp.cpp +++ b/wrapper/MM/MorsePotentialRestraint.pypp.cpp @@ -39,7 +39,7 @@ void register_MorsePotentialRestraint_class(){ typedef bp::class_< SireMM::MorsePotentialRestraint, bp::bases< SireBase::Property > > MorsePotentialRestraint_exposer_t; MorsePotentialRestraint_exposer_t MorsePotentialRestraint_exposer = MorsePotentialRestraint_exposer_t( "MorsePotentialRestraint", "This class represents a single Morse restraint between any two\natoms in a system\n", bp::init< >("Null constructor") ); bp::scope MorsePotentialRestraint_scope( MorsePotentialRestraint_exposer ); - MorsePotentialRestraint_exposer.def( bp::init< qint64, qint64, SireUnits::Dimension::HarmonicBondConstant const &, SireUnits::Dimension::Length const &, SireUnits::Dimension::MolarEnergy const & >(( bp::arg("atom0"), bp::arg("atom1"), bp::arg("k"), bp::arg("r0"), bp::arg("de") ), "Construct to restrain the atom at index atom to the specified position\n using the specified force constant and flat-bottom well-width\n") ); + MorsePotentialRestraint_exposer.def( bp::init< qint64, qint64, SireUnits::Dimension::HarmonicBondConstant const &, SireUnits::Dimension::Length const &, SireUnits::Dimension::MolarEnergy const & >(( bp::arg("atom0"), bp::arg("atom1"), bp::arg("k"), bp::arg("r0"), bp::arg("de") ), "Construct to restrain the atom at index atom to the specified position\n using the specified force constant and well depth (dissociation energy)\n") ); MorsePotentialRestraint_exposer.def( bp::init< QList< long long > const &, QList< long long > const &, SireUnits::Dimension::HarmonicBondConstant const &, SireUnits::Dimension::Length const &, SireUnits::Dimension::MolarEnergy const & >(( bp::arg("atoms0"), bp::arg("atoms1"), bp::arg("k"), bp::arg("r0"), bp::arg("de") ), "Construct to restrain the atoms whose indicies are\n in atoms to the specified position using the specified force constant\n and dissociation energy\n") ); MorsePotentialRestraint_exposer.def( bp::init< SireMM::MorsePotentialRestraint const & >(( bp::arg("other") ), "Copy constructor") ); { //::SireMM::MorsePotentialRestraint::atom0 diff --git a/wrapper/MM/MorsePotentialRestraints.pypp.cpp b/wrapper/MM/MorsePotentialRestraints.pypp.cpp index bba601577..60b6c12d7 100644 --- a/wrapper/MM/MorsePotentialRestraints.pypp.cpp +++ b/wrapper/MM/MorsePotentialRestraints.pypp.cpp @@ -40,7 +40,7 @@ void register_MorsePotentialRestraints_class(){ { //::SireMM::MorsePotentialRestraints typedef bp::class_< SireMM::MorsePotentialRestraints, bp::bases< SireMM::Restraints, SireBase::Property > > MorsePotentialRestraints_exposer_t; - MorsePotentialRestraints_exposer_t MorsePotentialRestraints_exposer = MorsePotentialRestraints_exposer_t( "MorsePotentialRestraints", "This class provides the information for a collection of Moving Harmonic Restraints\nrestraints that can be added to a collection of molecules. Each\nrestraint can act on a pair of particles.\n", bp::init< >("Null constructor") ); + MorsePotentialRestraints_exposer_t MorsePotentialRestraints_exposer = MorsePotentialRestraints_exposer_t( "MorsePotentialRestraints", "This class provides the information for a collection of Morse potential\nrestraints that can be added to a collection of molecules. Each\nrestraint can act on a pair of particles.\n", bp::init< >("Null constructor") ); bp::scope MorsePotentialRestraints_scope( MorsePotentialRestraints_exposer ); MorsePotentialRestraints_exposer.def( bp::init< QString const & >(( bp::arg("name") ), "") ); MorsePotentialRestraints_exposer.def( bp::init< SireMM::MorsePotentialRestraint const & >(( bp::arg("restraint") ), "") ); @@ -122,6 +122,18 @@ void register_MorsePotentialRestraints_class(){ , bp::release_gil_policy() , "Return the number of restraints" ); + } + { //::SireMM::MorsePotentialRestraints::getUsesPeriodicBoundaryConditions + + typedef bool ( ::SireMM::MorsePotentialRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; + getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::MorsePotentialRestraints::getUsesPeriodicBoundaryConditions ); + + MorsePotentialRestraints_exposer.def( + "getUsesPeriodicBoundaryConditions" + , getUsesPeriodicBoundaryConditions_function_value + , bp::release_gil_policy() + , "Return whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::MorsePotentialRestraints::hasAtomRestraints @@ -248,6 +260,19 @@ void register_MorsePotentialRestraints_class(){ , bp::release_gil_policy() , "Return all of the restraints" ); + } + { //::SireMM::MorsePotentialRestraints::setUsesPeriodicBoundaryConditions + + typedef void ( ::SireMM::MorsePotentialRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; + setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::MorsePotentialRestraints::setUsesPeriodicBoundaryConditions ); + + MorsePotentialRestraints_exposer.def( + "setUsesPeriodicBoundaryConditions" + , setUsesPeriodicBoundaryConditions_function_value + , ( bp::arg("use_pbc") ) + , bp::release_gil_policy() + , "Set whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::MorsePotentialRestraints::size diff --git a/wrapper/MM/PositionalRestraints.pypp.cpp b/wrapper/MM/PositionalRestraints.pypp.cpp index 787f32e66..ea5ac2800 100644 --- a/wrapper/MM/PositionalRestraints.pypp.cpp +++ b/wrapper/MM/PositionalRestraints.pypp.cpp @@ -122,6 +122,18 @@ void register_PositionalRestraints_class(){ , bp::release_gil_policy() , "Return the number of restraints" ); + } + { //::SireMM::PositionalRestraints::getUsesPeriodicBoundaryConditions + + typedef bool ( ::SireMM::PositionalRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; + getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::PositionalRestraints::getUsesPeriodicBoundaryConditions ); + + PositionalRestraints_exposer.def( + "getUsesPeriodicBoundaryConditions" + , getUsesPeriodicBoundaryConditions_function_value + , bp::release_gil_policy() + , "Return whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::PositionalRestraints::hasAtomRestraints @@ -248,6 +260,19 @@ void register_PositionalRestraints_class(){ , bp::release_gil_policy() , "Return all of the restraints" ); + } + { //::SireMM::PositionalRestraints::setUsesPeriodicBoundaryConditions + + typedef void ( ::SireMM::PositionalRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; + setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::PositionalRestraints::setUsesPeriodicBoundaryConditions ); + + PositionalRestraints_exposer.def( + "setUsesPeriodicBoundaryConditions" + , setUsesPeriodicBoundaryConditions_function_value + , ( bp::arg("use_pbc") ) + , bp::release_gil_policy() + , "Set whether or not periodic boundary conditions are to be used" ); + } { //::SireMM::PositionalRestraints::size diff --git a/wrapper/MM/SireMM_properties.cpp b/wrapper/MM/SireMM_properties.cpp index 4939d13db..8728c6ce2 100644 --- a/wrapper/MM/SireMM_properties.cpp +++ b/wrapper/MM/SireMM_properties.cpp @@ -4,28 +4,6 @@ #include "Base/convertproperty.hpp" #include "SireMM_properties.h" -#include "SireBase/errors.h" -#include "SireBase/generalunitproperty.h" -#include "SireBase/lengthproperty.h" -#include "SireBase/numberproperty.h" -#include "SireBase/properties.h" -#include "SireBase/stringproperty.h" -#include "SireError/errors.h" -#include "SireMaths/multidouble.h" -#include "SireStream/datastream.h" -#include "SireStream/shareddatastream.h" -#include "SireVol/cartesian.h" -#include "SireVol/gridinfo.h" -#include "SireVol/periodicbox.h" -#include "SireVol/triclinicbox.h" -#include "cljboxes.h" -#include "cljfunction.h" -#include "switchingfunction.h" -#include "tbb/blocked_range.h" -#include "tbb/parallel_for.h" -#include "tostring.h" -#include -#include "cljfunction.h" #include "SireCAS/errors.h" #include "SireCAS/expression.h" #include "SireCAS/symbols.h" @@ -50,10 +28,32 @@ #include #include #include "switchingfunction.h" +#include "SireBase/errors.h" +#include "SireBase/generalunitproperty.h" +#include "SireBase/lengthproperty.h" +#include "SireBase/numberproperty.h" +#include "SireBase/properties.h" +#include "SireBase/stringproperty.h" +#include "SireError/errors.h" +#include "SireMaths/multidouble.h" +#include "SireStream/datastream.h" +#include "SireStream/shareddatastream.h" +#include "SireVol/cartesian.h" +#include "SireVol/gridinfo.h" +#include "SireVol/periodicbox.h" +#include "SireVol/triclinicbox.h" +#include "cljboxes.h" +#include "cljfunction.h" +#include "switchingfunction.h" +#include "tbb/blocked_range.h" +#include "tbb/parallel_for.h" +#include "tostring.h" +#include +#include "cljfunction.h" void register_SireMM_properties() { - register_property_container< SireMM::CLJFunctionPtr, SireMM::CLJFunction >(); register_property_container< SireMM::RestraintPtr, SireMM::Restraint >(); register_property_container< SireMM::Restraint3DPtr, SireMM::Restraint3D >(); register_property_container< SireMM::SwitchFuncPtr, SireMM::SwitchingFunction >(); + register_property_container< SireMM::CLJFunctionPtr, SireMM::CLJFunction >(); } diff --git a/wrapper/MM/SireMM_registrars.cpp b/wrapper/MM/SireMM_registrars.cpp index 37e5c8e77..5b7d1b0d4 100644 --- a/wrapper/MM/SireMM_registrars.cpp +++ b/wrapper/MM/SireMM_registrars.cpp @@ -3,122 +3,105 @@ #include "SireMM_registrars.h" -#include "cljrffunction.h" -#include "internalcomponent.h" -#include "threeatomfunctions.h" -#include "anglerestraints.h" -#include "gridff2.h" -#include "intergroupff.h" -#include "restraintff.h" -#include "lj1264parameter.h" -#include "interff.h" -#include "intersoftcljff.h" -#include "selectorbond.h" -#include "cljworkspace.h" -#include "internalparameters.h" +#include "multicljcomponent.h" +#include "intracoulombff.h" +#include "cljshiftfunction.h" +#include "cmapfunctions.h" +#include "gromacsparams.h" +#include "selectordihedral.h" #include "amberparams.h" -#include "selectorimproper.h" -#include "twoatomfunctions.h" -#include "ljpair.h" -#include "cmapparameter.h" -#include "ljparameter.h" -#include "cljboxes.h" -#include "cljgroup.h" -#include "excludedpairs.h" -#include "cljcomponent.h" -#include "atomljs.h" -#include "cljdelta.h" -#include "clj14group.h" -#include "intragroupff.h" -#include "positionalrestraints.h" #include "interljff.h" #include "cljatoms.h" -#include "mmdetail.h" -#include "bond.h" -#include "rmsdrestraints.h" -#include "cljgrid.h" -#include "intraff.h" -#include "internalgroupff.h" -#include "cljfunction.h" -#include "restraint.h" -#include "selectormangle.h" -#include "multicljcomponent.h" -#include "cmapfunctions.h" -#include "internalperturbation.h" -#include "cljprobe.h" +#include "ljperturbation.h" +#include "selectormdihedral.h" #include "boreschrestraints.h" -#include "cljparam.h" -#include "intercljff.h" +#include "intersoftcljff.h" #include "cljnbpairs.h" -#include "internalff.h" -#include "bondrestraints.h" -#include "inversebondrestraints.h" -#include "intracljff.h" -#include "softcljcomponent.h" -#include "dihedralrestraints.h" -#include "intraljff.h" -#include "fouratomfunctions.h" -#include "restraintcomponent.h" -#include "morsepotentialrestraints.h" -#include "selectorangle.h" -#include "distancerestraint.h" -#include "selectordihedral.h" -#include "gridff.h" +#include "restraint.h" #include "cljextractor.h" -#include "ljperturbation.h" +#include "morsepotentialrestraints.h" #include "intercoulombff.h" +#include "switchingfunction.h" +#include "cljgroup.h" #include "selectormimproper.h" +#include "inversebondrestraints.h" +#include "cljdelta.h" +#include "cljprobe.h" +#include "internalcomponent.h" +#include "cmapparameter.h" +#include "dihedral.h" +#include "fouratomfunctions.h" +#include "internalff.h" #include "cljcalculator.h" +#include "cljfunction.h" +#include "dihedralrestraints.h" +#include "intercljff.h" +#include "bond.h" +#include "internalgroupff.h" +#include "rmsdrestraints.h" +#include "cljworkspace.h" +#include "softcljcomponent.h" +#include "ljparameter.h" +#include "lj1264parameter.h" #include "improper.h" -#include "gromacsparams.h" -#include "dihedral.h" -#include "selectormbond.h" +#include "selectorimproper.h" +#include "anglerestraints.h" +#include "selectorangle.h" +#include "intracljff.h" +#include "restraintff.h" +#include "distancerestraint.h" +#include "cljgrid.h" +#include "cljcomponent.h" +#include "internalparameters.h" +#include "atomljs.h" +#include "intergroupff.h" +#include "excludedpairs.h" +#include "ljpair.h" +#include "cljboxes.h" +#include "restraintcomponent.h" +#include "gridff.h" #include "intrasoftcljff.h" -#include "switchingfunction.h" +#include "selectormangle.h" +#include "intraljff.h" +#include "clj14group.h" #include "angle.h" -#include "selectormdihedral.h" -#include "cljshiftfunction.h" -#include "intracoulombff.h" +#include "selectorbond.h" +#include "selectormbond.h" +#include "interff.h" +#include "intragroupff.h" +#include "positionalrestraints.h" +#include "twoatomfunctions.h" +#include "intraff.h" +#include "gridff2.h" +#include "bondrestraints.h" +#include "mmdetail.h" +#include "internalperturbation.h" +#include "threeatomfunctions.h" +#include "cljparam.h" +#include "cljrffunction.h" #include "Helpers/objectregistry.hpp" void register_SireMM_objects() { - ObjectRegistry::registerConverterFor< SireMM::CLJRFFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJIntraRFFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJSoftRFFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJSoftIntraRFFunction >(); - ObjectRegistry::registerConverterFor< SireMM::BondComponent >(); - ObjectRegistry::registerConverterFor< SireMM::AngleComponent >(); - ObjectRegistry::registerConverterFor< SireMM::DihedralComponent >(); - ObjectRegistry::registerConverterFor< SireMM::ImproperComponent >(); - ObjectRegistry::registerConverterFor< SireMM::UreyBradleyComponent >(); - ObjectRegistry::registerConverterFor< SireMM::StretchStretchComponent >(); - ObjectRegistry::registerConverterFor< SireMM::StretchBendComponent >(); - ObjectRegistry::registerConverterFor< SireMM::BendBendComponent >(); - ObjectRegistry::registerConverterFor< SireMM::StretchBendTorsionComponent >(); - ObjectRegistry::registerConverterFor< SireMM::Intra14CoulombComponent >(); - ObjectRegistry::registerConverterFor< SireMM::Intra14LJComponent >(); - ObjectRegistry::registerConverterFor< SireMM::Intra14Component >(); - ObjectRegistry::registerConverterFor< SireMM::InternalComponent >(); - ObjectRegistry::registerConverterFor< SireMM::ThreeAtomFunctions >(); - ObjectRegistry::registerConverterFor< SireMM::AngleRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::AngleRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::GridFF2 >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupFF >(); - ObjectRegistry::registerConverterFor< SireMM::RestraintFF >(); - ObjectRegistry::registerConverterFor< SireMM::LJ1264Parameter >(); - ObjectRegistry::registerConverterFor< SireMM::InterFF >(); - ObjectRegistry::registerConverterFor< SireMM::InterSoftCLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::InterSoftCLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupSoftCLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupSoftCLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorBond >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::CLJWorkspace >(); - ObjectRegistry::registerConverterFor< SireMM::InternalParameters >(); - ObjectRegistry::registerConverterFor< SireMM::InternalParameters3D >(); + ObjectRegistry::registerConverterFor< SireMM::MultiCLJComponent >(); + ObjectRegistry::registerConverterFor< SireMM::IntraCoulombFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::IntraCoulombFF >(); + ObjectRegistry::registerConverterFor< SireMM::IntraGroupCoulombFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::IntraGroupCoulombFF >(); + ObjectRegistry::registerConverterFor< SireMM::CLJShiftFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJIntraShiftFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJSoftShiftFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJSoftIntraShiftFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CMAPFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CMAPFunctions >(); + ObjectRegistry::registerConverterFor< SireMM::GromacsAtomType >(); + ObjectRegistry::registerConverterFor< SireMM::GromacsBond >(); + ObjectRegistry::registerConverterFor< SireMM::GromacsAngle >(); + ObjectRegistry::registerConverterFor< SireMM::GromacsDihedral >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorDihedral >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); ObjectRegistry::registerConverterFor< SireMM::AmberParams >(); ObjectRegistry::registerConverterFor< SireMM::AmberBond >(); ObjectRegistry::registerConverterFor< SireMM::AmberAngle >(); @@ -126,132 +109,149 @@ void register_SireMM_objects() ObjectRegistry::registerConverterFor< SireMM::AmberDihedral >(); ObjectRegistry::registerConverterFor< SireMM::AmberNB14 >(); ObjectRegistry::registerConverterFor< SireMM::AmberNBDihPart >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorImproper >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::TwoAtomFunctions >(); - ObjectRegistry::registerConverterFor< SireMM::LJPair >(); - ObjectRegistry::registerConverterFor< SireMM::CMAPParameter >(); - ObjectRegistry::registerConverterFor< SireMM::LJParameter >(); - ObjectRegistry::registerConverterFor< SireMM::CLJBox >(); - ObjectRegistry::registerConverterFor< SireMM::CLJBoxIndex >(); - ObjectRegistry::registerConverterFor< SireMM::CLJBoxes >(); - ObjectRegistry::registerConverterFor< SireMM::CLJBoxDistance >(); - ObjectRegistry::registerConverterFor< SireMM::CLJGroup >(); - ObjectRegistry::registerConverterFor< SireMM::ExcludedPairs >(); - ObjectRegistry::registerConverterFor< SireMM::CoulombComponent >(); - ObjectRegistry::registerConverterFor< SireMM::LJComponent >(); - ObjectRegistry::registerConverterFor< SireMM::CLJComponent >(); - ObjectRegistry::registerConverterFor< SireMM::AtomLJs >(); - ObjectRegistry::registerConverterFor< SireMM::LJException >(); - ObjectRegistry::registerConverterFor< SireMM::LJExceptionID >(); - ObjectRegistry::registerConverterFor< SireMM::CLJDelta >(); - ObjectRegistry::registerConverterFor< SireMM::CLJ14Group >(); - ObjectRegistry::registerConverterFor< SireMM::IntraGroupFF >(); - ObjectRegistry::registerConverterFor< SireMM::PositionalRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::PositionalRestraints >(); ObjectRegistry::registerConverterFor< SireMM::InterLJFFBase >(); ObjectRegistry::registerConverterFor< SireMM::InterLJFF >(); ObjectRegistry::registerConverterFor< SireMM::InterGroupLJFFBase >(); ObjectRegistry::registerConverterFor< SireMM::InterGroupLJFF >(); ObjectRegistry::registerConverterFor< SireMM::CLJAtom >(); ObjectRegistry::registerConverterFor< SireMM::CLJAtoms >(); - ObjectRegistry::registerConverterFor< SireMM::MMDetail >(); - ObjectRegistry::registerConverterFor< SireMM::Bond >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::RMSDRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::RMSDRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::CLJGrid >(); - ObjectRegistry::registerConverterFor< SireMM::IntraFF >(); - ObjectRegistry::registerConverterFor< SireMM::InternalGroupFF >(); - ObjectRegistry::registerConverterFor< SireMM::NullCLJFunction >(); - ObjectRegistry::registerConverterFor< SireMM::NullRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorMAngle >(); - ObjectRegistry::registerConverterFor< SireMM::MultiCLJComponent >(); - ObjectRegistry::registerConverterFor< SireMM::CMAPFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CMAPFunctions >(); - ObjectRegistry::registerConverterFor< SireMM::TwoAtomPerturbation >(); - ObjectRegistry::registerConverterFor< SireMM::ThreeAtomPerturbation >(); - ObjectRegistry::registerConverterFor< SireMM::FourAtomPerturbation >(); - ObjectRegistry::registerConverterFor< SireMM::CoulombProbe >(); - ObjectRegistry::registerConverterFor< SireMM::LJProbe >(); - ObjectRegistry::registerConverterFor< SireMM::CLJProbe >(); + ObjectRegistry::registerConverterFor< SireMM::LJPerturbation >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorMDihedral >(); ObjectRegistry::registerConverterFor< SireMM::BoreschRestraint >(); ObjectRegistry::registerConverterFor< SireMM::BoreschRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::CLJParams >(); - ObjectRegistry::registerConverterFor< SireMM::CLJParamsArray >(); - ObjectRegistry::registerConverterFor< SireMM::InterCLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::InterCLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupCLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::InterGroupCLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::InterSoftCLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::InterSoftCLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupSoftCLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupSoftCLJFF >(); ObjectRegistry::registerConverterFor< SireMM::CoulombScaleFactor >(); ObjectRegistry::registerConverterFor< SireMM::LJScaleFactor >(); ObjectRegistry::registerConverterFor< SireMM::CLJScaleFactor >(); ObjectRegistry::registerConverterFor< SireMM::CLJNBPairs >(); ObjectRegistry::registerConverterFor< SireMM::CoulombNBPairs >(); ObjectRegistry::registerConverterFor< SireMM::LJNBPairs >(); - ObjectRegistry::registerConverterFor< SireMM::InternalFF >(); - ObjectRegistry::registerConverterFor< SireMM::BondRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::BondRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::InverseBondRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::InverseBondRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::IntraCLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::IntraCLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::IntraGroupCLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::IntraGroupCLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::SoftCLJComponent >(); - ObjectRegistry::registerConverterFor< SireMM::DihedralRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::DihedralRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::IntraLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::IntraLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::IntraGroupLJFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::IntraGroupLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::FourAtomFunctions >(); - ObjectRegistry::registerConverterFor< SireMM::RestraintComponent >(); + ObjectRegistry::registerConverterFor< SireMM::NullRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::CLJExtractor >(); ObjectRegistry::registerConverterFor< SireMM::MorsePotentialRestraint >(); ObjectRegistry::registerConverterFor< SireMM::MorsePotentialRestraints >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorAngle >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::DistanceRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::DoubleDistanceRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::TripleDistanceRestraint >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorDihedral >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::GridFF >(); - ObjectRegistry::registerConverterFor< SireMM::CLJExtractor >(); - ObjectRegistry::registerConverterFor< SireMM::LJPerturbation >(); ObjectRegistry::registerConverterFor< SireMM::InterCoulombFFBase >(); ObjectRegistry::registerConverterFor< SireMM::InterCoulombFF >(); ObjectRegistry::registerConverterFor< SireMM::InterGroupCoulombFFBase >(); ObjectRegistry::registerConverterFor< SireMM::InterGroupCoulombFF >(); + ObjectRegistry::registerConverterFor< SireMM::NoCutoff >(); + ObjectRegistry::registerConverterFor< SireMM::HarmonicSwitchingFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CHARMMSwitchingFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJGroup >(); ObjectRegistry::registerConverterFor< SireMM::SelectorMImproper >(); + ObjectRegistry::registerConverterFor< SireMM::InverseBondRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::InverseBondRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::CLJDelta >(); + ObjectRegistry::registerConverterFor< SireMM::CoulombProbe >(); + ObjectRegistry::registerConverterFor< SireMM::LJProbe >(); + ObjectRegistry::registerConverterFor< SireMM::CLJProbe >(); + ObjectRegistry::registerConverterFor< SireMM::BondComponent >(); + ObjectRegistry::registerConverterFor< SireMM::AngleComponent >(); + ObjectRegistry::registerConverterFor< SireMM::DihedralComponent >(); + ObjectRegistry::registerConverterFor< SireMM::ImproperComponent >(); + ObjectRegistry::registerConverterFor< SireMM::UreyBradleyComponent >(); + ObjectRegistry::registerConverterFor< SireMM::StretchStretchComponent >(); + ObjectRegistry::registerConverterFor< SireMM::StretchBendComponent >(); + ObjectRegistry::registerConverterFor< SireMM::BendBendComponent >(); + ObjectRegistry::registerConverterFor< SireMM::StretchBendTorsionComponent >(); + ObjectRegistry::registerConverterFor< SireMM::Intra14CoulombComponent >(); + ObjectRegistry::registerConverterFor< SireMM::Intra14LJComponent >(); + ObjectRegistry::registerConverterFor< SireMM::Intra14Component >(); + ObjectRegistry::registerConverterFor< SireMM::InternalComponent >(); + ObjectRegistry::registerConverterFor< SireMM::CMAPParameter >(); + ObjectRegistry::registerConverterFor< SireMM::Dihedral >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::FourAtomFunctions >(); + ObjectRegistry::registerConverterFor< SireMM::InternalFF >(); ObjectRegistry::registerConverterFor< SireMM::CLJCalculator >(); + ObjectRegistry::registerConverterFor< SireMM::NullCLJFunction >(); + ObjectRegistry::registerConverterFor< SireMM::DihedralRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::DihedralRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::InterCLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::InterCLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupCLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupCLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::Bond >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::InternalGroupFF >(); + ObjectRegistry::registerConverterFor< SireMM::RMSDRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::RMSDRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::CLJWorkspace >(); + ObjectRegistry::registerConverterFor< SireMM::SoftCLJComponent >(); + ObjectRegistry::registerConverterFor< SireMM::LJParameter >(); + ObjectRegistry::registerConverterFor< SireMM::LJ1264Parameter >(); ObjectRegistry::registerConverterFor< SireMM::Improper >(); ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::GromacsAtomType >(); - ObjectRegistry::registerConverterFor< SireMM::GromacsBond >(); - ObjectRegistry::registerConverterFor< SireMM::GromacsAngle >(); - ObjectRegistry::registerConverterFor< SireMM::GromacsDihedral >(); - ObjectRegistry::registerConverterFor< SireMM::Dihedral >(); - ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorMBond >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorImproper >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::AngleRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::AngleRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorAngle >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::IntraCLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::IntraCLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::IntraGroupCLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::IntraGroupCLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::RestraintFF >(); + ObjectRegistry::registerConverterFor< SireMM::DistanceRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::DoubleDistanceRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::TripleDistanceRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::CLJGrid >(); + ObjectRegistry::registerConverterFor< SireMM::CoulombComponent >(); + ObjectRegistry::registerConverterFor< SireMM::LJComponent >(); + ObjectRegistry::registerConverterFor< SireMM::CLJComponent >(); + ObjectRegistry::registerConverterFor< SireMM::InternalParameters >(); + ObjectRegistry::registerConverterFor< SireMM::InternalParameters3D >(); + ObjectRegistry::registerConverterFor< SireMM::AtomLJs >(); + ObjectRegistry::registerConverterFor< SireMM::LJException >(); + ObjectRegistry::registerConverterFor< SireMM::LJExceptionID >(); + ObjectRegistry::registerConverterFor< SireMM::InterGroupFF >(); + ObjectRegistry::registerConverterFor< SireMM::ExcludedPairs >(); + ObjectRegistry::registerConverterFor< SireMM::LJPair >(); + ObjectRegistry::registerConverterFor< SireMM::CLJBox >(); + ObjectRegistry::registerConverterFor< SireMM::CLJBoxIndex >(); + ObjectRegistry::registerConverterFor< SireMM::CLJBoxes >(); + ObjectRegistry::registerConverterFor< SireMM::CLJBoxDistance >(); + ObjectRegistry::registerConverterFor< SireMM::RestraintComponent >(); + ObjectRegistry::registerConverterFor< SireMM::GridFF >(); ObjectRegistry::registerConverterFor< SireMM::IntraSoftCLJFFBase >(); ObjectRegistry::registerConverterFor< SireMM::IntraSoftCLJFF >(); ObjectRegistry::registerConverterFor< SireMM::IntraGroupSoftCLJFFBase >(); ObjectRegistry::registerConverterFor< SireMM::IntraGroupSoftCLJFF >(); - ObjectRegistry::registerConverterFor< SireMM::NoCutoff >(); - ObjectRegistry::registerConverterFor< SireMM::HarmonicSwitchingFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CHARMMSwitchingFunction >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorMAngle >(); + ObjectRegistry::registerConverterFor< SireMM::IntraLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::IntraLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::IntraGroupLJFFBase >(); + ObjectRegistry::registerConverterFor< SireMM::IntraGroupLJFF >(); + ObjectRegistry::registerConverterFor< SireMM::CLJ14Group >(); ObjectRegistry::registerConverterFor< SireMM::Angle >(); ObjectRegistry::registerConverterFor< SireMol::Mover >(); - ObjectRegistry::registerConverterFor< SireMM::SelectorMDihedral >(); - ObjectRegistry::registerConverterFor< SireMM::CLJShiftFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJIntraShiftFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJSoftShiftFunction >(); - ObjectRegistry::registerConverterFor< SireMM::CLJSoftIntraShiftFunction >(); - ObjectRegistry::registerConverterFor< SireMM::IntraCoulombFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::IntraCoulombFF >(); - ObjectRegistry::registerConverterFor< SireMM::IntraGroupCoulombFFBase >(); - ObjectRegistry::registerConverterFor< SireMM::IntraGroupCoulombFF >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorBond >(); + ObjectRegistry::registerConverterFor< SireMol::Mover >(); + ObjectRegistry::registerConverterFor< SireMM::SelectorMBond >(); + ObjectRegistry::registerConverterFor< SireMM::InterFF >(); + ObjectRegistry::registerConverterFor< SireMM::IntraGroupFF >(); + ObjectRegistry::registerConverterFor< SireMM::PositionalRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::PositionalRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::TwoAtomFunctions >(); + ObjectRegistry::registerConverterFor< SireMM::IntraFF >(); + ObjectRegistry::registerConverterFor< SireMM::GridFF2 >(); + ObjectRegistry::registerConverterFor< SireMM::BondRestraint >(); + ObjectRegistry::registerConverterFor< SireMM::BondRestraints >(); + ObjectRegistry::registerConverterFor< SireMM::MMDetail >(); + ObjectRegistry::registerConverterFor< SireMM::TwoAtomPerturbation >(); + ObjectRegistry::registerConverterFor< SireMM::ThreeAtomPerturbation >(); + ObjectRegistry::registerConverterFor< SireMM::FourAtomPerturbation >(); + ObjectRegistry::registerConverterFor< SireMM::ThreeAtomFunctions >(); + ObjectRegistry::registerConverterFor< SireMM::CLJParams >(); + ObjectRegistry::registerConverterFor< SireMM::CLJParamsArray >(); + ObjectRegistry::registerConverterFor< SireMM::CLJRFFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJIntraRFFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJSoftRFFunction >(); + ObjectRegistry::registerConverterFor< SireMM::CLJSoftIntraRFFunction >(); } From 5998a7acbfe5619264f9f2dfa20b055b5362869f Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Tue, 4 Nov 2025 17:24:11 +0000 Subject: [PATCH 10/10] Simplify API. --- corelib/src/libs/SireMM/anglerestraints.cpp | 4 ++-- corelib/src/libs/SireMM/anglerestraints.h | 4 ++-- corelib/src/libs/SireMM/bondrestraints.cpp | 4 ++-- corelib/src/libs/SireMM/bondrestraints.h | 4 ++-- corelib/src/libs/SireMM/boreschrestraints.cpp | 4 ++-- corelib/src/libs/SireMM/boreschrestraints.h | 4 ++-- .../src/libs/SireMM/dihedralrestraints.cpp | 4 ++-- corelib/src/libs/SireMM/dihedralrestraints.h | 4 ++-- .../src/libs/SireMM/inversebondrestraints.cpp | 4 ++-- .../src/libs/SireMM/inversebondrestraints.h | 4 ++-- .../libs/SireMM/morsepotentialrestraints.cpp | 4 ++-- .../libs/SireMM/morsepotentialrestraints.h | 4 ++-- .../src/libs/SireMM/positionalrestraints.cpp | 4 ++-- .../src/libs/SireMM/positionalrestraints.h | 4 ++-- src/sire/restraints/_restraints.py | 12 +++++------ tests/convert/test_openmm_restraints.py | 4 ++-- .../SireOpenMM/sire_to_openmm_system.cpp | 14 ++++++------- wrapper/MM/AngleRestraints.pypp.cpp | 20 +++++++++---------- wrapper/MM/BondRestraints.pypp.cpp | 20 +++++++++---------- wrapper/MM/BoreschRestraints.pypp.cpp | 20 +++++++++---------- wrapper/MM/DihedralRestraints.pypp.cpp | 20 +++++++++---------- wrapper/MM/InverseBondRestraints.pypp.cpp | 20 +++++++++---------- wrapper/MM/MorsePotentialRestraints.pypp.cpp | 20 +++++++++---------- wrapper/MM/PositionalRestraints.pypp.cpp | 20 +++++++++---------- 24 files changed, 113 insertions(+), 113 deletions(-) diff --git a/corelib/src/libs/SireMM/anglerestraints.cpp b/corelib/src/libs/SireMM/anglerestraints.cpp index eee4b6751..a12978fc4 100644 --- a/corelib/src/libs/SireMM/anglerestraints.cpp +++ b/corelib/src/libs/SireMM/anglerestraints.cpp @@ -488,13 +488,13 @@ AngleRestraints AngleRestraints::operator+(const AngleRestraints &restraints) co } /** Set whether or not periodic boundary conditions are to be used */ -void AngleRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +void AngleRestraints::setUsesPbc(bool use_pbc) { this->use_pbc = use_pbc; } /** Return whether or not periodic boundary conditions are to be used */ -bool AngleRestraints::getUsesPeriodicBoundaryConditions() const +bool AngleRestraints::usesPbc() const { return this->use_pbc; } diff --git a/corelib/src/libs/SireMM/anglerestraints.h b/corelib/src/libs/SireMM/anglerestraints.h index e774eeb8c..bf0f7fc9e 100644 --- a/corelib/src/libs/SireMM/anglerestraints.h +++ b/corelib/src/libs/SireMM/anglerestraints.h @@ -161,8 +161,8 @@ namespace SireMM AngleRestraints operator+(const AngleRestraint &restraint) const; AngleRestraints operator+(const AngleRestraints &restraints) const; - void setUsesPeriodicBoundaryConditions(bool use_pbc); - bool getUsesPeriodicBoundaryConditions() const; + void setUsesPbc(bool use_pbc); + bool usesPbc() const; private: /** List of restraints */ diff --git a/corelib/src/libs/SireMM/bondrestraints.cpp b/corelib/src/libs/SireMM/bondrestraints.cpp index 8eb15abf8..ff63cd678 100644 --- a/corelib/src/libs/SireMM/bondrestraints.cpp +++ b/corelib/src/libs/SireMM/bondrestraints.cpp @@ -692,13 +692,13 @@ BondRestraints BondRestraints::operator+(const BondRestraints &restraints) const } /** Set whether or not periodic boundary conditions are to be used */ -void BondRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +void BondRestraints::setUsesPbc(bool use_pbc) { this->use_pbc = use_pbc; } /** Return whether or not periodic boundary conditions are to be used */ -bool BondRestraints::getUsesPeriodicBoundaryConditions() const +bool BondRestraints::usesPbc() const { return this->use_pbc; } diff --git a/corelib/src/libs/SireMM/bondrestraints.h b/corelib/src/libs/SireMM/bondrestraints.h index 2b7c01ce6..312452a88 100644 --- a/corelib/src/libs/SireMM/bondrestraints.h +++ b/corelib/src/libs/SireMM/bondrestraints.h @@ -191,8 +191,8 @@ namespace SireMM BondRestraints operator+(const BondRestraint &restraint) const; BondRestraints operator+(const BondRestraints &restraints) const; - void setUsesPeriodicBoundaryConditions(bool use_pbc); - bool getUsesPeriodicBoundaryConditions() const; + void setUsesPbc(bool use_pbc); + bool usesPbc() const; private: /** The actual list of restraints*/ diff --git a/corelib/src/libs/SireMM/boreschrestraints.cpp b/corelib/src/libs/SireMM/boreschrestraints.cpp index 4ee54e3c4..25be2ebf6 100644 --- a/corelib/src/libs/SireMM/boreschrestraints.cpp +++ b/corelib/src/libs/SireMM/boreschrestraints.cpp @@ -600,13 +600,13 @@ BoreschRestraints BoreschRestraints::operator+(const BoreschRestraints &restrain } /** Set whether or not periodic boundary conditions are to be used */ -void BoreschRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +void BoreschRestraints::setUsesPbc(bool use_pbc) { this->use_pbc = use_pbc; } /** Return whether or not periodic boundary conditions are to be used */ -bool BoreschRestraints::getUsesPeriodicBoundaryConditions() const +bool BoreschRestraints::usesPbc() const { return this->use_pbc; } diff --git a/corelib/src/libs/SireMM/boreschrestraints.h b/corelib/src/libs/SireMM/boreschrestraints.h index 421e84d54..7592daf5f 100644 --- a/corelib/src/libs/SireMM/boreschrestraints.h +++ b/corelib/src/libs/SireMM/boreschrestraints.h @@ -194,8 +194,8 @@ namespace SireMM BoreschRestraints operator+(const BoreschRestraint &restraint) const; BoreschRestraints operator+(const BoreschRestraints &restraints) const; - void setUsesPeriodicBoundaryConditions(bool use_pbc); - bool getUsesPeriodicBoundaryConditions() const; + void setUsesPbc(bool use_pbc); + bool usesPbc() const; private: /** The actual list of restraints*/ diff --git a/corelib/src/libs/SireMM/dihedralrestraints.cpp b/corelib/src/libs/SireMM/dihedralrestraints.cpp index 7e5580e20..8ef7b254b 100644 --- a/corelib/src/libs/SireMM/dihedralrestraints.cpp +++ b/corelib/src/libs/SireMM/dihedralrestraints.cpp @@ -487,13 +487,13 @@ DihedralRestraints DihedralRestraints::operator+(const DihedralRestraints &restr } /** Set whether or not periodic boundary conditions are to be used */ -void DihedralRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +void DihedralRestraints::setUsesPbc(bool use_pbc) { this->use_pbc = use_pbc; } /** Return whether or not periodic boundary conditions are to be used */ -bool DihedralRestraints::getUsesPeriodicBoundaryConditions() const +bool DihedralRestraints::usesPbc() const { return this->use_pbc; } diff --git a/corelib/src/libs/SireMM/dihedralrestraints.h b/corelib/src/libs/SireMM/dihedralrestraints.h index 4a794fb12..a2cb22a2d 100644 --- a/corelib/src/libs/SireMM/dihedralrestraints.h +++ b/corelib/src/libs/SireMM/dihedralrestraints.h @@ -161,8 +161,8 @@ namespace SireMM DihedralRestraints operator+(const DihedralRestraint &restraint) const; DihedralRestraints operator+(const DihedralRestraints &restraints) const; - void setUsesPeriodicBoundaryConditions(bool use_pbc); - bool getUsesPeriodicBoundaryConditions() const; + void setUsesPbc(bool use_pbc); + bool usesPbc() const; private: /** List of restraints */ diff --git a/corelib/src/libs/SireMM/inversebondrestraints.cpp b/corelib/src/libs/SireMM/inversebondrestraints.cpp index 7d900d5f6..f88acc3fe 100644 --- a/corelib/src/libs/SireMM/inversebondrestraints.cpp +++ b/corelib/src/libs/SireMM/inversebondrestraints.cpp @@ -692,13 +692,13 @@ InverseBondRestraints InverseBondRestraints::operator+(const InverseBondRestrain } /** Set whether or not periodic boundary conditions are to be used */ -void InverseBondRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +void InverseBondRestraints::setUsesPbc(bool use_pbc) { this->use_pbc = use_pbc; } /** Return whether or not periodic boundary conditions are to be used */ -bool InverseBondRestraints::getUsesPeriodicBoundaryConditions() const +bool InverseBondRestraints::usesPbc() const { return this->use_pbc; } diff --git a/corelib/src/libs/SireMM/inversebondrestraints.h b/corelib/src/libs/SireMM/inversebondrestraints.h index 388c44175..1e47c06e9 100644 --- a/corelib/src/libs/SireMM/inversebondrestraints.h +++ b/corelib/src/libs/SireMM/inversebondrestraints.h @@ -191,8 +191,8 @@ namespace SireMM InverseBondRestraints operator+(const InverseBondRestraint &restraint) const; InverseBondRestraints operator+(const InverseBondRestraints &restraints) const; - void setUsesPeriodicBoundaryConditions(bool use_pbc); - bool getUsesPeriodicBoundaryConditions() const; + void setUsesPbc(bool use_pbc); + bool usesPbc() const; private: /** The actual list of restraints*/ diff --git a/corelib/src/libs/SireMM/morsepotentialrestraints.cpp b/corelib/src/libs/SireMM/morsepotentialrestraints.cpp index afc5dad3e..1322e08b1 100644 --- a/corelib/src/libs/SireMM/morsepotentialrestraints.cpp +++ b/corelib/src/libs/SireMM/morsepotentialrestraints.cpp @@ -704,13 +704,13 @@ MorsePotentialRestraints MorsePotentialRestraints::operator+(const MorsePotentia } /** Set whether or not periodic boundary conditions are to be used */ -void MorsePotentialRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +void MorsePotentialRestraints::setUsesPbc(bool use_pbc) { this->use_pbc = use_pbc; } /** Return whether or not periodic boundary conditions are to be used */ -bool MorsePotentialRestraints::getUsesPeriodicBoundaryConditions() const +bool MorsePotentialRestraints::usesPbc() const { return this->use_pbc; } diff --git a/corelib/src/libs/SireMM/morsepotentialrestraints.h b/corelib/src/libs/SireMM/morsepotentialrestraints.h index 5959a75dd..858b5396f 100644 --- a/corelib/src/libs/SireMM/morsepotentialrestraints.h +++ b/corelib/src/libs/SireMM/morsepotentialrestraints.h @@ -193,8 +193,8 @@ namespace SireMM MorsePotentialRestraints operator+(const MorsePotentialRestraint &restraint) const; MorsePotentialRestraints operator+(const MorsePotentialRestraints &restraints) const; - void setUsesPeriodicBoundaryConditions(bool use_pbc); - bool getUsesPeriodicBoundaryConditions() const; + void setUsesPbc(bool use_pbc); + bool usesPbc() const; private: /** The actual list of restraints*/ diff --git a/corelib/src/libs/SireMM/positionalrestraints.cpp b/corelib/src/libs/SireMM/positionalrestraints.cpp index 7eb8b5b38..101ce0f57 100644 --- a/corelib/src/libs/SireMM/positionalrestraints.cpp +++ b/corelib/src/libs/SireMM/positionalrestraints.cpp @@ -631,13 +631,13 @@ PositionalRestraints PositionalRestraints::operator+(const PositionalRestraints } /** Set whether or not periodic boundary conditions are to be used */ -void PositionalRestraints::setUsesPeriodicBoundaryConditions(bool use_pbc) +void PositionalRestraints::setUsesPbc(bool use_pbc) { this->use_pbc = use_pbc; } /** Return whether or not periodic boundary conditions are to be used */ -bool PositionalRestraints::getUsesPeriodicBoundaryConditions() const +bool PositionalRestraints::usesPbc() const { return this->use_pbc; } diff --git a/corelib/src/libs/SireMM/positionalrestraints.h b/corelib/src/libs/SireMM/positionalrestraints.h index 676e3f623..6aa6f550b 100644 --- a/corelib/src/libs/SireMM/positionalrestraints.h +++ b/corelib/src/libs/SireMM/positionalrestraints.h @@ -191,8 +191,8 @@ namespace SireMM PositionalRestraints operator+(const PositionalRestraint &restraint) const; PositionalRestraints operator+(const PositionalRestraints &restraints) const; - void setUsesPeriodicBoundaryConditions(bool use_pbc); - bool getUsesPeriodicBoundaryConditions() const; + void setUsesPbc(bool use_pbc); + bool usesPbc() const; private: /** The actual list of restraints*/ diff --git a/src/sire/restraints/_restraints.py b/src/sire/restraints/_restraints.py index bb84929c4..cc443facc 100644 --- a/src/sire/restraints/_restraints.py +++ b/src/sire/restraints/_restraints.py @@ -124,7 +124,7 @@ def angle(mols, atoms, theta0=None, ktheta=None, use_pbc=None, name=None, map=No restraints.add(AngleRestraint(mols.find(atoms), theta0, ktheta)) # Set the use_pbc flag. - restraints.set_uses_periodic_boundary_conditions(use_pbc) + restraints.set_uses_pbc(use_pbc) return restraints @@ -605,7 +605,7 @@ def dihedral(mols, atoms, phi0=None, kphi=None, use_pbc=None, name=None, map=Non restraints.add(DihedralRestraint(mols.find(atoms), phi0, kphi)) # Set the use_pbc flag. - restraints.set_uses_periodic_boundary_conditions(use_pbc) + restraints.set_uses_pbc(use_pbc) return restraints @@ -718,7 +718,7 @@ def distance(mols, atoms0, atoms1, r0=None, k=None, use_pbc=None, name=None, map restraints.add(BondRestraint(idxs0[0], idxs1[0], ik, ir0)) # Set the use_pbc flag. - restraints.set_uses_periodic_boundary_conditions(use_pbc) + restraints.set_uses_pbc(use_pbc) return restraints @@ -968,7 +968,7 @@ def morse_potential( restraints.add(MorsePotentialRestraint(idxs0[0], idxs1[0], ik, ir0, de)) # Set the use_pbc flag. - restraints.set_uses_periodic_boundary_conditions(use_pbc) + restraints.set_uses_pbc(use_pbc) return restraints @@ -1091,7 +1091,7 @@ def inverse_distance( restraints.add(InverseBondRestraint(idxs0[0], idxs1[0], ik, ir0)) # Set the use_pbc flag. - restraints.set_uses_periodic_boundary_conditions(use_pbc) + restraints.set_uses_pbc(use_pbc) return restraints @@ -1203,7 +1203,7 @@ def positional( restraints.add(PositionalRestraint(idxs[0], position[i], ik, ir0)) # Set the use_pbc flag. - restraints.set_uses_periodic_boundary_conditions(use_pbc) + restraints.set_uses_pbc(use_pbc) return restraints diff --git a/tests/convert/test_openmm_restraints.py b/tests/convert/test_openmm_restraints.py index 0580c6ea0..f8bcd1aeb 100644 --- a/tests/convert/test_openmm_restraints.py +++ b/tests/convert/test_openmm_restraints.py @@ -276,7 +276,7 @@ def test_openmm_restraints_pbc(ala_mols, restraint, default_pbc, openmm_platform ) # make sure the _use_pbc flag is set to the default value - assert restraints.get_uses_periodic_boundary_conditions() == default_pbc + assert restraints.uses_pbc() == default_pbc # create a dynamics object d = mols.dynamics(restraints=restraints, platform=openmm_platform) @@ -296,7 +296,7 @@ def test_openmm_restraints_pbc(ala_mols, restraint, default_pbc, openmm_platform ) # make sure the _use_pbc flag is set to False - assert restraints.get_uses_periodic_boundary_conditions() == (not default_pbc) + assert restraints.uses_pbc() == (not default_pbc) # create a dynamics object d = mols.dynamics(restraints=restraints, platform=openmm_platform) diff --git a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp index 46fcad1ae..23c75b7f2 100644 --- a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp +++ b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp @@ -134,7 +134,7 @@ void _add_boresch_restraints(const SireMM::BoreschRestraints &restraints, restraintff->addPerBondParameter("kphi_C"); restraintff->addPerBondParameter("phi0_C"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -221,7 +221,7 @@ void _add_bond_restraints(const SireMM::BondRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("r0"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -287,7 +287,7 @@ void _add_inverse_bond_restraints(const SireMM::InverseBondRestraints &restraint restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("r0"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -365,7 +365,7 @@ void _add_morse_potential_restraints(const SireMM::MorsePotentialRestraints &res restraintff->addPerBondParameter("r0"); restraintff->addPerBondParameter("de"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -439,7 +439,7 @@ void _add_positional_restraints(const SireMM::PositionalRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("rb"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -669,7 +669,7 @@ void _add_angle_restraints(const SireMM::AngleRestraints &restraints, restraintff->addPerAngleParameter("k"); restraintff->addPerAngleParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -732,7 +732,7 @@ void _add_dihedral_restraints(const SireMM::DihedralRestraints &restraints, restraintff->addPerTorsionParameter("k"); restraintff->addPerTorsionParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(restraints.getUsesPeriodicBoundaryConditions()); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); diff --git a/wrapper/MM/AngleRestraints.pypp.cpp b/wrapper/MM/AngleRestraints.pypp.cpp index 61cf99fb0..23f5c6b08 100644 --- a/wrapper/MM/AngleRestraints.pypp.cpp +++ b/wrapper/MM/AngleRestraints.pypp.cpp @@ -99,14 +99,14 @@ void register_AngleRestraints_class(){ , "Return the number of restraints" ); } - { //::SireMM::AngleRestraints::getUsesPeriodicBoundaryConditions + { //::SireMM::AngleRestraints::usesPbc - typedef bool ( ::SireMM::AngleRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; - getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::AngleRestraints::getUsesPeriodicBoundaryConditions ); + typedef bool ( ::SireMM::AngleRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::AngleRestraints::usesPbc ); AngleRestraints_exposer.def( - "getUsesPeriodicBoundaryConditions" - , getUsesPeriodicBoundaryConditions_function_value + "usesPbc" + , usesPbc_function_value , bp::release_gil_policy() , "Return whether or not periodic boundary conditions are to be used" ); @@ -189,14 +189,14 @@ void register_AngleRestraints_class(){ , "Return all of the restraints" ); } - { //::SireMM::AngleRestraints::setUsesPeriodicBoundaryConditions + { //::SireMM::AngleRestraints::setUsesPbc - typedef void ( ::SireMM::AngleRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; - setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::AngleRestraints::setUsesPeriodicBoundaryConditions ); + typedef void ( ::SireMM::AngleRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::AngleRestraints::setUsesPbc ); AngleRestraints_exposer.def( - "setUsesPeriodicBoundaryConditions" - , setUsesPeriodicBoundaryConditions_function_value + "setUsesPbc" + , setUsesPbc_function_value , ( bp::arg("use_pbc") ) , bp::release_gil_policy() , "Set whether or not periodic boundary conditions are to be used" ); diff --git a/wrapper/MM/BondRestraints.pypp.cpp b/wrapper/MM/BondRestraints.pypp.cpp index 8fc1fbc2d..2327e6cb9 100644 --- a/wrapper/MM/BondRestraints.pypp.cpp +++ b/wrapper/MM/BondRestraints.pypp.cpp @@ -123,14 +123,14 @@ void register_BondRestraints_class(){ , "Return the number of restraints" ); } - { //::SireMM::BondRestraints::getUsesPeriodicBoundaryConditions + { //::SireMM::BondRestraints::usesPbc - typedef bool ( ::SireMM::BondRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; - getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::BondRestraints::getUsesPeriodicBoundaryConditions ); + typedef bool ( ::SireMM::BondRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::BondRestraints::usesPbc ); BondRestraints_exposer.def( - "getUsesPeriodicBoundaryConditions" - , getUsesPeriodicBoundaryConditions_function_value + "usesPbc" + , usesPbc_function_value , bp::release_gil_policy() , "Return whether or not periodic boundary conditions are to be used" ); @@ -261,14 +261,14 @@ void register_BondRestraints_class(){ , "Return all of the restraints" ); } - { //::SireMM::BondRestraints::setUsesPeriodicBoundaryConditions + { //::SireMM::BondRestraints::setUsesPbc - typedef void ( ::SireMM::BondRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; - setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::BondRestraints::setUsesPeriodicBoundaryConditions ); + typedef void ( ::SireMM::BondRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::BondRestraints::setUsesPbc ); BondRestraints_exposer.def( - "setUsesPeriodicBoundaryConditions" - , setUsesPeriodicBoundaryConditions_function_value + "setUsesPbc" + , setUsesPbc_function_value , ( bp::arg("use_pbc") ) , bp::release_gil_policy() , "Set whether or not periodic boundary conditions are to be used" ); diff --git a/wrapper/MM/BoreschRestraints.pypp.cpp b/wrapper/MM/BoreschRestraints.pypp.cpp index e0c12a5e0..da907dcd9 100644 --- a/wrapper/MM/BoreschRestraints.pypp.cpp +++ b/wrapper/MM/BoreschRestraints.pypp.cpp @@ -99,14 +99,14 @@ void register_BoreschRestraints_class(){ , "Return the number of restraints" ); } - { //::SireMM::BoreschRestraints::getUsesPeriodicBoundaryConditions + { //::SireMM::BoreschRestraints::usesPbc - typedef bool ( ::SireMM::BoreschRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; - getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::BoreschRestraints::getUsesPeriodicBoundaryConditions ); + typedef bool ( ::SireMM::BoreschRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::BoreschRestraints::usesPbc ); BoreschRestraints_exposer.def( - "getUsesPeriodicBoundaryConditions" - , getUsesPeriodicBoundaryConditions_function_value + "usesPbc" + , usesPbc_function_value , bp::release_gil_policy() , "Return whether or not periodic boundary conditions are to be used" ); @@ -189,14 +189,14 @@ void register_BoreschRestraints_class(){ , "Return all of the restraints" ); } - { //::SireMM::BoreschRestraints::setUsesPeriodicBoundaryConditions + { //::SireMM::BoreschRestraints::setUsesPbc - typedef void ( ::SireMM::BoreschRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; - setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::BoreschRestraints::setUsesPeriodicBoundaryConditions ); + typedef void ( ::SireMM::BoreschRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::BoreschRestraints::setUsesPbc ); BoreschRestraints_exposer.def( - "setUsesPeriodicBoundaryConditions" - , setUsesPeriodicBoundaryConditions_function_value + "setUsesPbc" + , setUsesPbc_function_value , ( bp::arg("use_pbc") ) , bp::release_gil_policy() , "Set whether or not periodic boundary conditions are to be used" ); diff --git a/wrapper/MM/DihedralRestraints.pypp.cpp b/wrapper/MM/DihedralRestraints.pypp.cpp index 277e0d0db..74ea2f5da 100644 --- a/wrapper/MM/DihedralRestraints.pypp.cpp +++ b/wrapper/MM/DihedralRestraints.pypp.cpp @@ -99,14 +99,14 @@ void register_DihedralRestraints_class(){ , "Return the number of restraints" ); } - { //::SireMM::DihedralRestraints::getUsesPeriodicBoundaryConditions + { //::SireMM::DihedralRestraints::usesPbc - typedef bool ( ::SireMM::DihedralRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; - getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::DihedralRestraints::getUsesPeriodicBoundaryConditions ); + typedef bool ( ::SireMM::DihedralRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::DihedralRestraints::usesPbc ); DihedralRestraints_exposer.def( - "getUsesPeriodicBoundaryConditions" - , getUsesPeriodicBoundaryConditions_function_value + "usesPbc" + , usesPbc_function_value , bp::release_gil_policy() , "Return whether or not periodic boundary conditions are to be used" ); @@ -189,14 +189,14 @@ void register_DihedralRestraints_class(){ , "Return all of the restraints" ); } - { //::SireMM::DihedralRestraints::setUsesPeriodicBoundaryConditions + { //::SireMM::DihedralRestraints::setUsesPbc - typedef void ( ::SireMM::DihedralRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; - setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::DihedralRestraints::setUsesPeriodicBoundaryConditions ); + typedef void ( ::SireMM::DihedralRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::DihedralRestraints::setUsesPbc ); DihedralRestraints_exposer.def( - "setUsesPeriodicBoundaryConditions" - , setUsesPeriodicBoundaryConditions_function_value + "setUsesPbc" + , setUsesPbc_function_value , ( bp::arg("use_pbc") ) , bp::release_gil_policy() , "Set whether or not periodic boundary conditions are to be used" ); diff --git a/wrapper/MM/InverseBondRestraints.pypp.cpp b/wrapper/MM/InverseBondRestraints.pypp.cpp index f53616610..aa86830ec 100644 --- a/wrapper/MM/InverseBondRestraints.pypp.cpp +++ b/wrapper/MM/InverseBondRestraints.pypp.cpp @@ -123,14 +123,14 @@ void register_InverseBondRestraints_class(){ , "Return the number of restraints" ); } - { //::SireMM::InverseBondRestraints::getUsesPeriodicBoundaryConditions + { //::SireMM::InverseBondRestraints::usesPbc - typedef bool ( ::SireMM::InverseBondRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; - getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::InverseBondRestraints::getUsesPeriodicBoundaryConditions ); + typedef bool ( ::SireMM::InverseBondRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::InverseBondRestraints::usesPbc ); InverseBondRestraints_exposer.def( - "getUsesPeriodicBoundaryConditions" - , getUsesPeriodicBoundaryConditions_function_value + "usesPbc" + , usesPbc_function_value , bp::release_gil_policy() , "Return whether or not periodic boundary conditions are to be used" ); @@ -261,14 +261,14 @@ void register_InverseBondRestraints_class(){ , "Return all of the restraints" ); } - { //::SireMM::InverseBondRestraints::setUsesPeriodicBoundaryConditions + { //::SireMM::InverseBondRestraints::setUsesPbc - typedef void ( ::SireMM::InverseBondRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; - setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::InverseBondRestraints::setUsesPeriodicBoundaryConditions ); + typedef void ( ::SireMM::InverseBondRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::InverseBondRestraints::setUsesPbc ); InverseBondRestraints_exposer.def( - "setUsesPeriodicBoundaryConditions" - , setUsesPeriodicBoundaryConditions_function_value + "setUsesPbc" + , setUsesPbc_function_value , ( bp::arg("use_pbc") ) , bp::release_gil_policy() , "Set whether or not periodic boundary conditions are to be used" ); diff --git a/wrapper/MM/MorsePotentialRestraints.pypp.cpp b/wrapper/MM/MorsePotentialRestraints.pypp.cpp index 60b6c12d7..b03fc22e9 100644 --- a/wrapper/MM/MorsePotentialRestraints.pypp.cpp +++ b/wrapper/MM/MorsePotentialRestraints.pypp.cpp @@ -123,14 +123,14 @@ void register_MorsePotentialRestraints_class(){ , "Return the number of restraints" ); } - { //::SireMM::MorsePotentialRestraints::getUsesPeriodicBoundaryConditions + { //::SireMM::MorsePotentialRestraints::usesPbc - typedef bool ( ::SireMM::MorsePotentialRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; - getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::MorsePotentialRestraints::getUsesPeriodicBoundaryConditions ); + typedef bool ( ::SireMM::MorsePotentialRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::MorsePotentialRestraints::usesPbc ); MorsePotentialRestraints_exposer.def( - "getUsesPeriodicBoundaryConditions" - , getUsesPeriodicBoundaryConditions_function_value + "usesPbc" + , usesPbc_function_value , bp::release_gil_policy() , "Return whether or not periodic boundary conditions are to be used" ); @@ -261,14 +261,14 @@ void register_MorsePotentialRestraints_class(){ , "Return all of the restraints" ); } - { //::SireMM::MorsePotentialRestraints::setUsesPeriodicBoundaryConditions + { //::SireMM::MorsePotentialRestraints::setUsesPbc - typedef void ( ::SireMM::MorsePotentialRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; - setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::MorsePotentialRestraints::setUsesPeriodicBoundaryConditions ); + typedef void ( ::SireMM::MorsePotentialRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::MorsePotentialRestraints::setUsesPbc ); MorsePotentialRestraints_exposer.def( - "setUsesPeriodicBoundaryConditions" - , setUsesPeriodicBoundaryConditions_function_value + "setUsesPbc" + , setUsesPbc_function_value , ( bp::arg("use_pbc") ) , bp::release_gil_policy() , "Set whether or not periodic boundary conditions are to be used" ); diff --git a/wrapper/MM/PositionalRestraints.pypp.cpp b/wrapper/MM/PositionalRestraints.pypp.cpp index ea5ac2800..a179d8924 100644 --- a/wrapper/MM/PositionalRestraints.pypp.cpp +++ b/wrapper/MM/PositionalRestraints.pypp.cpp @@ -123,14 +123,14 @@ void register_PositionalRestraints_class(){ , "Return the number of restraints" ); } - { //::SireMM::PositionalRestraints::getUsesPeriodicBoundaryConditions + { //::SireMM::PositionalRestraints::usesPbc - typedef bool ( ::SireMM::PositionalRestraints::*getUsesPeriodicBoundaryConditions_function_type)( ) const; - getUsesPeriodicBoundaryConditions_function_type getUsesPeriodicBoundaryConditions_function_value( &::SireMM::PositionalRestraints::getUsesPeriodicBoundaryConditions ); + typedef bool ( ::SireMM::PositionalRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::PositionalRestraints::usesPbc ); PositionalRestraints_exposer.def( - "getUsesPeriodicBoundaryConditions" - , getUsesPeriodicBoundaryConditions_function_value + "usesPbc" + , usesPbc_function_value , bp::release_gil_policy() , "Return whether or not periodic boundary conditions are to be used" ); @@ -261,14 +261,14 @@ void register_PositionalRestraints_class(){ , "Return all of the restraints" ); } - { //::SireMM::PositionalRestraints::setUsesPeriodicBoundaryConditions + { //::SireMM::PositionalRestraints::setUsesPbc - typedef void ( ::SireMM::PositionalRestraints::*setUsesPeriodicBoundaryConditions_function_type)( bool ) ; - setUsesPeriodicBoundaryConditions_function_type setUsesPeriodicBoundaryConditions_function_value( &::SireMM::PositionalRestraints::setUsesPeriodicBoundaryConditions ); + typedef void ( ::SireMM::PositionalRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::PositionalRestraints::setUsesPbc ); PositionalRestraints_exposer.def( - "setUsesPeriodicBoundaryConditions" - , setUsesPeriodicBoundaryConditions_function_value + "setUsesPbc" + , setUsesPbc_function_value , ( bp::arg("use_pbc") ) , bp::release_gil_policy() , "Set whether or not periodic boundary conditions are to be used" );