Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature merge #175

Closed
wants to merge 53 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f5a307b
WIP - adding in mutate and merge functions to make it easier to use A…
chryswoods Feb 18, 2024
5a8d34e
Added the ability in AtomMapping to store the atoms that weren't mapp…
chryswoods Feb 19, 2024
326032a
Added quick functions to get and set the expression used for the pote…
chryswoods Feb 20, 2024
605e820
Merge branch 'fix_164' of https://github.com/openbiosim/sire into fea…
chryswoods Feb 20, 2024
807270b
Merge branch 'fix_164' of https://github.com/openbiosim/sire into fea…
chryswoods Feb 21, 2024
f31f5c8
Merge branch 'fix_164' of https://github.com/openbiosim/sire into fea…
chryswoods Feb 21, 2024
7c31ecb
Merge branch 'devel' of https://github.com/openbiosim/sire into featu…
chryswoods Feb 22, 2024
e3668f8
WIP - VERY WIP
chryswoods Feb 22, 2024
469e284
WIP - filling in missing functions and fixing wrappers
chryswoods Feb 22, 2024
85b2419
All functions implemented - can now compile and run code that has alt…
chryswoods Feb 22, 2024
1d87e8f
Added functions to switch to or remove the alternate names.
chryswoods Feb 23, 2024
8b2cdca
Merge branch 'fix_170' of https://github.com/openbiosim/sire into fea…
chryswoods Feb 23, 2024
dc43473
Fixed new code - all compiles, links and tests pass. Out of the rabbi…
chryswoods Feb 23, 2024
2855d9f
Making good progress - realised that can use properties of the atoms …
chryswoods Feb 23, 2024
8d33ce3
WIP (not compiling yet)
chryswoods Feb 25, 2024
2338e91
WIP (still) - added ability to control the value of ghost atom parame…
chryswoods Feb 25, 2024
52156d1
Merge branch 'fix_170' of https://github.com/openbiosim/sire into fea…
chryswoods Feb 26, 2024
4588f20
Added a SireBase::Console that connects through the sire.utils.Consol…
chryswoods Feb 26, 2024
ad73472
Added a warning that these higher-level properties aren't being merge…
chryswoods Feb 26, 2024
60abd65
WIP - I've been filling in the merge function for most of the MolView…
chryswoods Feb 27, 2024
e6a3223
Finished filling in null merge functions for the MolViewProperty clas…
chryswoods Feb 28, 2024
04f103e
AtomProperty merging is working quite well :-)
chryswoods Feb 28, 2024
44a4eaa
WIP - working out how to merge bonds...
chryswoods Feb 28, 2024
6bdf012
Making progress - am merging the bonds. To test this, I need to next …
chryswoods Mar 1, 2024
ce46594
Added code to merge the connectivities, plus build a shared connectiv…
chryswoods Mar 2, 2024
4f27171
Connectivity, atomtype, charge, LJ, mass, name and bond properties lo…
chryswoods Mar 2, 2024
9b1005c
Some optimisation, plus made sure that bonds involving atoms that exi…
chryswoods Mar 3, 2024
e0f3674
Added the same code to ThreeAtomFunctions and FourAtomFunctions and a…
chryswoods Mar 3, 2024
026cb15
Make sure to add connections from ghosts to reference atoms in the re…
chryswoods Mar 3, 2024
42ff6bd
Fixed a bug in AtomIdxMapping, and remembered to add the connections/…
chryswoods Mar 3, 2024
e5ae14e
Merge branch 'fix_constraints' of https://github.com/openbiosim/sire …
chryswoods Mar 4, 2024
1dab9f3
Added the code to merge the CLJNBPairs.
chryswoods Mar 4, 2024
f53bae3
Added a "to_xml" function so that it is easier to convert sire OpenMM…
chryswoods Mar 4, 2024
5348fcd
Added an AtomNumMatcher as this perfectly re-matches the separated ex…
chryswoods Mar 4, 2024
0a6c0ae
I've added alignment and also got the mutation working. A quick look …
chryswoods Mar 5, 2024
51a68eb
Working on adding in the checks for ring size breaking and changing, …
chryswoods Mar 5, 2024
e344caa
Added in the ring growing and breaking checks, ported from Python to C++
chryswoods Mar 6, 2024
ec46c5c
Added function-level documentation, plus also the sr.morph.decouple f…
chryswoods Mar 6, 2024
8bde2df
Fixes to make the merge, mutate and decouple work for the demo
chryswoods Mar 7, 2024
5cf821c
Added kartograf support to the match function. Can now pass in a Kart…
chryswoods Mar 8, 2024
ce1baa6
Optimised the code that edits proteins, so that the merge is not O(N2…
chryswoods Mar 9, 2024
0fbd040
Optimised the CLJNBPairs makeCompatible function, so that it works an…
chryswoods Mar 10, 2024
85546e8
Merge branch 'devel' of https://github.com/openbiosim/sire into featu…
chryswoods Mar 10, 2024
79ac2b6
Bringing in the fix for Mol2 atom types
chryswoods Mar 10, 2024
05969bb
Copying ghost NBSCL parameters from the alternate end state.
chryswoods Mar 10, 2024
ae47981
Added more to the merge test
chryswoods Mar 10, 2024
f724cf8
Optimised the perturbation object, fixed a small bug in the merge cod…
chryswoods Mar 10, 2024
c639827
Remerged does give the same energy as original merge
chryswoods Mar 10, 2024
08141be
Added in lambda=0.5 check - it is different - worth checking why
chryswoods Mar 10, 2024
86b3ca0
Fixed the crash (I think) caused by not removing atoms from the conne…
chryswoods Mar 17, 2024
dc78ac2
Updated requirements to not pull in kartograf on Windows
chryswoods Mar 17, 2024
50fab9a
Added decorators to skip tests for functionality not supported on win…
chryswoods Mar 17, 2024
8771ad7
Merge branch 'devel' into feature_merge
chryswoods Mar 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added the same code to ThreeAtomFunctions and FourAtomFunctions and a…
…re now merging

angles, dihedrals and impropers. But this all needs testing. Will do that after I have
added in the code to merge the CLJNBPairs
chryswoods committed Mar 3, 2024
commit e0f36745e5d3fce6591c59c05abb2acd925f6618
136 changes: 132 additions & 4 deletions corelib/src/libs/SireMM/fouratomfunctions.cpp
Original file line number Diff line number Diff line change
@@ -496,6 +496,45 @@ void FourAtomFunctions::clear(AtomIdx atom)
}
}

/** Clear all functions that involve any of the atoms in 'atoms'
* - if 'exclusive' is true, then this only removes functions
* that exclusively involve these atoms - if false, then
* if removes functions that involve any of these atoms
*/
void FourAtomFunctions::clear(const QList<AtomIdx> &atoms, bool exclusive)
{
QSet<quint32> atms;
atms.reserve(atoms.count());

for (const auto &atom : atoms)
{
atms.insert(atom.map(info().nAtoms()));
}

QList<IDQuad> keys = potentials_by_atoms.keys();

if (exclusive)
{
for (const auto &key : keys)
{
if (atms.contains(key.atom0) and atms.contains(key.atom1) and atms.contains(key.atom2) and atms.contains(key.atom3))
{
FourAtomFunctions::removeSymbols(potentials_by_atoms.take(key).symbols());
}
}
}
else
{
for (const auto &key : keys)
{
if (atms.contains(key.atom0) or atms.contains(key.atom1) or atms.contains(key.atom2) or atms.contains(key.atom3))
{
FourAtomFunctions::removeSymbols(potentials_by_atoms.take(key).symbols());
}
}
}
}

/** Clear any function that acts on the atoms identified by 'atom'

\throw SireMol::missing_atom
@@ -750,6 +789,47 @@ Expression FourAtomFunctions::force(const ImproperID &improperid, const Symbol &
return -(this->potential(improperid).differentiate(symbol));
}

/** Return the potential energy functions acting between the identified
atoms - if exclusive is true then only return potentials where
all atoms are in the dihedral or improper
*/
QVector<FourAtomFunction> FourAtomFunctions::potentials(const QList<AtomIdx> &atms, bool exclusive) const
{
QVector<FourAtomFunction> funcs;
funcs.reserve(potentials_by_atoms.count());

QSet<AtomIdx> atoms(atms.begin(), atms.end());

for (QHash<IDQuad, Expression>::const_iterator it = potentials_by_atoms.constBegin();
it != potentials_by_atoms.constEnd(); ++it)
{
if (exclusive)
{
if (atoms.contains(AtomIdx(it.key().atom0)) and atoms.contains(AtomIdx(it.key().atom1)) and atoms.contains(AtomIdx(it.key().atom2)) and atoms.contains(AtomIdx(it.key().atom3)))
{
funcs.append(FourAtomFunction(info().cgAtomIdx(AtomIdx(it.key().atom0)),
info().cgAtomIdx(AtomIdx(it.key().atom1)),
info().cgAtomIdx(AtomIdx(it.key().atom2)),
info().cgAtomIdx(AtomIdx(it.key().atom3)),
it.value()));
}
}
else
{
if (atoms.contains(AtomIdx(it.key().atom0)) or atoms.contains(AtomIdx(it.key().atom1)) or atoms.contains(AtomIdx(it.key().atom2)) or atoms.contains(AtomIdx(it.key().atom3)))
{
funcs.append(FourAtomFunction(info().cgAtomIdx(AtomIdx(it.key().atom0)),
info().cgAtomIdx(AtomIdx(it.key().atom1)),
info().cgAtomIdx(AtomIdx(it.key().atom2)),
info().cgAtomIdx(AtomIdx(it.key().atom3)),
it.value()));
}
}
}

return funcs;
}

/** Return the potential energy functions acting between the identified
quads of atoms */
QVector<FourAtomFunction> FourAtomFunctions::potentials() const
@@ -933,13 +1013,61 @@ PropertyList FourAtomFunctions::merge(const MolViewProperty &other,
CODELOC);
}

SireBase::Console::warning(QObject::tr("Merging %1 properties is not yet implemented. Returning two copies of the original property.")
.arg(this->what()));
if (not ghost.isEmpty())
{
Console::warning(QObject::tr("The ghost parameter '%1' for dihedral/improper parameters is ignored").arg(ghost));
}

const FourAtomFunctions &ref = *this;
const FourAtomFunctions &pert = other.asA<FourAtomFunctions>();

FourAtomFunctions prop0 = ref;
FourAtomFunctions prop1 = ref;

// the prop1 properties are made by finding all of the atoms that
// are involved in dihedrals in 'pert' and removing any involving
// only those atoms from 'prop1', and then adding back the matching
// dihedral from 'pert'. Use 'true' to only remove angles where all
// atoms are in the mapping
prop1.clear(mapping.mappedIn1(), true);

// get the mapping from the perturbed to reference states, including
// atoms that don't exist in the reference state. In all cases,
// the values are the indexes in the merged molecule
auto map1to0 = mapping.map1to0(true);

// now find all of the dihedrals in 'pert' where all atoms in the
// dihedral are in map1to0.keys() - i.e. exist and are mapped from
// the perturbed state
const auto pert_dihs = pert.potentials(map1to0.keys(), true);

for (const auto &pert_dih : pert_dihs)
{
const auto atom0 = map1to0.value(info().atomIdx(pert_dih.atom0()));
const auto atom1 = map1to0.value(info().atomIdx(pert_dih.atom1()));
const auto atom2 = map1to0.value(info().atomIdx(pert_dih.atom2()));
const auto atom3 = map1to0.value(info().atomIdx(pert_dih.atom3()));

prop1.set(atom0, atom1, atom2, atom3, pert_dih.function());

if (mapping.isUnmappedIn0(atom0) or mapping.isUnmappedIn0(atom1) or mapping.isUnmappedIn0(atom2) or mapping.isUnmappedIn0(atom3))
{
// the prop0 properties are nearly correct - we just need to add
// in dihedrals from 'pert' that involve the atoms that are not mapped
// in the reference state - this way, those added atoms are held
// by a constant dihedral potential, so won't fly away in the
// simulation of the reference state
prop0.set(atom0, atom1, atom2, atom3, pert_dih.function());
}
}

// the dihedrals for atoms that are unmapped in the perturbed state are
// already in prop1, as this was copied from prop0

SireBase::PropertyList ret;

ret.append(*this);
ret.append(*this);
ret.append(prop0);
ret.append(prop1);

return ret;
}
8 changes: 6 additions & 2 deletions corelib/src/libs/SireMM/fouratomfunctions.h
Original file line number Diff line number Diff line change
@@ -184,8 +184,6 @@ namespace SireMM

QString toString() const;

int nFunctions() const;

void set(AtomIdx atom0, AtomIdx atom1, AtomIdx atom2, AtomIdx atom3, const Expression &expression);

void set(const AtomID &atom0, const AtomID &atom1, const AtomID &atom2, const AtomID &atom3,
@@ -203,12 +201,16 @@ namespace SireMM
void clear(const DihedralID &dihedralid);
void clear(const ImproperID &improperid);

void clear(const QList<AtomIdx> &atoms, bool exclusive = true);

void clear();

void substitute(const Identities &identities);

bool isEmpty() const;

int nFunctions() const;

Expression potential(AtomIdx atom0, AtomIdx atom1, AtomIdx atom2, AtomIdx atom3) const;
Expression potential(const AtomID &atom0, const AtomID &atom1, const AtomID &atom2, const AtomID &atom3) const;

@@ -225,6 +227,8 @@ namespace SireMM
QVector<FourAtomFunction> potentials() const;
QVector<FourAtomFunction> forces(const Symbol &symbol) const;

QVector<FourAtomFunction> potentials(const QList<AtomIdx> &atoms, bool exclusive = true) const;

FourAtomFunctions includeOnly(const AtomSelection &selected_atoms, bool isstrict = true) const;

SireBase::PropertyList merge(const MolViewProperty &other,
133 changes: 129 additions & 4 deletions corelib/src/libs/SireMM/threeatomfunctions.cpp
Original file line number Diff line number Diff line change
@@ -450,6 +450,45 @@ void ThreeAtomFunctions::clear(AtomIdx atom)
}
}

/** Clear all functions that involve any of the atoms in 'atoms'
* - if 'exclusive' is true, then this only removes functions
* that exclusively involve these atoms - if false, then
* if removes functions that involve any of these atoms
*/
void ThreeAtomFunctions::clear(const QList<AtomIdx> &atoms, bool exclusive)
{
QSet<quint32> atms;
atms.reserve(atoms.count());

for (const auto &atom : atoms)
{
atms.insert(atom.map(info().nAtoms()));
}

QList<IDTriple> keys = potentials_by_atoms.keys();

if (exclusive)
{
for (const auto &key : keys)
{
if (atms.contains(key.atom0) and atms.contains(key.atom1) and atms.contains(key.atom2))
{
ThreeAtomFunctions::removeSymbols(potentials_by_atoms.take(key).symbols());
}
}
}
else
{
for (const auto &key : keys)
{
if (atms.contains(key.atom0) or atms.contains(key.atom1) or atms.contains(key.atom2))
{
ThreeAtomFunctions::removeSymbols(potentials_by_atoms.take(key).symbols());
}
}
}
}

/** Clear any function that acts on the atoms identified by 'atom'

\throw SireMol::missing_atom
@@ -631,6 +670,45 @@ Expression ThreeAtomFunctions::force(const AngleID &angleid, const Symbol &symbo
return -(this->potential(angleid).differentiate(symbol));
}

/** Return the potential energy functions acting between the identified
atoms - if exclusive is true then only return potentials where
all atoms are in the angle
*/
QVector<ThreeAtomFunction> ThreeAtomFunctions::potentials(const QList<AtomIdx> &atms, bool exclusive) const
{
QVector<ThreeAtomFunction> funcs;
funcs.reserve(potentials_by_atoms.count());

QSet<AtomIdx> atoms(atms.begin(), atms.end());

for (QHash<IDTriple, Expression>::const_iterator it = potentials_by_atoms.constBegin();
it != potentials_by_atoms.constEnd(); ++it)
{
if (exclusive)
{
if (atoms.contains(AtomIdx(it.key().atom0)) and atoms.contains(AtomIdx(it.key().atom1)) and atoms.contains(AtomIdx(it.key().atom2)))
{
funcs.append(ThreeAtomFunction(info().cgAtomIdx(AtomIdx(it.key().atom0)),
info().cgAtomIdx(AtomIdx(it.key().atom1)),
info().cgAtomIdx(AtomIdx(it.key().atom2)),
it.value()));
}
}
else
{
if (atoms.contains(AtomIdx(it.key().atom0)) or atoms.contains(AtomIdx(it.key().atom1)) or atoms.contains(AtomIdx(it.key().atom2)))
{
funcs.append(ThreeAtomFunction(info().cgAtomIdx(AtomIdx(it.key().atom0)),
info().cgAtomIdx(AtomIdx(it.key().atom1)),
info().cgAtomIdx(AtomIdx(it.key().atom2)),
it.value()));
}
}
}

return funcs;
}

/** Return the potential energy functions acting between the identified
triples of atoms */
QVector<ThreeAtomFunction> ThreeAtomFunctions::potentials() const
@@ -811,13 +889,60 @@ PropertyList ThreeAtomFunctions::merge(const MolViewProperty &other,
CODELOC);
}

SireBase::Console::warning(QObject::tr("Merging %1 properties is not yet implemented. Returning two copies of the original property.")
.arg(this->what()));
if (not ghost.isEmpty())
{
Console::warning(QObject::tr("The ghost parameter '%1' for angle parameters is ignored").arg(ghost));
}

const ThreeAtomFunctions &ref = *this;
const ThreeAtomFunctions &pert = other.asA<ThreeAtomFunctions>();

ThreeAtomFunctions prop0 = ref;
ThreeAtomFunctions prop1 = ref;

// the prop1 properties are made by finding all of the atoms that
// are involved in angles in 'pert' and removing any angles involving
// only those atoms from 'prop1', and then adding back the matching
// angle from 'pert'. Use 'true' to only remove angles where all
// atoms are in the mapping
prop1.clear(mapping.mappedIn1(), true);

// get the mapping from the perturbed to reference states, including
// atoms that don't exist in the reference state. In all cases,
// the values are the indexes in the merged molecule
auto map1to0 = mapping.map1to0(true);

// now find all of the angles in 'pert' where all atoms in the
// angle are in map1to0.keys() - i.e. exist and are mapped from
// the perturbed state
const auto pert_angs = pert.potentials(map1to0.keys(), true);

for (const auto &pert_ang : pert_angs)
{
const auto atom0 = map1to0.value(info().atomIdx(pert_ang.atom0()));
const auto atom1 = map1to0.value(info().atomIdx(pert_ang.atom1()));
const auto atom2 = map1to0.value(info().atomIdx(pert_ang.atom2()));

prop1.set(atom0, atom1, atom2, pert_ang.function());

if (mapping.isUnmappedIn0(atom0) or mapping.isUnmappedIn0(atom1) or mapping.isUnmappedIn0(atom2))
{
// the prop0 properties are nearly correct - we just need to add
// in angles from 'pert' that involve the atoms that are not mapped
// in the reference state - this way, those added atoms are held
// by a constant angle potential, so won't fly away in the
// simulation of the reference state
prop0.set(atom0, atom1, atom2, pert_ang.function());
}
}

// the angles for atoms that are unmapped in the perturbed state are
// already in prop1, as this was copied from prop0

SireBase::PropertyList ret;

ret.append(*this);
ret.append(*this);
ret.append(prop0);
ret.append(prop1);

return ret;
}
8 changes: 6 additions & 2 deletions corelib/src/libs/SireMM/threeatomfunctions.h
Original file line number Diff line number Diff line change
@@ -189,14 +189,16 @@ namespace SireMM
void clear(const AtomID &atom0, const AtomID &atom1, const AtomID &atom2);
void clear(const AngleID &angleid);

void clear(const QList<AtomIdx> &atoms, bool exclusive = true);

void clear();

void substitute(const Identities &identities);

int nFunctions() const;

bool isEmpty() const;

int nFunctions() const;

Expression potential(AtomIdx atom0, AtomIdx atom1, AtomIdx atom2) const;
Expression potential(const AtomID &atom0, const AtomID &atom1, const AtomID &atom2) const;
Expression potential(const AngleID &angleid) const;
@@ -208,6 +210,8 @@ namespace SireMM
QVector<ThreeAtomFunction> potentials() const;
QVector<ThreeAtomFunction> forces(const Symbol &symbol) const;

QVector<ThreeAtomFunction> potentials(const QList<AtomIdx> &atoms, bool exclusive = true) const;

ThreeAtomFunctions includeOnly(const AtomSelection &selected_atoms, bool isstrict = true) const;

SireBase::PropertyList merge(const MolViewProperty &other,
2 changes: 2 additions & 0 deletions wrapper/MM/AtomLJs.pypp.cpp
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@

namespace bp = boost::python;

#include "SireBase/console.h"

#include "SireBase/incremint.h"

#include "SireBase/propertylist.h"
24 changes: 24 additions & 0 deletions wrapper/MM/FourAtomFunctions.pypp.cpp
Original file line number Diff line number Diff line change
@@ -127,6 +127,18 @@ void register_FourAtomFunctions_class(){
, bp::release_gil_policy()
, "Clear the potential that acts over the improper identified by improperid\nThis clears all matching impropers, so 1-2-3-4 and 1-2-4-3\nThrow: SireMol::missing_atom\nThrow: SireError::invalid_index\n" );

}
{ //::SireMM::FourAtomFunctions::clear

typedef void ( ::SireMM::FourAtomFunctions::*clear_function_type)( ::QList< SireMol::AtomIdx > const &,bool ) ;
clear_function_type clear_function_value( &::SireMM::FourAtomFunctions::clear );

FourAtomFunctions_exposer.def(
"clear"
, clear_function_value
, ( bp::arg("atoms"), bp::arg("exclusive")=(bool)(true) )
, "Clear all functions that involve any of the atoms in atoms\n - if exclusive is true, then this only removes functions\n that exclusively involve these atoms - if false, then\n if removes functions that involve any of these atoms\n" );

}
{ //::SireMM::FourAtomFunctions::clear

@@ -331,6 +343,18 @@ void register_FourAtomFunctions_class(){
, bp::release_gil_policy()
, "Return the potential energy functions acting between the identified\nquads of atoms" );

}
{ //::SireMM::FourAtomFunctions::potentials

typedef ::QVector< SireMM::FourAtomFunction > ( ::SireMM::FourAtomFunctions::*potentials_function_type)( ::QList< SireMol::AtomIdx > const &,bool ) const;
potentials_function_type potentials_function_value( &::SireMM::FourAtomFunctions::potentials );

FourAtomFunctions_exposer.def(
"potentials"
, potentials_function_value
, ( bp::arg("atoms"), bp::arg("exclusive")=(bool)(true) )
, "Return the potential energy functions acting between the identified\natoms - if exclusive is true then only return potentials where\nall atoms are in the dihedral or improper\n" );

}
{ //::SireMM::FourAtomFunctions::set

2 changes: 2 additions & 0 deletions wrapper/MM/LJException.pypp.cpp
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@

namespace bp = boost::python;

#include "SireBase/console.h"

#include "SireBase/incremint.h"

#include "SireBase/propertylist.h"
2 changes: 2 additions & 0 deletions wrapper/MM/LJExceptionID.pypp.cpp
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@

namespace bp = boost::python;

#include "SireBase/console.h"

#include "SireBase/incremint.h"

#include "SireBase/propertylist.h"
24 changes: 24 additions & 0 deletions wrapper/MM/ThreeAtomFunctions.pypp.cpp
Original file line number Diff line number Diff line change
@@ -114,6 +114,18 @@ void register_ThreeAtomFunctions_class(){
, bp::release_gil_policy()
, "Clear the potential that acts over the angle identified by angleid\nThis clears both 1-2-3 and 3-2-1\nThrow: SireMol::missing_atom\nThrow: SireError::invalid_index\n" );

}
{ //::SireMM::ThreeAtomFunctions::clear

typedef void ( ::SireMM::ThreeAtomFunctions::*clear_function_type)( ::QList< SireMol::AtomIdx > const &,bool ) ;
clear_function_type clear_function_value( &::SireMM::ThreeAtomFunctions::clear );

ThreeAtomFunctions_exposer.def(
"clear"
, clear_function_value
, ( bp::arg("atoms"), bp::arg("exclusive")=(bool)(true) )
, "Clear all functions that involve any of the atoms in atoms\n - if exclusive is true, then this only removes functions\n that exclusively involve these atoms - if false, then\n if removes functions that involve any of these atoms\n" );

}
{ //::SireMM::ThreeAtomFunctions::clear

@@ -292,6 +304,18 @@ void register_ThreeAtomFunctions_class(){
, bp::release_gil_policy()
, "Return the potential energy functions acting between the identified\ntriples of atoms" );

}
{ //::SireMM::ThreeAtomFunctions::potentials

typedef ::QVector< SireMM::ThreeAtomFunction > ( ::SireMM::ThreeAtomFunctions::*potentials_function_type)( ::QList< SireMol::AtomIdx > const &,bool ) const;
potentials_function_type potentials_function_value( &::SireMM::ThreeAtomFunctions::potentials );

ThreeAtomFunctions_exposer.def(
"potentials"
, potentials_function_value
, ( bp::arg("atoms"), bp::arg("exclusive")=(bool)(true) )
, "Return the potential energy functions acting between the identified\natoms - if exclusive is true then only return potentials where\nall atoms are in the angle\n" );

}
{ //::SireMM::ThreeAtomFunctions::set

24 changes: 24 additions & 0 deletions wrapper/MM/TwoAtomFunctions.pypp.cpp
Original file line number Diff line number Diff line change
@@ -114,6 +114,18 @@ void register_TwoAtomFunctions_class(){
, bp::release_gil_policy()
, "Clear the potential that acts over the bond identified by bondid\nNote that this removes both 1-2 and 2-1\nThrow: SireMol::missing_atom\nThrow: SireError::invalid_index\n" );

}
{ //::SireMM::TwoAtomFunctions::clear

typedef void ( ::SireMM::TwoAtomFunctions::*clear_function_type)( ::QList< SireMol::AtomIdx > const &,bool ) ;
clear_function_type clear_function_value( &::SireMM::TwoAtomFunctions::clear );

TwoAtomFunctions_exposer.def(
"clear"
, clear_function_value
, ( bp::arg("atoms"), bp::arg("exclusive")=(bool)(true) )
, "Clear all functions that invole any of the atoms in atoms\n - if exclusive is true, then this only removes functions\n that exclusively involve these atoms - if false, then\n if removes functions that involve any of these atoms\n" );

}
{ //::SireMM::TwoAtomFunctions::clear

@@ -292,6 +304,18 @@ void register_TwoAtomFunctions_class(){
, bp::release_gil_policy()
, "Return the potential energy functions acting between the identified\npairs of atoms" );

}
{ //::SireMM::TwoAtomFunctions::potentials

typedef ::QVector< SireMM::TwoAtomFunction > ( ::SireMM::TwoAtomFunctions::*potentials_function_type)( ::QList< SireMol::AtomIdx > const &,bool ) const;
potentials_function_type potentials_function_value( &::SireMM::TwoAtomFunctions::potentials );

TwoAtomFunctions_exposer.def(
"potentials"
, potentials_function_value
, ( bp::arg("atoms"), bp::arg("exclusive")=(bool)(true) )
, "Return the potential energy functions acting between the identified\npairs of atoms - if exclusive is true then only return potentials where\nboth atoms are in the bond\n" );

}
{ //::SireMM::TwoAtomFunctions::set