Skip to content

Commit 9d4c4e5

Browse files
author
Gareth Aneurin Tribello
committed
Ran astyle
1 parent 570827a commit 9d4c4e5

File tree

6 files changed

+65
-65
lines changed

6 files changed

+65
-65
lines changed

src/crystdistrib/QuaternionBondProductMatrix.cpp

+29-29
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ unsigned QuaternionBondProductMatrix::getNumberOfDerivatives() {
122122
}
123123

124124
unsigned QuaternionBondProductMatrix::getNumberOfColumns() const {
125-
const ActionWithMatrix* am=dynamic_cast<const ActionWithMatrix*>( getPntrToArgument(4)->getPntrToAction() ); plumed_assert( am );
125+
const ActionWithMatrix* am=dynamic_cast<const ActionWithMatrix*>( getPntrToArgument(4)->getPntrToAction() ); plumed_assert( am );
126126
if( getPntrToArgument(4)->isSymmetric() && am->getNumberOfColumns()==getPntrToArgument(4)->getShape()[1]-1 ) return am->getNumberOfColumns() + 1;
127127
return am->getNumberOfColumns();
128128
}
@@ -245,15 +245,15 @@ void QuaternionBondProductMatrix::performTask( const std::string& controller, co
245245
}
246246
//had to split because bond's derivatives depend on the value of the overall quaternion component
247247
if( !doNotCalculateDerivatives() ) {
248-
unsigned ostrn = getConstPntrToComponent(0)->getPositionInStream();
249-
for(unsigned i=0; i<4; ++i) {
250-
tempDot=dotProduct(Vector4d(quat[0],-quat[1],-quat[2],-quat[3]), dqt[1].getCol(i))*normFac;
251-
if( i>0 ) {
252-
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
253-
myvals.addDerivative( ostrn, base + find, tempDot ); myvals.updateIndex( ostrn, base + find );
254-
}
255-
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
248+
unsigned ostrn = getConstPntrToComponent(0)->getPositionInStream();
249+
for(unsigned i=0; i<4; ++i) {
250+
tempDot=dotProduct(Vector4d(quat[0],-quat[1],-quat[2],-quat[3]), dqt[1].getCol(i))*normFac;
251+
if( i>0 ) {
252+
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
253+
myvals.addDerivative( ostrn, base + find, tempDot ); myvals.updateIndex( ostrn, base + find );
256254
}
255+
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
256+
}
257257
}
258258

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

275-
if( !doNotCalculateDerivatives() ) {
276-
unsigned ostrn = getConstPntrToComponent(1)->getPositionInStream();
277-
for(unsigned i=0; i<4; ++i) {
278-
tempDot=dotProduct(Vector4d(quat[1],quat[0],quat[3],-quat[2]), dqt[1].getCol(i))*normFac;
279-
if( i>0 ) {
280-
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
281-
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*xf) ); myvals.updateIndex( ostrn, base + find );
282-
}
283-
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
275+
if( !doNotCalculateDerivatives() ) {
276+
unsigned ostrn = getConstPntrToComponent(1)->getPositionInStream();
277+
for(unsigned i=0; i<4; ++i) {
278+
tempDot=dotProduct(Vector4d(quat[1],quat[0],quat[3],-quat[2]), dqt[1].getCol(i))*normFac;
279+
if( i>0 ) {
280+
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
281+
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*xf) ); myvals.updateIndex( ostrn, base + find );
284282
}
283+
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
284+
}
285285
}
286286

287287

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

305305
if( !doNotCalculateDerivatives() ) {
306-
unsigned ostrn = getConstPntrToComponent(2)->getPositionInStream();
307-
for(unsigned i=0; i<4; ++i) {
308-
tempDot=dotProduct(Vector4d(quat[2],-quat[3],quat[0],quat[1]), dqt[1].getCol(i))*normFac;
309-
if( i>0 ) {
310-
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
311-
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*yf) ); myvals.updateIndex( ostrn, base + find );
312-
}
313-
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
306+
unsigned ostrn = getConstPntrToComponent(2)->getPositionInStream();
307+
for(unsigned i=0; i<4; ++i) {
308+
tempDot=dotProduct(Vector4d(quat[2],-quat[3],quat[0],quat[1]), dqt[1].getCol(i))*normFac;
309+
if( i>0 ) {
310+
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
311+
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*yf) ); myvals.updateIndex( ostrn, base + find );
314312
}
313+
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
314+
}
315315
}
316316

317317
//k component
@@ -337,8 +337,8 @@ void QuaternionBondProductMatrix::performTask( const std::string& controller, co
337337
for(unsigned i=0; i<4; ++i) {
338338
tempDot=dotProduct(Vector4d(quat[3],quat[2],-quat[1],quat[0]), dqt[1].getCol(i))*normFac;
339339
if( i>0 ) {
340-
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
341-
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*zf) ); myvals.updateIndex( ostrn, base + find );
340+
plumed_assert( !stored[4+i] ); unsigned find = getPntrToArgument(4+i)->getIndexInStore( index1*getPntrToArgument(4+i)->getShape()[1] + ind2 );
341+
myvals.addDerivative( ostrn, base + find, tempDot+(-bond[i]*normFac*normFac*zf) ); myvals.updateIndex( ostrn, base + find );
342342
}
343343
base += getPntrToArgument(4+i)->getNumberOfStoredValues();
344344
}

src/secondarystructure/AlphaRMSD.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ AlphaRMSD::AlphaRMSD(const ActionOptions&ao):
169169
readInputLine( lab + ": SECONDARY_STRUCTURE_RMSD BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
170170
// Create the less than object
171171
if( ltmap.length()>0 ) {
172-
readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
173-
if( uselessthan ) readInputLine( getShortcutLabel() + "_lessthan: SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
174-
else readInputLine( getShortcutLabel() + ": SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
172+
readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
173+
if( uselessthan ) readInputLine( getShortcutLabel() + "_lessthan: SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
174+
else readInputLine( getShortcutLabel() + ": SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
175175
}
176176
}
177177

src/secondarystructure/AntibetaRMSD.cpp

+12-12
Original file line numberDiff line numberDiff line change
@@ -233,22 +233,22 @@ AntibetaRMSD::AntibetaRMSD(const ActionOptions&ao):
233233
std::string atoms="ATOMS=" + all_atoms[0]; for(unsigned i=1; i<all_atoms.size(); ++i) atoms += "," + all_atoms[i];
234234

235235
if( strands_cutoff>0 ) {
236-
readInputLine( scutoff_action ); std::string str_cut; Tools::convert( strands_cutoff, str_cut );
237-
readInputLine( getShortcutLabel() + "_cut: CUSTOM ARG=" + getShortcutLabel() + "_cut_dists FUNC=step(" + str_cut + "-x) PERIODIC=NO");
238-
readInputLine( lab + ": SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS MASK=" + getShortcutLabel() + "_cut BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
239-
if( ltmap.length()>0 ) {
240-
readInputLine( getShortcutLabel() + "_ltu: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"} MASK=" + getShortcutLabel() + "_cut");
241-
readInputLine( getShortcutLabel() + "_lt: CUSTOM ARG=" + getShortcutLabel() + "_ltu," + getShortcutLabel() + "_cut FUNC=x*y PERIODIC=NO");
242-
}
236+
readInputLine( scutoff_action ); std::string str_cut; Tools::convert( strands_cutoff, str_cut );
237+
readInputLine( getShortcutLabel() + "_cut: CUSTOM ARG=" + getShortcutLabel() + "_cut_dists FUNC=step(" + str_cut + "-x) PERIODIC=NO");
238+
readInputLine( lab + ": SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS MASK=" + getShortcutLabel() + "_cut BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
239+
if( ltmap.length()>0 ) {
240+
readInputLine( getShortcutLabel() + "_ltu: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"} MASK=" + getShortcutLabel() + "_cut");
241+
readInputLine( getShortcutLabel() + "_lt: CUSTOM ARG=" + getShortcutLabel() + "_ltu," + getShortcutLabel() + "_cut FUNC=x*y PERIODIC=NO");
242+
}
243243
} else {
244-
readInputLine( lab + ": SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
245-
if( ltmap.length()>0 ) readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
244+
readInputLine( lab + ": SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
245+
if( ltmap.length()>0 ) readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
246246
}
247247
// Create the less than object
248248
if( ltmap.length()>0 ) {
249-
if( uselessthan ) readInputLine( getShortcutLabel() + "_lessthan: SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
250-
else readInputLine( getShortcutLabel() + ": SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
251-
}
249+
if( uselessthan ) readInputLine( getShortcutLabel() + "_lessthan: SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
250+
else readInputLine( getShortcutLabel() + ": SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");
251+
}
252252
}
253253

254254
}

src/secondarystructure/ParabetaRMSD.cpp

+18-18
Original file line numberDiff line numberDiff line change
@@ -275,25 +275,25 @@ ParabetaRMSD::ParabetaRMSD(const ActionOptions&ao):
275275
std::string atoms="ATOMS=" + all_atoms[0]; for(unsigned i=1; i<all_atoms.size(); ++i) atoms += "," + all_atoms[i];
276276

277277
if( strands_cutoff>0 ) {
278-
readInputLine( scutoff_action ); std::string str_cut; Tools::convert( strands_cutoff, str_cut );
279-
readInputLine( getShortcutLabel() + "_cut: CUSTOM ARG=" + getShortcutLabel() + "_cut_dists FUNC=step(" + str_cut + "-x) PERIODIC=NO");
280-
readInputLine( getShortcutLabel() + "_both: SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS MASK=" + getShortcutLabel() + "_cut BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
281-
if( ltmap.length()>0 ) {
282-
// Create the lowest line
283-
readInputLine( lab + ": LOWEST ARG=" + getShortcutLabel() + "_both.struct-1," + getShortcutLabel() + "_both.struct-2" );
284-
// Create the less than object
285-
readInputLine( getShortcutLabel() + "_ltu: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"} MASK=" + getShortcutLabel() + "_cut");
286-
// Multiply by the strands cutoff
287-
readInputLine( getShortcutLabel() + "_lt: CUSTOM ARG=" + getShortcutLabel() + "_ltu," + getShortcutLabel() + "_cut FUNC=x*y PERIODIC=NO");
288-
}
278+
readInputLine( scutoff_action ); std::string str_cut; Tools::convert( strands_cutoff, str_cut );
279+
readInputLine( getShortcutLabel() + "_cut: CUSTOM ARG=" + getShortcutLabel() + "_cut_dists FUNC=step(" + str_cut + "-x) PERIODIC=NO");
280+
readInputLine( getShortcutLabel() + "_both: SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS MASK=" + getShortcutLabel() + "_cut BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
281+
if( ltmap.length()>0 ) {
282+
// Create the lowest line
283+
readInputLine( lab + ": LOWEST ARG=" + getShortcutLabel() + "_both.struct-1," + getShortcutLabel() + "_both.struct-2" );
284+
// Create the less than object
285+
readInputLine( getShortcutLabel() + "_ltu: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"} MASK=" + getShortcutLabel() + "_cut");
286+
// Multiply by the strands cutoff
287+
readInputLine( getShortcutLabel() + "_lt: CUSTOM ARG=" + getShortcutLabel() + "_ltu," + getShortcutLabel() + "_cut FUNC=x*y PERIODIC=NO");
288+
}
289289
} else {
290-
readInputLine( getShortcutLabel() + "_both: SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
291-
if( ltmap.length()>0 ) {
292-
// Create the lowest line
293-
readInputLine( lab + ": LOWEST ARG=" + getShortcutLabel() + "_both.struct-1," + getShortcutLabel() + "_both.struct-2" );
294-
// Create the less than object
295-
readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
296-
}
290+
readInputLine( getShortcutLabel() + "_both: SECONDARY_STRUCTURE_RMSD ALIGN_STRANDS BONDLENGTH=0.17" + seglist + structure + " " + atoms + " TYPE=" + type + nopbcstr );
291+
if( ltmap.length()>0 ) {
292+
// Create the lowest line
293+
readInputLine( lab + ": LOWEST ARG=" + getShortcutLabel() + "_both.struct-1," + getShortcutLabel() + "_both.struct-2" );
294+
// Create the less than object
295+
readInputLine( getShortcutLabel() + "_lt: LESS_THAN ARG=" + lab + " SWITCH={" + ltmap +"}");
296+
}
297297
}
298298
if( ltmap.length()>0 ) {
299299
if( uselessthan ) readInputLine( getShortcutLabel() + "_lessthan: SUM ARG=" + getShortcutLabel() + "_lt PERIODIC=NO");

src/secondarystructure/SecondaryStructureRMSD.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ SecondaryStructureRMSD::SecondaryStructureRMSD(const ActionOptions&ao):
122122
log<<" Bibliography "<<plumed.cite("Pietrucci and Laio, J. Chem. Theory Comput. 5, 2197 (2009)"); log<<"\n";
123123

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

127127
// Read in the atoms
128128
std::vector<AtomNumber> all_atoms; parseAtomList("ATOMS",all_atoms); requestAtoms( all_atoms );

src/valtools/VStack.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class VStack : public ActionWithMatrix {
4949
unsigned getNumberOfColumns() const override { return getNumberOfArguments(); }
5050
///
5151
void setupForTask( const unsigned& task_index, std::vector<unsigned>& indices, MultiValue& myvals ) const override ;
52-
///
52+
///
5353
int checkTaskIsActive( const unsigned& itask ) const override ;
5454
///
5555
void performTask( const std::string& controller, const unsigned& index1, const unsigned& index2, MultiValue& myvals ) const override ;
@@ -135,7 +135,7 @@ void VStack::setupForTask( const unsigned& task_index, std::vector<unsigned>& in
135135

136136
int VStack::checkTaskIsActive( const unsigned& itask ) const {
137137
return 1;
138-
}
138+
}
139139

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

0 commit comments

Comments
 (0)