Skip to content

Commit 46f53ba

Browse files
Gareth Aneurin TribelloGareth Aneurin Tribello
Gareth Aneurin Tribello
authored and
Gareth Aneurin Tribello
committed
Removed code that was used for chained version of derivatives that is no longer used for forces
1 parent 03e8500 commit 46f53ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+325
-1109
lines changed

src/adjmat/AdjacencyMatrixBase.cpp

+17-45
Original file line numberDiff line numberDiff line change
@@ -206,25 +206,6 @@ void AdjacencyMatrixBase::updateNeighbourList() {
206206
if( read_one_group && maxcol==getConstPntrToComponent(0)->getShape()[1] ) maxcol = maxcol-1;
207207
}
208208

209-
void AdjacencyMatrixBase::getAdditionalTasksRequired( ActionWithVector* action, std::vector<unsigned>& atasks ) {
210-
if( action==this ) return;
211-
// Update the neighbour list
212-
updateNeighbourList();
213-
214-
unsigned nactive = atasks.size();
215-
std::vector<unsigned> indlist( 1 + ablocks.size() + threeblocks.size() );
216-
for(unsigned i=0; i<nactive; ++i) {
217-
unsigned num = retrieveNeighbours( atasks[i], indlist );
218-
for(unsigned j=0; j<num; ++j) {
219-
bool found=false;
220-
for(unsigned k=0; k<atasks.size(); ++k ) {
221-
if( indlist[j]==atasks[k] ) { found=true; break; }
222-
}
223-
if( !found ) atasks.push_back( indlist[j] );
224-
}
225-
}
226-
}
227-
228209
unsigned AdjacencyMatrixBase::retrieveNeighbours( const unsigned& current, std::vector<unsigned> & indices ) const {
229210
unsigned natoms=nlist[current]; indices[0]=current;
230211
unsigned lstart = getConstPntrToComponent(0)->getShape()[0] + current*(1+natoms_per_list); plumed_dbg_assert( nlist[lstart]==current );
@@ -278,10 +259,9 @@ void AdjacencyMatrixBase::performTask( const std::string& controller, const unsi
278259
// Update dynamic list indices for virial
279260
unsigned base = 3*getNumberOfAtoms(); for(unsigned j=0; j<9; ++j) myvals.updateIndex( 0, base+j );
280261
// And the indices for the derivatives of the row of the matrix
281-
unsigned nmat = getConstPntrToComponent(0)->getPositionInMatrixStash(), nmat_ind = myvals.getNumberOfMatrixRowDerivatives( nmat );
282-
std::vector<unsigned>& matrix_indices( myvals.getMatrixRowDerivativeIndices( nmat ) );
262+
unsigned nmat_ind = myvals.getNumberOfMatrixRowDerivatives(); std::vector<unsigned>& matrix_indices( myvals.getMatrixRowDerivativeIndices() );
283263
matrix_indices[nmat_ind+0]=3*index2+0; matrix_indices[nmat_ind+1]=3*index2+1; matrix_indices[nmat_ind+2]=3*index2+2;
284-
myvals.setNumberOfMatrixRowDerivatives( nmat, nmat_ind+3 );
264+
myvals.setNumberOfMatrixRowDerivatives( nmat_ind+3 );
285265
}
286266

287267
// Calculate the components if we need them
@@ -319,38 +299,30 @@ void AdjacencyMatrixBase::performTask( const std::string& controller, const unsi
319299
myvals.addDerivative( 3, base+1, 0 ); myvals.addDerivative( 3, base+4, 0 ); myvals.addDerivative( 3, base+7, 0 );
320300
myvals.addDerivative( 3, base+2, -atom[0] ); myvals.addDerivative( 3, base+5, -atom[1] ); myvals.addDerivative( 3, base+8, -atom[2] );
321301
for(unsigned k=0; k<9; ++k) { myvals.updateIndex( 1, base+k ); myvals.updateIndex( 2, base+k ); myvals.updateIndex( 3, base+k ); }
322-
for(unsigned k=1; k<4; ++k) {
323-
unsigned nmat = getConstPntrToComponent(k)->getPositionInMatrixStash(), nmat_ind = myvals.getNumberOfMatrixRowDerivatives( nmat );
324-
std::vector<unsigned>& matrix_indices( myvals.getMatrixRowDerivativeIndices( nmat ) );
325-
matrix_indices[nmat_ind+0]=3*index2+0; matrix_indices[nmat_ind+1]=3*index2+1; matrix_indices[nmat_ind+2]=3*index2+2;
326-
myvals.setNumberOfMatrixRowDerivatives( nmat, nmat_ind+3 );
327-
}
328302
}
329303
}
330304
}
331305

332306
void AdjacencyMatrixBase::runEndOfRowJobs( const unsigned& ind, const std::vector<unsigned> & indices, MultiValue& myvals ) const {
333307
if( doNotCalculateDerivatives() ) return;
334308

335-
for(int k=0; k<getNumberOfComponents(); ++k) {
336-
unsigned nmat = getConstPntrToComponent(k)->getPositionInMatrixStash(), nmat_ind = myvals.getNumberOfMatrixRowDerivatives( nmat );
337-
std::vector<unsigned>& matrix_indices( myvals.getMatrixRowDerivativeIndices( nmat ) );
338-
plumed_assert( nmat_ind<matrix_indices.size() );
339-
matrix_indices[nmat_ind+0]=3*ind+0;
340-
matrix_indices[nmat_ind+1]=3*ind+1;
341-
matrix_indices[nmat_ind+2]=3*ind+2;
309+
unsigned nmat_ind = myvals.getNumberOfMatrixRowDerivatives();
310+
std::vector<unsigned>& matrix_indices( myvals.getMatrixRowDerivativeIndices() );
311+
plumed_assert( nmat_ind<matrix_indices.size() );
312+
matrix_indices[nmat_ind+0]=3*ind+0;
313+
matrix_indices[nmat_ind+1]=3*ind+1;
314+
matrix_indices[nmat_ind+2]=3*ind+2;
315+
nmat_ind+=3;
316+
for(unsigned i=myvals.getSplitIndex(); i<myvals.getNumberOfIndices(); ++i) {
317+
matrix_indices[nmat_ind+0]=3*indices[i]+0;
318+
matrix_indices[nmat_ind+1]=3*indices[i]+1;
319+
matrix_indices[nmat_ind+2]=3*indices[i]+2;
342320
nmat_ind+=3;
343-
for(unsigned i=myvals.getSplitIndex(); i<myvals.getNumberOfIndices(); ++i) {
344-
matrix_indices[nmat_ind+0]=3*indices[i]+0;
345-
matrix_indices[nmat_ind+1]=3*indices[i]+1;
346-
matrix_indices[nmat_ind+2]=3*indices[i]+2;
347-
nmat_ind+=3;
348-
}
349-
unsigned virbase = 3*getNumberOfAtoms();
350-
for(unsigned i=0; i<9; ++i) matrix_indices[nmat_ind+i]=virbase+i;
351-
nmat_ind+=9; plumed_dbg_massert( nmat_ind<=3*getNumberOfAtoms() + 9, "found too many derivatives in " + getLabel() );
352-
myvals.setNumberOfMatrixRowDerivatives( nmat, nmat_ind );
353321
}
322+
unsigned virbase = 3*getNumberOfAtoms();
323+
for(unsigned i=0; i<9; ++i) matrix_indices[nmat_ind+i]=virbase+i;
324+
nmat_ind+=9; plumed_dbg_massert( nmat_ind<=3*getNumberOfAtoms() + 9, "found too many derivatives in " + getLabel() );
325+
myvals.setNumberOfMatrixRowDerivatives( nmat_ind );
354326
}
355327

356328
}

src/adjmat/AdjacencyMatrixBase.h

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class AdjacencyMatrixBase : public ActionWithMatrix {
5454
unsigned getNumberOfDerivatives() override ;
5555
unsigned getNumberOfColumns() const override;
5656
void prepare() override;
57-
void getAdditionalTasksRequired( ActionWithVector* action, std::vector<unsigned>& atasks ) override ;
5857
void setupForTask( const unsigned& current, std::vector<unsigned> & indices, MultiValue& myvals ) const override;
5958
// void setupCurrentTaskList() override;
6059
void updateNeighbourList() override ;

src/adjmat/Neighbors.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class Neighbors : public ActionWithMatrix {
4242
explicit Neighbors(const ActionOptions&);
4343
unsigned getNumberOfDerivatives() override;
4444
unsigned getNumberOfColumns() const override { return number; }
45-
bool canBeAfterInChain( ActionWithVector* av ) { return av->getLabel()!=(getPntrToArgument(0)->getPntrToAction())->getLabel(); }
4645
void setupForTask( const unsigned& task_index, std::vector<unsigned>& indices, MultiValue& myvals ) const ;
4746
void performTask( const std::string& controller, const unsigned& index1, const unsigned& index2, MultiValue& myvals ) const override;
4847
void runEndOfRowJobs( const unsigned& ival, const std::vector<unsigned> & indices, MultiValue& myvals ) const override {}
@@ -64,7 +63,6 @@ Neighbors::Neighbors(const ActionOptions&ao):
6463
{
6564
if( getNumberOfArguments()!=1 ) error("found wrong number of arguments in input");
6665
if( getPntrToArgument(0)->getRank()!=2 ) error("input argument should be a matrix");
67-
getPntrToArgument(0)->buildDataStore();
6866

6967
unsigned nlow; parse("NLOWEST",nlow);
7068
unsigned nhigh; parse("NHIGHEST",nhigh);

src/adjmat/TorsionsMatrix.cpp

+13-16
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ namespace PLMD {
3636
namespace adjmat {
3737

3838
class TorsionsMatrix : public ActionWithMatrix {
39-
private:
40-
unsigned nderivatives;
41-
bool stored_matrix1, stored_matrix2;
4239
public:
4340
static void registerKeywords( Keywords& keys );
4441
explicit TorsionsMatrix(const ActionOptions&);
@@ -85,10 +82,7 @@ TorsionsMatrix::TorsionsMatrix(const ActionOptions&ao):
8582
log.printf("\n"); requestAtoms( atoms_a, false );
8683

8784
std::vector<unsigned> shape(2); shape[0]=getPntrToArgument(0)->getShape()[0]; shape[1]=getPntrToArgument(1)->getShape()[1];
88-
addValue( shape ); setPeriodic("-pi","pi"); nderivatives = buildArgumentStore(0) + 3*getNumberOfAtoms() + 9;
89-
std::string headstr=getFirstActionInChain()->getLabel();
90-
stored_matrix1 = getPntrToArgument(0)->ignoreStoredValue( headstr );
91-
stored_matrix2 = getPntrToArgument(1)->ignoreStoredValue( headstr );
85+
addValue( shape ); setPeriodic("-pi","pi");
9286

9387
if( nm>0 ) {
9488
unsigned iarg = getNumberOfArguments()-1;
@@ -98,7 +92,7 @@ TorsionsMatrix::TorsionsMatrix(const ActionOptions&ao):
9892
}
9993

10094
unsigned TorsionsMatrix::getNumberOfDerivatives() {
101-
return nderivatives;
95+
return 3*getNumberOfAtoms() + 9 + getPntrToArgument(0)->getNumberOfStoredValues() + getPntrToArgument(1)->getNumberOfStoredValues();
10296
}
10397

10498
unsigned TorsionsMatrix::getNumberOfColumns() const {
@@ -131,8 +125,8 @@ void TorsionsMatrix::performTask( const std::string& controller, const unsigned&
131125

132126
// Get the two vectors
133127
for(unsigned i=0; i<3; ++i) {
134-
v1[i] = getElementOfMatrixArgument( 0, index1, i, myvals );
135-
v2[i] = getElementOfMatrixArgument( 1, i, ind2, myvals );
128+
v1[i] = getPntrToArgument(0)->get( index1*getPntrToArgument(0)->getNumberOfColumns() + i, false );
129+
v2[i] = getPntrToArgument(1)->get( i*getPntrToArgument(1)->getNumberOfColumns() + ind2, false );
136130
}
137131
// Evaluate angle
138132
Torsion t; double angle = t.compute( v1, conn, v2, dv1, dconn, dv2 );
@@ -141,9 +135,12 @@ void TorsionsMatrix::performTask( const std::string& controller, const unsigned&
141135
if( doNotCalculateDerivatives() ) return;
142136

143137
// Add the derivatives on the matrices
138+
unsigned base1 = index1*getPntrToArgument(0)->getNumberOfColumns();
139+
unsigned ncols = getPntrToArgument(1)->getNumberOfColumns();
140+
unsigned base2 = getPntrToArgument(0)->getNumberOfStoredValues() + ind2;
144141
for(unsigned i=0; i<3; ++i) {
145-
addDerivativeOnMatrixArgument( stored_matrix1, 0, 0, index1, i, dv1[i], myvals );
146-
addDerivativeOnMatrixArgument( stored_matrix2, 0, 1, i, ind2, dv2[i], myvals );
142+
myvals.addDerivative( 0, base1 + i, dv1[i] ); myvals.updateIndex( 0, base1 + i );
143+
myvals.addDerivative( 0, base2 + i*ncols, dv2[i] ); myvals.updateIndex( 0, base2 + i*ncols );
147144
}
148145
// And derivatives on positions
149146
unsigned narg_derivatives = getPntrToArgument(0)->getNumberOfValues() + getPntrToArgument(1)->getNumberOfValues();
@@ -160,20 +157,20 @@ void TorsionsMatrix::runEndOfRowJobs( const unsigned& ival, const std::vector<un
160157
if( doNotCalculateDerivatives() ) return ;
161158

162159
unsigned mat1s = 3*ival, ss = getPntrToArgument(1)->getShape()[1];
163-
unsigned nmat = getConstPntrToComponent(0)->getPositionInMatrixStash(), nmat_ind = myvals.getNumberOfMatrixRowDerivatives( nmat );
160+
unsigned nmat_ind = myvals.getNumberOfMatrixRowDerivatives();
164161
unsigned narg_derivatives = getPntrToArgument(0)->getNumberOfValues() + getPntrToArgument(1)->getNumberOfValues();
165-
std::vector<unsigned>& matrix_indices( myvals.getMatrixRowDerivativeIndices( nmat ) ); unsigned ntwo_atoms = myvals.getSplitIndex();
162+
std::vector<unsigned>& matrix_indices( myvals.getMatrixRowDerivativeIndices() ); unsigned ntwo_atoms = myvals.getSplitIndex();
166163
for(unsigned j=0; j<3; ++j) {
167164
matrix_indices[nmat_ind] = mat1s + j; nmat_ind++;
168165
matrix_indices[nmat_ind] = narg_derivatives + mat1s + j; nmat_ind++;
169166
for(unsigned i=1; i<ntwo_atoms; ++i) {
170167
unsigned ind2 = indices[i]; if( ind2>=getPntrToArgument(0)->getShape()[0] ) ind2 = indices[i] - getPntrToArgument(0)->getShape()[0];
171-
matrix_indices[nmat_ind] = arg_deriv_starts[1] + j*ss + ind2; nmat_ind++;
168+
matrix_indices[nmat_ind] = getPntrToArgument(0)->getNumberOfStoredValues() + j*ss + ind2; nmat_ind++;
172169
matrix_indices[nmat_ind] = narg_derivatives + 3*indices[i] + j; nmat_ind++;
173170
}
174171
}
175172
unsigned base = narg_derivatives + 3*getNumberOfAtoms(); for(unsigned j=0; j<9; ++j) { matrix_indices[nmat_ind] = base + j; nmat_ind++; }
176-
myvals.setNumberOfMatrixRowDerivatives( nmat, nmat_ind );
173+
myvals.setNumberOfMatrixRowDerivatives( nmat_ind );
177174
}
178175

179176
}

src/clusters/ClusterDistribution.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,9 @@ ClusterDistribution::ClusterDistribution(const ActionOptions&ao):
127127
}
128128
// Request the arguments
129129
requestArguments( clusters );
130-
getPntrToArgument(0)->buildDataStore();
131-
if( getNumberOfArguments()>1 ) getPntrToArgument(1)->buildDataStore();
132130
// Now create the value
133131
std::vector<unsigned> shape(1); shape[0]=clusters[0]->getShape()[0];
134-
addValue( shape ); setNotPeriodic(); getPntrToValue()->buildDataStore();
132+
addValue( shape ); setNotPeriodic();
135133
}
136134

137135
unsigned ClusterDistribution::getNumberOfDerivatives() {

src/clusters/ClusterWeights.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ ClusterWeights::ClusterWeights(const ActionOptions&ao):
8989
requestArguments( clusters );
9090
// Now create the value
9191
std::vector<unsigned> shape(1); shape[0]=clusters[0]->getShape()[0];
92-
addValue( shape ); setNotPeriodic(); getPntrToComponent(0)->buildDataStore();
92+
addValue( shape ); setNotPeriodic();
9393
// Find out which cluster we want
9494
parse("CLUSTER",clustr);
9595
if( clustr<1 ) error("cannot look for a cluster larger than the largest cluster");

src/clusters/ClusteringBase.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ClusteringBase::ClusteringBase(const ActionOptions&ao):
4242
// Now create a value - this holds the data on which cluster each guy is in
4343
std::vector<unsigned> shape(1); shape[0]=getPntrToArgument(0)->getShape()[0];
4444
// Build the store here to make sure that next action has all data
45-
addValue( shape ); setNotPeriodic(); getPntrToValue()->buildDataStore();
45+
addValue( shape ); setNotPeriodic();
4646
// Resize local variables
4747
which_cluster.resize( getPntrToArgument(0)->getShape()[0] ); cluster_sizes.resize( getPntrToArgument(0)->getShape()[0] );
4848
}

src/colvar/MultiColvarTemplate.h

+1-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class MultiColvarTemplate : public ActionWithVector {
4444
unsigned getNumberOfDerivatives() override ;
4545
void addValueWithDerivatives( const std::vector<unsigned>& shape=std::vector<unsigned>() ) override ;
4646
void addComponentWithDerivatives( const std::string& name, const std::vector<unsigned>& shape=std::vector<unsigned>() ) override ;
47-
void setupStreamedComponents( const std::string& headstr, unsigned& nquants, unsigned& nmat, unsigned& maxcol ) override ;
4847
void performTask( const unsigned&, MultiValue& ) const override ;
4948
void calculate() override;
5049
};
@@ -114,6 +113,7 @@ unsigned MultiColvarTemplate<T>::getNumberOfDerivatives() {
114113

115114
template <class T>
116115
void MultiColvarTemplate<T>::calculate() {
116+
if( wholemolecules ) makeWhole();
117117
runAllTasks();
118118
}
119119

@@ -127,12 +127,6 @@ void MultiColvarTemplate<T>::addComponentWithDerivatives( const std::string& nam
127127
std::vector<unsigned> s(1); s[0]=ablocks[0].size(); addComponent( name, s );
128128
}
129129

130-
template <class T>
131-
void MultiColvarTemplate<T>::setupStreamedComponents( const std::string& headstr, unsigned& nquants, unsigned& nmat, unsigned& maxcol ) {
132-
if( wholemolecules ) makeWhole();
133-
ActionWithVector::setupStreamedComponents( headstr, nquants, nmat, maxcol );
134-
}
135-
136130
template <class T>
137131
void MultiColvarTemplate<T>::performTask( const unsigned& task_index, MultiValue& myvals ) const {
138132
// Retrieve the positions

src/colvar/RMSDVector.cpp

+15-8
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ RMSDVector::RMSDVector(const ActionOptions&ao):
9494
if( displacement && (getPntrToArgument(1)->getRank()==1 || getPntrToArgument(1)->getShape()[0]<=1) ) {
9595
addComponentWithDerivatives("dist"); componentIsNotPeriodic("dist");
9696
std::vector<unsigned> shape( 1, getPntrToArgument(0)->getNumberOfValues() );
97-
addComponent( "disp", shape ); getPntrToComponent(1)->buildDataStore(); componentIsNotPeriodic("disp");
97+
addComponent( "disp", shape ); componentIsNotPeriodic("disp");
9898
} else if( displacement ) {
9999
std::vector<unsigned> shape( 1, getPntrToArgument(1)->getShape()[0] );
100-
addComponent( "dist", shape ); getPntrToComponent(0)->buildDataStore();
100+
addComponent( "dist", shape );
101101
componentIsNotPeriodic("dist");
102102
shape.resize(2); shape[0] = getPntrToArgument(1)->getShape()[0]; shape[1] = getPntrToArgument(0)->getNumberOfValues();
103-
addComponent( "disp", shape ); getPntrToComponent(1)->buildDataStore(); getPntrToComponent(1)->reshapeMatrixStore( shape[1] );
103+
addComponent( "disp", shape ); getPntrToComponent(1)->reshapeMatrixStore( shape[1] );
104104
componentIsNotPeriodic("disp");
105105
} else if( (getPntrToArgument(1)->getRank()==1 || getPntrToArgument(1)->getShape()[0]==1) ) {
106106
addValue(); setNotPeriodic();
@@ -278,11 +278,18 @@ void RMSDVector::gatherStoredValue( const unsigned& valindex, const unsigned& co
278278
}
279279
}
280280

281-
void RMSDVector::gatherForcesOnStoredValue( const unsigned& ival, const unsigned& itask, const MultiValue& myvals, std::vector<double>& forces ) const {
282-
if( getConstPntrToComponent(ival)->getRank()==1 ) { ActionWithVector::gatherForcesOnStoredValue( ival, itask, myvals, forces ); return; }
283-
const std::vector<Vector>& direction( myvals.getConstFirstAtomDerivativeVector()[1] ); unsigned natoms = direction.size();
284-
for(unsigned i=0; i<natoms; ++i) {
285-
for(unsigned j=0; j<3; ++j ) forces[j*natoms+i] += direction[i][j];
281+
void RMSDVector::gatherForces( const unsigned& itask, const MultiValue& myvals, std::vector<double>& forces ) const {
282+
if( checkComponentsForForce() ) {
283+
for(unsigned ival=0; ival<getNumberOfComponents(); ++ival) {
284+
if( getConstPntrToComponent(ival)->getRank()==1 ) {
285+
gatherForcesOnStoredValue( ival, itask, myvals, forces );
286+
} else {
287+
const std::vector<Vector>& direction( myvals.getConstFirstAtomDerivativeVector()[1] ); unsigned natoms = direction.size();
288+
for(unsigned i=0; i<natoms; ++i) {
289+
for(unsigned j=0; j<3; ++j ) forces[j*natoms+i] += direction[i][j];
290+
}
291+
}
292+
}
286293
}
287294
}
288295

src/colvar/RMSDVector.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class RMSDVector : public ActionWithVector {
4646
void performTask( const unsigned& current, MultiValue& myvals ) const override ;
4747
void gatherStoredValue( const unsigned& valindex, const unsigned& code, const MultiValue& myvals,
4848
const unsigned& bufstart, std::vector<double>& buffer ) const override ;
49-
void gatherForcesOnStoredValue( const unsigned& ival, const unsigned& itask, const MultiValue& myvals, std::vector<double>& forces ) const override ;
49+
void gatherForces( const unsigned& i, const MultiValue& myvals, std::vector<double>& forces ) const override ;
5050
void setReferenceConfigurations();
5151
void calculate() override ;
5252
bool checkForTaskForce( const unsigned& itask, const Value* myval ) const override ;

src/contour/DistanceFromContourBase.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ DistanceFromContourBase::DistanceFromContourBase( const ActionOptions& ao ):
4646
nactive(0)
4747
{
4848
if( getNumberOfArguments()>1 ) error("should only use one argument for this action");
49-
if( getNumberOfArguments()==1 ) {
50-
if( getPntrToArgument(0)->getRank()!=1 ) error("ARG for distance from contour should be rank one");
51-
getPntrToArgument(0)->buildDataStore();
52-
}
49+
if( getNumberOfArguments()==1 && getPntrToArgument(0)->getRank()!=1 ) error("ARG for distance from contour should be rank one");
50+
5351
// Read in the multicolvar/atoms
5452
std::vector<AtomNumber> atoms; parseAtomList("POSITIONS",atoms);
5553
std::vector<AtomNumber> origin; parseAtomList("ATOM",origin);

src/contour/FindContour.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,7 @@ FindContour::FindContour(const ActionOptions&ao):
109109
std::vector<std::string> argn( ag->getGridCoordinateNames() );
110110

111111
std::vector<unsigned> shape(1); shape[0]=0;
112-
for(unsigned i=0; i<argn.size(); ++i ) {
113-
addComponent( argn[i], shape ); componentIsNotPeriodic( argn[i] ); getPntrToComponent(i)->buildDataStore();
114-
}
115-
// Check for task reduction
116-
updateTaskListReductionStatus();
112+
for(unsigned i=0; i<argn.size(); ++i ) { addComponent( argn[i], shape ); componentIsNotPeriodic( argn[i] ); }
117113
}
118114

119115
std::string FindContour::getOutputComponentDescription( const std::string& cname, const Keywords& keys ) const {

src/contour/FindContourSurface.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ FindContourSurface::FindContourSurface(const ActionOptions&ao):
149149
// Now add a value
150150
std::vector<unsigned> shape( getInputGridObject().getDimension()-1 );
151151
addValueWithDerivatives( shape ); setNotPeriodic();
152-
getPntrToComponent(0)->buildDataStore();
153152
}
154153

155154
void FindContourSurface::setupValuesOnFirstStep() {

src/contour/FindSphericalContour.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ FindSphericalContour::FindSphericalContour(const ActionOptions&ao):
151151
// Now create a value
152152
std::vector<unsigned> shape( 3 ); shape[0]=npoints; shape[1]=shape[2]=1;
153153
addValueWithDerivatives( shape ); setNotPeriodic();
154-
getPntrToComponent(0)->buildDataStore(); checkRead();
155154
}
156155

157156
unsigned FindSphericalContour::getNumberOfDerivatives() {

src/core/ActionToGetData.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ActionToGetData::ActionToGetData(const ActionOptions&ao):
6060

6161
if( getNumberOfArguments()!=1 ) error("python interface works best when you ask for one argument at a time");
6262
if( getPntrToArgument(0)->getNumberOfValues()==0 ) error("cannot get data as shape of value " + getPntrToArgument(0)->getName() + " has not been set");
63-
getPntrToArgument(0)->buildDataStore(); data.resize( getPntrToArgument(0)->getNumberOfValues() );
63+
data.resize( getPntrToArgument(0)->getNumberOfValues() );
6464
}
6565

6666
void ActionToGetData::get_rank( const TypesafePtr & dims ) {

0 commit comments

Comments
 (0)