Skip to content
Snippets Groups Projects
Commit bf662f65 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Merge remote-tracking branch 'origin/v2.3' into v2.3

parents 9d462172 8858ff1b
No related branches found
No related tags found
No related merge requests found
...@@ -160,6 +160,7 @@ See branch \branch{v2.3} on git repository. ...@@ -160,6 +160,7 @@ See branch \branch{v2.3} on git repository.
- Prevented users from causing segfaults by storing derivatives without LOWMEM flag. In these caess PLUMED crashes with meaningful errors. - Prevented users from causing segfaults by storing derivatives without LOWMEM flag. In these caess PLUMED crashes with meaningful errors.
- Fixed bug in \ref HISTOGRAM that causes nans when using KERNEL=DISCRETE option - Fixed bug in \ref HISTOGRAM that causes nans when using KERNEL=DISCRETE option
- Fixed a bug in the parser related to braces, see \issue{229} - Fixed a bug in the parser related to braces, see \issue{229}
- Fixed a bug that appeared when using \ref Q3, \ref Q4 and \ref Q6 with LOWEST or HIGHEST flag
For developers: For developers:
- plumedcheck validation has been made stricter. All the checks are now described in the developer manual. - plumedcheck validation has been made stricter. All the checks are now described in the developer manual.
......
#! FIELDS time q6.mean #! FIELDS time q6.mean q6.lowest
0.000000 0.245096 0.000000 0.245096 0.150123
...@@ -3,10 +3,10 @@ COORDINATIONNUMBER SPECIES=1-64 SWITCH={RATIONAL D_0=3.0 R_0=1.5} MEAN LABEL=c ...@@ -3,10 +3,10 @@ COORDINATIONNUMBER SPECIES=1-64 SWITCH={RATIONAL D_0=3.0 R_0=1.5} MEAN LABEL=c
PRINT ARG=c.* FILE=colv2 PRINT ARG=c.* FILE=colv2
DUMPDERIVATIVES ARG=c.* FILE=deriv2 FMT=%8.4f DUMPDERIVATIVES ARG=c.* FILE=deriv2 FMT=%8.4f
Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q6 Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LOWEST LABEL=q6
# Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q6n # Q6 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q6n
PRINT ARG=q6.* FILE=colv PRINT ARG=q6.* FILE=colv
DUMPDERIVATIVES ARG=q6.* FILE=deriv FMT=%8.4f DUMPDERIVATIVES ARG=q6.mean FILE=deriv FMT=%8.4f
Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q4 Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN LABEL=q4
# Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q4n # Q4 SPECIES=1-64 D_0=3.0 R_0=1.5 MEAN NUMERICAL_DERIVATIVES LABEL=q4n
......
...@@ -37,8 +37,6 @@ StoreDataVessel::StoreDataVessel( const VesselOptions& da ): ...@@ -37,8 +37,6 @@ StoreDataVessel::StoreDataVessel( const VesselOptions& da ):
ActionWithValue* myval=dynamic_cast<ActionWithValue*>( getAction() ); ActionWithValue* myval=dynamic_cast<ActionWithValue*>( getAction() );
if( !myval ) hasderiv=false; if( !myval ) hasderiv=false;
else hasderiv=!myval->doNotCalculateDerivatives(); else hasderiv=!myval->doNotCalculateDerivatives();
vecsize=getAction()->getNumberOfQuantities();
} }
void StoreDataVessel::addActionThatUses( ActionWithVessel* actionThatUses ) { void StoreDataVessel::addActionThatUses( ActionWithVessel* actionThatUses ) {
...@@ -46,8 +44,6 @@ void StoreDataVessel::addActionThatUses( ActionWithVessel* actionThatUses ) { ...@@ -46,8 +44,6 @@ void StoreDataVessel::addActionThatUses( ActionWithVessel* actionThatUses ) {
} }
void StoreDataVessel::resize() { void StoreDataVessel::resize() {
plumed_dbg_assert( vecsize>0 );
if( getAction()->lowmem || !getAction()->derivativesAreRequired() ) { if( getAction()->lowmem || !getAction()->derivativesAreRequired() ) {
nspace = 1; nspace = 1;
active_der.resize( max_lowmem_stash * ( 1 + getAction()->getNumberOfDerivatives() ) ); active_der.resize( max_lowmem_stash * ( 1 + getAction()->getNumberOfDerivatives() ) );
...@@ -58,6 +54,7 @@ void StoreDataVessel::resize() { ...@@ -58,6 +54,7 @@ void StoreDataVessel::resize() {
nspace = 1 + getAction()->maxderivatives; nspace = 1 + getAction()->maxderivatives;
active_der.resize( getNumberOfStoredValues() * ( 1 + getAction()->maxderivatives ) ); active_der.resize( getNumberOfStoredValues() * ( 1 + getAction()->maxderivatives ) );
} }
vecsize=getAction()->getNumberOfQuantities();
resizeBuffer( getNumberOfStoredValues()*vecsize*nspace ); resizeBuffer( getNumberOfStoredValues()*vecsize*nspace );
local_buffer.resize( getNumberOfStoredValues()*vecsize*nspace ); local_buffer.resize( getNumberOfStoredValues()*vecsize*nspace );
} }
...@@ -102,14 +99,14 @@ void StoreDataVessel::storeDerivatives( const unsigned& myelem, MultiValue& myva ...@@ -102,14 +99,14 @@ void StoreDataVessel::storeDerivatives( const unsigned& myelem, MultiValue& myva
} }
void StoreDataVessel::retrieveSequentialValue( const unsigned& jelem, const bool& normed, std::vector<double>& values ) const { void StoreDataVessel::retrieveSequentialValue( const unsigned& jelem, const bool& normed, std::vector<double>& values ) const {
plumed_assert( values.size()==vecsize ); plumed_dbg_assert( values.size()==vecsize );
unsigned ibuf = jelem * vecsize * nspace; unsigned ibuf = jelem * vecsize * nspace;
for(unsigned i=0; i<vecsize; ++i) { values[i]=local_buffer[ibuf]; ibuf+=nspace; } for(unsigned i=0; i<vecsize; ++i) { values[i]=local_buffer[ibuf]; ibuf+=nspace; }
if( normed && values.size()>2 ) getAction()->normalizeVector( values ); if( normed && values.size()>2 ) getAction()->normalizeVector( values );
} }
void StoreDataVessel::retrieveValueWithIndex( const unsigned& myelem, const bool& normed, std::vector<double>& values ) const { void StoreDataVessel::retrieveValueWithIndex( const unsigned& myelem, const bool& normed, std::vector<double>& values ) const {
plumed_assert( values.size()==vecsize ); plumed_dbg_assert( values.size()==vecsize );
unsigned jelem = getStoreIndex( myelem ); unsigned jelem = getStoreIndex( myelem );
retrieveSequentialValue( jelem, normed, values ); retrieveSequentialValue( jelem, normed, values );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment