Skip to content

Commit

Permalink
Ran astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Aneurin Tribello committed Sep 12, 2024
1 parent 570827a commit 9d4c4e5
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 65 deletions.
58 changes: 29 additions & 29 deletions src/crystdistrib/QuaternionBondProductMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ unsigned QuaternionBondProductMatrix::getNumberOfDerivatives() {
}

unsigned QuaternionBondProductMatrix::getNumberOfColumns() const {
const ActionWithMatrix* am=dynamic_cast<const ActionWithMatrix*>( getPntrToArgument(4)->getPntrToAction() ); plumed_assert( am );
const ActionWithMatrix* am=dynamic_cast<const ActionWithMatrix*>( getPntrToArgument(4)->getPntrToAction() ); plumed_assert( am );
if( getPntrToArgument(4)->isSymmetric() && am->getNumberOfColumns()==getPntrToArgument(4)->getShape()[1]-1 ) return am->getNumberOfColumns() + 1;
return am->getNumberOfColumns();
}
Expand Down Expand Up @@ -245,15 +245,15 @@ void QuaternionBondProductMatrix::performTask( const std::string& controller, co
}
//had to split because bond's derivatives depend on the value of the overall quaternion component
if( !doNotCalculateDerivatives() ) {
unsigned ostrn = getConstPntrToComponent(0)->getPositionInStream();
for(unsigned i=0; i<4; ++i) {
tempDot=dotProduct(Vector4d(quat[0],-quat[1],-quat[2],-quat[3]), dqt[1].getCol(i))*normFac;
if( i>0 ) {
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
myvals.addDerivative( ostrn, base + find, tempDot ); myvals.updateIndex( ostrn, base + find );
}
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
unsigned ostrn = getConstPntrToComponent(0)->getPositionInStream();
for(unsigned i=0; i<4; ++i) {
tempDot=dotProduct(Vector4d(quat[0],-quat[1],-quat[2],-quat[3]), dqt[1].getCol(i))*normFac;
if( i>0 ) {
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
myvals.addDerivative( ostrn, base + find, tempDot ); myvals.updateIndex( ostrn, base + find );
}
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
}
}

//i component
Expand All @@ -269,19 +269,19 @@ void QuaternionBondProductMatrix::performTask( const std::string& controller, co
if( doNotCalculateDerivatives() ) continue ;
tempDot=(dotProduct(Vector4d(quat[1],quat[0],quat[3],-quat[2]), dqt[0].getCol(i)) + pref2*quatTemp[(5-i)%4])*normFac;
addDerivativeOnVectorArgument( stored[i], 1, i, index1, tempDot, myvals);
base += getPntrToArgument(i)->getNumberOfStoredValues();
base += getPntrToArgument(i)->getNumberOfStoredValues();
}

if( !doNotCalculateDerivatives() ) {
unsigned ostrn = getConstPntrToComponent(1)->getPositionInStream();
for(unsigned i=0; i<4; ++i) {
tempDot=dotProduct(Vector4d(quat[1],quat[0],quat[3],-quat[2]), dqt[1].getCol(i))*normFac;
if( i>0 ) {
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*xf) ); myvals.updateIndex( ostrn, base + find );
}
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
if( !doNotCalculateDerivatives() ) {
unsigned ostrn = getConstPntrToComponent(1)->getPositionInStream();
for(unsigned i=0; i<4; ++i) {
tempDot=dotProduct(Vector4d(quat[1],quat[0],quat[3],-quat[2]), dqt[1].getCol(i))*normFac;
if( i>0 ) {
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*xf) ); myvals.updateIndex( ostrn, base + find );
}
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
}
}


Expand All @@ -303,15 +303,15 @@ void QuaternionBondProductMatrix::performTask( const std::string& controller, co
}

if( !doNotCalculateDerivatives() ) {
unsigned ostrn = getConstPntrToComponent(2)->getPositionInStream();
for(unsigned i=0; i<4; ++i) {
tempDot=dotProduct(Vector4d(quat[2],-quat[3],quat[0],quat[1]), dqt[1].getCol(i))*normFac;
if( i>0 ) {
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*yf) ); myvals.updateIndex( ostrn, base + find );
}
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
unsigned ostrn = getConstPntrToComponent(2)->getPositionInStream();
for(unsigned i=0; i<4; ++i) {
tempDot=dotProduct(Vector4d(quat[2],-quat[3],quat[0],quat[1]), dqt[1].getCol(i))*normFac;
if( i>0 ) {
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*yf) ); myvals.updateIndex( ostrn, base + find );
}
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
}
}

//k component
Expand All @@ -337,8 +337,8 @@ void QuaternionBondProductMatrix::performTask( const std::string& controller, co
for(unsigned i=0; i<4; ++i) {
tempDot=dotProduct(Vector4d(quat[3],quat[2],-quat[1],quat[0]), dqt[1].getCol(i))*normFac;
if( i>0 ) {
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*zf) ); myvals.updateIndex( ostrn, base + find );
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*zf) ); myvals.updateIndex( ostrn, base + find );
}
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
}
Expand Down
6 changes: 3 additions & 3 deletions src/secondarystructure/AlphaRMSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ AlphaRMSD::AlphaRMSD(const ActionOptions&ao):
readInputLine( lab + ": SECONDARY_STRUCTURE_RMSD BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
// Create the less than object
if( ltmap.length()>0 ) {
readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
if( uselessthan ) readInputLine( getShortcutLabel() + "_lessthan: SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
else readInputLine( getShortcutLabel() + ": SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
if( uselessthan ) readInputLine( getShortcutLabel() + "_lessthan: SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
else readInputLine( getShortcutLabel() + ": SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
}
}

Expand Down
24 changes: 12 additions & 12 deletions src/secondarystructure/AntibetaRMSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,22 +233,22 @@ AntibetaRMSD::AntibetaRMSD(const ActionOptions&ao):
std::string atoms="ATOMS=" + all_atoms[0]; for(unsigned i=1; i<all_atoms.size(); ++i) atoms += "," + all_atoms[i];

if( strands_cutoff>0 ) {
readInputLine( scutoff_action ); std::string str_cut; Tools::convert( strands_cutoff, str_cut );
readInputLine( getShortcutLabel() + "_cut: CUSTOM ARG=" + getShortcutLabel() + "_cut_dists FUNC=step(" + str_cut + "-x) PERIODIC=NO");
readInputLine( lab + ": SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS MASK=" + getShortcutLabel() + "_cut BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
if( ltmap.length()>0 ) {
readInputLine( getShortcutLabel() + "_ltu: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"} MASK=" + getShortcutLabel() + "_cut");
readInputLine( getShortcutLabel() + "_lt: CUSTOM ARG=" + getShortcutLabel() + "_ltu," + getShortcutLabel() + "_cut FUNC=x*y PERIODIC=NO");
}
readInputLine( scutoff_action ); std::string str_cut; Tools::convert( strands_cutoff, str_cut );
readInputLine( getShortcutLabel() + "_cut: CUSTOM ARG=" + getShortcutLabel() + "_cut_dists FUNC=step(" + str_cut + "-x) PERIODIC=NO");
readInputLine( lab + ": SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS MASK=" + getShortcutLabel() + "_cut BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
if( ltmap.length()>0 ) {
readInputLine( getShortcutLabel() + "_ltu: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"} MASK=" + getShortcutLabel() + "_cut");
readInputLine( getShortcutLabel() + "_lt: CUSTOM ARG=" + getShortcutLabel() + "_ltu," + getShortcutLabel() + "_cut FUNC=x*y PERIODIC=NO");
}
} else {
readInputLine( lab + ": SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
if( ltmap.length()>0 ) readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
readInputLine( lab + ": SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
if( ltmap.length()>0 ) readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
}
// Create the less than object
if( ltmap.length()>0 ) {
if( uselessthan ) readInputLine( getShortcutLabel() + "_lessthan: SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
else readInputLine( getShortcutLabel() + ": SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
}
if( uselessthan ) readInputLine( getShortcutLabel() + "_lessthan: SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
else readInputLine( getShortcutLabel() + ": SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
}
}

}
Expand Down
36 changes: 18 additions & 18 deletions src/secondarystructure/ParabetaRMSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,25 +275,25 @@ ParabetaRMSD::ParabetaRMSD(const ActionOptions&ao):
std::string atoms="ATOMS=" + all_atoms[0]; for(unsigned i=1; i<all_atoms.size(); ++i) atoms += "," + all_atoms[i];

if( strands_cutoff>0 ) {
readInputLine( scutoff_action ); std::string str_cut; Tools::convert( strands_cutoff, str_cut );
readInputLine( getShortcutLabel() + "_cut: CUSTOM ARG=" + getShortcutLabel() + "_cut_dists FUNC=step(" + str_cut + "-x) PERIODIC=NO");
readInputLine( getShortcutLabel() + "_both: SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS MASK=" + getShortcutLabel() + "_cut BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
if( ltmap.length()>0 ) {
// Create the lowest line
readInputLine( lab + ": LOWEST ARG=" + getShortcutLabel() + "_both.struct-1," + getShortcutLabel() + "_both.struct-2" );
// Create the less than object
readInputLine( getShortcutLabel() + "_ltu: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"} MASK=" + getShortcutLabel() + "_cut");
// Multiply by the strands cutoff
readInputLine( getShortcutLabel() + "_lt: CUSTOM ARG=" + getShortcutLabel() + "_ltu," + getShortcutLabel() + "_cut FUNC=x*y PERIODIC=NO");
}
readInputLine( scutoff_action ); std::string str_cut; Tools::convert( strands_cutoff, str_cut );
readInputLine( getShortcutLabel() + "_cut: CUSTOM ARG=" + getShortcutLabel() + "_cut_dists FUNC=step(" + str_cut + "-x) PERIODIC=NO");
readInputLine( getShortcutLabel() + "_both: SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS MASK=" + getShortcutLabel() + "_cut BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
if( ltmap.length()>0 ) {
// Create the lowest line
readInputLine( lab + ": LOWEST ARG=" + getShortcutLabel() + "_both.struct-1," + getShortcutLabel() + "_both.struct-2" );
// Create the less than object
readInputLine( getShortcutLabel() + "_ltu: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"} MASK=" + getShortcutLabel() + "_cut");
// Multiply by the strands cutoff
readInputLine( getShortcutLabel() + "_lt: CUSTOM ARG=" + getShortcutLabel() + "_ltu," + getShortcutLabel() + "_cut FUNC=x*y PERIODIC=NO");
}
} else {
readInputLine( getShortcutLabel() + "_both: SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
if( ltmap.length()>0 ) {
// Create the lowest line
readInputLine( lab + ": LOWEST ARG=" + getShortcutLabel() + "_both.struct-1," + getShortcutLabel() + "_both.struct-2" );
// Create the less than object
readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
}
readInputLine( getShortcutLabel() + "_both: SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
if( ltmap.length()>0 ) {
// Create the lowest line
readInputLine( lab + ": LOWEST ARG=" + getShortcutLabel() + "_both.struct-1," + getShortcutLabel() + "_both.struct-2" );
// Create the less than object
readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
}
}
if( ltmap.length()>0 ) {
if( uselessthan ) readInputLine( getShortcutLabel() + "_lessthan: SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
Expand Down
2 changes: 1 addition & 1 deletion src/secondarystructure/SecondaryStructureRMSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ SecondaryStructureRMSD::SecondaryStructureRMSD(const ActionOptions&ao):
log<<" Bibliography "<<plumed.cite("Pietrucci and Laio, J. Chem. Theory Comput. 5, 2197 (2009)"); log<<"\n";

parseFlag("VERBOSE",verbose_output); parseFlag("ALIGN_STRANDS",align_strands);
log.printf(" ensuring atoms 7 and 22 in each residue are not separated by pbc before doing alignment\n");
log.printf(" ensuring atoms 7 and 22 in each residue are not separated by pbc before doing alignment\n");

// Read in the atoms
std::vector<AtomNumber> all_atoms; parseAtomList("ATOMS",all_atoms); requestAtoms( all_atoms );
Expand Down
4 changes: 2 additions & 2 deletions src/valtools/VStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class VStack : public ActionWithMatrix {
unsigned getNumberOfColumns() const override { return getNumberOfArguments(); }
///
void setupForTask( const unsigned& task_index, std::vector<unsigned>& indices, MultiValue& myvals ) const override ;
///
///
int checkTaskIsActive( const unsigned& itask ) const override ;
///
void performTask( const std::string& controller, const unsigned& index1, const unsigned& index2, MultiValue& myvals ) const override ;
Expand Down Expand Up @@ -135,7 +135,7 @@ void VStack::setupForTask( const unsigned& task_index, std::vector<unsigned>& in

int VStack::checkTaskIsActive( const unsigned& itask ) const {
return 1;
}
}

void VStack::performTask( const std::string& controller, const unsigned& index1, const unsigned& index2, MultiValue& myvals ) const {
unsigned ind2 = index2; if( index2>=getConstPntrToComponent(0)->getShape()[0] ) ind2 = index2 - getConstPntrToComponent(0)->getShape()[0];
Expand Down

1 comment on commit 9d4c4e5

@PlumedBot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found broken examples in automatic/ANGLES.tmp
Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/CAVITY.tmp
Found broken examples in automatic/CLASSICAL_MDS.tmp
Found broken examples in automatic/CLUSTER_DIAMETER.tmp
Found broken examples in automatic/CLUSTER_DISTRIBUTION.tmp
Found broken examples in automatic/CLUSTER_PROPERTIES.tmp
Found broken examples in automatic/CONSTANT.tmp
Found broken examples in automatic/CONTACT_MATRIX.tmp
Found broken examples in automatic/CONTACT_MATRIX_PROPER.tmp
Found broken examples in automatic/COORDINATIONNUMBER.tmp
Found broken examples in automatic/DFSCLUSTERING.tmp
Found broken examples in automatic/DISTANCE_FROM_CONTOUR.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/ENVIRONMENTSIMILARITY.tmp
Found broken examples in automatic/FIND_CONTOUR.tmp
Found broken examples in automatic/FIND_CONTOUR_SURFACE.tmp
Found broken examples in automatic/FIND_SPHERICAL_CONTOUR.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GHBFIX.tmp
Found broken examples in automatic/GPROPERTYMAP.tmp
Found broken examples in automatic/HBOND_MATRIX.tmp
Found broken examples in automatic/INCLUDE.tmp
Found broken examples in automatic/INCYLINDER.tmp
Found broken examples in automatic/INENVELOPE.tmp
Found broken examples in automatic/INTERPOLATE_GRID.tmp
Found broken examples in automatic/LOCAL_AVERAGE.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/METATENSOR.tmp
Found broken examples in automatic/MULTICOLVARDENS.tmp
Found broken examples in automatic/OUTPUT_CLUSTER.tmp
Found broken examples in automatic/PAMM.tmp
Found broken examples in automatic/PCA.tmp
Found broken examples in automatic/PCAVARS.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PLUMED.tmp
Found broken examples in automatic/PYCVINTERFACE.tmp
Found broken examples in automatic/PYTHONFUNCTION.tmp
Found broken examples in automatic/Q3.tmp
Found broken examples in automatic/Q4.tmp
Found broken examples in automatic/Q6.tmp
Found broken examples in automatic/QUATERNION.tmp
Found broken examples in automatic/SIZESHAPE_POSITION_LINEAR_PROJ.tmp
Found broken examples in automatic/SIZESHAPE_POSITION_MAHA_DIST.tmp
Found broken examples in automatic/SPRINT.tmp
Found broken examples in automatic/TETRAHEDRALPORE.tmp
Found broken examples in automatic/TORSIONS.tmp
Found broken examples in automatic/WHAM_WEIGHTS.tmp
Found broken examples in AnalysisPP.md
Found broken examples in CollectiveVariablesPP.md
Found broken examples in MiscelaneousPP.md

Please sign in to comment.