diff --git a/src/DataSet_Coords_CRD.cpp b/src/DataSet_Coords_CRD.cpp index 7a69f97872..ecafc785a6 100644 --- a/src/DataSet_Coords_CRD.cpp +++ b/src/DataSet_Coords_CRD.cpp @@ -133,16 +133,16 @@ static inline void ArrayToFrame(int idx, Frame& fOut, CompactFrameArray const& f /** Get a frame from specified position in array. */ void DataSet_Coords_CRD::GetFrame(int idx, Frame& fOut) { if (frames_.HasComponent(CoordinateInfo::POSITION)) frames_.GetToDblPtr(fOut.xAddress(), idx, CoordinateInfo::POSITION); - if (frames_.HasComponent(CoordinateInfo::VELOCITY)) frames_.GetToDblPtr(fOut.vAddress(), idx, CoordinateInfo::VELOCITY); - if (frames_.HasComponent(CoordinateInfo::FORCE)) frames_.GetToDblPtr(fOut.fAddress(), idx, CoordinateInfo::FORCE); + if (frames_.HasComponent(CoordinateInfo::VELOCITY) && fOut.HasVelocity()) frames_.GetToDblPtr(fOut.vAddress(), idx, CoordinateInfo::VELOCITY); + if (frames_.HasComponent(CoordinateInfo::FORCE) && fOut.HasForce()) frames_.GetToDblPtr(fOut.fAddress(), idx, CoordinateInfo::FORCE); ArrayToFrame(idx, fOut, frames_); } /** Get selected atoms from a frame from specified position in array. */ void DataSet_Coords_CRD::GetFrame(int idx, Frame& fOut, AtomMask const& mask) { if (frames_.HasComponent(CoordinateInfo::POSITION)) frames_.GetToMaskDblPtr(fOut.xAddress(), mask.Selected(), idx, CoordinateInfo::POSITION); - if (frames_.HasComponent(CoordinateInfo::VELOCITY)) frames_.GetToMaskDblPtr(fOut.vAddress(), mask.Selected(), idx, CoordinateInfo::VELOCITY); - if (frames_.HasComponent(CoordinateInfo::FORCE)) frames_.GetToMaskDblPtr(fOut.fAddress(), mask.Selected(), idx, CoordinateInfo::FORCE); + if (frames_.HasComponent(CoordinateInfo::VELOCITY) && fOut.HasVelocity()) frames_.GetToMaskDblPtr(fOut.vAddress(), mask.Selected(), idx, CoordinateInfo::VELOCITY); + if (frames_.HasComponent(CoordinateInfo::FORCE) && fOut.HasForce()) frames_.GetToMaskDblPtr(fOut.fAddress(), mask.Selected(), idx, CoordinateInfo::FORCE); ArrayToFrame(idx, fOut, frames_); } diff --git a/src/Version.h b/src/Version.h index bd2c7716a0..37ebe70960 100644 --- a/src/Version.h +++ b/src/Version.h @@ -12,7 +12,7 @@ * Whenever a number that precedes is incremented, all subsequent * numbers should be reset to 0. */ -#define CPPTRAJ_INTERNAL_VERSION "V5.3.1" +#define CPPTRAJ_INTERNAL_VERSION "V5.3.2" /// PYTRAJ relies on this #define CPPTRAJ_VERSION_STRING CPPTRAJ_INTERNAL_VERSION #endif diff --git a/test/Test_2DRMS/RunTest.sh b/test/Test_2DRMS/RunTest.sh index 4011f1f4f2..b1744de3b7 100755 --- a/test/Test_2DRMS/RunTest.sh +++ b/test/Test_2DRMS/RunTest.sh @@ -3,7 +3,8 @@ . ../MasterTest.sh # Clean -CleanFiles rms.in rmsd1.dat rmsd2.dat ref.nc rmsd.mass.dat dme.dat trp.dat nofit.dat +CleanFiles rms.in rmsd1.dat rmsd2.dat ref.nc rmsd.mass.dat dme.dat trp.dat \ + nofit.dat rgacc.dat TESTNAME='2D RMSD tests' Requires netcdf maxthreads 10 @@ -73,6 +74,19 @@ EOF RunCpptraj "2D RMSD test, no fitting." DoTest nofit.dat.save nofit.dat +# Test 7 - coords with velocities +TOP='' +CRD='' +cat > rms.in <