diff --git a/src/Action_DihedralRMS.cpp b/src/Action_DihedralRMS.cpp new file mode 100644 index 0000000000..2d6c265d7f --- /dev/null +++ b/src/Action_DihedralRMS.cpp @@ -0,0 +1,219 @@ +#include // fabs, sqrt +#include "Action_DihedralRMS.h" +#include "CpptrajStdio.h" +#include "TorsionRoutines.h" +#include "Constants.h" + +/// CONSTRUCTOR +Action_DihedralRMS::Action_DihedralRMS() : + dataOut_(0), + debug_(0) +{} + +// Action_DihedralRMS::Help() +void Action_DihedralRMS::Help() const { + mprintf("\t[] [out ]\n" + "%s" + "\t[%s]\n", ReferenceAction::Help(), DihedralSearch::newTypeArgsHelp_); +} + +// Action_DihedralRMS::Init() +Action::RetType Action_DihedralRMS::Init(ArgList& actionArgs, ActionInit& init, int debugIn) +{ + debug_ = debugIn; + // Get keywords + DataFile* outfile = init.DFL().AddDataFile( actionArgs.GetStringKey("out"), actionArgs); + std::string tgtArg = actionArgs.GetStringKey("tgtrange"); + std::string refArg = actionArgs.GetStringKey("refrange"); + if (!tgtArg.empty()) { + if (tgtRange_.SetRange( tgtArg )) return Action::ERR; + } + if (!refArg.empty()) { + if (refRange_.SetRange( refArg )) return Action::ERR; + } else if (!tgtArg.empty()) { + if (refRange_.SetRange( tgtArg )) return Action::ERR; + } + // Reference keywords. false= no fit, false= no use mass + if (REF_.InitRef(actionArgs, init.DSL(), false, false)) return Action::ERR; + // Search for known dihedral keywords + dihSearch_.SearchForArgs(actionArgs); + // Get custom dihedral arguments: dihtype ::::[:] + if (dihSearch_.SearchForNewTypeArgs(actionArgs)) return Action::ERR; + // If no dihedral types yet selected, this will select all. + dihSearch_.SearchForAll(); + // Reference will try to select same types as target + refSearch_ = dihSearch_; + // Setup DataSet(s) name + std::string dsetname = actionArgs.GetStringNext(); + // Setup output data set + dataOut_ = init.DSL().AddSet(DataSet::DOUBLE, dsetname, "DIHRMS"); + if (dataOut_ == 0) return Action::ERR; + if (outfile != 0) outfile->AddDataSet( dataOut_ ); +# ifdef MPI + if (REF_.SetTrajComm( init.TrajComm() )) return Action::ERR; +# endif + + mprintf(" DIHEDRAL RMSD: Calculating dihedral RMS for dihedrals:"); + dihSearch_.PrintTypes(); + mprintf("\n"); + if (debug_ > 0) { + mprintf("\tReference dihedrals:"); + refSearch_.PrintTypes(); // DEBUG + mprintf("\n"); + } + if (!tgtRange_.Empty()) + mprintf("\tTarget residue range: %s\n", tgtRange_.RangeArg()); + if (!refRange_.Empty()) + mprintf("\tReference residue range: %s\n", refRange_.RangeArg()); + mprintf("\tReference is %s\n", REF_.RefModeString().c_str()); + return Action::OK; +} + +/** \return Range with actual residues to search for dihedrals in. If the + * given range is not set, will use all solute residues. + */ +Range Action_DihedralRMS::GetActualRange(Topology const& top, Range const& resRange) const { + Range actualRange; + // If range is empty (i.e. no resrange arg given) look through all + // solute residues. + if (resRange.Empty()) + actualRange = top.SoluteResidues(); + else { + // If user range specified, create new range shifted by -1 since internal + // resnums start from 0. + actualRange = resRange; + actualRange.ShiftBy(-1); + } + return actualRange; +} + +/** Find dihedrals in the reference structure.*/ +int Action_DihedralRMS::SetupRefDihedrals(Topology const& top) { + Range actualRange = GetActualRange(top, refRange_); + if (actualRange.Empty()) { + mprinterr("Error: No residues in reference topology %s\n", top.c_str()); + return 1; + } + // Search for specified dihedrals in each residue in the range + if (refSearch_.FindDihedrals(top, actualRange)) { + mprinterr("Error: No dihedrals found in reference topology %s\n", top.c_str()); + return 1; + } + mprintf("\tSelected %i reference dihedrals\n", refSearch_.Ndihedrals()); + return 0; +} + +/**Fill the refVals_ array with reference dihedral values. */ +int Action_DihedralRMS::CalcRefDihedrals(Frame const& frm) { + // Calculate dihedrals + refVals_.clear(); + refVals_.reserve( refSearch_.Ndihedrals() ); + for (DihedralSearch::mask_it dih = refSearch_.begin(); + dih != refSearch_.end(); ++dih) + { + double torsion = Torsion( frm.XYZ(dih->A0()), + frm.XYZ(dih->A1()), + frm.XYZ(dih->A2()), + frm.XYZ(dih->A3()) ); + refVals_.push_back( torsion ); + } + return 0; +} + +// Action_DihedralRMS::Setup() +Action::RetType Action_DihedralRMS::Setup(ActionSetup& setup) +{ + // Perform any reference setup. -1 means do not check number of selected + // atoms, which is not necessary because we are looking for dihedrals, + // not atoms. + if (REF_.SetupRef(setup.Top(), -1)) + return Action::SKIP; + // Perform any dihedral-specific setup for reference. + // Fill the reference values if needed + if (refVals_.empty()) { + if (REF_.RefMode() == ReferenceAction::FRAME || + REF_.RefMode() == ReferenceAction::TRAJ) + { + // Sanity check + Topology* refTop = REF_.RefCrdTopPtr(); + if (refTop == 0) { + mprinterr("Internal Error: Reference topology is null.\n"); + return Action::ERR; + } + if (SetupRefDihedrals( *refTop )) return Action::ERR; + if (REF_.RefMode() == ReferenceAction::FRAME) { + if (CalcRefDihedrals( REF_.CurrentReference() )) return Action::ERR; + // DEBUG + if (debug_ > 0) { + mprintf("DEBUG: Reference dihedral values (radians):\n"); + for (Darray::const_iterator it = refVals_.begin(); it != refVals_.end(); ++it) + mprintf("\t%8li %12.4f\n", it-refVals_.begin(), *it); + } + } + } else { + // FIRST, PREVIOUS + if (SetupRefDihedrals( setup.Top() )) return Action::ERR; + } + } + + // Get the target range + Range actualRange = GetActualRange(setup.Top(), tgtRange_); + if (actualRange.Empty()) { + mprinterr("Error: No residues in topology %s\n", setup.Top().c_str()); + return Action::ERR; + } + // Search for specified dihedrals in each residue in the range + if (dihSearch_.FindDihedrals(setup.Top(), actualRange)) { + mprinterr("Error: No dihedrals found in topology %s\n", setup.Top().c_str()); + return Action::ERR; + } + mprintf("\tSelected %i dihedrals\n", dihSearch_.Ndihedrals()); + + if (dihSearch_.Ndihedrals() != refSearch_.Ndihedrals()) { + mprintf("Warning: # target dihedrals %i != # reference dihedrals %i. Skipping.\n", + dihSearch_.Ndihedrals(), refSearch_.Ndihedrals()); + return Action::SKIP; + } + return Action::OK; +} + +// Action_DihedralRMS::DoAction() +Action::RetType Action_DihedralRMS::DoAction(int frameNum, ActionFrame& frm) +{ + // Perform any needed reference actions + REF_.ActionRef( frm.TrajoutNum(), frm.Frm() ); + if (REF_.RefMode() == ReferenceAction::TRAJ || + REF_.RefMode() == ReferenceAction::PREVIOUS || + refVals_.empty()) + CalcRefDihedrals( REF_.CurrentReference() ); + // Calculate dihedral rmsd + //mprintf("DEBUG: Frame %i\n", frameNum); + double rms = 0.0; + double total_mass = (double)refVals_.size(); + Darray::const_iterator refv = refVals_.begin(); + for (DihedralSearch::mask_it dih = dihSearch_.begin(); + dih != dihSearch_.end(); ++dih, ++refv) + { + double torsion = Torsion( frm.Frm().XYZ(dih->A0()), + frm.Frm().XYZ(dih->A1()), + frm.Frm().XYZ(dih->A2()), + frm.Frm().XYZ(dih->A3()) ); + double diff = fabs(torsion - *refv); + //mprintf("DEBUG:\t\tTgt = %12.4f Ref = %12.4f Diff = %12.4f", + // torsion*Constants::RADDEG, + // (*refv)*Constants::RADDEG, + // diff*Constants::RADDEG); + if (diff > Constants::PI) + diff = Constants::TWOPI - diff; // TODO what if diff is > TWOPI? Can that happen? + //mprintf(" AdjDiff = %12.4f\n", diff * Constants::RADDEG); + rms += (diff*diff); + } + rms = sqrt(rms / total_mass); + + rms = rms * Constants::RADDEG; + + dataOut_->Add(frameNum, &rms); + + REF_.PreviousRef( frm.Frm() ); + return Action::OK; +} diff --git a/src/Action_DihedralRMS.h b/src/Action_DihedralRMS.h new file mode 100644 index 0000000000..779dd8113a --- /dev/null +++ b/src/Action_DihedralRMS.h @@ -0,0 +1,33 @@ +#ifndef INC_ACTION_DIHEDRALRMS_H +#define INC_ACTION_DIHEDRALRMS_H +#include "Action.h" +#include "DihedralSearch.h" +#include "ReferenceAction.h" +/// Calculate dihedral RMSD to reference +class Action_DihedralRMS : public Action { + public: + Action_DihedralRMS(); + DispatchObject* Alloc() const { return (DispatchObject*)new Action_DihedralRMS(); } + void Help() const; + private: + Action::RetType Init(ArgList&, ActionInit&, int); + Action::RetType Setup(ActionSetup&); + Action::RetType DoAction(int, ActionFrame&); + void Print() {} + + typedef std::vector Darray; + + Range GetActualRange(Topology const&, Range const&) const; + int SetupRefDihedrals(Topology const&); + int CalcRefDihedrals(Frame const&); + + DihedralSearch dihSearch_; ///< Used to select specified dihedrals in target + DihedralSearch refSearch_; ///< Used to select specified dihedrals in reference + ReferenceAction REF_; ///< Hold reference structure + Darray refVals_; ///< Reference dihedral values in radians + Range tgtRange_; + Range refRange_; + DataSet* dataOut_; ///< Output data set + int debug_; +}; +#endif diff --git a/src/Action_MultiDihedral.cpp b/src/Action_MultiDihedral.cpp index 90de0b1c40..412d31bf59 100644 --- a/src/Action_MultiDihedral.cpp +++ b/src/Action_MultiDihedral.cpp @@ -37,18 +37,7 @@ Action::RetType Action_MultiDihedral::Init(ArgList& actionArgs, ActionInit& init // Search for known dihedral keywords dihSearch_.SearchForArgs(actionArgs); // Get custom dihedral arguments: dihtype ::::[:] - std::string dihtype_arg = actionArgs.GetStringKey("dihtype"); - while (!dihtype_arg.empty()) { - ArgList dihtype(dihtype_arg, ":"); - if (dihtype.Nargs() < 5) { - mprinterr("Error: Malformed dihtype arg.\n"); - return Action::ERR; - } - int offset = 0; - if (dihtype.Nargs() == 6) offset = convertToInteger(dihtype[5]); - dihSearch_.SearchForNewType(offset,dihtype[1],dihtype[2],dihtype[3],dihtype[4], dihtype[0]); - dihtype_arg = actionArgs.GetStringKey("dihtype"); - } + if (dihSearch_.SearchForNewTypeArgs(actionArgs)) return Action::ERR; // If no dihedral types yet selected, this will select all. dihSearch_.SearchForAll(); diff --git a/src/Command.cpp b/src/Command.cpp index 8771e8f7ea..8214c31d09 100644 --- a/src/Command.cpp +++ b/src/Command.cpp @@ -140,6 +140,7 @@ #include "Action_InfraredSpectrum.h" #include "Action_XtalSymm.h" #include "Action_Time.h" +#include "Action_DihedralRMS.h" // ----- ANALYSIS -------------------------------------------------------------- #include "Analysis_Hist.h" #include "Analysis_Corr.h" @@ -297,6 +298,7 @@ void Command::Init() { Command::AddCmd( new Action_Density(), Cmd::ACT, 1, "density" ); Command::AddCmd( new Action_Diffusion(), Cmd::ACT, 1, "diffusion" ); Command::AddCmd( new Action_Dihedral(), Cmd::ACT, 1, "dihedral" ); + Command::AddCmd( new Action_DihedralRMS(), Cmd::ACT, 1, "dihrms" ); Command::AddCmd( new Action_Dipole(), Cmd::ACT, 1, "dipole" ); Command::AddCmd( new Action_Distance(), Cmd::ACT, 1, "distance" ); Command::AddCmd( new Action_DNAionTracker(), Cmd::ACT, 1, "dnaiontracker" ); // HIDDEN diff --git a/src/DataSet_string.cpp b/src/DataSet_string.cpp index 9269d22a05..3db69d5218 100644 --- a/src/DataSet_string.cpp +++ b/src/DataSet_string.cpp @@ -1,3 +1,4 @@ +#include // std::max #include "DataSet_string.h" size_t DataSet_string::MemUsageInBytes() const { @@ -38,7 +39,8 @@ void DataSet_string::WriteBuffer(CpptrajFile &cbuffer, SizeArray const& pIn) con cbuffer.Printf(format_.fmt(), "NoData"); else { // Protect against CpptrajFile buffer overflow. - if (format_.Width() >= (int)CpptrajFile::BUF_SIZE) { + size_t maxWidth = std::max( (size_t)format_.Width(), Data_[pIn[0]].size() ); + if (maxWidth >= CpptrajFile::BUF_SIZE) { // FIXME: Data sets should not have to worry about spaces in format strings. if (format_.fmt()[0] == ' ') cbuffer.Printf(" "); cbuffer.Write(Data_[pIn[0]].c_str(), Data_[pIn[0]].size()); diff --git a/src/DihedralSearch.cpp b/src/DihedralSearch.cpp index 2b17e6ea7d..d47038b701 100644 --- a/src/DihedralSearch.cpp +++ b/src/DihedralSearch.cpp @@ -1,5 +1,8 @@ #include "DihedralSearch.h" #include "CpptrajStdio.h" +#include "StringRoutines.h" // convertToInteger +#include "ArgList.h" +#include "Topology.h" const DihedralSearch::DihedralType DihedralSearch::D_FIRST = MetaData::ALPHA; const DihedralSearch::DihedralType DihedralSearch::D_END = MetaData::PUCKER; @@ -204,6 +207,29 @@ void DihedralSearch::SearchForArgs(ArgList& argIn) { } } +const char* DihedralSearch::newTypeArgsHelp_ = "dihtype ::::[:] ..."; + +/** Get custom dihedral arguments: + * 'dihtype ::::[:]' + * where determines which residue / are in. + */ +int DihedralSearch::SearchForNewTypeArgs(ArgList& argIn) { + std::string dihtype_arg = argIn.GetStringKey("dihtype"); + while (!dihtype_arg.empty()) { + ArgList dihtype(dihtype_arg, ":"); + if (dihtype.Nargs() < 5) { + mprinterr("Error: Malformed dihtype arg.\n"); + return 1; + } + int offset = 0; + if (dihtype.Nargs() == 6) offset = convertToInteger(dihtype[5]); + // NOTE: Not checking return status here because worse that happens is a Warning + SearchForNewType(offset,dihtype[1],dihtype[2],dihtype[3],dihtype[4], dihtype[0]); + dihtype_arg = argIn.GetStringKey("dihtype"); + } + return 0; +} + // DihedralSearch::SearchForNewType() /** Add new type to search for. */ int DihedralSearch::SearchForNewType(int off, std::string const& an0, std::string const& an1, diff --git a/src/DihedralSearch.h b/src/DihedralSearch.h index 1f76467131..23384b7602 100644 --- a/src/DihedralSearch.h +++ b/src/DihedralSearch.h @@ -1,9 +1,11 @@ #ifndef INC_DIHEDRALSEARCH_H #define INC_DIHEDRALSEARCH_H -#include "Topology.h" -#include "DataSet.h" -#include "Range.h" -#include "ArgList.h" +#include "MetaData.h" +#include "AtomMask.h" +// Forward declarations +class ArgList; +class Range; +class Topology; /// Class that can be used to search for dihedral angles in a range. // Thanks to C. Bergonzo for the NA angle definitions. class DihedralSearch { @@ -28,6 +30,10 @@ class DihedralSearch { int SearchFor(DihedralType); /// Search for known dihedral type keywords. void SearchForArgs(ArgList&); + /// Contains keywords for SearchNewTypeArgs() + static const char* newTypeArgsHelp_; + /// Search for new type via args + int SearchForNewTypeArgs(ArgList&); /// Add a new dihedral type to be searched for. int SearchForNewType(int, std::string const&, std::string const&, std::string const&, std::string const&, std::string const&); diff --git a/src/ReferenceAction.cpp b/src/ReferenceAction.cpp index 451ada1179..9edd9a8ed5 100644 --- a/src/ReferenceAction.cpp +++ b/src/ReferenceAction.cpp @@ -1,4 +1,5 @@ #include "ReferenceAction.h" +#include "DataSetList.h" #include "CpptrajStdio.h" #include "DataSet_Coords_TRJ.h" #include "ReferenceFrame.h" @@ -7,7 +8,6 @@ ReferenceAction::ReferenceAction() : refMode_( FIRST ), refCrd_( 0 ), traj_( 0 ), - previous_( false ), needsSetup_( false), fitRef_( false ), useMass_( false ) @@ -18,7 +18,7 @@ ReferenceAction::~ReferenceAction() { if (traj_ != 0) delete traj_; } // ReferenceAction::RefModeString() std::string ReferenceAction::RefModeString() const { std::string modeString; - if (previous_) + if (refMode_ == PREVIOUS) modeString = "previous frame"; else if (refMode_ == FIRST) modeString = "first frame"; @@ -26,7 +26,8 @@ std::string ReferenceAction::RefModeString() const { modeString = "trajectory " + refCrd_->Meta().Legend(); else // FRAME modeString = "\"" + refCrd_->Meta().Legend() + "\""; - modeString += " (" + refMask_.MaskExpression() + ")"; + if (refMask_.MaskStringSet()) + modeString += " (" + refMask_.MaskExpression() + ")"; return modeString; } @@ -38,7 +39,7 @@ std::string ReferenceAction::help_ = /** Should be called after InitRef(). */ int ReferenceAction::SetTrajComm( Parallel::Comm const& commIn ) { // Does not work for previous - if (previous_ && commIn.Size() > 1) { + if (refMode_ == PREVIOUS && commIn.Size() > 1) { mprinterr("Error: 'previous' reference does not work in parallel.\n"); return 1; } @@ -72,10 +73,11 @@ int ReferenceAction::InitRef(ArgList& argIn, DataSetList const& DSLin, { fitRef_ = fitRefIn; useMass_ = useMassIn; - previous_ = argIn.hasKey("previous"); // Attempt to determine reference mode. refMode_ = FIRST; // Default - if (!argIn.hasKey("first")) { + if (argIn.hasKey("previous")) { + refMode_ = PREVIOUS; + } else if (!argIn.hasKey("first")) { // Attempt to set refMode_ and refCrd_ if (argIn.Contains("reftraj")) { // Reference trajectory. First try to find COORDS or TRAJ. @@ -116,18 +118,24 @@ int ReferenceAction::InitRef(ArgList& argIn, DataSetList const& DSLin, /// Allocate space for reading Frame from COORDS if necessary if (refCrd_ != 0) { refFrame_ = refCrd_->AllocateFrame(); - needsSetup_ = true; } } + needsSetup_ = true; return 0; } // ReferenceAction::SetupRefMask() int ReferenceAction::SetupRefMask(Topology const& topIn) { - if (topIn.SetupIntegerMask( refMask_ )) return 1; - mprintf("\tReference mask:"); - refMask_.BriefMaskInfo(); - mprintf("\n"); + if (refMask_.MaskStringSet()) { + if (topIn.SetupIntegerMask( refMask_ )) return 1; + mprintf("\tReference mask:"); + refMask_.BriefMaskInfo(); + mprintf("\n"); + } else { + refMask_.ResetMask(); + refMask_.SetNatoms( topIn.Natom() ); + refMask_.AddAtomRange(0, topIn.Natom() ); + } if (refMask_.None()) { mprinterr("Error: No reference atoms selected for parm %s, [%s]\n", topIn.c_str(), refMask_.MaskString()); @@ -156,19 +164,23 @@ void ReferenceAction::SelectRefAtoms(Frame const& frameIn) { // ReferenceAction::SetupRef() int ReferenceAction::SetupRef(Topology const& topIn, int Ntgt) { - if (refMode_ == FIRST) { - if ( SetupRefMask( topIn ) ) return 1; - } else if (previous_) { - mprintf("Warning: 'previous' may not work properly for changing topologies.\n"); - if ( SetupRefMask( topIn ) ) return 1; - } else if (needsSetup_) { // FRAME, TRAJ; only set up once. - if ( SetupRefMask( refCrd_->Top() ) ) return 1; - if (refMode_ == FRAME) - SelectRefAtoms( ((DataSet_Coords_REF*)refCrd_)->RefFrame() ); + if (needsSetup_) { + if (refMode_ == FIRST || refMode_ == PREVIOUS) { + // First frame or previous frame. Topology will be topIn. + if ( SetupRefMask( topIn ) ) return 1; + } else { + // Specified frame or trajectory. Accessed via refCrd_. + if ( SetupRefMask( refCrd_->Top() ) ) return 1; + if (refMode_ == FRAME) + SelectRefAtoms( ((DataSet_Coords_REF*)refCrd_)->RefFrame() ); + } needsSetup_ = false; + } else { + if (refMode_ == PREVIOUS) + mprintf("Warning: 'previous' may not work properly for changing topologies.\n"); } // Check that num atoms in target mask from this parm match ref parm mask - if ( refMask_.Nselected() != Ntgt ) { + if ( Ntgt != -1 && refMask_.Nselected() != Ntgt ) { mprintf("Warning: Number of atoms in target mask (%i) does not equal\n" "Warning: number of atoms in reference mask (%i).\n", Ntgt, refMask_.Nselected()); diff --git a/src/ReferenceAction.h b/src/ReferenceAction.h index 6b0c8d4622..b305da1a63 100644 --- a/src/ReferenceAction.h +++ b/src/ReferenceAction.h @@ -1,12 +1,21 @@ #ifndef INC_REFERENCEACTION_H #define INC_REFERENCEACTION_H -#include "DataSetList.h" +#include +#include "Frame.h" #include "DataSet_Coords.h" +// Forward declarations +class DataSetList; +class ArgList; +class Topology; /// Class that can be used by Actions to hold a COORDS DataSet to use as reference. class ReferenceAction { public: ReferenceAction(); ~ReferenceAction(); + + /// Modes: FIRST=first frame, FRAME=given frame, TRAJ=reference traj + enum RefModeType { FIRST = 0, FRAME, TRAJ, PREVIOUS }; + /// Process all reference-related arguments, figure out reference mode. int InitRef(ArgList&, DataSetList const&, bool, bool); # ifdef MPI @@ -29,6 +38,8 @@ class ReferenceAction { Frame const& SelectedRef() const { return selectedRef_; } /// \return Translation vector from origin to original ref center. Vec3 const& RefTrans() const { return refTrans_; } + /// \return Current reference mode + RefModeType RefMode() const { return refMode_; } /// \return Help text static const char* Help() { return help_.c_str(); } /// \return Pointer to reference COORDS topology if possible. @@ -41,8 +52,6 @@ class ReferenceAction { void SelectRefAtoms(Frame const&); /// Set up ref mask for given topology. Allocate space for selected ref atoms. int SetupRefMask(Topology const&); - /// Modes: FIRST=first frame, FRAME=given frame, TRAJ=reference traj - enum RefModeType { FIRST = 0, FRAME, TRAJ }; RefModeType refMode_; ///< Reference mode. DataSet_Coords* refCrd_; ///< Reference COORDS DataSet. @@ -52,7 +61,6 @@ class ReferenceAction { Frame selectedRef_; ///< Atoms from reference frame selected by refMask_. Vec3 refTrans_; ///< If fitting, translation from origin to original ref center. static std::string help_;///< Help text. - bool previous_; ///< True if current reference is previous frame (only RMSD now) bool needsSetup_; ///< True if ref from COORDS needs to be set up during SetupRef() bool fitRef_; ///< If true, move reference to origin for RMS fitting bool useMass_; ///< (If fitRef_) If true, move COM, otherwise geometric center. @@ -64,18 +72,18 @@ class ReferenceAction { // ReferenceAction::ActionRef() void ReferenceAction::ActionRef(int frameNum, Frame const& frameIn) { - if (refMode_ == FIRST) { - SelectRefAtoms( frameIn ); - refMode_ = FRAME; - } else if (refMode_ == TRAJ) { + if (refMode_ == TRAJ) { refCrd_->GetFrame( frameNum, refFrame_ ); selectedRef_.SetCoordinates(refFrame_, refMask_); if (fitRef_) refTrans_ = selectedRef_.CenterOnOrigin(useMass_); + } else if (refFrame_.empty()) { + // FIRST or first PREVIOUS + SelectRefAtoms( frameIn ); } } void ReferenceAction::PreviousRef(Frame const& frameIn) { - if (previous_) SelectRefAtoms( frameIn ); + if (refMode_ == PREVIOUS) SelectRefAtoms( frameIn ); } #endif diff --git a/src/Version.h b/src/Version.h index e324438b53..f3b2c9afaa 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 "V4.14.11" +#define CPPTRAJ_INTERNAL_VERSION "V4.14.12" /// PYTRAJ relies on this #define CPPTRAJ_VERSION_STRING CPPTRAJ_INTERNAL_VERSION #endif diff --git a/src/cpptrajdepend b/src/cpptrajdepend index 766bda7614..94b9602c77 100644 --- a/src/cpptrajdepend +++ b/src/cpptrajdepend @@ -25,6 +25,7 @@ Action_DSSP.o : Action_DSSP.cpp Action.h ActionState.h Action_DSSP.h ArgList.h A Action_Density.o : Action_Density.cpp Action.h ActionState.h Action_Density.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImagedAction.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OnlineVarT.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h Vec3.h Action_Diffusion.o : Action_Diffusion.cpp Action.h ActionState.h Action_Diffusion.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImagedAction.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h Vec3.h Action_Dihedral.o : Action_Dihedral.cpp Action.h ActionState.h Action_Dihedral.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_double.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h Vec3.h +Action_DihedralRMS.o : Action_DihedralRMS.cpp Action.h ActionState.h Action_DihedralRMS.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h DihedralSearch.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceAction.h ReferenceFrame.h ReplicaDimArray.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h Vec3.h Action_Dipole.o : Action_Dipole.cpp Action.h ActionState.h Action_Dipole.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_3D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_GridFlt.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h Grid.h GridAction.h GridBin.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h Vec3.h Action_DistRmsd.o : Action_DistRmsd.cpp Action.h ActionState.h Action_DistRmsd.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceAction.h ReferenceFrame.h ReplicaDimArray.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h Vec3.h Action_Distance.o : Action_Distance.cpp Action.h ActionState.h Action_Distance.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImagedAction.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h Vec3.h @@ -156,7 +157,7 @@ Cluster_ReadInfo.o : Cluster_ReadInfo.cpp ArgList.h ArrayIterator.h AssociatedDa Cmd.o : Cmd.cpp Cmd.h DispatchObject.h CmdInput.o : CmdInput.cpp CmdInput.h StringRoutines.h CmdList.o : CmdList.cpp Cmd.h CmdList.h DispatchObject.h -Command.o : Command.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Action_Align.h Action_Angle.h Action_AreaPerMol.h Action_AtomMap.h Action_AtomicCorr.h Action_AtomicFluct.h Action_AutoImage.h Action_Average.h Action_Bounds.h Action_Box.h Action_Center.h Action_Channel.h Action_CheckChirality.h Action_CheckStructure.h Action_Closest.h Action_ClusterDihedral.h Action_Contacts.h Action_CreateCrd.h Action_CreateReservoir.h Action_DNAionTracker.h Action_DSSP.h Action_Density.h Action_Diffusion.h Action_Dihedral.h Action_Dipole.h Action_DistRmsd.h Action_Distance.h Action_Energy.h Action_Esander.h Action_FilterByData.h Action_FixAtomOrder.h Action_FixImagedBonds.h Action_GIST.h Action_Grid.h Action_GridFreeEnergy.h Action_HydrogenBond.h Action_Image.h Action_InfraredSpectrum.h Action_Jcoupling.h Action_LESsplit.h Action_LIE.h Action_LipidOrder.h Action_MakeStructure.h Action_Mask.h Action_Matrix.h Action_MinImage.h Action_Molsurf.h Action_MultiDihedral.h Action_MultiVector.h Action_NAstruct.h Action_NMRrst.h Action_NativeContacts.h Action_OrderParameter.h Action_Outtraj.h Action_PairDist.h Action_Pairwise.h Action_Principal.h Action_Projection.h Action_Pucker.h Action_Radgyr.h Action_Radial.h Action_RandomizeIons.h Action_Remap.h Action_ReplicateCell.h Action_Rmsd.h Action_Rotate.h Action_RunningAvg.h Action_STFC_Diffusion.h Action_Scale.h Action_SetVelocity.h Action_Spam.h Action_Strip.h Action_Surf.h Action_SymmetricRmsd.h Action_Temperature.h Action_Time.h Action_Translate.h Action_Unstrip.h Action_Unwrap.h Action_Vector.h Action_VelocityAutoCorr.h Action_Volmap.h Action_Volume.h Action_Watershell.h Action_XtalSymm.h Analysis.h AnalysisList.h AnalysisState.h Analysis_AmdBias.h Analysis_AutoCorr.h Analysis_Average.h Analysis_Clustering.h Analysis_ConstantPHStats.h Analysis_Corr.h Analysis_CrankShaft.h Analysis_CrdFluct.h Analysis_CrossCorr.h Analysis_CurveFit.h Analysis_Divergence.h Analysis_FFT.h Analysis_HausdorffDistance.h Analysis_Hist.h Analysis_IRED.h Analysis_Integrate.h Analysis_KDE.h Analysis_Lifetime.h Analysis_LowestCurve.h Analysis_Matrix.h Analysis_MeltCurve.h Analysis_Modes.h Analysis_MultiHist.h Analysis_Multicurve.h Analysis_Overlap.h Analysis_PhiPsi.h Analysis_Regression.h Analysis_RemLog.h Analysis_Rms2d.h Analysis_RmsAvgCorr.h Analysis_Rotdif.h Analysis_RunningAvg.h Analysis_Spline.h Analysis_State.h Analysis_Statistics.h Analysis_TI.h Analysis_Timecorr.h Analysis_VectorMath.h Analysis_Wavelet.h ArgList.h Array1D.h ArrayIterator.h AssociatedData.h Atom.h AtomExtra.h AtomMap.h AtomMask.h AxisType.h BaseIOtype.h Box.h BufferedLine.h CharMask.h ClusterDist.h ClusterList.h ClusterMap.h ClusterNode.h ClusterSieve.h Cmd.h CmdInput.h CmdList.h Command.h ComplexArray.h Constraints.h Control.h CoordinateInfo.h Corr.h Cph.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_3D.h DataSet_Cmatrix.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_GridFlt.h DataSet_Mat3x3.h DataSet_MatrixDbl.h DataSet_MatrixFlt.h DataSet_Mesh.h DataSet_Modes.h DataSet_RemLog.h DataSet_Vector.h DataSet_double.h DataSet_float.h DataSet_integer.h DataSet_integer_mem.h DataSet_pH.h DataSet_string.h Deprecated.h DihedralSearch.h Dimension.h DispatchObject.h DistRoutines.h Energy.h Energy_Sander.h EnsembleIn.h EnsembleOutList.h Ewald.h Exec.h Exec_Analyze.h Exec_Calc.h Exec_CatCrd.h Exec_Change.h Exec_ClusterMap.h Exec_CombineCoords.h Exec_Commands.h Exec_CompareTop.h Exec_CrdAction.h Exec_CrdOut.h Exec_CreateSet.h Exec_DataFile.h Exec_DataFilter.h Exec_DataSetCmd.h Exec_GenerateAmberRst.h Exec_Help.h Exec_LoadCrd.h Exec_LoadTraj.h Exec_ParallelAnalysis.h Exec_ParmBox.h Exec_ParmSolvent.h Exec_ParmStrip.h Exec_ParmWrite.h Exec_PermuteDihedrals.h Exec_Precision.h Exec_PrintData.h Exec_ReadData.h Exec_ReadEnsembleData.h Exec_ReadInput.h Exec_RotateDihedral.h Exec_RunAnalysis.h Exec_ScaleDihedralK.h Exec_SequenceAlign.h Exec_SortEnsembleData.h Exec_SplitCoords.h Exec_System.h Exec_Top.h Exec_Traj.h Exec_UpdateParameters.h Exec_ViewRst.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h Grid.h GridAction.h GridBin.h HistBin.h Hungarian.h ImageTypes.h ImagedAction.h InputTrajCommon.h MapAtom.h MaskArray.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h NetcdfFile.h OnlineVarT.h OutputTrajCommon.h PDBfile.h PairList.h Parallel.h ParameterHolders.h ParameterTypes.h PubFFT.h RPNcalc.h Random.h Range.h ReferenceAction.h ReferenceFrame.h RemdReservoirNC.h ReplicaDimArray.h ReplicaInfo.h Residue.h Spline.h StructureCheck.h SymbolExporting.h SymmetricRmsdCalc.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h VariableArray.h Vec3.h molsurf.h +Command.o : Command.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Action_Align.h Action_Angle.h Action_AreaPerMol.h Action_AtomMap.h Action_AtomicCorr.h Action_AtomicFluct.h Action_AutoImage.h Action_Average.h Action_Bounds.h Action_Box.h Action_Center.h Action_Channel.h Action_CheckChirality.h Action_CheckStructure.h Action_Closest.h Action_ClusterDihedral.h Action_Contacts.h Action_CreateCrd.h Action_CreateReservoir.h Action_DNAionTracker.h Action_DSSP.h Action_Density.h Action_Diffusion.h Action_Dihedral.h Action_DihedralRMS.h Action_Dipole.h Action_DistRmsd.h Action_Distance.h Action_Energy.h Action_Esander.h Action_FilterByData.h Action_FixAtomOrder.h Action_FixImagedBonds.h Action_GIST.h Action_Grid.h Action_GridFreeEnergy.h Action_HydrogenBond.h Action_Image.h Action_InfraredSpectrum.h Action_Jcoupling.h Action_LESsplit.h Action_LIE.h Action_LipidOrder.h Action_MakeStructure.h Action_Mask.h Action_Matrix.h Action_MinImage.h Action_Molsurf.h Action_MultiDihedral.h Action_MultiVector.h Action_NAstruct.h Action_NMRrst.h Action_NativeContacts.h Action_OrderParameter.h Action_Outtraj.h Action_PairDist.h Action_Pairwise.h Action_Principal.h Action_Projection.h Action_Pucker.h Action_Radgyr.h Action_Radial.h Action_RandomizeIons.h Action_Remap.h Action_ReplicateCell.h Action_Rmsd.h Action_Rotate.h Action_RunningAvg.h Action_STFC_Diffusion.h Action_Scale.h Action_SetVelocity.h Action_Spam.h Action_Strip.h Action_Surf.h Action_SymmetricRmsd.h Action_Temperature.h Action_Time.h Action_Translate.h Action_Unstrip.h Action_Unwrap.h Action_Vector.h Action_VelocityAutoCorr.h Action_Volmap.h Action_Volume.h Action_Watershell.h Action_XtalSymm.h Analysis.h AnalysisList.h AnalysisState.h Analysis_AmdBias.h Analysis_AutoCorr.h Analysis_Average.h Analysis_Clustering.h Analysis_ConstantPHStats.h Analysis_Corr.h Analysis_CrankShaft.h Analysis_CrdFluct.h Analysis_CrossCorr.h Analysis_CurveFit.h Analysis_Divergence.h Analysis_FFT.h Analysis_HausdorffDistance.h Analysis_Hist.h Analysis_IRED.h Analysis_Integrate.h Analysis_KDE.h Analysis_Lifetime.h Analysis_LowestCurve.h Analysis_Matrix.h Analysis_MeltCurve.h Analysis_Modes.h Analysis_MultiHist.h Analysis_Multicurve.h Analysis_Overlap.h Analysis_PhiPsi.h Analysis_Regression.h Analysis_RemLog.h Analysis_Rms2d.h Analysis_RmsAvgCorr.h Analysis_Rotdif.h Analysis_RunningAvg.h Analysis_Spline.h Analysis_State.h Analysis_Statistics.h Analysis_TI.h Analysis_Timecorr.h Analysis_VectorMath.h Analysis_Wavelet.h ArgList.h Array1D.h ArrayIterator.h AssociatedData.h Atom.h AtomExtra.h AtomMap.h AtomMask.h AxisType.h BaseIOtype.h Box.h BufferedLine.h CharMask.h ClusterDist.h ClusterList.h ClusterMap.h ClusterNode.h ClusterSieve.h Cmd.h CmdInput.h CmdList.h Command.h ComplexArray.h Constraints.h Control.h CoordinateInfo.h Corr.h Cph.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_3D.h DataSet_Cmatrix.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_GridFlt.h DataSet_Mat3x3.h DataSet_MatrixDbl.h DataSet_MatrixFlt.h DataSet_Mesh.h DataSet_Modes.h DataSet_RemLog.h DataSet_Vector.h DataSet_double.h DataSet_float.h DataSet_integer.h DataSet_integer_mem.h DataSet_pH.h DataSet_string.h Deprecated.h DihedralSearch.h Dimension.h DispatchObject.h DistRoutines.h Energy.h Energy_Sander.h EnsembleIn.h EnsembleOutList.h Ewald.h Exec.h Exec_Analyze.h Exec_Calc.h Exec_CatCrd.h Exec_Change.h Exec_ClusterMap.h Exec_CombineCoords.h Exec_Commands.h Exec_CompareTop.h Exec_CrdAction.h Exec_CrdOut.h Exec_CreateSet.h Exec_DataFile.h Exec_DataFilter.h Exec_DataSetCmd.h Exec_GenerateAmberRst.h Exec_Help.h Exec_LoadCrd.h Exec_LoadTraj.h Exec_ParallelAnalysis.h Exec_ParmBox.h Exec_ParmSolvent.h Exec_ParmStrip.h Exec_ParmWrite.h Exec_PermuteDihedrals.h Exec_Precision.h Exec_PrintData.h Exec_ReadData.h Exec_ReadEnsembleData.h Exec_ReadInput.h Exec_RotateDihedral.h Exec_RunAnalysis.h Exec_ScaleDihedralK.h Exec_SequenceAlign.h Exec_SortEnsembleData.h Exec_SplitCoords.h Exec_System.h Exec_Top.h Exec_Traj.h Exec_UpdateParameters.h Exec_ViewRst.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h Grid.h GridAction.h GridBin.h HistBin.h Hungarian.h ImageTypes.h ImagedAction.h InputTrajCommon.h MapAtom.h MaskArray.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h NetcdfFile.h OnlineVarT.h OutputTrajCommon.h PDBfile.h PairList.h Parallel.h ParameterHolders.h ParameterTypes.h PubFFT.h RPNcalc.h Random.h Range.h ReferenceAction.h ReferenceFrame.h RemdReservoirNC.h ReplicaDimArray.h ReplicaInfo.h Residue.h Spline.h StructureCheck.h SymbolExporting.h SymmetricRmsdCalc.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h VariableArray.h Vec3.h molsurf.h ComplexArray.o : ComplexArray.cpp ArrayIterator.h ComplexArray.h Constraints.o : Constraints.cpp ArgList.h Atom.h AtomExtra.h AtomMask.h Box.h CharMask.h Constants.h Constraints.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h SymbolExporting.h Topology.h Vec3.h Control.o : Control.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Control.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h VariableArray.h Vec3.h @@ -221,7 +222,7 @@ DataSet_integer_mem.o : DataSet_integer_mem.cpp ArgList.h AssociatedData.h Cpptr DataSet_pH.o : DataSet_pH.cpp ArgList.h AssociatedData.h Cph.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_1D.h DataSet_pH.h Dimension.h FileIO.h FileName.h MetaData.h NameType.h Parallel.h Range.h TextFormat.h DataSet_string.o : DataSet_string.cpp ArgList.h AssociatedData.h CpptrajFile.h DataSet.h DataSet_string.h Dimension.h FileIO.h FileName.h MetaData.h Parallel.h Range.h TextFormat.h Deprecated.o : Deprecated.cpp CpptrajStdio.h Deprecated.h DispatchObject.h -DihedralSearch.o : DihedralSearch.cpp ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DihedralSearch.h Dimension.h FileIO.h FileName.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h SymbolExporting.h TextFormat.h Topology.h Vec3.h +DihedralSearch.o : DihedralSearch.cpp ArgList.h Atom.h AtomExtra.h AtomMask.h Box.h CharMask.h CoordinateInfo.h CpptrajStdio.h DihedralSearch.h FileName.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h StringRoutines.h SymbolExporting.h Topology.h Vec3.h DistRoutines.o : DistRoutines.cpp Box.h DistRoutines.h Matrix_3x3.h Parallel.h Vec3.h Energy.o : Energy.cpp Atom.h AtomExtra.h AtomMask.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h Energy.h FileName.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h SymbolExporting.h Topology.h TorsionRoutines.h Vec3.h Energy_Sander.o : Energy_Sander.cpp ArgList.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h BondSearch.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h Energy_Sander.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterTypes.h ParmFile.h ParmIO.h Range.h ReplicaDimArray.h Residue.h SymbolExporting.h Topology.h Vec3.h diff --git a/src/cpptrajfiles b/src/cpptrajfiles index b51ae76dca..c02caaa64e 100644 --- a/src/cpptrajfiles +++ b/src/cpptrajfiles @@ -29,6 +29,7 @@ COMMON_SOURCES= \ Action_Density.cpp \ Action_Diffusion.cpp \ Action_Dihedral.cpp \ + Action_DihedralRMS.cpp \ Action_Dipole.cpp \ Action_Distance.cpp \ Action_DistRmsd.cpp \ diff --git a/test/Makefile b/test/Makefile index 86eb7e97bf..15062eae2d 100644 --- a/test/Makefile +++ b/test/Makefile @@ -453,6 +453,9 @@ test.time: test.splitcoords: @-cd Test_SplitCoords && ./RunTest.sh $(OPT) +test.dihedralrms: + @-cd Test_DihedralRMS && ./RunTest.sh $(OPT) + # Every test target should go here. COMPLETETESTS=test.general \ test.strip \ @@ -598,7 +601,8 @@ COMPLETETESTS=test.general \ test.catcrd \ test.xtalsymm \ test.time \ - test.splitcoords + test.splitcoords \ + test.dihedralrms test.all: $(MAKE) test.complete summary diff --git a/test/Test_DihedralRMS/RunTest.sh b/test/Test_DihedralRMS/RunTest.sh new file mode 100755 index 0000000000..8e025a8024 --- /dev/null +++ b/test/Test_DihedralRMS/RunTest.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +. ../MasterTest.sh + +CleanFiles dih.in dihrms.dat toref.dat previous.dat totraj.dat phipsifluct.dat + +TESTNAME='Dihedral RMSD tests' +Requires netcdf maxthreads 10 + +INPUT="-i dih.in" + +UNITNAME='Dihedral RMSD tests (first, reference, reference traj.)' +cat > dih.in < dih.in < dih.in < rms.in <