diff --git a/corelib/src/libs/SireIO/biosimspace.cpp b/corelib/src/libs/SireIO/biosimspace.cpp index c21a92a8e..89dd01ca5 100644 --- a/corelib/src/libs/SireIO/biosimspace.cpp +++ b/corelib/src/libs/SireIO/biosimspace.cpp @@ -1687,6 +1687,64 @@ namespace SireIO return ion; } + System setCoordinates(System &system, const QVector> &coordinates, const bool is_lambda1, const PropertyMap &map) + { + // Make sure that the number of coordinates matches the number of atoms. + if (system.nAtoms() != coordinates.size()) + { + throw SireError::incompatible_error( + QObject::tr("Number of coordinates (%1) does not match number of atoms in the system (%2)!") + .arg(coordinates.size()) + .arg(system.nAtoms()), + CODELOC); + } + + // Keep track of the current coordinate index. + unsigned coord_idx = 0; + + // Loop over all molecules in the system in MolIdx order. + for (int i = 0; i < system.nMolecules(); ++i) + { + // Extract the molecule and make it editable. + auto molecule = system.molecule(MolIdx(i)).molecule().edit(); + + QString prop_name = "coordinates"; + if (molecule.hasProperty("is_perturbable")) + { + if (is_lambda1) + prop_name = "coordinates1"; + else + prop_name = "coordinates0"; + } + + // Get the coordinate property. + const auto coord_prop = map[prop_name]; + + // Loop over all atoms in the molecule. + for (int j = 0; j < molecule.nAtoms(); ++j) + { + // Construct the new coordinate. + const auto coord = Vector(coordinates[coord_idx + j][0], + coordinates[coord_idx + j][1], + coordinates[coord_idx + j][2]); + + // Set the new coordinates. + molecule = molecule.edit() + .atom(AtomIdx(j)) + .setProperty(coord_prop, coord) + .molecule(); + } + + // Update the molecule in the system. + system.update(molecule.commit()); + + // Update the coordinate index. + coord_idx += molecule.nAtoms(); + } + + return system; + } + Vector cross(const Vector &v0, const Vector &v1) { double nx = v0.y() * v1.z() - v0.z() * v1.y(); diff --git a/corelib/src/libs/SireIO/biosimspace.h b/corelib/src/libs/SireIO/biosimspace.h index b90c6db8a..081735cff 100644 --- a/corelib/src/libs/SireIO/biosimspace.h +++ b/corelib/src/libs/SireIO/biosimspace.h @@ -351,6 +351,26 @@ namespace SireIO SIREIO_EXPORT Molecule createChlorineIon( const Vector &coords, const QString model, const PropertyMap &map = PropertyMap()); + //! Set the coordinates of the entire system. + /* \param system + The molecular system of interest. + + \param coordinates + The new coordinates for the system. + + \param is_lambda1 + Whether this is for the lambda = 1 state. + + \param map + A dictionary of user-defined molecular property names. + + \retval system + The system with updated coordinates. + */ + SIREIO_EXPORT SireSystem::System setCoordinates( + SireSystem::System &system, const QVector> &coordinates, + const bool is_lambda1 = false, const PropertyMap &map = PropertyMap()); + Vector cross(const Vector &v0, const Vector &v1); } // namespace SireIO @@ -366,6 +386,7 @@ SIRE_EXPOSE_FUNCTION(SireIO::updateAndPreserveOrder) SIRE_EXPOSE_FUNCTION(SireIO::updateCoordinatesAndVelocities) SIRE_EXPOSE_FUNCTION(SireIO::createSodiumIon) SIRE_EXPOSE_FUNCTION(SireIO::createChlorineIon) +SIRE_EXPOSE_FUNCTION(SireIO::setCoordinates) SIRE_END_HEADER diff --git a/corelib/src/libs/SireIO/moleculeparser.cpp b/corelib/src/libs/SireIO/moleculeparser.cpp index 305be0f87..b9c89a8dc 100644 --- a/corelib/src/libs/SireIO/moleculeparser.cpp +++ b/corelib/src/libs/SireIO/moleculeparser.cpp @@ -1669,7 +1669,35 @@ QStringList MoleculeParser::writeToFile(const QString &filename) const QStringList written_files; - createDirectoryForFile(filename); + // Check whether list of trajectory frames have been specified via the map. + // If so, then the name will be prefixed with "frames_names:" + QStringList frame_names; + if (filename.contains("frames_names:")) + { + // Split the part of the string following "frames_names:" by commas to get + // individual frame names. + const QString frames_names_str = filename.section("frames_names:", 1); + frame_names = frames_names_str.split(",", Qt::SkipEmptyParts); + + // Convert to absolute paths. + for (auto &frame_name : frame_names) + { + frame_name = QFileInfo(frame_name.trimmed()).absoluteFilePath(); + } + + if (frame_names.size() != frames_to_write.size()) + { + throw SireError::program_bug( + QObject::tr("The number of frame names provided (%1) does not match the number of frames to write (%2).") + .arg(frame_names.size()) + .arg(frames_to_write.size()), + CODELOC); + } + } + else + { + createDirectoryForFile(filename); + } if (this->writingTrajectory() and this->isFrame()) { @@ -1694,51 +1722,61 @@ QStringList MoleculeParser::writeToFile(const QString &filename) const const int padding = QString::number(largest_frame).length(); - // in this case, we are going to create a directory named after the - // filename, into which all the frames will be written - auto fileinfo = QFileInfo(filename); + QDir framedir; + QFileInfo fileinfo; + bool write_to_frame_dir = false; - if (fileinfo.exists()) + if (frame_names.isEmpty()) { - // by default, we support overwriting of files - so remove this if it is a file - if (fileinfo.isDir()) - { - _check_and_remove_frame_dir(fileinfo); + fileinfo = QFileInfo(filename); + write_to_frame_dir = true; - // rebuild so it is not cached - fileinfo = QFileInfo(filename); + // in this case, we are going to create a directory named after the + // filename, into which all the frames will be written + fileinfo = QFileInfo(filename); - if (fileinfo.exists()) - throw SireError::file_error(QObject::tr( - "Could not write the trajectory for file '%1' as there " - "is already a directory with this name that contains " - "files that don't appear to have been created by sire.") - .arg(filename), - CODELOC); - } - else + if (fileinfo.exists()) { - auto dir = fileinfo.absoluteDir(); - - if (not dir.remove(fileinfo.fileName())) - throw SireError::file_error(QObject::tr( - "Could not write the trajectory for file '%1' as " - "we don't have permission to remove the existing " - "file with this name.") - .arg(filename), - CODELOC); + // by default, we support overwriting of files - so remove this if it is a file + if (fileinfo.isDir()) + { + _check_and_remove_frame_dir(fileinfo); + + // rebuild so it is not cached + fileinfo = QFileInfo(filename); + + if (fileinfo.exists()) + throw SireError::file_error(QObject::tr( + "Could not write the trajectory for file '%1' as there " + "is already a directory with this name that contains " + "files that don't appear to have been created by sire.") + .arg(filename), + CODELOC); + } + else + { + auto dir = fileinfo.absoluteDir(); + + if (not dir.remove(fileinfo.fileName())) + throw SireError::file_error(QObject::tr( + "Could not write the trajectory for file '%1' as " + "we don't have permission to remove the existing " + "file with this name.") + .arg(filename), + CODELOC); + } } - } - QDir framedir(fileinfo.absoluteFilePath()); + framedir = QDir(fileinfo.absoluteFilePath()); - if (not framedir.mkpath(".")) - throw SireError::file_error(QObject::tr( - "Could not create the directory into which to write the " - "trajectory for '%1'. Check that there is enough space " - "and you have the correct permissions.") - .arg(framedir.absolutePath()), - CODELOC); + if (not framedir.mkpath(".")) + throw SireError::file_error(QObject::tr( + "Could not create the directory into which to write the " + "trajectory for '%1'. Check that there is enough space " + "and you have the correct permissions.") + .arg(framedir.absolutePath()), + CODELOC); + } const auto suffix = fileinfo.completeSuffix(); @@ -1765,13 +1803,26 @@ QStringList MoleculeParser::writeToFile(const QString &filename) const // construct a copy of this parser for this frame auto parser = this->construct(thread_s, m); - // now write it to the file, numbered by the frame number and time - QString frame_filename = framedir.filePath( - "frame_" + - QString::number(i).rightJustified(padding, '0') + - "_" + - QString::number(time).replace(".", "-") + - "." + suffix); + QString frame_filename; + + if (write_to_frame_dir) + { + // now write it to the file, numbered by the frame number and time + QDir framedir(fileinfo.absoluteFilePath()); + + frame_filename = framedir.filePath( + "frame_" + + QString::number(i).rightJustified(padding, '0') + + "_" + + QString::number(time).replace(".", "-") + + "." + suffix); + } + else + { + // write to the specified frame name + frame_filename = frame_names[i]; + createDirectoryForFile(frame_filename); + } parser.read().writeToFile(frame_filename); @@ -1792,13 +1843,26 @@ QStringList MoleculeParser::writeToFile(const QString &filename) const // construct a copy of this parser for this frame auto parser = this->construct(s, m); - // now write it to the file, numbered by the frame number - QString frame_filename = framedir.filePath( - "frame_" + - QString::number(i).rightJustified(padding, '0') + - "_" + - QString::number(time).replace(".", "-") + - "." + suffix); + QString frame_filename; + + if (write_to_frame_dir) + { + // now write it to the file, numbered by the frame number + QDir framedir(fileinfo.absoluteFilePath()); + + frame_filename = framedir.filePath( + "frame_" + + QString::number(i).rightJustified(padding, '0') + + "_" + + QString::number(time).replace(".", "-") + + "." + suffix); + } + else + { + // write to the specified frame name + frame_filename = frame_names[i]; + createDirectoryForFile(frame_filename); + } parser.read().writeToFile(frame_filename); @@ -1810,7 +1874,14 @@ QStringList MoleculeParser::writeToFile(const QString &filename) const // only return the directory name, as we can handle // reading all the frames contained therein - written_files.append(framedir.absolutePath()); + if (write_to_frame_dir) + { + written_files.append(framedir.absolutePath()); + } + else + { + written_files.append(frame_names); + } } else { @@ -2452,6 +2523,38 @@ QStringList MoleculeParser::write(const System &system, const QString &filename, } } + // Check for a frame_names property in the map, which is used to control the naming of + // specific frames when writing trajectories. + if (map.specified("frame_names")) + { + const auto frame_names_property = map["frame_names"]; + + QStringList frame_names; + + if (frame_names_property.hasSource()) + { + frame_names = frame_names_property.source().split(","); + } + else + { + try + { + frame_names = frame_names_property.value().asA().toString().split(","); + } + catch (...) + { + throw SireError::incompatible_error( + QObject::tr("The 'frame_names' property must be a StringProperty containing " + "a comma-separated list of filenames to use for each frame when " + "writing trajectories."), + CODELOC); + } + } + + // add the special prefix to the first filename + filenames[0] = "frames_names:" + frame_names.join(","); + } + // now we have a list of filenames and associated formats, actually // write the files return ::pvt_write(system, filenames, fileformats, map); diff --git a/corelib/src/libs/SireMM/CMakeLists.txt b/corelib/src/libs/SireMM/CMakeLists.txt index 3b923c3de..5849e3942 100644 --- a/corelib/src/libs/SireMM/CMakeLists.txt +++ b/corelib/src/libs/SireMM/CMakeLists.txt @@ -71,6 +71,7 @@ set ( SIREMM_HEADERS intragroupff.h intraljff.h intrasoftcljff.h + inversebondrestraints.h lj1264parameter.h ljfunction.h ljpair.h @@ -167,6 +168,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/anglerestraints.cpp b/corelib/src/libs/SireMM/anglerestraints.cpp index 5eaf82fc1..a12978fc4 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::setUsesPbc(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +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 b34de4822..bf0f7fc9e 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 setUsesPbc(bool use_pbc); + bool usesPbc() 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..ff63cd678 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; } @@ -424,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) { } @@ -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::setUsesPbc(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +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 ccf534de9..312452a88 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 setUsesPbc(bool use_pbc); + bool usesPbc() 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..25be2ebf6 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); @@ -343,11 +345,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 +365,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 +426,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 +437,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 +499,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 +598,15 @@ BoreschRestraints BoreschRestraints::operator+(const BoreschRestraints &restrain ret += restraints; return *this; } + +/** Set whether or not periodic boundary conditions are to be used */ +void BoreschRestraints::setUsesPbc(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +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 963e9e423..7592daf5f 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 setUsesPbc(bool use_pbc); + bool usesPbc() 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..8ef7b254b 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::setUsesPbc(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +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 f40b03e0c..a2cb22a2d 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 setUsesPbc(bool use_pbc); + bool usesPbc() 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 new file mode 100644 index 000000000..f88acc3fe --- /dev/null +++ b/corelib/src/libs/SireMM/inversebondrestraints.cpp @@ -0,0 +1,704 @@ +/********************************************\ + * + * 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, 2); + + SharedDataStream sds(ds); + + sds << bndrests.r << bndrests.use_pbc + << 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 if (v == 2) + { + SharedDataStream sds(ds); + + sds >> bndrests.r >> bndrests.use_pbc + >> 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), use_pbc(other.use_pbc) +{ +} + +InverseBondRestraints::~InverseBondRestraints() +{ +} + +InverseBondRestraints &InverseBondRestraints::operator=(const InverseBondRestraints &other) +{ + r = other.r; + use_pbc = other.use_pbc; + 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, 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 */ +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; +} + +/** Set whether or not periodic boundary conditions are to be used */ +void InverseBondRestraints::setUsesPbc(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +bool InverseBondRestraints::usesPbc() const +{ + return this->use_pbc; +} diff --git a/corelib/src/libs/SireMM/inversebondrestraints.h b/corelib/src/libs/SireMM/inversebondrestraints.h new file mode 100644 index 000000000..1e47c06e9 --- /dev/null +++ b/corelib/src/libs/SireMM/inversebondrestraints.h @@ -0,0 +1,215 @@ +/********************************************\ + * + * 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_INVERSEBONDRESTRAINTS_H +#define SIREMM_INVERSEBONDRESTRAINTS_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; + + void setUsesPbc(bool use_pbc); + bool usesPbc() const; + + private: + /** The actual list of restraints*/ + QList r; + + /** Whether the restraints use periodic boundary conditions */ + bool use_pbc = false; + }; + +} + +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/corelib/src/libs/SireMM/morsepotentialrestraints.cpp b/corelib/src/libs/SireMM/morsepotentialrestraints.cpp index 78e28d887..1322e08b1 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::setUsesPbc(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +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 49add6127..858b5396f 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 setUsesPbc(bool use_pbc); + bool usesPbc() 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..101ce0f57 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::setUsesPbc(bool use_pbc) +{ + this->use_pbc = use_pbc; +} + +/** Return whether or not periodic boundary conditions are to be used */ +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 abda2d9d7..6aa6f550b 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 setUsesPbc(bool use_pbc); + bool usesPbc() const; + private: /** The actual list of restraints*/ QList r; + + /** Whether the restraints use periodic boundary conditions */ + bool use_pbc = true; }; } diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index a8f80aedf..cd3bf40c6 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -12,7 +12,7 @@ Development was migrated into the `OpenBioSim `__ organisation on `GitHub `__. -`2025.3.0 `__ - December 2025 +`2025.3.0 `__ - November 2025 --------------------------------------------------------------------------------------------- * Reset GCMC water state prior to minimisation following a dynamics crash. @@ -25,9 +25,23 @@ organisation on `GitHub `__. * Add missing dihedrals for all 1-4 atom paths in ``Sire::MM::AmberParams::validateAndFix``, not just the first one found. +* Added :func:`Sire::IO::setCoordinates` function to set atom coordinates of an entire system. + +* Add support for ``openmm.MonteCarloMembraneBarostat`` in Sire-to-OpenMM conversion. + +* Added support for saving crash reports during Sire dynamics runs. + * Fix missing ``Sire::IO::Gro87::getFrame`` implementation to allow creation of trajectory frames from GROMACS coordinate file data. +* Add support for writing trajectory frames to user-defined file names. + +* Add inverse distance restraint to keep atoms apart during OpenMM dyanmics. + +* 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 d53daa436..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 | @@ -199,6 +202,9 @@ Available keys and allowable values are listed below. | space | Space in which the simulation should be conducted, e.g. | | | `sr.vol.Cartesian` | +------------------------------+----------------------------------------------------------+ +| surface_tension | Surface tension for membrane simulations at constant | +| | pressure, e.g. ``0.05*sr.units.bar*sr.units.nanometer`` | ++------------------------------+----------------------------------------------------------+ | swap_end_states | Whether to swap the end states of a perturbable molecule | | | (i.e. treat the perturbed state as the reference state | | | and vice versa). This defaults to False. | diff --git a/doc/source/tutorial/part01/06_trajectories.rst b/doc/source/tutorial/part01/06_trajectories.rst index 88aa7c578..9a89aeb3e 100644 --- a/doc/source/tutorial/part01/06_trajectories.rst +++ b/doc/source/tutorial/part01/06_trajectories.rst @@ -157,5 +157,17 @@ System( name=output num_molecules=1 num_residues=3 num_atoms=22 ) 1000 The individual frame files are named using the frame number plus the time in picoseconds for that frame. +Rather than writing to a frame directory, it is also possible to use specific +names for each frame file by passing a list of filenames to :func:`sire.save`, +e.g.: + +>>> f = sr.save(mols[0].trajectory()[:2], ["cat.pdb", "dog.pdb"]) +>>> print(f) +['cat.pdb', 'dog.pdb'] + +When specifying frame names, the number of names provided must match the +number of frames being saved. In addition, the frames must have a common +file format (e.g. all PDB, or all GRO etc). + :mod:`sire` has extensive support for trajectories. To learn more, check out the :doc:`detailed guide <../../cheatsheet/trajectory>`. 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/_load.py b/src/sire/_load.py index 0943ea9a0..27891d69d 100644 --- a/src/sire/_load.py +++ b/src/sire/_load.py @@ -524,7 +524,7 @@ def save_to_string( def save( molecules, - filename: str, + filename: _Union[str, _List[str]], format: _Union[str, _List[str]] = None, save_velocities: bool = True, show_warnings=True, @@ -552,7 +552,9 @@ def save( filename (str): The name of the file to which to write the file. Extensions will be automatically added if they are needed to match - the formats of the file (or files) that are written. + the formats of the file (or files) that are written. If + 'molecules' is a TrajectoryIterator, then this can also be + list of filenames, one for each frame of the trajectory. format (str or list(str)): The format (or formats) that should be used to write the @@ -628,7 +630,11 @@ def save( if not os.path.exists(directory): os.makedirs(directory) - filename = os.path.join(directory, filename) + if isinstance(filename, str): + filename = os.path.join(directory, filename) + elif isinstance(filename, (list, tuple)): + for i in range(0, len(filename)): + filename[i] = os.path.join(directory, filename[i]) if format is not None: if type(format) is str: @@ -637,6 +643,37 @@ def save( map.set("fileformat", ",".join(format)) if hasattr(molecules, "_is_trajectory_iterator"): + # The user has passed a list of filenames - one for each frame. + if isinstance(filename, (list, tuple)): + # Make sure the number of filenames matches the number of frames. + if len(filename) != molecules.num_frames(): + raise ValueError( + f"When saving a trajectory, if you pass a list of " + f"filenames, there must be one for each frame. " + f"You passed {len(filename)} filenames, but the " + f"trajectory has {molecules.num_frames()} frames." + ) + + # Make sure the filenames have consistent extensions. + exts = set() + for fname in filename: + import os + + exts.add(os.path.splitext(fname)[1]) + if len(exts) != 1: + raise ValueError( + "When saving a trajectory, if you pass a list of " + "filenames, they must all have the same file " + "extension." + ) + + # Set the 'frame_names' property in the map to the list of filenames. + map.set("frame_names", ",".join(filename)) + + # Set the filename to be the first filename in the list. This + # argument is redundant now, but MoleculeParser.save requires it. + filename = filename[0] + # Doing it this way rather that using type(molecules) # as type(molecules) randomly fails, and because # this way is more pythonic diff --git a/src/sire/mm/__init__.py b/src/sire/mm/__init__.py index 1f68451ae..de5dec3ca 100644 --- a/src/sire/mm/__init__.py +++ b/src/sire/mm/__init__.py @@ -9,6 +9,8 @@ "Bond", "BondRestraint", "BondRestraints", + "InverseBondRestraint", + "InverseBondRestraints", "CMAPParameter", "Dihedral", "Improper", @@ -46,6 +48,9 @@ BondRestraint = _MM.BondRestraint BondRestraints = _MM.BondRestraints +InverseBondRestraint = _MM.InverseBondRestraint +InverseBondRestraints = _MM.InverseBondRestraints + BoreschRestraint = _MM.BoreschRestraint BoreschRestraints = _MM.BoreschRestraints diff --git a/src/sire/mol/__init__.py b/src/sire/mol/__init__.py index f3a7ded7d..2f4d09770 100644 --- a/src/sire/mol/__init__.py +++ b/src/sire/mol/__init__.py @@ -1567,6 +1567,7 @@ def _dynamics( ignore_perturbations=None, temperature=None, pressure=None, + surface_tension=None, rest2_scale=None, rest2_selection=None, vacuum=None, @@ -1688,6 +1689,10 @@ def _dynamics( microcanonical (NVE) or canonical (NVT) simulation will be run if the pressure is not set. + surface_tension: surface_tension + The surface tension to use if running a NPT simulation with + a membrane barostat. + rest2_scale: float The scaling factor to apply when running a REST2 simulation (Replica Exchange with Solute Tempering). This defaults to 1.0. @@ -1878,6 +1883,10 @@ def _dynamics( pressure = u(pressure) map.set("pressure", pressure) + if surface_tension is not None: + surface_tension = u(surface_tension) + map.set("surface_tension", surface_tension) + if rest2_scale is not None: map.set("rest2_scale", rest2_scale) diff --git a/src/sire/mol/_dynamics.py b/src/sire/mol/_dynamics.py index b18e186c3..c82bd6465 100644 --- a/src/sire/mol/_dynamics.py +++ b/src/sire/mol/_dynamics.py @@ -972,6 +972,45 @@ def _rebuild_and_minimise(self): self._gcmc_sampler._set_water_state(self._omm_mols) self._gcmc_sampler.pop() + if self._save_crash_report: + import openmm + import numpy as np + from copy import deepcopy + from uuid import uuid4 + + # Create a unique identifier for this crash report. + crash_id = str(uuid4())[:8] + + # Get the current context and system. + context = self._omm_mols + system = deepcopy(context.getSystem()) + + # Add each force to a unique group. + for i, f in enumerate(system.getForces()): + f.setForceGroup(i) + + # Create a new context. + new_context = openmm.Context(system, deepcopy(context.getIntegrator())) + new_context.setPositions(context.getState(getPositions=True).getPositions()) + + # Write the energies for each force group. + with open(f"crash_{crash_id}.log", "w") as f: + f.write(f"Current lambda: {str(self.get_lambda())}\n") + for i, force in enumerate(system.getForces()): + state = new_context.getState(getEnergy=True, groups={i}) + f.write(f"{force.getName()}, {state.getPotentialEnergy()}\n") + + # Save the serialised system. + with open(f"system_{crash_id}.xml", "w") as f: + f.write(openmm.XmlSerializer.serialize(system)) + + # Save the positions. + positions = ( + new_context.getState(getPositions=True).getPositions(asNumpy=True) + / openmm.unit.nanometer + ) + np.savetxt(f"positions_{crash_id}.txt", positions) + self.run_minimisation() def run( @@ -990,6 +1029,7 @@ def run( null_energy: str = None, excess_chemical_potential: float = None, num_waters: int = None, + save_crash_report: bool = False, ): if self.is_null(): return @@ -1009,6 +1049,7 @@ def run( "null_energy": null_energy, "excess_chemical_potential": excess_chemical_potential, "num_waters": num_waters, + "save_crash_report": save_crash_report, } from concurrent.futures import ThreadPoolExecutor @@ -1031,7 +1072,7 @@ def run( if null_energy is not None: null_energy = u(null_energy) else: - null_energy = u("10000 kcal/mol") + null_energy = u("1e6 kcal/mol") if num_energy_neighbours is not None: try: @@ -1048,6 +1089,13 @@ def run( except: raise ValueError("'num_waters' must be an integer") + if save_crash_report is not None: + if not isinstance(save_crash_report, bool): + raise ValueError("'save_crash_report' must be True or False") + self._save_crash_report = save_crash_report + else: + self._save_crash_report = False + try: steps_to_run = int(time.to(picosecond) / self.timestep().to(picosecond)) except Exception: @@ -1649,6 +1697,7 @@ def run( null_energy: str = None, excess_chemical_potential: str = None, num_waters: int = None, + save_crash_report: bool = False, ): """ Perform dynamics on the molecules. @@ -1722,6 +1771,14 @@ def run( Whether to save the energy on exit, regardless of whether the energy frequency has been reached. + save_crash_report: bool + Whether to save a crash report if the dynamics fails due to an + instability. This will save a named log file containing the energy + for each force, an XML file containing the OpenMM system at the + start of the dynamics block, and a NumPy text file containing + the atomic positions at the start of the dynamics block. This + option is only used when auto_fix_minimise is True. + auto_fix_minimise: bool Whether or not to automatically run minimisation if the trajectory exits with an error in the first few steps. @@ -1768,6 +1825,14 @@ def run( else: save_velocities = False + if save_crash_report is None: + if self._d._map.specified("save_crash_report"): + save_crash_report = ( + self._d._map["save_crash_report"].value().as_bool() + ) + else: + save_crash_report = False + self._d.run( time=time, save_frequency=save_frequency, @@ -1778,6 +1843,7 @@ def run( save_velocities=save_velocities, save_frame_on_exit=save_frame_on_exit, save_energy_on_exit=save_energy_on_exit, + save_crash_report=save_crash_report, auto_fix_minimise=auto_fix_minimise, num_energy_neighbours=num_energy_neighbours, null_energy=null_energy, diff --git a/src/sire/restraints/__init__.py b/src/sire/restraints/__init__.py index 7322319cb..834f33080 100644 --- a/src/sire/restraints/__init__.py +++ b/src/sire/restraints/__init__.py @@ -1,12 +1,14 @@ __all__ = [ "angle", "positional", - "rmsd", "bond", "dihedral", "distance", - "morse_potential", "boresch", + "inverse_bond", + "inverse_distance", + "rmsd", + "morse_potential", "get_standard_state_correction", ] @@ -16,6 +18,8 @@ boresch, dihedral, distance, + inverse_bond, + inverse_distance, positional, morse_potential, rmsd, diff --git a/src/sire/restraints/_restraints.py b/src/sire/restraints/_restraints.py index b20f5f782..cc443facc 100644 --- a/src/sire/restraints/_restraints.py +++ b/src/sire/restraints/_restraints.py @@ -4,6 +4,8 @@ "bond", "dihedral", "distance", + "inverse_bond", + "inverse_distance", "morse_potential", "positional", "rmsd", @@ -22,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 @@ -52,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 @@ -67,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: @@ -109,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.set_uses_pbc(use_pbc) + return restraints @@ -122,6 +139,7 @@ def boresch( r0=None, theta0=None, phi0=None, + use_pbc=None, name=None, map=None, temperature=u("298 K"), @@ -196,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. @@ -250,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) @@ -267,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") @@ -413,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")): @@ -471,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 @@ -501,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 @@ -516,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) @@ -526,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: @@ -558,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.set_uses_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 @@ -598,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") @@ -662,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.set_uses_pbc(use_pbc) + return restraints @@ -672,6 +730,7 @@ def morse_potential( r0=None, k=None, de=None, + use_pbc=None, name=None, auto_parametrise=False, map=None, @@ -719,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. @@ -749,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( @@ -898,18 +967,146 @@ def morse_potential( restraints.add(MorsePotentialRestraint(idxs0[0], idxs1[0], ik, ir0, de)) + # Set the use_pbc flag. + restraints.set_uses_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 positional(mols, atoms, k=None, r0=None, position=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 + 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)] + + 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) + + 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)) + + # Set the use_pbc flag. + restraints.set_uses_pbc(use_pbc) + + return restraints + + +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, use_pbc=use_pbc, **kwargs) + + +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 @@ -950,6 +1147,12 @@ 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'") + else: + use_pbc = True + atoms = _to_atoms(mols, atoms) mols = mols.atoms() @@ -999,6 +1202,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.set_uses_pbc(use_pbc) + return restraints diff --git a/tests/biosimspace/test_set_coordinates.py b/tests/biosimspace/test_set_coordinates.py new file mode 100644 index 000000000..2a0adba47 --- /dev/null +++ b/tests/biosimspace/test_set_coordinates.py @@ -0,0 +1,84 @@ +import sire as sr +import numpy as np + + +def test_set_coordinates(ala_mols): + + # Clone the input molecules. + mols = ala_mols.clone() + + # Store the existing coordinates as a NumPy array. + coords = sr.io.get_coords_array(mols) + + # Modify the system to multiply all coordinates by 2. + new_mols = sr.legacy.IO.setCoordinates(mols._system, (coords * 2.0).tolist()) + + # Get the new coordinates as a NumPy array. + new_coords = sr.io.get_coords_array(new_mols) + + # Make sure the new coordinates are as expected. + assert ( + np.sum(np.round(new_coords / coords)) == 6.0 * mols.num_atoms() + ), "Coordinates were not set correctly." + + +def test_set_coordinates_perturbable(merged_ethane_methanol): + + # Clone the input molecules. + mols = merged_ethane_methanol.clone() + + # First link to the reference state. + mols = sr.morph.link_to_reference(mols) + + # Store the existing coordinates as a NumPy array. + coords = sr.io.get_coords_array(mols) + + # Modify the system to multiply all coordinates by 2. + new_mols = sr.legacy.IO.setCoordinates(mols._system, (coords * 2.0).tolist()) + + # Link to the reference state. + new_mols = sr.system.System(new_mols) + new_mols = sr.morph.link_to_reference(new_mols) + + # Get the new coordinates as a NumPy array. + new_coords = sr.io.get_coords_array(new_mols) + + # Divide the new coordinates by the old coordinates. + ratio = new_coords / coords + + # Set any NaN values to 2.0 (in case of zero coordinates). + ratio = np.where(np.isnan(ratio), 2.0, ratio) + + # Make sure the new coordinates are as expected. + assert ( + np.sum(np.round(ratio)) == 6.0 * mols.num_atoms() + ), "Coordinates were not set correctly." + + # Now link to the perturbable state. + mols = sr.morph.link_to_perturbed(mols) + + # Store the existing coordinates as a NumPy array. + coords = sr.io.get_coords_array(mols) + + # Modify the system to multiply all coordinates by 2. + new_mols = sr.legacy.IO.setCoordinates( + mols._system, (coords * 2.0).tolist(), is_lambda1=True + ) + + # Link to the perturbable state. + new_mols = sr.system.System(new_mols) + new_mols = sr.morph.link_to_perturbed(new_mols) + + # Get the new coordinates as a NumPy array. + new_coords = sr.io.get_coords_array(new_mols) + + # Divide the new coordinates by the old coordinates. + ratio = new_coords / coords + + # Set any NaN values to 2.0 (in case of zero coordinates). + ratio = np.where(np.isnan(ratio), 2.0, ratio) + + # Make sure the new coordinates are as expected. + assert ( + np.sum(np.round(ratio)) == 6.0 * mols.num_atoms() + ), "Coordinates were not set correctly." diff --git a/tests/convert/test_openmm.py b/tests/convert/test_openmm.py index 4a6b58d69..d2efb7c15 100644 --- a/tests/convert/test_openmm.py +++ b/tests/convert/test_openmm.py @@ -447,3 +447,45 @@ def test_openmm_default_box_vectors(ala_mols, openmm_platform): # Check that the box vectors match the expected values. for i, vec in enumerate(box_vectors): assert vec[i].value_in_unit(angstrom) == pytest.approx(box[i].value(), abs=1e-3) + + +@pytest.mark.skipif( + "openmm" not in sr.convert.supported_formats(), + reason="openmm support is not available", +) +def test_openmm_membrane_barostat(ala_mols, openmm_platform): + from openmm import MonteCarloMembraneBarostat + from openmm import unit + + mols = ala_mols.clone() + + # Create a dynamics object with a membrane barostat. + d = mols.dynamics( + pressure="1atm", + temperature="298K", + surface_tension="1 angstrom*atm", + platform=openmm_platform, + barostat_frequency=50, + ) + + # Find the barostat. + barostat = None + for force in d.context().getSystem().getForces(): + if force.getName() == "MonteCarloMembraneBarostat": + barostat = force + break + assert barostat is not None + + # Check the barostat parameters. + assert barostat.getDefaultPressure().value_in_unit( + unit.atmosphere + ) == pytest.approx(1.0, abs=1e-3) + assert barostat.getDefaultSurfaceTension().value_in_unit( + unit.angstrom * unit.atmosphere + ) == pytest.approx(1.0, abs=1e-3) + assert barostat.getDefaultTemperature().value_in_unit(unit.kelvin) == pytest.approx( + 298.0, abs=1e-3 + ) + assert barostat.getXYMode() == MonteCarloMembraneBarostat.XYIsotropic + assert barostat.getZMode() == MonteCarloMembraneBarostat.ZFree + assert barostat.getFrequency() == 50 diff --git a/tests/convert/test_openmm_restraints.py b/tests/convert/test_openmm_restraints.py index c7dcd8bf7..f8bcd1aeb 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 @@ -247,3 +248,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.uses_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.uses_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/tests/io/test_trajectories.py b/tests/io/test_trajectories.py index 558e3652d..64d5b7983 100644 --- a/tests/io/test_trajectories.py +++ b/tests/io/test_trajectories.py @@ -128,3 +128,32 @@ def test_trajectories(tmpdir, ala_traj): assert_space_equal(m.property("space"), m2.property("space"), precision) assert_coords_equal(m[0], m2[0], precision) + + +def test_frame_names(tmpdir, ala_traj): + mols = ala_traj.clone() + + d = tmpdir.mkdir("test_frame_names") + + # First, write two trajectory frames to named Gro87 files. + sr.save(mols.trajectory()[0:2], [d.join("cat.gro"), d.join("dog.gro")]) + + # Make sure the output files exist. + cat_path = d.join("cat.gro") + dog_path = d.join("dog.gro") + assert cat_path.check() + assert dog_path.check() + + # Try writing to mixed formats. This should raise a ValueError. + with pytest.raises(ValueError): + sr.save( + mols.trajectory()[0:2], + [d.join("cat.gro"), d.join("dog.rst7")], + ) + + # Try writing with mismatched number of frames and filenames. + with pytest.raises(ValueError): + sr.save( + mols.trajectory()[0:3], + [d.join("cat.gro"), d.join("dog.gro")], + ) diff --git a/tests/mol/test_dynamics.py b/tests/mol/test_dynamics.py index 7b86fad4a..9d6c43b48 100644 --- a/tests/mol/test_dynamics.py +++ b/tests/mol/test_dynamics.py @@ -81,7 +81,7 @@ def test_cutoff_options(ala_mols): "openmm" not in sr.convert.supported_formats(), reason="openmm support is not available", ) -def test_sample_frequency(ala_mols): +def test_sample_frequency(ala_mols, openmm_platform): """ Test that energies and frames are saved at the correct frequency. """ @@ -92,7 +92,7 @@ def test_sample_frequency(ala_mols): mols = ala_mols - d = mols.dynamics(platform="Reference", timestep="1 fs") + d = mols.dynamics(platform=openmm_platform, timestep="1 fs") # Create a list of lambda windows. lambdas = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0] @@ -145,3 +145,54 @@ def test_sample_frequency(ala_mols): # Check that the trajectory has 10 frames. assert new_mols.num_frames() == 10 + + +@pytest.mark.skipif( + "openmm" not in sr.convert.supported_formats(), + reason="openmm support is not available", +) +def test_crash_report(merged_ethane_methanol, openmm_platform): + """ + Test that energies and frames are saved at the correct frequency. + """ + + import os + import glob + import tempfile + from sire.base import ProgressBar + + ProgressBar.set_silent() + + mols = merged_ethane_methanol.clone() + mols = sr.morph.link_to_reference(mols) + + d = mols.dynamics(platform=openmm_platform) + + # Run a short simulation within a temporary directory. + tmpdir = tempfile.TemporaryDirectory() + + # Save the current directory. + old_dir = os.getcwd() + + try: + # Change to the temporary directory. + os.chdir(tmpdir.name) + + # Run a short simulation, forcing a crash. + d.run("1ps", save_crash_report=True) + + # Glob for the crash report files. + crash_log = glob.glob("crash_*.log") + crash_system = glob.glob("system_*.xml") + crash_positions = glob.glob("positions_*.txt") + + # Make sure we have one of each file. + assert len(crash_log) == 1 + assert len(crash_system) == 1 + assert len(crash_positions) == 1 + except: + # Ingore exceptions raised during the dynamics run. + pass + finally: + # Change back to the old directory. + os.chdir(old_dir) diff --git a/version.txt b/version.txt index 3e34ca22d..56488616f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2025.2.0 +2025.3.0 diff --git a/wrapper/Convert/SireOpenMM/_sommcontext.py b/wrapper/Convert/SireOpenMM/_sommcontext.py index 15fcba546..8d990cc46 100644 --- a/wrapper/Convert/SireOpenMM/_sommcontext.py +++ b/wrapper/Convert/SireOpenMM/_sommcontext.py @@ -309,6 +309,12 @@ def set_pressure(self, pressure): """ raise NotImplementedError("We can't yet set the pressure") + def set_surface_tension(self, surface_tension): + """ + Set the target surface tension for the dynamics. + """ + raise NotImplementedError("We can't yet set the surface tension") + def get_potential_energy(self, to_sire_units: bool = True): """ Calculate and return the potential energy of the system diff --git a/wrapper/Convert/SireOpenMM/lambdalever.cpp b/wrapper/Convert/SireOpenMM/lambdalever.cpp index 4eea6f279..8651e2951 100644 --- a/wrapper/Convert/SireOpenMM/lambdalever.cpp +++ b/wrapper/Convert/SireOpenMM/lambdalever.cpp @@ -2088,9 +2088,9 @@ void _update_restraint_in_context(OpenMM::CustomCVForce *ff, double rho, // First global param corresponds to rho. double current_rho = context.getParameter(rho_name); if (current_rho == rho) - return; + return; - // Update the value of rho + // Update the value of rho context.setParameter(rho_name, rho); ff->updateParametersInContext(context); @@ -2104,7 +2104,10 @@ 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" or ff_type == "MorsePotentialRestraintForce") + if (ff_type == "BondRestraintForce" or + ff_type == "PositionalRestraintForce" or + ff_type == "MorsePotentialRestraintForce" 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 85d79657f..23c75b7f2 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/morsepotentialrestraints.h" @@ -133,7 +134,7 @@ void _add_boresch_restraints(const SireMM::BoreschRestraints &restraints, restraintff->addPerBondParameter("kphi_C"); restraintff->addPerBondParameter("phi0_C"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -220,7 +221,7 @@ void _add_bond_restraints(const SireMM::BondRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("r0"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -259,6 +260,74 @@ 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 (restraints.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,(r0 - r)))") + .toStdString(); + + auto *restraintff = new OpenMM::CustomBondForce(energy_expression); + restraintff->setName("InverseBondRestraintForce"); + + restraintff->addPerBondParameter("rho"); + restraintff->addPerBondParameter("k"); + restraintff->addPerBondParameter("r0"); + + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); + + 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 morse potential restraints from 'restraints' to the passed * system, which is acted on by the passed LambdaLever. */ @@ -296,7 +365,7 @@ void _add_morse_potential_restraints(const SireMM::MorsePotentialRestraints &res restraintff->addPerBondParameter("r0"); restraintff->addPerBondParameter("de"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -370,7 +439,7 @@ void _add_positional_restraints(const SireMM::PositionalRestraints &restraints, restraintff->addPerBondParameter("k"); restraintff->addPerBondParameter("rb"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -600,7 +669,7 @@ void _add_angle_restraints(const SireMM::AngleRestraints &restraints, restraintff->addPerAngleParameter("k"); restraintff->addPerAngleParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -663,7 +732,7 @@ void _add_dihedral_restraints(const SireMM::DihedralRestraints &restraints, restraintff->addPerTorsionParameter("k"); restraintff->addPerTorsionParameter("theta0"); - restraintff->setUsesPeriodicBoundaryConditions(true); + restraintff->setUsesPeriodicBoundaryConditions(restraints.usesPbc()); lambda_lever.addRestraintIndex(restraints.name(), system.addForce(restraintff)); @@ -2057,6 +2126,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_inverse_bond_restraints(prop.read().asA(), + system, lambda_lever, start_index); + } else if (prop.read().isA()) { _add_boresch_restraints(prop.read().asA(), @@ -2064,6 +2138,31 @@ OpenMMMetaData SireOpenMM::sire_to_openmm_system(OpenMM::System &system, } } } + 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); + } + } + } /// /// Stage 8 - Copy across the coordinates and velocities diff --git a/wrapper/Convert/__init__.py b/wrapper/Convert/__init__.py index a481b4b86..a68325e20 100644 --- a/wrapper/Convert/__init__.py +++ b/wrapper/Convert/__init__.py @@ -223,6 +223,12 @@ def sire_to_openmm(mols, map): friction = friction.to(1.0 / picosecond) / openmm.unit.picosecond + if map.specified("surface_tension"): + surface_tension = map["surface_tension"].value() + surface_tension = surface_tension.to("bar * nanometer") + else: + surface_tension = None + use_andersen = False temperature = None @@ -354,7 +360,19 @@ def sire_to_openmm(mols, map): pressure = ensemble.pressure().to(atm) * openmm.unit.atmosphere - barostat = openmm.MonteCarloBarostat(pressure, temperature, barostat_freq) + if surface_tension is not None: + barostat = openmm.MonteCarloMembraneBarostat( + pressure, + surface_tension, + temperature, + openmm.MonteCarloMembraneBarostat.XYIsotropic, + openmm.MonteCarloMembraneBarostat.ZFree, + barostat_freq, + ) + else: + barostat = openmm.MonteCarloBarostat( + pressure, temperature, barostat_freq + ) system.addForce(barostat) @@ -453,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 diff --git a/wrapper/IO/Amber.pypp.cpp b/wrapper/IO/Amber.pypp.cpp index d321929b6..4cfc341ab 100644 --- a/wrapper/IO/Amber.pypp.cpp +++ b/wrapper/IO/Amber.pypp.cpp @@ -87,6 +87,8 @@ namespace bp = boost::python; SireIO::Amber __copy__(const SireIO::Amber &other){ return SireIO::Amber(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" const char* pvt_get_name(const SireIO::Amber&){ return "SireIO::Amber";} @@ -197,13 +199,13 @@ void register_Amber_class(){ "writeCrd" , writeCrd_function_value , ( bp::arg("mols"), bp::arg("space"), bp::arg("crdfile"), bp::arg("map")=SireBase::PropertyMap() ) - , "" ); + , "Write the coordinates of the molecules in the passed MoleculeGroup in the\npassed Space to an Amber7,\nformat coordinaterestart file. The passed property map is used to find\nthe required properties" ); } Amber_exposer.staticmethod( "typeName" ); - Amber_exposer.def( "__copy__", &__copy__); - Amber_exposer.def( "__deepcopy__", &__copy__); - Amber_exposer.def( "clone", &__copy__); + Amber_exposer.def( "__copy__", &__copy__); + Amber_exposer.def( "__deepcopy__", &__copy__); + Amber_exposer.def( "clone", &__copy__); Amber_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::Amber >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); Amber_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::Amber >, diff --git a/wrapper/IO/AmberPrm.pypp.cpp b/wrapper/IO/AmberPrm.pypp.cpp index e18672e68..d3ba24c8c 100644 --- a/wrapper/IO/AmberPrm.pypp.cpp +++ b/wrapper/IO/AmberPrm.pypp.cpp @@ -11,6 +11,10 @@ namespace bp = boost::python; #include "SireBase/parallel.h" +#include "SireBase/progressbar.h" + +#include "SireBase/propertylist.h" + #include "SireBase/stringproperty.h" #include "SireBase/tempdir.h" @@ -37,6 +41,8 @@ namespace bp = boost::python; #include "SireMM/internalff.h" +#include "SireMM/lj1264parameter.h" + #include "SireMM/ljparameter.h" #include "SireMaths/maths.h" @@ -125,6 +131,8 @@ namespace bp = boost::python; SireIO::AmberPrm __copy__(const SireIO::AmberPrm &other){ return SireIO::AmberPrm(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -142,6 +150,7 @@ void register_AmberPrm_class(){ .value("INTEGER", SireIO::AmberPrm::INTEGER) .value("FLOAT", SireIO::AmberPrm::FLOAT) .value("STRING", SireIO::AmberPrm::STRING) + .value("FFLOAT", SireIO::AmberPrm::FFLOAT) .export_values() ; AmberPrm_exposer.def( bp::init< QString const &, bp::optional< SireBase::PropertyMap const & > >(( bp::arg("filename"), bp::arg("map")=SireBase::PropertyMap() ), "Construct by reading from the file called filename") ); @@ -603,6 +612,18 @@ void register_AmberPrm_class(){ , bp::release_gil_policy() , "" ); + } + { //::SireIO::AmberPrm::warnings + + typedef ::QStringList ( ::SireIO::AmberPrm::*warnings_function_type)( ) const; + warnings_function_type warnings_function_value( &::SireIO::AmberPrm::warnings ); + + AmberPrm_exposer.def( + "warnings" + , warnings_function_value + , bp::release_gil_policy() + , "" ); + } { //::SireIO::AmberPrm::what @@ -618,9 +639,9 @@ void register_AmberPrm_class(){ } AmberPrm_exposer.staticmethod( "parse" ); AmberPrm_exposer.staticmethod( "typeName" ); - AmberPrm_exposer.def( "__copy__", &__copy__); - AmberPrm_exposer.def( "__deepcopy__", &__copy__); - AmberPrm_exposer.def( "clone", &__copy__); + AmberPrm_exposer.def( "__copy__", &__copy__); + AmberPrm_exposer.def( "__deepcopy__", &__copy__); + AmberPrm_exposer.def( "clone", &__copy__); AmberPrm_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::AmberPrm >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); AmberPrm_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::AmberPrm >, diff --git a/wrapper/IO/AmberRst.pypp.cpp b/wrapper/IO/AmberRst.pypp.cpp index 70b9cdf5b..30fb1f37e 100644 --- a/wrapper/IO/AmberRst.pypp.cpp +++ b/wrapper/IO/AmberRst.pypp.cpp @@ -69,6 +69,8 @@ namespace bp = boost::python; SireIO::AmberRst __copy__(const SireIO::AmberRst &other){ return SireIO::AmberRst(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -338,9 +340,9 @@ void register_AmberRst_class(){ } AmberRst_exposer.staticmethod( "parse" ); AmberRst_exposer.staticmethod( "typeName" ); - AmberRst_exposer.def( "__copy__", &__copy__); - AmberRst_exposer.def( "__deepcopy__", &__copy__); - AmberRst_exposer.def( "clone", &__copy__); + AmberRst_exposer.def( "__copy__", &__copy__); + AmberRst_exposer.def( "__deepcopy__", &__copy__); + AmberRst_exposer.def( "clone", &__copy__); AmberRst_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::AmberRst >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); AmberRst_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::AmberRst >, diff --git a/wrapper/IO/AmberRst7.pypp.cpp b/wrapper/IO/AmberRst7.pypp.cpp index 28ebd62a3..85e6a1619 100644 --- a/wrapper/IO/AmberRst7.pypp.cpp +++ b/wrapper/IO/AmberRst7.pypp.cpp @@ -55,6 +55,8 @@ namespace bp = boost::python; SireIO::AmberRst7 __copy__(const SireIO::AmberRst7 &other){ return SireIO::AmberRst7(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -345,9 +347,9 @@ void register_AmberRst7_class(){ } AmberRst7_exposer.staticmethod( "parse" ); AmberRst7_exposer.staticmethod( "typeName" ); - AmberRst7_exposer.def( "__copy__", &__copy__); - AmberRst7_exposer.def( "__deepcopy__", &__copy__); - AmberRst7_exposer.def( "clone", &__copy__); + AmberRst7_exposer.def( "__copy__", &__copy__); + AmberRst7_exposer.def( "__deepcopy__", &__copy__); + AmberRst7_exposer.def( "clone", &__copy__); AmberRst7_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::AmberRst7 >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); AmberRst7_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::AmberRst7 >, diff --git a/wrapper/IO/AmberTraj.pypp.cpp b/wrapper/IO/AmberTraj.pypp.cpp index 123670eff..18a058145 100644 --- a/wrapper/IO/AmberTraj.pypp.cpp +++ b/wrapper/IO/AmberTraj.pypp.cpp @@ -67,6 +67,8 @@ namespace bp = boost::python; SireIO::AmberTraj __copy__(const SireIO::AmberTraj &other){ return SireIO::AmberTraj(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -322,9 +324,9 @@ void register_AmberTraj_class(){ } AmberTraj_exposer.staticmethod( "parse" ); AmberTraj_exposer.staticmethod( "typeName" ); - AmberTraj_exposer.def( "__copy__", &__copy__); - AmberTraj_exposer.def( "__deepcopy__", &__copy__); - AmberTraj_exposer.def( "clone", &__copy__); + AmberTraj_exposer.def( "__copy__", &__copy__); + AmberTraj_exposer.def( "__deepcopy__", &__copy__); + AmberTraj_exposer.def( "clone", &__copy__); AmberTraj_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::AmberTraj >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); AmberTraj_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::AmberTraj >, diff --git a/wrapper/IO/BrokenParser.pypp.cpp b/wrapper/IO/BrokenParser.pypp.cpp index 6ec0406a4..fa14b0f03 100644 --- a/wrapper/IO/BrokenParser.pypp.cpp +++ b/wrapper/IO/BrokenParser.pypp.cpp @@ -79,6 +79,8 @@ namespace bp = boost::python; SireIO::BrokenParser __copy__(const SireIO::BrokenParser &other){ return SireIO::BrokenParser(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -260,9 +262,9 @@ void register_BrokenParser_class(){ } BrokenParser_exposer.staticmethod( "typeName" ); - BrokenParser_exposer.def( "__copy__", &__copy__); - BrokenParser_exposer.def( "__deepcopy__", &__copy__); - BrokenParser_exposer.def( "clone", &__copy__); + BrokenParser_exposer.def( "__copy__", &__copy__); + BrokenParser_exposer.def( "__deepcopy__", &__copy__); + BrokenParser_exposer.def( "clone", &__copy__); BrokenParser_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::BrokenParser >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); BrokenParser_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::BrokenParser >, diff --git a/wrapper/IO/CMakeAutogenFile.txt b/wrapper/IO/CMakeAutogenFile.txt index 4695ffe6b..b5ccdb7dc 100644 --- a/wrapper/IO/CMakeAutogenFile.txt +++ b/wrapper/IO/CMakeAutogenFile.txt @@ -1,45 +1,45 @@ # WARNING - AUTOGENERATED FILE - CONTENTS WILL BE OVERWRITTEN! set ( PYPP_SOURCES - PerturbationsTemplate.pypp.cpp - ProtoMSParameters.pypp.cpp - AmberPrm.pypp.cpp - PDB2.pypp.cpp - SDF.pypp.cpp - TinkerParameters.pypp.cpp - CharmmPSF.pypp.cpp Gro87.pypp.cpp + TRR.pypp.cpp + ZmatrixMaker.pypp.cpp + GroMolType.pypp.cpp + GroAtom.pypp.cpp + NullIO.pypp.cpp + MoleculeParser.pypp.cpp + Tinker.pypp.cpp + CharmmPSF.pypp.cpp + PDBParameters.pypp.cpp + IOParametersBase.pypp.cpp + SDF.pypp.cpp + BrokenParser.pypp.cpp + XTC.pypp.cpp + Cube.pypp.cpp + GroSystem.pypp.cpp + NullParser.pypp.cpp + AmberPrm.pypp.cpp + PerturbationsTemplate.pypp.cpp _IO_free_functions.pypp.cpp - PDB.pypp.cpp - IOBase.pypp.cpp + PDB2.pypp.cpp PDBx.pypp.cpp + AmberRst7.pypp.cpp + IOBase.pypp.cpp + Supplementary.pypp.cpp + TinkerParameters.pypp.cpp FlexibilityTemplate.pypp.cpp - GroSystem.pypp.cpp DCD.pypp.cpp - AmberRst.pypp.cpp - PDBParameters.pypp.cpp + FileTrajectoryParser.pypp.cpp + PerturbationsLibrary.pypp.cpp + AmberTraj.pypp.cpp + ProtoMSParameters.pypp.cpp + PDB.pypp.cpp GroTop.pypp.cpp - ZmatrixMaker.pypp.cpp - NullIO.pypp.cpp - NullParser.pypp.cpp - TRR.pypp.cpp - Supplementary.pypp.cpp - IOParametersBase.pypp.cpp Amber.pypp.cpp - GroMolType.pypp.cpp - Tinker.pypp.cpp - GroAtom.pypp.cpp - AmberRst7.pypp.cpp TrajectoryMonitor.pypp.cpp - PerturbationsLibrary.pypp.cpp - Cube.pypp.cpp - Mol2.pypp.cpp - FileTrajectoryParser.pypp.cpp - MoleculeParser.pypp.cpp + AmberRst.pypp.cpp ProtoMS.pypp.cpp + Mol2.pypp.cpp FlexibilityLibrary.pypp.cpp - AmberTraj.pypp.cpp - BrokenParser.pypp.cpp - XTC.pypp.cpp SireIO_containers.cpp SireIO_properties.cpp SireIO_registrars.cpp diff --git a/wrapper/IO/CharmmPSF.pypp.cpp b/wrapper/IO/CharmmPSF.pypp.cpp index 99a1be45d..c41747441 100644 --- a/wrapper/IO/CharmmPSF.pypp.cpp +++ b/wrapper/IO/CharmmPSF.pypp.cpp @@ -73,6 +73,8 @@ namespace bp = boost::python; SireIO::CharmmPSF __copy__(const SireIO::CharmmPSF &other){ return SireIO::CharmmPSF(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -452,9 +454,9 @@ void register_CharmmPSF_class(){ } CharmmPSF_exposer.staticmethod( "typeName" ); - CharmmPSF_exposer.def( "__copy__", &__copy__); - CharmmPSF_exposer.def( "__deepcopy__", &__copy__); - CharmmPSF_exposer.def( "clone", &__copy__); + CharmmPSF_exposer.def( "__copy__", &__copy__); + CharmmPSF_exposer.def( "__deepcopy__", &__copy__); + CharmmPSF_exposer.def( "clone", &__copy__); CharmmPSF_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::CharmmPSF >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); CharmmPSF_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::CharmmPSF >, diff --git a/wrapper/IO/Cube.pypp.cpp b/wrapper/IO/Cube.pypp.cpp index 172377b01..1129c1ebe 100644 --- a/wrapper/IO/Cube.pypp.cpp +++ b/wrapper/IO/Cube.pypp.cpp @@ -31,6 +31,8 @@ namespace bp = boost::python; SireIO::Cube __copy__(const SireIO::Cube &other){ return SireIO::Cube(other); } +#include "Helpers/copy.hpp" + const char* pvt_get_name(const SireIO::Cube&){ return "SireIO::Cube";} #include "Helpers/release_gil_policy.hpp" @@ -94,9 +96,9 @@ void register_Cube_class(){ , "" ); } - Cube_exposer.def( "__copy__", &__copy__); - Cube_exposer.def( "__deepcopy__", &__copy__); - Cube_exposer.def( "clone", &__copy__); + Cube_exposer.def( "__copy__", &__copy__); + Cube_exposer.def( "__deepcopy__", &__copy__); + Cube_exposer.def( "clone", &__copy__); Cube_exposer.def( "__str__", &pvt_get_name); Cube_exposer.def( "__repr__", &pvt_get_name); } diff --git a/wrapper/IO/DCD.pypp.cpp b/wrapper/IO/DCD.pypp.cpp index 3c6c65ef5..6b0326cb2 100644 --- a/wrapper/IO/DCD.pypp.cpp +++ b/wrapper/IO/DCD.pypp.cpp @@ -83,6 +83,8 @@ namespace bp = boost::python; SireIO::DCD __copy__(const SireIO::DCD &other){ return SireIO::DCD(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -352,9 +354,9 @@ void register_DCD_class(){ } DCD_exposer.staticmethod( "parse" ); DCD_exposer.staticmethod( "typeName" ); - DCD_exposer.def( "__copy__", &__copy__); - DCD_exposer.def( "__deepcopy__", &__copy__); - DCD_exposer.def( "clone", &__copy__); + DCD_exposer.def( "__copy__", &__copy__); + DCD_exposer.def( "__deepcopy__", &__copy__); + DCD_exposer.def( "clone", &__copy__); DCD_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::DCD >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); DCD_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::DCD >, diff --git a/wrapper/IO/FileTrajectoryParser.pypp.cpp b/wrapper/IO/FileTrajectoryParser.pypp.cpp index 1084fbcb8..c5b550aa3 100644 --- a/wrapper/IO/FileTrajectoryParser.pypp.cpp +++ b/wrapper/IO/FileTrajectoryParser.pypp.cpp @@ -65,6 +65,8 @@ namespace bp = boost::python; SireIO::FileTrajectoryParser __copy__(const SireIO::FileTrajectoryParser &other){ return SireIO::FileTrajectoryParser(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -320,9 +322,9 @@ void register_FileTrajectoryParser_class(){ } FileTrajectoryParser_exposer.staticmethod( "parse" ); FileTrajectoryParser_exposer.staticmethod( "typeName" ); - FileTrajectoryParser_exposer.def( "__copy__", &__copy__); - FileTrajectoryParser_exposer.def( "__deepcopy__", &__copy__); - FileTrajectoryParser_exposer.def( "clone", &__copy__); + FileTrajectoryParser_exposer.def( "__copy__", &__copy__); + FileTrajectoryParser_exposer.def( "__deepcopy__", &__copy__); + FileTrajectoryParser_exposer.def( "clone", &__copy__); FileTrajectoryParser_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::FileTrajectoryParser >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); FileTrajectoryParser_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::FileTrajectoryParser >, diff --git a/wrapper/IO/FlexibilityLibrary.pypp.cpp b/wrapper/IO/FlexibilityLibrary.pypp.cpp index 80c95c87f..f2ff6fca8 100644 --- a/wrapper/IO/FlexibilityLibrary.pypp.cpp +++ b/wrapper/IO/FlexibilityLibrary.pypp.cpp @@ -49,6 +49,8 @@ namespace bp = boost::python; SireIO::FlexibilityLibrary __copy__(const SireIO::FlexibilityLibrary &other){ return SireIO::FlexibilityLibrary(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -157,9 +159,9 @@ void register_FlexibilityLibrary_class(){ } FlexibilityLibrary_exposer.staticmethod( "typeName" ); - FlexibilityLibrary_exposer.def( "__copy__", &__copy__); - FlexibilityLibrary_exposer.def( "__deepcopy__", &__copy__); - FlexibilityLibrary_exposer.def( "clone", &__copy__); + FlexibilityLibrary_exposer.def( "__copy__", &__copy__); + FlexibilityLibrary_exposer.def( "__deepcopy__", &__copy__); + FlexibilityLibrary_exposer.def( "clone", &__copy__); FlexibilityLibrary_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::FlexibilityLibrary >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); FlexibilityLibrary_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::FlexibilityLibrary >, diff --git a/wrapper/IO/FlexibilityTemplate.pypp.cpp b/wrapper/IO/FlexibilityTemplate.pypp.cpp index 5246be7cc..0b6751379 100644 --- a/wrapper/IO/FlexibilityTemplate.pypp.cpp +++ b/wrapper/IO/FlexibilityTemplate.pypp.cpp @@ -49,6 +49,8 @@ namespace bp = boost::python; SireIO::FlexibilityTemplate __copy__(const SireIO::FlexibilityTemplate &other){ return SireIO::FlexibilityTemplate(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" const char* pvt_get_name(const SireIO::FlexibilityTemplate&){ return "SireIO::FlexibilityTemplate";} @@ -342,9 +344,9 @@ void register_FlexibilityTemplate_class(){ } FlexibilityTemplate_exposer.staticmethod( "typeName" ); - FlexibilityTemplate_exposer.def( "__copy__", &__copy__); - FlexibilityTemplate_exposer.def( "__deepcopy__", &__copy__); - FlexibilityTemplate_exposer.def( "clone", &__copy__); + FlexibilityTemplate_exposer.def( "__copy__", &__copy__); + FlexibilityTemplate_exposer.def( "__deepcopy__", &__copy__); + FlexibilityTemplate_exposer.def( "clone", &__copy__); FlexibilityTemplate_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::FlexibilityTemplate >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); FlexibilityTemplate_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::FlexibilityTemplate >, diff --git a/wrapper/IO/Gro87.pypp.cpp b/wrapper/IO/Gro87.pypp.cpp index d749f44e4..444c30e7d 100644 --- a/wrapper/IO/Gro87.pypp.cpp +++ b/wrapper/IO/Gro87.pypp.cpp @@ -69,6 +69,8 @@ namespace bp = boost::python; SireIO::Gro87 __copy__(const SireIO::Gro87 &other){ return SireIO::Gro87(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -569,9 +571,9 @@ void register_Gro87_class(){ } Gro87_exposer.staticmethod( "typeName" ); - Gro87_exposer.def( "__copy__", &__copy__); - Gro87_exposer.def( "__deepcopy__", &__copy__); - Gro87_exposer.def( "clone", &__copy__); + Gro87_exposer.def( "__copy__", &__copy__); + Gro87_exposer.def( "__deepcopy__", &__copy__); + Gro87_exposer.def( "clone", &__copy__); Gro87_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::Gro87 >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); Gro87_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::Gro87 >, diff --git a/wrapper/IO/GroAtom.pypp.cpp b/wrapper/IO/GroAtom.pypp.cpp index c3e5aa3de..e3dc7a7e0 100644 --- a/wrapper/IO/GroAtom.pypp.cpp +++ b/wrapper/IO/GroAtom.pypp.cpp @@ -23,6 +23,8 @@ namespace bp = boost::python; #include "SireMM/cljnbpairs.h" +#include "SireMM/cmapfunctions.h" + #include "SireMM/fouratomfunctions.h" #include "SireMM/internalff.h" @@ -77,6 +79,8 @@ namespace bp = boost::python; SireIO::GroAtom __copy__(const SireIO::GroAtom &other){ return SireIO::GroAtom(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -404,9 +408,9 @@ void register_GroAtom_class(){ } GroAtom_exposer.staticmethod( "typeName" ); - GroAtom_exposer.def( "__copy__", &__copy__); - GroAtom_exposer.def( "__deepcopy__", &__copy__); - GroAtom_exposer.def( "clone", &__copy__); + GroAtom_exposer.def( "__copy__", &__copy__); + GroAtom_exposer.def( "__deepcopy__", &__copy__); + GroAtom_exposer.def( "clone", &__copy__); GroAtom_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::GroAtom >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); GroAtom_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::GroAtom >, diff --git a/wrapper/IO/GroMolType.pypp.cpp b/wrapper/IO/GroMolType.pypp.cpp index dffc1affa..aa131f21d 100644 --- a/wrapper/IO/GroMolType.pypp.cpp +++ b/wrapper/IO/GroMolType.pypp.cpp @@ -23,6 +23,8 @@ namespace bp = boost::python; #include "SireMM/cljnbpairs.h" +#include "SireMM/cmapfunctions.h" + #include "SireMM/fouratomfunctions.h" #include "SireMM/internalff.h" @@ -77,6 +79,8 @@ namespace bp = boost::python; SireIO::GroMolType __copy__(const SireIO::GroMolType &other){ return SireIO::GroMolType(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -150,6 +154,18 @@ void register_GroMolType_class(){ , ( bp::arg("bonds"), bp::arg("is_lambda1")=(bool)(false) ) , "Add the passed bonds to the molecule" ); + } + { //::SireIO::GroMolType::addCMAPs + + typedef void ( ::SireIO::GroMolType::*addCMAPs_function_type)( ::QHash< SireMol::CMAPID, QString > const &,bool ) ; + addCMAPs_function_type addCMAPs_function_value( &::SireIO::GroMolType::addCMAPs ); + + GroMolType_exposer.def( + "addCMAPs" + , addCMAPs_function_value + , ( bp::arg("cmaps"), bp::arg("is_lambda1")=(bool)(false) ) + , "Add the passed CMAPs to the molecule" ); + } { //::SireIO::GroMolType::addDihedral @@ -307,6 +323,18 @@ void register_GroMolType_class(){ , ( bp::arg("is_lambda1")=(bool)(false) ) , "Return all of the bonds" ); + } + { //::SireIO::GroMolType::cmaps + + typedef ::QHash< SireMol::CMAPID, QString > ( ::SireIO::GroMolType::*cmaps_function_type)( bool ) const; + cmaps_function_type cmaps_function_value( &::SireIO::GroMolType::cmaps ); + + GroMolType_exposer.def( + "cmaps" + , cmaps_function_value + , ( bp::arg("is_lambda1")=(bool)(false) ) + , "Return all of the cmaps" ); + } { //::SireIO::GroMolType::dihedrals @@ -454,6 +482,30 @@ void register_GroMolType_class(){ , ( bp::arg("elecstyle"), bp::arg("vdwstyle"), bp::arg("combrule"), bp::arg("elec14"), bp::arg("vdw14"), bp::arg("is_lambda1")=(bool)(false) ) , "Sanitise this moleculetype. This assumes that the moleculetype has\nbeen fully specified, so it collects everything together and checks that the\nmolecule makes sense. Any warnings generated can be retrieved using the\nwarnings function. It also uses the passed defaults from the top file,\ntogether with the information in the molecule to guess the forcefield for\nthe molecule" ); + } + { //::SireIO::GroMolType::sanitiseCMAPs + + typedef void ( ::SireIO::GroMolType::*sanitiseCMAPs_function_type)( bool ) ; + sanitiseCMAPs_function_type sanitiseCMAPs_function_value( &::SireIO::GroMolType::sanitiseCMAPs ); + + GroMolType_exposer.def( + "sanitiseCMAPs" + , sanitiseCMAPs_function_value + , ( bp::arg("is_lambda1")=(bool)(false) ) + , "Sanitise all of the CMAP terms - this sets the string equal to 1,\n as the information contained previously has already been read\n" ); + + } + { //::SireIO::GroMolType::setAtomType + + typedef void ( ::SireIO::GroMolType::*setAtomType_function_type)( ::SireMol::AtomIdx const &,::QString const &,bool ) ; + setAtomType_function_type setAtomType_function_value( &::SireIO::GroMolType::setAtomType ); + + GroMolType_exposer.def( + "setAtomType" + , setAtomType_function_value + , ( bp::arg("atomidx"), bp::arg("atomtype"), bp::arg("is_lambda1")=(bool)(false) ) + , "Set the atom type of the specified atom" ); + } { //::SireIO::GroMolType::setAtoms @@ -553,9 +605,9 @@ void register_GroMolType_class(){ } GroMolType_exposer.staticmethod( "typeName" ); - GroMolType_exposer.def( "__copy__", &__copy__); - GroMolType_exposer.def( "__deepcopy__", &__copy__); - GroMolType_exposer.def( "clone", &__copy__); + GroMolType_exposer.def( "__copy__", &__copy__); + GroMolType_exposer.def( "__deepcopy__", &__copy__); + GroMolType_exposer.def( "clone", &__copy__); GroMolType_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::GroMolType >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); GroMolType_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::GroMolType >, diff --git a/wrapper/IO/GroSystem.pypp.cpp b/wrapper/IO/GroSystem.pypp.cpp index f71c52165..28efe6652 100644 --- a/wrapper/IO/GroSystem.pypp.cpp +++ b/wrapper/IO/GroSystem.pypp.cpp @@ -23,6 +23,8 @@ namespace bp = boost::python; #include "SireMM/cljnbpairs.h" +#include "SireMM/cmapfunctions.h" + #include "SireMM/fouratomfunctions.h" #include "SireMM/internalff.h" @@ -77,6 +79,8 @@ namespace bp = boost::python; SireIO::GroSystem __copy__(const SireIO::GroSystem &other){ return SireIO::GroSystem(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -279,9 +283,9 @@ void register_GroSystem_class(){ } GroSystem_exposer.staticmethod( "typeName" ); - GroSystem_exposer.def( "__copy__", &__copy__); - GroSystem_exposer.def( "__deepcopy__", &__copy__); - GroSystem_exposer.def( "clone", &__copy__); + GroSystem_exposer.def( "__copy__", &__copy__); + GroSystem_exposer.def( "__deepcopy__", &__copy__); + GroSystem_exposer.def( "clone", &__copy__); GroSystem_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::GroSystem >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); GroSystem_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::GroSystem >, diff --git a/wrapper/IO/GroTop.pypp.cpp b/wrapper/IO/GroTop.pypp.cpp index 633f279b8..50a05a9ec 100644 --- a/wrapper/IO/GroTop.pypp.cpp +++ b/wrapper/IO/GroTop.pypp.cpp @@ -23,6 +23,8 @@ namespace bp = boost::python; #include "SireMM/cljnbpairs.h" +#include "SireMM/cmapfunctions.h" + #include "SireMM/fouratomfunctions.h" #include "SireMM/internalff.h" @@ -77,6 +79,8 @@ namespace bp = boost::python; SireIO::GroTop __copy__(const SireIO::GroTop &other){ return SireIO::GroTop(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -193,6 +197,19 @@ void register_GroTop_class(){ , bp::release_gil_policy() , "Return the bond potential data for the passed pair of atoms. This returns\na list of all associated parameters" ); + } + { //::SireIO::GroTop::cmaps + + typedef ::QList< SireMM::CMAPParameter > ( ::SireIO::GroTop::*cmaps_function_type)( ::QString const &,::QString const &,::QString const &,::QString const &,::QString const &,int ) const; + cmaps_function_type cmaps_function_value( &::SireIO::GroTop::cmaps ); + + GroTop_exposer.def( + "cmaps" + , cmaps_function_value + , ( bp::arg("atm0"), bp::arg("atm1"), bp::arg("atm2"), bp::arg("atm3"), bp::arg("atm4"), bp::arg("func") ) + , bp::release_gil_policy() + , "Return all of the CMAP potentials for the passed quint of atom types, for the\n passed function type. This returns a list of all associated parameters\n (or an empty list if none exist)" ); + } { //::SireIO::GroTop::combiningRules @@ -528,9 +545,9 @@ void register_GroTop_class(){ } GroTop_exposer.staticmethod( "typeName" ); - GroTop_exposer.def( "__copy__", &__copy__); - GroTop_exposer.def( "__deepcopy__", &__copy__); - GroTop_exposer.def( "clone", &__copy__); + GroTop_exposer.def( "__copy__", &__copy__); + GroTop_exposer.def( "__deepcopy__", &__copy__); + GroTop_exposer.def( "clone", &__copy__); GroTop_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::GroTop >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); GroTop_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::GroTop >, diff --git a/wrapper/IO/IOParametersBase.pypp.cpp b/wrapper/IO/IOParametersBase.pypp.cpp index 2e4f41165..c50593441 100644 --- a/wrapper/IO/IOParametersBase.pypp.cpp +++ b/wrapper/IO/IOParametersBase.pypp.cpp @@ -29,6 +29,8 @@ namespace bp = boost::python; SireIO::IOParametersBase __copy__(const SireIO::IOParametersBase &other){ return SireIO::IOParametersBase(other); } +#include "Helpers/copy.hpp" + const char* pvt_get_name(const SireIO::IOParametersBase&){ return "SireIO::IOParametersBase";} #include "Helpers/release_gil_policy.hpp" @@ -75,9 +77,9 @@ void register_IOParametersBase_class(){ , "Return the default source of the property into which\nthe chemical elements of each atom will be placed\n\ndefault == element\n" ); } - IOParametersBase_exposer.def( "__copy__", &__copy__); - IOParametersBase_exposer.def( "__deepcopy__", &__copy__); - IOParametersBase_exposer.def( "clone", &__copy__); + IOParametersBase_exposer.def( "__copy__", &__copy__); + IOParametersBase_exposer.def( "__deepcopy__", &__copy__); + IOParametersBase_exposer.def( "clone", &__copy__); IOParametersBase_exposer.def( "__str__", &pvt_get_name); IOParametersBase_exposer.def( "__repr__", &pvt_get_name); } diff --git a/wrapper/IO/Mol2.pypp.cpp b/wrapper/IO/Mol2.pypp.cpp index ad9e66c94..15dee02cd 100644 --- a/wrapper/IO/Mol2.pypp.cpp +++ b/wrapper/IO/Mol2.pypp.cpp @@ -45,6 +45,8 @@ namespace bp = boost::python; SireIO::Mol2 __copy__(const SireIO::Mol2 &other){ return SireIO::Mol2(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -372,9 +374,9 @@ void register_Mol2_class(){ } Mol2_exposer.staticmethod( "typeName" ); - Mol2_exposer.def( "__copy__", &__copy__); - Mol2_exposer.def( "__deepcopy__", &__copy__); - Mol2_exposer.def( "clone", &__copy__); + Mol2_exposer.def( "__copy__", &__copy__); + Mol2_exposer.def( "__deepcopy__", &__copy__); + Mol2_exposer.def( "clone", &__copy__); Mol2_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::Mol2 >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); Mol2_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::Mol2 >, diff --git a/wrapper/IO/NullIO.pypp.cpp b/wrapper/IO/NullIO.pypp.cpp index a3a0926ae..c40d0fb3a 100644 --- a/wrapper/IO/NullIO.pypp.cpp +++ b/wrapper/IO/NullIO.pypp.cpp @@ -29,6 +29,8 @@ namespace bp = boost::python; SireIO::NullIO __copy__(const SireIO::NullIO &other){ return SireIO::NullIO(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -70,9 +72,9 @@ void register_NullIO_class(){ } NullIO_exposer.staticmethod( "typeName" ); - NullIO_exposer.def( "__copy__", &__copy__); - NullIO_exposer.def( "__deepcopy__", &__copy__); - NullIO_exposer.def( "clone", &__copy__); + NullIO_exposer.def( "__copy__", &__copy__); + NullIO_exposer.def( "__deepcopy__", &__copy__); + NullIO_exposer.def( "clone", &__copy__); NullIO_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::NullIO >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); NullIO_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::NullIO >, diff --git a/wrapper/IO/NullParser.pypp.cpp b/wrapper/IO/NullParser.pypp.cpp index 24e8cc5a0..56b2c551a 100644 --- a/wrapper/IO/NullParser.pypp.cpp +++ b/wrapper/IO/NullParser.pypp.cpp @@ -79,6 +79,8 @@ namespace bp = boost::python; SireIO::NullParser __copy__(const SireIO::NullParser &other){ return SireIO::NullParser(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -231,9 +233,9 @@ void register_NullParser_class(){ } NullParser_exposer.staticmethod( "typeName" ); - NullParser_exposer.def( "__copy__", &__copy__); - NullParser_exposer.def( "__deepcopy__", &__copy__); - NullParser_exposer.def( "clone", &__copy__); + NullParser_exposer.def( "__copy__", &__copy__); + NullParser_exposer.def( "__deepcopy__", &__copy__); + NullParser_exposer.def( "clone", &__copy__); NullParser_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::NullParser >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); NullParser_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::NullParser >, diff --git a/wrapper/IO/PDB.pypp.cpp b/wrapper/IO/PDB.pypp.cpp index 96033a623..b0a1e9147 100644 --- a/wrapper/IO/PDB.pypp.cpp +++ b/wrapper/IO/PDB.pypp.cpp @@ -85,6 +85,8 @@ namespace bp = boost::python; SireIO::PDB __copy__(const SireIO::PDB &other){ return SireIO::PDB(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -151,9 +153,9 @@ void register_PDB_class(){ } PDB_exposer.staticmethod( "parameters" ); PDB_exposer.staticmethod( "typeName" ); - PDB_exposer.def( "__copy__", &__copy__); - PDB_exposer.def( "__deepcopy__", &__copy__); - PDB_exposer.def( "clone", &__copy__); + PDB_exposer.def( "__copy__", &__copy__); + PDB_exposer.def( "__deepcopy__", &__copy__); + PDB_exposer.def( "clone", &__copy__); PDB_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::PDB >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); PDB_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::PDB >, diff --git a/wrapper/IO/PDB2.pypp.cpp b/wrapper/IO/PDB2.pypp.cpp index dfc299654..f5e96f58e 100644 --- a/wrapper/IO/PDB2.pypp.cpp +++ b/wrapper/IO/PDB2.pypp.cpp @@ -41,6 +41,10 @@ namespace bp = boost::python; #include "SireUnits/units.h" +#include "SireVol/periodicbox.h" + +#include "SireVol/triclinicbox.h" + #include "pdb2.h" #include @@ -51,6 +55,8 @@ namespace bp = boost::python; SireIO::PDB2 __copy__(const SireIO::PDB2 &other){ return SireIO::PDB2(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -355,9 +361,9 @@ void register_PDB2_class(){ } PDB2_exposer.staticmethod( "typeName" ); - PDB2_exposer.def( "__copy__", &__copy__); - PDB2_exposer.def( "__deepcopy__", &__copy__); - PDB2_exposer.def( "clone", &__copy__); + PDB2_exposer.def( "__copy__", &__copy__); + PDB2_exposer.def( "__deepcopy__", &__copy__); + PDB2_exposer.def( "clone", &__copy__); PDB2_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::PDB2 >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); PDB2_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::PDB2 >, diff --git a/wrapper/IO/PDBParameters.pypp.cpp b/wrapper/IO/PDBParameters.pypp.cpp index e359aa973..5108f9487 100644 --- a/wrapper/IO/PDBParameters.pypp.cpp +++ b/wrapper/IO/PDBParameters.pypp.cpp @@ -85,6 +85,8 @@ namespace bp = boost::python; SireIO::PDBParameters __copy__(const SireIO::PDBParameters &other){ return SireIO::PDBParameters(other); } +#include "Helpers/copy.hpp" + const char* pvt_get_name(const SireIO::PDBParameters&){ return "SireIO::PDBParameters";} #include "Helpers/release_gil_policy.hpp" @@ -263,9 +265,9 @@ void register_PDBParameters_class(){ , "The function used to process segment names. Must be a StringMangler()\n\nsource == segment-name-mangler\ndefault == TrimString()\n" ); } - PDBParameters_exposer.def( "__copy__", &__copy__); - PDBParameters_exposer.def( "__deepcopy__", &__copy__); - PDBParameters_exposer.def( "clone", &__copy__); + PDBParameters_exposer.def( "__copy__", &__copy__); + PDBParameters_exposer.def( "__deepcopy__", &__copy__); + PDBParameters_exposer.def( "clone", &__copy__); PDBParameters_exposer.def( "__str__", &pvt_get_name); PDBParameters_exposer.def( "__repr__", &pvt_get_name); } diff --git a/wrapper/IO/PDBx.pypp.cpp b/wrapper/IO/PDBx.pypp.cpp index 75c67ae48..127d66035 100644 --- a/wrapper/IO/PDBx.pypp.cpp +++ b/wrapper/IO/PDBx.pypp.cpp @@ -41,10 +41,14 @@ namespace bp = boost::python; #include "pdbx.h" +#include + #include "pdbx.h" SireIO::PDBx __copy__(const SireIO::PDBx &other){ return SireIO::PDBx(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -261,9 +265,9 @@ void register_PDBx_class(){ } PDBx_exposer.staticmethod( "typeName" ); - PDBx_exposer.def( "__copy__", &__copy__); - PDBx_exposer.def( "__deepcopy__", &__copy__); - PDBx_exposer.def( "clone", &__copy__); + PDBx_exposer.def( "__copy__", &__copy__); + PDBx_exposer.def( "__deepcopy__", &__copy__); + PDBx_exposer.def( "clone", &__copy__); PDBx_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::PDBx >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); PDBx_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::PDBx >, diff --git a/wrapper/IO/PerturbationsLibrary.pypp.cpp b/wrapper/IO/PerturbationsLibrary.pypp.cpp index 93e2ba601..dc44f0c9d 100644 --- a/wrapper/IO/PerturbationsLibrary.pypp.cpp +++ b/wrapper/IO/PerturbationsLibrary.pypp.cpp @@ -75,6 +75,8 @@ namespace bp = boost::python; SireIO::PerturbationsLibrary __copy__(const SireIO::PerturbationsLibrary &other){ return SireIO::PerturbationsLibrary(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -183,9 +185,9 @@ void register_PerturbationsLibrary_class(){ } PerturbationsLibrary_exposer.staticmethod( "typeName" ); - PerturbationsLibrary_exposer.def( "__copy__", &__copy__); - PerturbationsLibrary_exposer.def( "__deepcopy__", &__copy__); - PerturbationsLibrary_exposer.def( "clone", &__copy__); + PerturbationsLibrary_exposer.def( "__copy__", &__copy__); + PerturbationsLibrary_exposer.def( "__deepcopy__", &__copy__); + PerturbationsLibrary_exposer.def( "clone", &__copy__); PerturbationsLibrary_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::PerturbationsLibrary >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); PerturbationsLibrary_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::PerturbationsLibrary >, diff --git a/wrapper/IO/PerturbationsTemplate.pypp.cpp b/wrapper/IO/PerturbationsTemplate.pypp.cpp index fc1f0e0f0..af5d80467 100644 --- a/wrapper/IO/PerturbationsTemplate.pypp.cpp +++ b/wrapper/IO/PerturbationsTemplate.pypp.cpp @@ -75,6 +75,8 @@ namespace bp = boost::python; SireIO::PerturbationsTemplate __copy__(const SireIO::PerturbationsTemplate &other){ return SireIO::PerturbationsTemplate(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" const char* pvt_get_name(const SireIO::PerturbationsTemplate&){ return "SireIO::PerturbationsTemplate";} @@ -645,9 +647,9 @@ void register_PerturbationsTemplate_class(){ } PerturbationsTemplate_exposer.staticmethod( "typeName" ); - PerturbationsTemplate_exposer.def( "__copy__", &__copy__); - PerturbationsTemplate_exposer.def( "__deepcopy__", &__copy__); - PerturbationsTemplate_exposer.def( "clone", &__copy__); + PerturbationsTemplate_exposer.def( "__copy__", &__copy__); + PerturbationsTemplate_exposer.def( "__deepcopy__", &__copy__); + PerturbationsTemplate_exposer.def( "clone", &__copy__); PerturbationsTemplate_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::PerturbationsTemplate >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); PerturbationsTemplate_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::PerturbationsTemplate >, diff --git a/wrapper/IO/ProtoMS.pypp.cpp b/wrapper/IO/ProtoMS.pypp.cpp index 9474db973..5d0e236ec 100644 --- a/wrapper/IO/ProtoMS.pypp.cpp +++ b/wrapper/IO/ProtoMS.pypp.cpp @@ -91,6 +91,8 @@ namespace bp = boost::python; SireIO::ProtoMS __copy__(const SireIO::ProtoMS &other){ return SireIO::ProtoMS(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" const char* pvt_get_name(const SireIO::ProtoMS&){ return "SireIO::ProtoMS";} @@ -220,9 +222,9 @@ void register_ProtoMS_class(){ } ProtoMS_exposer.staticmethod( "parameters" ); ProtoMS_exposer.staticmethod( "typeName" ); - ProtoMS_exposer.def( "__copy__", &__copy__); - ProtoMS_exposer.def( "__deepcopy__", &__copy__); - ProtoMS_exposer.def( "clone", &__copy__); + ProtoMS_exposer.def( "__copy__", &__copy__); + ProtoMS_exposer.def( "__deepcopy__", &__copy__); + ProtoMS_exposer.def( "clone", &__copy__); ProtoMS_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::ProtoMS >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); ProtoMS_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::ProtoMS >, diff --git a/wrapper/IO/ProtoMSParameters.pypp.cpp b/wrapper/IO/ProtoMSParameters.pypp.cpp index 480fc0204..ad2d7bc93 100644 --- a/wrapper/IO/ProtoMSParameters.pypp.cpp +++ b/wrapper/IO/ProtoMSParameters.pypp.cpp @@ -91,6 +91,8 @@ namespace bp = boost::python; SireIO::ProtoMSParameters __copy__(const SireIO::ProtoMSParameters &other){ return SireIO::ProtoMSParameters(other); } +#include "Helpers/copy.hpp" + const char* pvt_get_name(const SireIO::ProtoMSParameters&){ return "SireIO::ProtoMSParameters";} #include "Helpers/release_gil_policy.hpp" @@ -281,9 +283,9 @@ void register_ProtoMSParameters_class(){ , "Return the name of the property that will contain the\nz-matrix\n\ndefault == zmatrix\n" ); } - ProtoMSParameters_exposer.def( "__copy__", &__copy__); - ProtoMSParameters_exposer.def( "__deepcopy__", &__copy__); - ProtoMSParameters_exposer.def( "clone", &__copy__); + ProtoMSParameters_exposer.def( "__copy__", &__copy__); + ProtoMSParameters_exposer.def( "__deepcopy__", &__copy__); + ProtoMSParameters_exposer.def( "clone", &__copy__); ProtoMSParameters_exposer.def( "__str__", &pvt_get_name); ProtoMSParameters_exposer.def( "__repr__", &pvt_get_name); } diff --git a/wrapper/IO/SDF.pypp.cpp b/wrapper/IO/SDF.pypp.cpp index 63806c302..4811d1dde 100644 --- a/wrapper/IO/SDF.pypp.cpp +++ b/wrapper/IO/SDF.pypp.cpp @@ -71,6 +71,8 @@ namespace bp = boost::python; SireIO::SDF __copy__(const SireIO::SDF &other){ return SireIO::SDF(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -312,9 +314,9 @@ void register_SDF_class(){ } SDF_exposer.staticmethod( "typeName" ); - SDF_exposer.def( "__copy__", &__copy__); - SDF_exposer.def( "__deepcopy__", &__copy__); - SDF_exposer.def( "clone", &__copy__); + SDF_exposer.def( "__copy__", &__copy__); + SDF_exposer.def( "__deepcopy__", &__copy__); + SDF_exposer.def( "clone", &__copy__); SDF_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::SDF >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); SDF_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::SDF >, diff --git a/wrapper/IO/SireIO_containers.cpp b/wrapper/IO/SireIO_containers.cpp index 2136feffc..138c5c47a 100644 --- a/wrapper/IO/SireIO_containers.cpp +++ b/wrapper/IO/SireIO_containers.cpp @@ -52,6 +52,7 @@ using boost::python::register_tuple; void register_SireIO_containers() { + register_list< QVector> >(); register_list< QList >(); register_list< QVector >(); diff --git a/wrapper/IO/SireIO_properties.cpp b/wrapper/IO/SireIO_properties.cpp index 9f26f536d..9315b796c 100644 --- a/wrapper/IO/SireIO_properties.cpp +++ b/wrapper/IO/SireIO_properties.cpp @@ -4,16 +4,6 @@ #include "Base/convertproperty.hpp" #include "SireIO_properties.h" -#include "SireError/errors.h" -#include "SireMol/cuttingfunction.h" -#include "SireMol/molecule.h" -#include "SireMol/molidx.h" -#include "SireMol/mover.hpp" -#include "SireStream/datastream.h" -#include "iobase.h" -#include -#include -#include "iobase.h" #include "SireBase/booleanproperty.h" #include "SireBase/parallel.h" #include "SireBase/progressbar.h" @@ -49,8 +39,18 @@ #include #include #include "moleculeparser.h" +#include "SireError/errors.h" +#include "SireMol/cuttingfunction.h" +#include "SireMol/molecule.h" +#include "SireMol/molidx.h" +#include "SireMol/mover.hpp" +#include "SireStream/datastream.h" +#include "iobase.h" +#include +#include +#include "iobase.h" void register_SireIO_properties() { - register_property_container< SireIO::IOPtr, SireIO::IOBase >(); register_property_container< SireIO::MoleculeParserPtr, SireIO::MoleculeParser >(); + register_property_container< SireIO::IOPtr, SireIO::IOBase >(); } diff --git a/wrapper/IO/SireIO_registrars.cpp b/wrapper/IO/SireIO_registrars.cpp index 4e90f4026..b7e1662ae 100644 --- a/wrapper/IO/SireIO_registrars.cpp +++ b/wrapper/IO/SireIO_registrars.cpp @@ -3,79 +3,79 @@ #include "SireIO_registrars.h" -#include "iobase.h" -#include "amber.h" -#include "filetrajectoryparser.h" -#include "flexibilitylibrary.h" -#include "trr.h" #include "grotop.h" -#include "amberrst7.h" -#include "mol2.h" #include "protoms.h" -#include "pdb2.h" +#include "filetrajectory.h" +#include "amberrst7.h" #include "moleculeparser.h" -#include "amberrst.h" -#include "trajectorymonitor.h" +#include "iobase.h" #include "supplementary.h" -#include "xtc.h" -#include "filetrajectory.h" -#include "gro87.h" -#include "charmmpsf.h" -#include "perturbationslibrary.h" -#include "dcd.h" -#include "amberprm.h" -#include "tinker.h" #include "zmatrixmaker.h" +#include "tinker.h" +#include "amberprm.h" +#include "dcd.h" +#include "charmmpsf.h" #include "ambertraj.h" -#include "sdf.h" +#include "xtc.h" +#include "pdb2.h" +#include "trr.h" +#include "filetrajectoryparser.h" #include "pdb.h" +#include "mol2.h" +#include "trajectorymonitor.h" +#include "gro87.h" +#include "flexibilitylibrary.h" #include "pdbx.h" +#include "amberrst.h" +#include "amber.h" +#include "perturbationslibrary.h" +#include "sdf.h" #include "Helpers/objectregistry.hpp" void register_SireIO_objects() { - ObjectRegistry::registerConverterFor< SireIO::NullIO >(); - ObjectRegistry::registerConverterFor< SireIO::Amber >(); - ObjectRegistry::registerConverterFor< SireIO::FileTrajectoryParser >(); - ObjectRegistry::registerConverterFor< SireIO::FlexibilityLibrary >(); - ObjectRegistry::registerConverterFor< SireIO::FlexibilityTemplate >(); - ObjectRegistry::registerConverterFor< SireIO::TRR >(); ObjectRegistry::registerConverterFor< SireIO::GroTop >(); ObjectRegistry::registerConverterFor< SireIO::GroMolType >(); ObjectRegistry::registerConverterFor< SireIO::GroAtom >(); ObjectRegistry::registerConverterFor< SireIO::GroSystem >(); + ObjectRegistry::registerConverterFor< SireIO::ProtoMS >(); + ObjectRegistry::registerConverterFor< SireIO::FileTrajectory >(); ObjectRegistry::registerConverterFor< SireIO::AmberRst7 >(); + ObjectRegistry::registerConverterFor< SireIO::NullParser >(); + ObjectRegistry::registerConverterFor< SireIO::BrokenParser >(); + ObjectRegistry::registerConverterFor< SireIO::NullIO >(); + ObjectRegistry::registerConverterFor< SireIO::Supplementary >(); + ObjectRegistry::registerConverterFor< SireIO::ZmatrixMaker >(); + ObjectRegistry::registerConverterFor< SireIO::Tinker >(); + ObjectRegistry::registerConverterFor< SireIO::AmberPrm >(); + ObjectRegistry::registerConverterFor< SireIO::DCD >(); + ObjectRegistry::registerConverterFor< SireIO::PSFAtom >(); + ObjectRegistry::registerConverterFor< SireIO::CharmmParam >(); + ObjectRegistry::registerConverterFor< SireIO::CharmmPSF >(); + ObjectRegistry::registerConverterFor< SireIO::AmberTraj >(); + ObjectRegistry::registerConverterFor< SireIO::XTC >(); + ObjectRegistry::registerConverterFor< SireIO::PDBAtom >(); + ObjectRegistry::registerConverterFor< SireIO::PDB2 >(); + ObjectRegistry::registerConverterFor< SireIO::TRR >(); + ObjectRegistry::registerConverterFor< SireIO::FileTrajectoryParser >(); + ObjectRegistry::registerConverterFor< SireIO::PDB >(); ObjectRegistry::registerConverterFor< SireIO::Mol2Atom >(); ObjectRegistry::registerConverterFor< SireIO::Mol2Bond >(); ObjectRegistry::registerConverterFor< SireIO::Mol2Molecule >(); ObjectRegistry::registerConverterFor< SireIO::Mol2Substructure >(); ObjectRegistry::registerConverterFor< SireIO::Mol2 >(); - ObjectRegistry::registerConverterFor< SireIO::ProtoMS >(); - ObjectRegistry::registerConverterFor< SireIO::PDBAtom >(); - ObjectRegistry::registerConverterFor< SireIO::PDB2 >(); - ObjectRegistry::registerConverterFor< SireIO::NullParser >(); - ObjectRegistry::registerConverterFor< SireIO::BrokenParser >(); - ObjectRegistry::registerConverterFor< SireIO::AmberRst >(); ObjectRegistry::registerConverterFor< SireIO::TrajectoryMonitor >(); - ObjectRegistry::registerConverterFor< SireIO::Supplementary >(); - ObjectRegistry::registerConverterFor< SireIO::XTC >(); - ObjectRegistry::registerConverterFor< SireIO::FileTrajectory >(); ObjectRegistry::registerConverterFor< SireIO::Gro87 >(); - ObjectRegistry::registerConverterFor< SireIO::PSFAtom >(); - ObjectRegistry::registerConverterFor< SireIO::CharmmParam >(); - ObjectRegistry::registerConverterFor< SireIO::CharmmPSF >(); + ObjectRegistry::registerConverterFor< SireIO::FlexibilityLibrary >(); + ObjectRegistry::registerConverterFor< SireIO::FlexibilityTemplate >(); + ObjectRegistry::registerConverterFor< SireIO::PDBx >(); + ObjectRegistry::registerConverterFor< SireIO::AmberRst >(); + ObjectRegistry::registerConverterFor< SireIO::Amber >(); ObjectRegistry::registerConverterFor< SireIO::PerturbationsLibrary >(); ObjectRegistry::registerConverterFor< SireIO::PerturbationsTemplate >(); - ObjectRegistry::registerConverterFor< SireIO::DCD >(); - ObjectRegistry::registerConverterFor< SireIO::AmberPrm >(); - ObjectRegistry::registerConverterFor< SireIO::Tinker >(); - ObjectRegistry::registerConverterFor< SireIO::ZmatrixMaker >(); - ObjectRegistry::registerConverterFor< SireIO::AmberTraj >(); ObjectRegistry::registerConverterFor< SireIO::SDF >(); - ObjectRegistry::registerConverterFor< SireIO::PDB >(); - ObjectRegistry::registerConverterFor< SireIO::PDBx >(); } diff --git a/wrapper/IO/Supplementary.pypp.cpp b/wrapper/IO/Supplementary.pypp.cpp index 4f42dfea4..5a935d445 100644 --- a/wrapper/IO/Supplementary.pypp.cpp +++ b/wrapper/IO/Supplementary.pypp.cpp @@ -23,6 +23,8 @@ namespace bp = boost::python; SireIO::Supplementary __copy__(const SireIO::Supplementary &other){ return SireIO::Supplementary(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -189,9 +191,9 @@ void register_Supplementary_class(){ } Supplementary_exposer.staticmethod( "typeName" ); - Supplementary_exposer.def( "__copy__", &__copy__); - Supplementary_exposer.def( "__deepcopy__", &__copy__); - Supplementary_exposer.def( "clone", &__copy__); + Supplementary_exposer.def( "__copy__", &__copy__); + Supplementary_exposer.def( "__deepcopy__", &__copy__); + Supplementary_exposer.def( "clone", &__copy__); Supplementary_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::Supplementary >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); Supplementary_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::Supplementary >, diff --git a/wrapper/IO/TRR.pypp.cpp b/wrapper/IO/TRR.pypp.cpp index afcec861a..17609ea33 100644 --- a/wrapper/IO/TRR.pypp.cpp +++ b/wrapper/IO/TRR.pypp.cpp @@ -65,6 +65,8 @@ namespace bp = boost::python; SireIO::TRR __copy__(const SireIO::TRR &other){ return SireIO::TRR(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -334,9 +336,9 @@ void register_TRR_class(){ } TRR_exposer.staticmethod( "parse" ); TRR_exposer.staticmethod( "typeName" ); - TRR_exposer.def( "__copy__", &__copy__); - TRR_exposer.def( "__deepcopy__", &__copy__); - TRR_exposer.def( "clone", &__copy__); + TRR_exposer.def( "__copy__", &__copy__); + TRR_exposer.def( "__deepcopy__", &__copy__); + TRR_exposer.def( "clone", &__copy__); TRR_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::TRR >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); TRR_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::TRR >, diff --git a/wrapper/IO/Tinker.pypp.cpp b/wrapper/IO/Tinker.pypp.cpp index 2ebc0a381..480f5c7da 100644 --- a/wrapper/IO/Tinker.pypp.cpp +++ b/wrapper/IO/Tinker.pypp.cpp @@ -39,6 +39,8 @@ namespace bp = boost::python; SireIO::Tinker __copy__(const SireIO::Tinker &other){ return SireIO::Tinker(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -106,9 +108,9 @@ void register_Tinker_class(){ } Tinker_exposer.staticmethod( "parameters" ); Tinker_exposer.staticmethod( "typeName" ); - Tinker_exposer.def( "__copy__", &__copy__); - Tinker_exposer.def( "__deepcopy__", &__copy__); - Tinker_exposer.def( "clone", &__copy__); + Tinker_exposer.def( "__copy__", &__copy__); + Tinker_exposer.def( "__deepcopy__", &__copy__); + Tinker_exposer.def( "clone", &__copy__); Tinker_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::Tinker >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); Tinker_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::Tinker >, diff --git a/wrapper/IO/TinkerParameters.pypp.cpp b/wrapper/IO/TinkerParameters.pypp.cpp index fdf3b0e0a..56945f334 100644 --- a/wrapper/IO/TinkerParameters.pypp.cpp +++ b/wrapper/IO/TinkerParameters.pypp.cpp @@ -39,6 +39,8 @@ namespace bp = boost::python; SireIO::TinkerParameters __copy__(const SireIO::TinkerParameters &other){ return SireIO::TinkerParameters(other); } +#include "Helpers/copy.hpp" + const char* pvt_get_name(const SireIO::TinkerParameters&){ return "SireIO::TinkerParameters";} #include "Helpers/release_gil_policy.hpp" @@ -49,9 +51,9 @@ void register_TinkerParameters_class(){ typedef bp::class_< SireIO::TinkerParameters, bp::bases< SireIO::IOParametersBase > > TinkerParameters_exposer_t; TinkerParameters_exposer_t TinkerParameters_exposer = TinkerParameters_exposer_t( "TinkerParameters", "This class holds all of the sources and default values of the\nproperties and parameters used by the Tinker readerwriter\n\nAuthor: Christopher Woods\n", bp::init< >("Constructor") ); bp::scope TinkerParameters_scope( TinkerParameters_exposer ); - TinkerParameters_exposer.def( "__copy__", &__copy__); - TinkerParameters_exposer.def( "__deepcopy__", &__copy__); - TinkerParameters_exposer.def( "clone", &__copy__); + TinkerParameters_exposer.def( "__copy__", &__copy__); + TinkerParameters_exposer.def( "__deepcopy__", &__copy__); + TinkerParameters_exposer.def( "clone", &__copy__); TinkerParameters_exposer.def( "__str__", &pvt_get_name); TinkerParameters_exposer.def( "__repr__", &pvt_get_name); } diff --git a/wrapper/IO/TrajectoryMonitor.pypp.cpp b/wrapper/IO/TrajectoryMonitor.pypp.cpp index cf2a88a72..980b65828 100644 --- a/wrapper/IO/TrajectoryMonitor.pypp.cpp +++ b/wrapper/IO/TrajectoryMonitor.pypp.cpp @@ -37,6 +37,8 @@ namespace bp = boost::python; SireIO::TrajectoryMonitor __copy__(const SireIO::TrajectoryMonitor &other){ return SireIO::TrajectoryMonitor(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -133,9 +135,9 @@ void register_TrajectoryMonitor_class(){ } TrajectoryMonitor_exposer.staticmethod( "typeName" ); - TrajectoryMonitor_exposer.def( "__copy__", &__copy__); - TrajectoryMonitor_exposer.def( "__deepcopy__", &__copy__); - TrajectoryMonitor_exposer.def( "clone", &__copy__); + TrajectoryMonitor_exposer.def( "__copy__", &__copy__); + TrajectoryMonitor_exposer.def( "__deepcopy__", &__copy__); + TrajectoryMonitor_exposer.def( "clone", &__copy__); TrajectoryMonitor_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::TrajectoryMonitor >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); TrajectoryMonitor_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::TrajectoryMonitor >, diff --git a/wrapper/IO/XTC.pypp.cpp b/wrapper/IO/XTC.pypp.cpp index aa386ebd3..472bc26a5 100644 --- a/wrapper/IO/XTC.pypp.cpp +++ b/wrapper/IO/XTC.pypp.cpp @@ -65,6 +65,8 @@ namespace bp = boost::python; SireIO::XTC __copy__(const SireIO::XTC &other){ return SireIO::XTC(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" #include "Helpers/str.hpp" @@ -334,9 +336,9 @@ void register_XTC_class(){ } XTC_exposer.staticmethod( "parse" ); XTC_exposer.staticmethod( "typeName" ); - XTC_exposer.def( "__copy__", &__copy__); - XTC_exposer.def( "__deepcopy__", &__copy__); - XTC_exposer.def( "clone", &__copy__); + XTC_exposer.def( "__copy__", &__copy__); + XTC_exposer.def( "__deepcopy__", &__copy__); + XTC_exposer.def( "clone", &__copy__); XTC_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::XTC >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); XTC_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::XTC >, diff --git a/wrapper/IO/ZmatrixMaker.pypp.cpp b/wrapper/IO/ZmatrixMaker.pypp.cpp index b6c95c6ac..c2f0a31d3 100644 --- a/wrapper/IO/ZmatrixMaker.pypp.cpp +++ b/wrapper/IO/ZmatrixMaker.pypp.cpp @@ -49,6 +49,8 @@ namespace bp = boost::python; SireIO::ZmatrixMaker __copy__(const SireIO::ZmatrixMaker &other){ return SireIO::ZmatrixMaker(other); } +#include "Helpers/copy.hpp" + #include "Qt/qdatastream.hpp" const char* pvt_get_name(const SireIO::ZmatrixMaker&){ return "SireIO::ZmatrixMaker";} @@ -112,9 +114,9 @@ void register_ZmatrixMaker_class(){ } ZmatrixMaker_exposer.staticmethod( "typeName" ); - ZmatrixMaker_exposer.def( "__copy__", &__copy__); - ZmatrixMaker_exposer.def( "__deepcopy__", &__copy__); - ZmatrixMaker_exposer.def( "clone", &__copy__); + ZmatrixMaker_exposer.def( "__copy__", &__copy__); + ZmatrixMaker_exposer.def( "__deepcopy__", &__copy__); + ZmatrixMaker_exposer.def( "clone", &__copy__); ZmatrixMaker_exposer.def( "__rlshift__", &__rlshift__QDataStream< ::SireIO::ZmatrixMaker >, bp::return_internal_reference<1, bp::with_custodian_and_ward<1,2> >() ); ZmatrixMaker_exposer.def( "__rrshift__", &__rrshift__QDataStream< ::SireIO::ZmatrixMaker >, diff --git a/wrapper/IO/_IO_free_functions.pypp.cpp b/wrapper/IO/_IO_free_functions.pypp.cpp index fa5466500..4a5b57a62 100644 --- a/wrapper/IO/_IO_free_functions.pypp.cpp +++ b/wrapper/IO/_IO_free_functions.pypp.cpp @@ -9,6 +9,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -41,6 +43,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -109,6 +113,42 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + +#include "SireError/errors.h" + +#include "SireMol/atomelements.h" + +#include "SireMol/atommasses.h" + +#include "SireMol/connectivity.h" + +#include "SireMol/core.h" + +#include "SireMol/mgname.h" + +#include "SireMol/moleditor.h" + +#include "SireMol/molidx.h" + +#include "SireSystem/system.h" + +#include "SireUnits/units.h" + +#include "SireVol/periodicbox.h" + +#include "SireVol/triclinicbox.h" + +#include "biosimspace.h" + +#include "moleculeparser.h" + +#include "biosimspace.h" + +#include "SireBase/getinstalldir.h" + +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -141,6 +181,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -173,6 +215,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -205,6 +249,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -237,6 +283,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -269,6 +317,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -301,6 +351,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -333,6 +385,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -365,6 +419,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -397,6 +453,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -429,6 +487,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -461,6 +521,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -493,6 +555,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -525,6 +589,8 @@ namespace bp = boost::python; #include "SireBase/getinstalldir.h" +#include "SireBase/parallel.h" + #include "SireError/errors.h" #include "SireMol/atomelements.h" @@ -739,6 +805,19 @@ void register_free_functions(){ } + { //::SireIO::setCoordinates + + typedef ::SireSystem::System ( *setCoordinates_function_type )( ::SireSystem::System &,::QVector> const &,bool const,::SireBase::PropertyMap const & ); + setCoordinates_function_type setCoordinates_function_value( &::SireIO::setCoordinates ); + + bp::def( + "setCoordinates" + , setCoordinates_function_value + , ( bp::arg("system"), bp::arg("coordinates"), bp::arg("is_lambda1")=(bool const)(false), bp::arg("map")=SireBase::PropertyMap() ) + , "Set the coordinates of the entire system.\nPar:am system\nThe molecular system of interest.\n\nPar:am coordinates\nThe new coordinates for the system.\n\nPar:am map\nA dictionary of user-defined molecular property names.\n\nRetval: system\nThe system with updated coordinates.\n" ); + + } + { //::SireIO::setGromacsWater typedef ::SireSystem::System ( *setGromacsWater_function_type )( ::SireSystem::System const &,::QString const &,::SireBase::PropertyMap const &,bool ); diff --git a/wrapper/MM/AngleRestraints.pypp.cpp b/wrapper/MM/AngleRestraints.pypp.cpp index 13bb30886..23f5c6b08 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::usesPbc + + typedef bool ( ::SireMM::AngleRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::AngleRestraints::usesPbc ); + + AngleRestraints_exposer.def( + "usesPbc" + , usesPbc_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::setUsesPbc + + typedef void ( ::SireMM::AngleRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::AngleRestraints::setUsesPbc ); + + AngleRestraints_exposer.def( + "setUsesPbc" + , setUsesPbc_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..2327e6cb9 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::usesPbc + + typedef bool ( ::SireMM::BondRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::BondRestraints::usesPbc ); + + BondRestraints_exposer.def( + "usesPbc" + , usesPbc_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::setUsesPbc + + typedef void ( ::SireMM::BondRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::BondRestraints::setUsesPbc ); + + BondRestraints_exposer.def( + "setUsesPbc" + , setUsesPbc_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..da907dcd9 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::usesPbc + + typedef bool ( ::SireMM::BoreschRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::BoreschRestraints::usesPbc ); + + BoreschRestraints_exposer.def( + "usesPbc" + , usesPbc_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::setUsesPbc + + typedef void ( ::SireMM::BoreschRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::BoreschRestraints::setUsesPbc ); + + BoreschRestraints_exposer.def( + "setUsesPbc" + , setUsesPbc_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 39d516818..73369fa99 100644 --- a/wrapper/MM/CMakeAutogenFile.txt +++ b/wrapper/MM/CMakeAutogenFile.txt @@ -1,226 +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 + 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 + 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 - AmberAngle.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 - NoCutoff.pypp.cpp - InterCoulombFF.pypp.cpp - CLJAtom.pypp.cpp - HarmonicSwitchingFunction.pypp.cpp - CLJBoxDistance.pypp.cpp - GromacsAtomType.pypp.cpp - BondRestraint.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 + 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..74ea2f5da 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::usesPbc + + typedef bool ( ::SireMM::DihedralRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::DihedralRestraints::usesPbc ); + + DihedralRestraints_exposer.def( + "usesPbc" + , usesPbc_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::setUsesPbc + + typedef void ( ::SireMM::DihedralRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::DihedralRestraints::setUsesPbc ); + + DihedralRestraints_exposer.def( + "setUsesPbc" + , setUsesPbc_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/InverseBondRestraint.pypp.cpp b/wrapper/MM/InverseBondRestraint.pypp.cpp new file mode 100644 index 000000000..7e84163fd --- /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 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..aa86830ec --- /dev/null +++ b/wrapper/MM/InverseBondRestraints.pypp.cpp @@ -0,0 +1,339 @@ +// 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 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::usesPbc + + typedef bool ( ::SireMM::InverseBondRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::InverseBondRestraints::usesPbc ); + + InverseBondRestraints_exposer.def( + "usesPbc" + , usesPbc_function_value + , bp::release_gil_policy() + , "Return whether or not periodic boundary conditions are to be used" ); + + } + { //::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::setUsesPbc + + typedef void ( ::SireMM::InverseBondRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::InverseBondRestraints::setUsesPbc ); + + InverseBondRestraints_exposer.def( + "setUsesPbc" + , setUsesPbc_function_value + , ( bp::arg("use_pbc") ) + , bp::release_gil_policy() + , "Set whether or not periodic boundary conditions are to be used" ); + + } + { //::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/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..b03fc22e9 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::usesPbc + + typedef bool ( ::SireMM::MorsePotentialRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::MorsePotentialRestraints::usesPbc ); + + MorsePotentialRestraints_exposer.def( + "usesPbc" + , usesPbc_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::setUsesPbc + + typedef void ( ::SireMM::MorsePotentialRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::MorsePotentialRestraints::setUsesPbc ); + + MorsePotentialRestraints_exposer.def( + "setUsesPbc" + , setUsesPbc_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..a179d8924 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::usesPbc + + typedef bool ( ::SireMM::PositionalRestraints::*usesPbc_function_type)( ) const; + usesPbc_function_type usesPbc_function_value( &::SireMM::PositionalRestraints::usesPbc ); + + PositionalRestraints_exposer.def( + "usesPbc" + , usesPbc_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::setUsesPbc + + typedef void ( ::SireMM::PositionalRestraints::*setUsesPbc_function_type)( bool ) ; + setUsesPbc_function_type setUsesPbc_function_value( &::SireMM::PositionalRestraints::setUsesPbc ); + + PositionalRestraints_exposer.def( + "setUsesPbc" + , setUsesPbc_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 0891d3f6c..5b7d1b0d4 100644 --- a/wrapper/MM/SireMM_registrars.cpp +++ b/wrapper/MM/SireMM_registrars.cpp @@ -3,121 +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 "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 >(); @@ -125,130 +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::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 >(); } diff --git a/wrapper/MM/_MM.main.cpp b/wrapper/MM/_MM.main.cpp index 06560baae..28f418d1d 100644 --- a/wrapper/MM/_MM.main.cpp +++ b/wrapper/MM/_MM.main.cpp @@ -307,6 +307,10 @@ #include "IntraSoftCLJFFBase.pypp.hpp" +#include "InverseBondRestraint.pypp.hpp" + +#include "InverseBondRestraints.pypp.hpp" + #include "LJ1264Parameter.pypp.hpp" #include "LJComponent.pypp.hpp" @@ -788,6 +792,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 ed4345abd..c4943414c 100644 --- a/wrapper/MM/active_headers.h +++ b/wrapper/MM/active_headers.h @@ -57,6 +57,7 @@ #include "intragroupff.h" #include "intraljff.h" #include "intrasoftcljff.h" +#include "inversebondrestraints.h" #include "lj1264parameter.h" #include "ljpair.h" #include "ljparameter.h"