Skip to content

Commit

Permalink
Added activeAtomMask to energy calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
drmeister committed Dec 1, 2023
1 parent ae2a525 commit 9a8fe92
Show file tree
Hide file tree
Showing 98 changed files with 69,927 additions and 17,157 deletions.
7 changes: 4 additions & 3 deletions include/cando/chem/energyAnchorRestraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ class EnergyAnchorRestraint_O : public EnergyComponent_O


virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );
virtual num_real evaluateAllComponent( ScoringFunction_sp scorer,
NVector_sp pos,
core::T_sp componentEnergy,
Expand All @@ -171,8 +172,8 @@ class EnergyAnchorRestraint_O : public EnergyComponent_O
core::T_sp activeAtomMask
);

virtual void compareAnalyticalAndNumericalForceAndHessianTermByTerm(
NVector_sp pos );
virtual void compareAnalyticalAndNumericalForceAndHessianTermByTerm(NVector_sp pos,
core::T_sp activeAtomMask );

// virtual int checkForBeyondThresholdInteractions( stringstream& info, NVector_sp pos );

Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energyAngle.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ class EnergyAngle_O : public EnergyComponent_O


virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );
virtual num_real evaluateAllComponent( ScoringFunction_sp scorer,
NVector_sp pos,
core::T_sp componentEnergy,
Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energyChiralRestraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ class EnergyChiralRestraint_O : public EnergyComponent_O
virtual bool is_restraint() const { return true; };

virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );
virtual num_real evaluateAllComponent( ScoringFunction_sp scorer,
NVector_sp pos,
core::T_sp componentEnergy,
Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energyDihedral.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ class EnergyDihedral_O : public EnergyComponent_O


virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );
virtual num_real evaluateAllComponent( ScoringFunction_sp scorer,
NVector_sp pos,
core::T_sp componentEnergy,
Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energyDihedralRestraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ class EnergyDihedralRestraint_O : public EnergyComponent_O
virtual void dumpTerms(core::HashTable_sp atomTypes);

virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );
virtual num_real evaluateAllComponent( ScoringFunction_sp scorer,
NVector_sp pos,
core::T_sp componentEnergy,
Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energyFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ namespace chem {
CL_DEFMETHOD bool hasMissingParameters();
CL_DEFMETHOD core::List_sp getMissingParameters();

void setupHessianPreconditioner( NVector_sp pos, AbstractLargeSquareMatrix_sp hessian);
void setupHessianPreconditioner( NVector_sp pos, AbstractLargeSquareMatrix_sp hessian,
core::T_sp activeAtomMask );

/*! Enable debugging on all energy components
*/
Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energyNonbond.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ class EnergyNonbond_O : public EnergyComponent_O
virtual core::List_sp extract_vectors_as_alist() const;

virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );

void verifyExcludedAtoms(Matter_sp matter, ScoringFunction_sp score);

Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energyOutOfZPlane.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ class EnergyOutOfZPlane_O : public EnergyComponent_O
virtual void dumpTerms(core::HashTable_sp atomTypes);

virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );
virtual num_real evaluateAllComponent( ScoringFunction_sp scorer,
NVector_sp pos,
core::T_sp componentEnergy,
Expand Down
9 changes: 6 additions & 3 deletions include/cando/chem/energyPeriodicBoundaryConditionsNonbond.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class EnergyPeriodicBoundaryConditionsNonbond_O : public EnergyNonbond_O
LISP_CLASS(chem,ChemPkg,EnergyPeriodicBoundaryConditionsNonbond_O,"EnergyPeriodicBoundaryConditionsNonbond",EnergyNonbond_O);

virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );

virtual void evaluateUsingExcludedAtoms( ScoringFunction_sp score,
NVector_sp pos,
Expand All @@ -71,7 +72,8 @@ class EnergyPeriodicBoundaryConditionsNonbond_O : public EnergyNonbond_O
bool calcOffDiagonalHessian,
gc::Nilable<AbstractLargeSquareMatrix_sp> hessian,
gc::Nilable<NVector_sp> hdvec,
gc::Nilable<NVector_sp> dvec);
gc::Nilable<NVector_sp> dvec,
core::T_sp activeAtomMask );
virtual void evaluateTerms( ScoringFunction_sp score,
NVector_sp pos,
bool calcForce,
Expand All @@ -80,7 +82,8 @@ class EnergyPeriodicBoundaryConditionsNonbond_O : public EnergyNonbond_O
bool calcOffDiagonalHessian,
gc::Nilable<AbstractLargeSquareMatrix_sp> hessian,
gc::Nilable<NVector_sp> hdvec,
gc::Nilable<NVector_sp> dvec);
gc::Nilable<NVector_sp> dvec,
core::T_sp activeAtomMask );

virtual void compareAnalyticalAndNumericalForceAndHessianTermByTerm(ScoringFunction_sp score, NVector_sp pos );

Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energyRigidBodyNonbond.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ class EnergyRigidBodyNonbond_O : public EnergyRigidBodyComponent_O
CL_DEFMETHOD void energyRigidBodyNonbondSetTerm(gc::Fixnum index, core::T_sp object, double radius, double epsilon, double charge, const Vector3& position);

virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );

virtual num_real evaluateAllComponent( ScoringFunction_sp scorer,
NVector_sp pos,
Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energyRigidBodyStaple.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ class EnergyRigidBodyStaple_O : public EnergyRigidBodyComponent_O
virtual void dumpTerms(core::HashTable_sp atomTypes);

virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );
virtual num_real evaluateAllComponent( ScoringFunction_sp scorer,
NVector_sp pos,
core::T_sp componentEnergy,
Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energySketchNonbond.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ class EnergySketchNonbond_O : public EnergyComponent_O
void addSketchNonbondTerm(size_t coordinate1IndexTimes3, size_t coordinate2IndexTimes3, size_t freezeFlags, double constant);

virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );

virtual num_real evaluateAllComponent( ScoringFunction_sp scorer,
NVector_sp pos,
Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energySketchStretch.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ class EnergySketchStretch_O : public EnergyComponent_O
virtual void fill_from_vectors_in_alist(core::List_sp vectors);

virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask );
virtual num_real evaluateAllComponent( ScoringFunction_sp scorer,
NVector_sp pos,
core::T_sp componentEnergy,
Expand Down
3 changes: 2 additions & 1 deletion include/cando/chem/energyStretch.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ class EnergyStretch_O : public EnergyComponent_O
core::T_sp stretchTermBetweenAtoms(Atom_sp a1, Atom_sp a2);

virtual void setupHessianPreconditioner(NVector_sp nvPosition,
AbstractLargeSquareMatrix_sp m );
AbstractLargeSquareMatrix_sp m,
core::T_sp activeAtomMask);
virtual num_real evaluateAllComponent( ScoringFunction_sp scorer,
NVector_sp pos,
core::T_sp componentEnergy,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
/*
File: _AnchorRestraint_debugEvalDeclares.cc
*/
/*
Open Source License
Copyright (c) 2016, Christian E. Schafmeister
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
This is an open source license for the CANDO software from Temple University, but it is not the only one. Contact Temple University at mailto:[email protected] if you would like a different license.
*/
/* -^- */
// DEFINE_EVAL
struct {
double x1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
/*
File: _AnchorRestraint_debugEvalSerialize.cc
*/
/*
Open Source License
Copyright (c) 2016, Christian E. Schafmeister
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
This is an open source license for the CANDO software from Temple University, but it is not the only one. Contact Temple University at mailto:[email protected] if you would like a different license.
*/
/* -^- */
// XML_EVAL
node->attributeIfNotDefault("evalx1", this->eval.x1, 0.0 );
node->attributeIfNotDefault("evaly1", this->eval.y1, 0.0 );
Expand All @@ -42,3 +17,4 @@ This is an open source license for the CANDO software from Temple University, bu
node->attributeIfNotDefault("evalohx1z1", this->eval.ohx1z1, 0.0 );
node->attributeIfNotDefault("evalohy1z1", this->eval.ohy1z1, 0.0 );
node->attributeIfNotDefault("evalAnchorDeviation", this->eval.AnchorDeviation, 0.0 );

Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
/*
File: _AnchorRestraint_debugEvalSet.cc
*/
/*
Open Source License
Copyright (c) 2016, Christian E. Schafmeister
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
This is an open source license for the CANDO software from Temple University, but it is not the only one. Contact Temple University at mailto:[email protected] if you would like a different license.
*/
/* -^- */
// SET_EVAL
EVAL_SET(x1, x1);
EVAL_SET(y1, y1);
Expand All @@ -42,3 +17,4 @@ This is an open source license for the CANDO software from Temple University, bu
EVAL_SET(ohx1z1, ohx1z1);
EVAL_SET(ohy1z1, ohy1z1);
EVAL_SET(AnchorDeviation, AnchorDeviation);

Original file line number Diff line number Diff line change
@@ -1,83 +1,58 @@
/*
File: _AnchorRestraint_debugFiniteDifference.cc
*/
/*
Open Source License
Copyright (c) 2016, Christian E. Schafmeister
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
This is an open source license for the CANDO software from Temple University, but it is not the only one. Contact Temple University at mailto:[email protected] if you would like a different license.
*/
/* -^- */
// FINITE_DIFFERENCE_TEST
TEST_FORCE( _evaluateEnergyOnly_AnchorRestraint, delta2*2.0,
(-delta2 + x1, y1, z1, xa, ya, za, ka),
(delta2 + x1, y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, -delta2 + x1, y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, delta2 + x1, y1, z1, xa, ya, za, ka),
fx1,
index);
TEST_FORCE( _evaluateEnergyOnly_AnchorRestraint, delta2*2.0,
(x1, -delta2 + y1, z1, xa, ya, za, ka),
(x1, delta2 + y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, -delta2 + y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, delta2 + y1, z1, xa, ya, za, ka),
fy1,
index);
TEST_FORCE( _evaluateEnergyOnly_AnchorRestraint, delta2*2.0,
(x1, y1, -delta2 + z1, xa, ya, za, ka),
(x1, y1, delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, y1, -delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, y1, delta2 + z1, xa, ya, za, ka),
fz1,
index);
TEST_DIAGONAL_HESSIAN( _evaluateEnergyOnly_AnchorRestraint, delta2*2.0,
(-delta2 + x1, y1, z1, xa, ya, za, ka),
(x1, y1, z1, xa, ya, za, ka),
(delta2 + x1, y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, -delta2 + x1, y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, delta2 + x1, y1, z1, xa, ya, za, ka),
dhx1x1,
index);
TEST_OFF_DIAGONAL_HESSIAN( _evaluateEnergyOnly_AnchorRestraint,
delta2*2.0,
(-delta2 + x1, -delta2 + y1, z1, xa, ya, za, ka),
(delta2 + x1, -delta2 + y1, z1, xa, ya, za, ka),
(-delta2 + x1, delta2 + y1, z1, xa, ya, za, ka),
(delta2 + x1, delta2 + y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, -delta2 + x1, -delta2 + y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, delta2 + x1, -delta2 + y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, -delta2 + x1, delta2 + y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, delta2 + x1, delta2 + y1, z1, xa, ya, za, ka),
ohx1y1,
index);
TEST_OFF_DIAGONAL_HESSIAN( _evaluateEnergyOnly_AnchorRestraint,
delta2*2.0,
(-delta2 + x1, y1, -delta2 + z1, xa, ya, za, ka),
(delta2 + x1, y1, -delta2 + z1, xa, ya, za, ka),
(-delta2 + x1, y1, delta2 + z1, xa, ya, za, ka),
(delta2 + x1, y1, delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, -delta2 + x1, y1, -delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, delta2 + x1, y1, -delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, -delta2 + x1, y1, delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, delta2 + x1, y1, delta2 + z1, xa, ya, za, ka),
ohx1z1,
index);
TEST_DIAGONAL_HESSIAN( _evaluateEnergyOnly_AnchorRestraint, delta2*2.0,
(x1, -delta2 + y1, z1, xa, ya, za, ka),
(x1, y1, z1, xa, ya, za, ka),
(x1, delta2 + y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, -delta2 + y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, delta2 + y1, z1, xa, ya, za, ka),
dhy1y1,
index);
TEST_OFF_DIAGONAL_HESSIAN( _evaluateEnergyOnly_AnchorRestraint,
delta2*2.0,
(x1, -delta2 + y1, -delta2 + z1, xa, ya, za, ka),
(x1, delta2 + y1, -delta2 + z1, xa, ya, za, ka),
(x1, -delta2 + y1, delta2 + z1, xa, ya, za, ka),
(x1, delta2 + y1, delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, -delta2 + y1, -delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, delta2 + y1, -delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, -delta2 + y1, delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, delta2 + y1, delta2 + z1, xa, ya, za, ka),
ohy1z1,
index);
TEST_DIAGONAL_HESSIAN( _evaluateEnergyOnly_AnchorRestraint, delta2*2.0,
(x1, y1, -delta2 + z1, xa, ya, za, ka),
(x1, y1, z1, xa, ya, za, ka),
(x1, y1, delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, y1, -delta2 + z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, y1, z1, xa, ya, za, ka),
(ENERGY_FUNCTION, x1, y1, delta2 + z1, xa, ya, za, ka),
dhz1z1,
index);
Loading

0 comments on commit 9a8fe92

Please sign in to comment.