diff --git a/LICENSE b/LICENSE index 7378224bb2..bb7b9de935 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ _______________________________________________________________________ - CPPTRAJ: 2019 - LICENSE AGREEMENT + CPPTRAJ: 2021 - LICENSE AGREEMENT _______________________________________________________________________ cpptraj is free software; you can redistribute it and/or modify it diff --git a/README.md b/README.md index 922a456f2f..6b1da116fd 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ CPPTRAJ see the following publication: Disclaimer and Copyright ======================== -CPPTRAJ is Copyright (c) 2010-2020 Daniel R. Roe. +CPPTRAJ is Copyright (c) 2010-2021 Daniel R. Roe. The terms for using, copying, modifying, and distributing CPPTRAJ are specified in the file LICENSE. diff --git a/doc/CpptrajDevelopmentGuide.lyx b/doc/CpptrajDevelopmentGuide.lyx index 32f8a7cbec..ced87ea271 100644 --- a/doc/CpptrajDevelopmentGuide.lyx +++ b/doc/CpptrajDevelopmentGuide.lyx @@ -1912,6 +1912,73 @@ selectedTgt.SetCoordinates( Tgt2, mask ); rmsd = selectedTgt.RMSD_CenteredRef( selectedRef, ... \end_layout +\begin_layout Subsection +Box +\end_layout + +\begin_layout Standard +The Box class holds all unit cell information. + It has the unit cell vectors (stored in a Matrix_3x3 class in row-major + order), as well as the fractional cell matrix (for converting from Cartesian + to fractional coordinates), the box lengths and angles, and the unit cell + volume. + There are in general two ways to set up Box with unit cell information: + the SetupX routines (e.g. + SetupFromXyzAbg()) and AssignX routines (e.g. + AssignFromXyzAbg()). + The SetupX routines perform some extra checks and will return 1 if something + is wrong with the box. + The AssignX routines do not perform these checks and so should be used + where performance is needed (or the state of the box doesn't matter). +\end_layout + +\begin_layout Standard +Both the SetupX and AssignX will set the unit and fractional cell matrices, + the box lengths and angles, and the cell volume each time they are called. + The ImageOption class can then be used to determine what kind of imaging + can be performed on the unit cell using the distance calculation routines + (DIST2(), DIST()) found in DistRoutines.h. + For example, this is how distances are calculated using ImageOption imageOpt_ + in the distance action. +\end_layout + +\begin_layout Standard +1. + In Init(), determine if imaging should be used if possible: +\end_layout + +\begin_layout LyX-Code +imageOpt_.InitImaging( !(actionArgs.hasKey("noimage")) ); +\end_layout + +\begin_layout Standard +2. + In Setup(), determine if imaging will be possible based on if box info + is present: +\end_layout + +\begin_layout LyX-Code +imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); +\end_layout + +\begin_layout Standard +3. + In DoAction(), determine what imaging to use and then calculate distance + using DIST() from DistRoutines.h: +\end_layout + +\begin_layout LyX-Code +if (imageOpt_.ImagingEnabled()) +\end_layout + +\begin_layout LyX-Code + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); +\end_layout + +\begin_layout LyX-Code +double Dist = DIST(imageOpt_.ImagingType(), a1, a2_, frm.Frm().BoxCrd()); +\end_layout + \begin_layout Section Console and File Input/Output \end_layout diff --git a/doc/cpptraj.lyx b/doc/cpptraj.lyx index bfc1e487dd..a83003f850 100644 --- a/doc/cpptraj.lyx +++ b/doc/cpptraj.lyx @@ -15595,6 +15595,100 @@ trajout output.crd onlyframes 2,5-7 only frames 2, 5, 6, and 7 from input.crd will be written to output.crd. \end_layout +\begin_layout Subsubsection* +Cell not X-aligned Warning +\end_layout + +\begin_layout Standard +Certain Actions (e.g. + +\series bold +\emph on +align +\series default +\emph default +, +\series bold +\emph on +rms +\series default +\emph default +, +\series bold +\emph on +principal +\series default +\emph default +, etc.) can rotate the unit cell vectors (i.e. + the box) if they are present. + Some trajectory formats do not support writing out box coordinates if the + unit cell is not +\begin_inset Quotes eld +\end_inset + +X-aligned +\begin_inset Quotes erd +\end_inset + +; in other words, if the unit cell +\begin_inset Quotes eld +\end_inset + +A +\begin_inset Quotes erd +\end_inset + + vector is not aligned with the coordinate X-axis and the +\begin_inset Quotes eld +\end_inset + +B +\begin_inset Quotes erd +\end_inset + + vector is not in the X-Y plane. + If this is the case, the following warnings may appear: +\end_layout + +\begin_layout LyX-Code +Warning: Unit cell is not X-aligned. + Box cannot be properly stored as . +\end_layout + +\begin_layout LyX-Code +Warning: Set <#>; unit cell is not X-aligned. + Box cannot be properly stored as . +\end_layout + +\begin_layout Standard +This means that the frame will be written with the X-aligned unit cell instead + of the actual unit cell. + Imaging will not be possible with a trajectory written this way. + Currently the only trajectory formats that support writing non-X-aligned + cells are the Gromacs TRR and XTC formats. +\end_layout + +\begin_layout Standard +If unit cell information is no longer needed, it can be removed (via e.g. + the +\series bold +\emph on +box +\series default +\emph default + action, the +\series bold +\emph on +strip +\series default +\emph default + action with the +\series bold +'nobox' +\series default + keyword, etc.) to prevent these warnings from triggering. +\end_layout + \begin_layout Subsubsection \shape italic @@ -16020,6 +16114,13 @@ veltraj Write velocity trajectory instead of coordinates. \end_layout \end_deeper +\begin_layout Standard +Note that by default CPPTRAJ will try to write the symmetric shape matrix + if box information is present. + If this is not possible, CPPTRAJ will fall back to writing unit cell parameters + (lengths and angles) as long as the cell is X-aligned. +\end_layout + \begin_layout Subsubsection \emph on @@ -16037,6 +16138,11 @@ dt Time step tp multiply set numbers by (default 1.0). \end_layout \end_deeper +\begin_layout Standard +Note: these formats can write rotated (i.e. + non-X-aligned) unit cells. +\end_layout + \begin_layout Subsubsection \shape italic diff --git a/src/Action.cpp b/src/Action.cpp deleted file mode 100644 index 1e9cac9219..0000000000 --- a/src/Action.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "Action.h" -#include "CpptrajStdio.h" - -void Action::CheckImageRotationWarning(ActionSetup const& setup, const char* desc) { - if (setup.CoordInfo().TrajBox().Type() != Box::NOBOX) { - mprintf("Warning: Coordinates are being rotated and box coordinates are present.\n" - "Warning: Unit cell vectors are NOT rotated; imaging will not be possible\n" - "Warning: after %s is performed.\n", desc); - } -} diff --git a/src/Action.h b/src/Action.h index 0516c6e3bc..c6de35b1cc 100644 --- a/src/Action.h +++ b/src/Action.h @@ -60,8 +60,5 @@ class Action : public DispatchObject { /// Process array of frames before start required by ranks > 0 (not called by master) virtual int ParallelPreloadFrames(FArray const&) { return 0; } // TODO: pure virtual # endif - protected: - /// Print a warning that imaging will not be possible if coordinates are being rotated. - static void CheckImageRotationWarning(ActionSetup const&, const char*); }; #endif diff --git a/src/Action_Align.cpp b/src/Action_Align.cpp index 24e324462a..b7ab79dfd9 100644 --- a/src/Action_Align.cpp +++ b/src/Action_Align.cpp @@ -84,9 +84,6 @@ Action::RetType Action_Align::Setup(ActionSetup& setup) { if (REF_.SetupRef(setup.Top(), tgtMask_.Nselected())) return Action::SKIP; - // Warn if PBC and rotating - Action::CheckImageRotationWarning(setup, "the alignment"); - return Action::OK; } @@ -98,6 +95,7 @@ Action::RetType Action_Align::DoAction(int frameNum, ActionFrame& frm) { tgtFrame_.SetCoordinates(frm.Frm(), tgtMask_); tgtFrame_.RMSD_CenteredRef(REF_.SelectedRef(), rot_, tgtTrans_, useMass_); frm.ModifyFrm().Trans_Rot_Trans(movMask_, tgtTrans_, rot_, REF_.RefTrans()); + frm.ModifyFrm().ModifyBox().RotateUcell( rot_ ); REF_.PreviousRef( frm.Frm() ); return Action::MODIFY_COORDS; } diff --git a/src/Action_AreaPerMol.cpp b/src/Action_AreaPerMol.cpp index 3d045de4b7..1d352cf672 100644 --- a/src/Action_AreaPerMol.cpp +++ b/src/Action_AreaPerMol.cpp @@ -58,14 +58,14 @@ Action::RetType Action_AreaPerMol::Init(ArgList& actionArgs, ActionInit& init, i */ Action::RetType Action_AreaPerMol::Setup(ActionSetup& setup) { // Needs box info - if (setup.CoordInfo().TrajBox().Type() == Box::NOBOX) { + if (!setup.CoordInfo().TrajBox().HasBox()) { mprintf("Warning: No box information for '%s', cannot calculate area.\n", setup.Top().c_str()); return Action::SKIP; } // Probably will not work for non-orthorhombic cells - if (setup.CoordInfo().TrajBox().Type() != Box::ORTHO) - mprintf("Warning: Box is not orthorhombic, calculated area may not be correct.\n"); + if (!setup.CoordInfo().TrajBox().Is_X_Aligned_Ortho()) + mprintf("Warning: Box is not X-aligned orthorhombic, calculated area may not be correct.\n"); // Determine how many molecules are selected if (Mask1_.MaskStringSet()) { if (setup.Top().SetupCharMask(Mask1_)) return Action::ERR; @@ -93,11 +93,11 @@ Action::RetType Action_AreaPerMol::Setup(ActionSetup& setup) { Action::RetType Action_AreaPerMol::DoAction(int frameNum, ActionFrame& frm) { double area; if (areaType_ == XY) - area = frm.Frm().BoxCrd().BoxX() * frm.Frm().BoxCrd().BoxY(); + area = frm.Frm().BoxCrd().Param(Box::X) * frm.Frm().BoxCrd().Param(Box::Y); else if (areaType_ == XZ) - area = frm.Frm().BoxCrd().BoxX() * frm.Frm().BoxCrd().BoxZ(); + area = frm.Frm().BoxCrd().Param(Box::X) * frm.Frm().BoxCrd().Param(Box::Z); else // if areaType_ == YZ - area = frm.Frm().BoxCrd().BoxY() * frm.Frm().BoxCrd().BoxZ(); + area = frm.Frm().BoxCrd().Param(Box::Y) * frm.Frm().BoxCrd().Param(Box::Z); area = area / Nmols_; diff --git a/src/Action_AtomMap.cpp b/src/Action_AtomMap.cpp index edc069fd39..fea25e00bd 100644 --- a/src/Action_AtomMap.cpp +++ b/src/Action_AtomMap.cpp @@ -232,7 +232,6 @@ Action::RetType Action_AtomMap::Setup(ActionSetup& setup) { } if (rmsfit_) { mprintf("\trmsfit specified, %i atoms.\n",rmsRefFrame_.Natom()); - Action::CheckImageRotationWarning(setup, "the RMS-fit"); return Action::OK; } mprintf("\tMap for parm %s -> %s (%i atom).\n",TgtFrame_->Top().c_str(), @@ -257,6 +256,7 @@ Action::RetType Action_AtomMap::DoAction(int frameNum, ActionFrame& frm) { Vec3 Trans, refTrans; double R = rmsTgtFrame_.RMSD(rmsRefFrame_, Rot, Trans, refTrans, false); frm.ModifyFrm().Trans_Rot_Trans(Trans, Rot, refTrans); + frm.ModifyFrm().ModifyBox().RotateUcell( Rot ); if (rmsdata_!=0) rmsdata_->Add(frameNum, &R); } else { diff --git a/src/Action_AutoImage.cpp b/src/Action_AutoImage.cpp index 321668bd95..704a606c9a 100644 --- a/src/Action_AutoImage.cpp +++ b/src/Action_AutoImage.cpp @@ -10,7 +10,6 @@ Action_AutoImage::Action_AutoImage() : debug_(0), origin_(false), - ortho_(false), usecom_(true), truncoct_(false), useMass_(false), @@ -93,16 +92,14 @@ Action::RetType Action_AutoImage::Setup(ActionSetup& setup) { return Action::SKIP; } // Determine Box info - Box::BoxType boxType = setup.CoordInfo().TrajBox().Type(); - if (boxType == Box::NOBOX) { + if (!setup.CoordInfo().TrajBox().HasBox()) { mprintf("Warning: Topology %s does not contain box information.\n", setup.Top().c_str()); return Action::SKIP; } - ortho_ = false; - if (boxType == Box::ORTHO && triclinic_ == OFF) ortho_ = true; // If box is originally truncated oct and not forcing triclinic, // turn familiar on. - if (boxType == Box::TRUNCOCT && triclinic_ != FORCE && triclinic_ != FAMILIAR) { + if (triclinic_ != FORCE && triclinic_ != FAMILIAR && setup.CoordInfo().TrajBox().CellShape() == Box::OCTAHEDRAL) + { mprintf("\tOriginal box is truncated octahedron, turning on 'familiar'.\n"); triclinic_ = FAMILIAR; } @@ -211,13 +208,13 @@ Action::RetType Action_AutoImage::Setup(ActionSetup& setup) { // Action_AutoImage::DoAction() Action::RetType Action_AutoImage::DoAction(int frameNum, ActionFrame& frm) { - Matrix_3x3 ucell, recip; Vec3 fcom; Vec3 bp, bm, offset(0.0); Vec3 Trans, framecenter, imagedcenter, anchorcenter; Box const& box = frm.Frm().BoxCrd(); - if (!ortho_) box.ToRecip(ucell, recip); + bool is_ortho = frm.Frm().BoxCrd().Is_X_Aligned_Ortho(); + bool use_ortho = (is_ortho && triclinic_ == OFF); // Store anchor point in fcom for now. if (useMass_) fcom = frm.Frm().VCenterOfMass( anchorMask_ ); @@ -231,19 +228,19 @@ Action::RetType Action_AutoImage::DoAction(int frameNum, ActionFrame& frm) { anchorcenter.Zero(); } else { // Center on box center - if (ortho_ || truncoct_) + if (is_ortho || truncoct_) // Center is box xyz over 2 anchorcenter = box.Center(); else // Center in frac coords is (0.5,0.5,0.5) - anchorcenter = ucell.TransposeMult(Vec3(0.5)); + anchorcenter = box.UnitCell().TransposeMult(Vec3(0.5)); fcom = anchorcenter - fcom; } frm.ModifyFrm().Translate(fcom); // Setup imaging, and image everything in current Frame // according to mobileList_. - if (ortho_) { + if (is_ortho) { if (Image::SetupOrtho(box, bp, bm, origin_)) { mprintf("Warning: Frame %i imaging failed, box lengths are zero.\n",frameNum+1); // TODO: Return OK for now so next frame is tried; eventually indicate SKIP? @@ -253,7 +250,7 @@ Action::RetType Action_AutoImage::DoAction(int frameNum, ActionFrame& frm) { } else { if (truncoct_) fcom = Image::SetupTruncoct( frm.Frm(), 0, useMass_, origin_ ); - Image::Nonortho(frm.ModifyFrm(), origin_, fcom, offset, ucell, recip, truncoct_, + Image::Nonortho(frm.ModifyFrm(), origin_, fcom, offset, box.UnitCell(), box.FracCell(), truncoct_, *mobileList_); } @@ -267,13 +264,13 @@ Action::RetType Action_AutoImage::DoAction(int frameNum, ActionFrame& frm) { framecenter = fixedList_->GetCoord(idx, frm.Frm()); // Determine distance in terms of box lengths - if (ortho_) { + if (use_ortho) { // Determine direction from molecule to anchor Vec3 delta = anchorcenter - framecenter; //mprintf("DEBUG: anchorcenter - framecenter = %g %g %g\n", delta[0], delta[1], delta[2]); - Vec3 minTrans( floor(delta[0]/box.BoxX()+0.5)*box.BoxX(), - floor(delta[1]/box.BoxY()+0.5)*box.BoxY(), - floor(delta[2]/box.BoxZ()+0.5)*box.BoxZ() ); + Vec3 minTrans( floor(delta[0]/box.Param(Box::X)+0.5)*box.Param(Box::X), + floor(delta[1]/box.Param(Box::Y)+0.5)*box.Param(Box::Y), + floor(delta[2]/box.Param(Box::Z)+0.5)*box.Param(Box::Z) ); Vec3 minImage = framecenter + minTrans; //mprintf("DBG: %5i %3u %6i %6i {%8.2f %8.2f %8.2f}\n", // frameNum, (atom1-fixedList_.begin())/2, firstAtom+1, lastAtom, @@ -284,7 +281,7 @@ Action::RetType Action_AutoImage::DoAction(int frameNum, ActionFrame& frm) { anchorcenter = minImage; } else { Vec3 newAnchor = framecenter; - Trans = Image::Nonortho(framecenter, truncoct_, origin_, ucell, recip, fcom, -1.0); + Trans = Image::Nonortho(framecenter, truncoct_, origin_, box.UnitCell(), box.FracCell(), fcom, -1.0); // If molecule was imaged, determine whether imaged position is closer to anchor. if (Trans[0] != 0 || Trans[1] != 0 || Trans[2] != 0) { imagedcenter = framecenter + Trans; @@ -312,10 +309,10 @@ Action::RetType Action_AutoImage::DoAction(int frameNum, ActionFrame& frm) { framecenter = fixedList_->GetCoord(idx, frm.Frm()); // Determine if molecule would be imaged. - if (ortho_) + if (use_ortho) Trans = Image::Ortho(framecenter, bp, bm, box); else - Trans = Image::Nonortho(framecenter, truncoct_, origin_, ucell, recip, fcom, -1.0); + Trans = Image::Nonortho(framecenter, truncoct_, origin_, box.UnitCell(), box.FracCell(), fcom, -1.0); // If molecule was imaged, determine whether imaged position is closer to anchor. if (Trans[0] != 0 || Trans[1] != 0 || Trans[2] != 0) { imagedcenter = framecenter + Trans; diff --git a/src/Action_AutoImage.h b/src/Action_AutoImage.h index 5b124f5560..469b29182c 100644 --- a/src/Action_AutoImage.h +++ b/src/Action_AutoImage.h @@ -23,7 +23,6 @@ class Action_AutoImage : public Action { std::string mobile_; ///< Mask expression for mobile region. int debug_; bool origin_; ///< If true imaging occurs w.r.t. coordinate origin. - bool ortho_; ///< If true imaging is orthogonal. bool usecom_; ///< If true imaging of mobile region uses molecule center. bool truncoct_; ///< If true image into truncated octahedron shape. bool useMass_; ///< If true use center of mass diff --git a/src/Action_Box.cpp b/src/Action_Box.cpp index 15344d0754..50780b1483 100644 --- a/src/Action_Box.cpp +++ b/src/Action_Box.cpp @@ -1,12 +1,17 @@ #include "Action_Box.h" #include "CpptrajStdio.h" -Action_Box::Action_Box() : mode_(SET) {} +Action_Box::Action_Box() : + mode_(SET) +{} void Action_Box::Help() const { - mprintf("\t{[x ] [y ] [z ] {[alpha ] [beta ] [gamma ]\n" - "\t [truncoct]} | nobox | auto [offset ] [radii {vdw|gb|parse|none}]}\n" - " For each input frame, replace any box information with the information given.\n" + mprintf("\t{%s |\n" + "\t %s |\n" + "\t nobox |\n" + "\t auto [offset ] [radii {vdw|gb|parse|none}]}\n", + BoxArgs::Keywords_XyzAbg(), BoxArgs::Keywords_TruncOct()); + mprintf(" For each input frame, replace any box information with the information given.\n" " If 'truncoct' is specified, alpha, beta, and gamma will be set to the\n" " appropriate angle for a truncated octahedral box. If 'nobox' is specified,\n" " all existing box information will be removed. If 'auto' is specified, an\n" @@ -30,12 +35,8 @@ Action::RetType Action_Box::Init(ArgList& actionArgs, ActionInit& init, int debu radiiMode_ = UNSPECIFIED; // NOTE: Set angles to 90 here so we can set parm box type to // ORTHO in Setup(). - box_.SetAlpha(90.0); - box_.SetBeta(90.0); - box_.SetGamma(90.0); - box_.SetX(1.0); - box_.SetY(1.0); - box_.SetZ(1.0); + boxArgs_.SetAngles( 90.0 ); + boxArgs_.SetLengths( 1.0 ); std::string rstr = actionArgs.GetStringKey("radii"); if (!rstr.empty()) { if (rstr == "vdw") @@ -53,13 +54,8 @@ Action::RetType Action_Box::Init(ArgList& actionArgs, ActionInit& init, int debu } } else { mode_ = SET; - box_.SetX( actionArgs.getKeyDouble("x", 0.0) ); - box_.SetY( actionArgs.getKeyDouble("y", 0.0) ); - box_.SetZ( actionArgs.getKeyDouble("z", 0.0) ); - box_.SetAlpha( actionArgs.getKeyDouble("alpha", 0.0) ); - box_.SetBeta( actionArgs.getKeyDouble("beta", 0.0) ); - box_.SetGamma( actionArgs.getKeyDouble("gamma", 0.0) ); - if (actionArgs.hasKey("truncoct")) box_.SetTruncOct(); + // TODO check for bad args? + if (boxArgs_.SetBoxArgs( actionArgs )) return Action::ERR; } mprintf(" BOX:"); @@ -77,13 +73,7 @@ Action::RetType Action_Box::Init(ArgList& actionArgs, ActionInit& init, int debu break; } } else { - if (box_.BoxX() > 0) mprintf(" X=%.3f", box_.BoxX()); - if (box_.BoxY() > 0) mprintf(" Y=%.3f", box_.BoxY()); - if (box_.BoxZ() > 0) mprintf(" Z=%.3f", box_.BoxZ()); - if (box_.Alpha() > 0) mprintf(" A=%.3f", box_.Alpha()); - if (box_.Beta() > 0) mprintf(" B=%.3f", box_.Beta()); - if (box_.Gamma() > 0) mprintf(" G=%.3f", box_.Gamma()); - mprintf("\n"); + boxArgs_.PrintXyzAbg(); } return Action::OK; } @@ -96,10 +86,12 @@ Action::RetType Action_Box::Setup(ActionSetup& setup) { cInfo_.SetBox( Box() ); } else { // SET, AUTO - Box pbox( box_ ); - // Fill in missing box information from current box - pbox.SetMissingInfo( setup.CoordInfo().TrajBox() ); - mprintf("\tNew box type is %s\n", pbox.TypeName() ); + // Fill in missing box information from current box + if (boxArgs_.SetMissingInfo( setup.CoordInfo().TrajBox() )) + return Action::ERR; + Box pbox; + pbox.SetupFromXyzAbg( boxArgs_.XyzAbg() ); + mprintf("\tNew box type is %s\n", pbox.CellShapeName() ); cInfo_.SetBox( pbox ); // Get radii for AUTO if (mode_ == AUTO) { @@ -148,13 +140,12 @@ Action::RetType Action_Box::Setup(ActionSetup& setup) { // Action_Box::DoAction() Action::RetType Action_Box::DoAction(int frameNum, ActionFrame& frm) { if (mode_ == REMOVE) { - frm.ModifyFrm().SetBox( Box() ); + frm.ModifyFrm().ModifyBox().SetNoBox(); } else if (mode_ == AUTO) { frm.ModifyFrm().SetOrthoBoundingBox(Radii_, offset_); } else { - Box fbox( box_ ); - fbox.SetMissingInfo( frm.Frm().BoxCrd() ); - frm.ModifyFrm().SetBox( fbox ); + boxArgs_.SetMissingInfo( frm.Frm().BoxCrd() ); + frm.ModifyFrm().ModifyBox().AssignFromXyzAbg( boxArgs_.XyzAbg() ); } return Action::MODIFY_COORDS; } diff --git a/src/Action_Box.h b/src/Action_Box.h index da10935cd0..31ba075489 100644 --- a/src/Action_Box.h +++ b/src/Action_Box.h @@ -1,6 +1,7 @@ #ifndef ACTION_BOX_H #define ACTION_BOX_H #include "Action.h" +#include "BoxArgs.h" /// Manipulate box coords class Action_Box : public Action { public: @@ -17,7 +18,7 @@ class Action_Box : public Action { enum RadiiType { UNSPECIFIED = 0, GB, PARSE, VDW, NONE }; CoordinateInfo cInfo_; ///< For holding modified coordinate info. - Box box_; ///< Hold box info to be set for SET. + BoxArgs boxArgs_; ///< Hold arguments for setting box (SET). ModeType mode_; ///< How box info will be assigned. double offset_; ///< Offset for AUTO RadiiType radiiMode_; ///< Radii type to use for AUTO diff --git a/src/Action_Center.cpp b/src/Action_Center.cpp index 7c3a97c2ee..a54cf34852 100644 --- a/src/Action_Center.cpp +++ b/src/Action_Center.cpp @@ -86,7 +86,7 @@ Action::RetType Action_Center::Setup(ActionSetup& setup) { return Action::SKIP; } - if (centerMode_ == BOXCTR && setup.CoordInfo().TrajBox().Type()==Box::NOBOX) { + if (centerMode_ == BOXCTR && !setup.CoordInfo().TrajBox().HasBox()) { mprintf("Warning: Box center specified but no box information.\n"); return Action::SKIP; } diff --git a/src/Action_Channel.cpp b/src/Action_Channel.cpp index 82b3cca287..4c63823c31 100644 --- a/src/Action_Channel.cpp +++ b/src/Action_Channel.cpp @@ -52,10 +52,10 @@ Action::RetType Action_Channel::Setup(ActionSetup& setup) { if (grid_->Size() == 0) { DataSet_3D& GRID = static_cast( *grid_ ); Box const& box = setup.CoordInfo().TrajBox(); - if (box.Type() == Box::NOBOX) { + if (!box.HasBox()) { mprinterr("Error: No box information to set up grid.\n"); return Action::ERR; - } else if (box.Type() == Box::ORTHO) { + } else if (box.Is_X_Aligned_Ortho()) { // FIXME: May need to update parm box info or set up on first frame. if (GRID.Allocate_X_C_D(box.Lengths(), box.Center(), dxyz_)) return Action::ERR; } else { diff --git a/src/Action_CheckStructure.cpp b/src/Action_CheckStructure.cpp index c656c2331d..deb38aca38 100644 --- a/src/Action_CheckStructure.cpp +++ b/src/Action_CheckStructure.cpp @@ -95,7 +95,7 @@ Action::RetType Action_CheckStructure::Init(ArgList& actionArgs, ActionInit& ini mprintf(" CHECKSTRUCTURE: Checking atoms in mask '%s'", check_.Mask1().MaskString()); if (check_.Mask2().MaskStringSet()) mprintf(" around mask '%s'", check_.Mask2().MaskString()); - if (!check_.Image().UseImage()) + if (!check_.ImageOpt().UseImage()) mprintf(", imaging off"); if (outfile_ != 0) mprintf(", warnings output to %s", outfile_->Filename().full()); @@ -145,7 +145,7 @@ Action::RetType Action_CheckStructure::Setup(ActionSetup& setup) { if (check_.CheckBonds()) mprintf("\tChecking %u bonds.\n", check_.Nbonds()); // Print imaging info for this parm - if (check_.Image().ImagingEnabled()) + if (check_.ImageOpt().ImagingEnabled()) mprintf("\tImaging on.\n"); else mprintf("\timaging off.\n"); diff --git a/src/Action_Closest.cpp b/src/Action_Closest.cpp index 320aca60c2..bb461ae260 100644 --- a/src/Action_Closest.cpp +++ b/src/Action_Closest.cpp @@ -10,8 +10,10 @@ #ifdef CUDA // CUDA kernel wrappers -extern void Action_Closest_Center(const double*,double*,const double*,double,int,int,ImagingType,const double*,const double*,const double*); -extern void Action_Closest_NoCenter(const double*,double*,const double*,double,int,int,int,ImagingType,const double*,const double*,const double*); +extern void Action_Closest_Center(const double*,double*,const double*,double,int,int,ImageOption::Type,const double*,const double*,const double*); +extern void Action_Closest_NoCenter(const double*,double*,const double*,double,int,int,int,ImageOption::Type,const double*,const double*,const double*); +#else +#include "DistRoutines.h" #endif // CONSTRUCTOR @@ -72,7 +74,7 @@ Action::RetType Action_Closest::Init(ArgList& actionArgs, ActionInit& init, int if ( actionArgs.hasKey("oxygen") || actionArgs.hasKey("first") ) firstAtom_=true; useMaskCenter_ = actionArgs.hasKey("center"); - image_.InitImaging( !(actionArgs.hasKey("noimage")) ); + imageOpt_.InitImaging( !(actionArgs.hasKey("noimage")) ); topWriter_.InitTopWriter(actionArgs, "closest", debugIn); // Setup output file and sets if requested. // Will keep track of Frame, Mol#, Distance, and first solvent atom @@ -118,7 +120,7 @@ Action::RetType Action_Closest::Init(ArgList& actionArgs, ActionInit& init, int closestWaters_, distanceMask_.MaskString()); if (useMaskCenter_) mprintf("\tGeometric center of atoms in mask will be used.\n"); - if (!image_.UseImage()) + if (!imageOpt_.UseImage()) mprintf("\tImaging will be turned off.\n"); if (solventMask_.MaskStringSet()) mprintf("\tSolvent will be selected by mask '%s'\n", solventMask_.MaskString()); @@ -191,8 +193,8 @@ Action::RetType Action_Closest::Setup(ActionSetup& setup) { closestWaters_ = nSolvent; mprintf("Warning: Keeping %i solvent molecules.\n", closestWaters_); } - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); - if (image_.ImagingEnabled()) + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); + if (imageOpt_.ImagingEnabled()) mprintf("\tDistances will be imaged.\n"); else mprintf("\tImaging off.\n"); @@ -332,11 +334,12 @@ Action::RetType Action_Closest::DoAction(int frameNum, ActionFrame& frm) { double maxD, Dist2; Iarray::const_iterator solvent_atom; - if (image_.ImagingEnabled()) { + if (imageOpt_.ImagingEnabled()) { // Calculate max possible imaged distance - maxD = frm.Frm().BoxCrd().BoxX() + frm.Frm().BoxCrd().BoxY() + - frm.Frm().BoxCrd().BoxZ(); + maxD = frm.Frm().BoxCrd().Param(Box::X) + frm.Frm().BoxCrd().Param(Box::Y) + + frm.Frm().BoxCrd().Param(Box::Z); maxD *= maxD; + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); } else { // If not imaging, set max distance to an arbitrarily large number maxD = DBL_MAX; @@ -355,15 +358,13 @@ Action::RetType Action_Closest::DoAction(int frameNum, ActionFrame& frm) { } } - Matrix_3x3 ucell, recip; - if (image_.ImageType() == NONORTHO) - frm.Frm().BoxCrd().ToRecip(ucell, recip); - if (useMaskCenter_) { Vec3 maskCenter = frm.Frm().VGeometricCenter( distanceMask_ ); Action_Closest_Center( V_atom_coords_, V_distances_, maskCenter.Dptr(), - maxD, NsolventMolecules_, NAtoms, image_.ImageType(), - frm.Frm().BoxCrd().boxPtr(), ucell.Dptr(), recip.Dptr() ); + maxD, NsolventMolecules_, NAtoms, imageOpt_.ImagingType(), + frm.Frm().BoxCrd().XyzPtr(), + frm.Frm().BoxCrd().UnitCell().Dptr(), + frm.Frm().BoxCrd().FracCell().Dptr() ); } else { int NSAtoms = distanceMask_.Nselected(); for (int nsAtom = 0; nsAtom < NSAtoms; ++nsAtom) { @@ -374,8 +375,10 @@ Action::RetType Action_Closest::DoAction(int frameNum, ActionFrame& frm) { } Action_Closest_NoCenter( V_atom_coords_, V_distances_, U_atom_coords_, - maxD, NsolventMolecules_, NAtoms, NSAtoms, image_.ImageType(), - frm.Frm().BoxCrd().boxPtr(), ucell.Dptr(), recip.Dptr() ); + maxD, NsolventMolecules_, NAtoms, NSAtoms, imageOpt_.ImagingType(), + frm.Frm().BoxCrd().XyzPtr(), + frm.Frm().BoxCrd().UnitCell().Dptr(), + frm.Frm().BoxCrd().FracCell().Dptr() ); } // Copy distances back into SolventMols_ for (int sMol = 0; sMol < NsolventMolecules_; sMol++) @@ -383,23 +386,21 @@ Action::RetType Action_Closest::DoAction(int frameNum, ActionFrame& frm) { #else /* Not CUDA */ // ----------------------------------------------------------------------------- - if (image_.ImageType() == NONORTHO) { + if (imageOpt_.ImagingType() == ImageOption::NONORTHO) { // ----- NON-ORTHORHOMBIC IMAGING ------------ - Matrix_3x3 ucell, recip; - frm.Frm().BoxCrd().ToRecip(ucell, recip); // Wrap all solute atoms back into primary cell and save coords if (useMaskCenter_) { double* uFrac = &U_cell0_coords_[0]; // Calc COM and convert to frac coords - Vec3 center = recip * frm.Frm().VGeometricCenter( distanceMask_ ); + Vec3 center = frm.Frm().BoxCrd().FracCell() * frm.Frm().VGeometricCenter( distanceMask_ ); // Wrap to primary unit cell center[0] = center[0] - floor(center[0]); center[1] = center[1] - floor(center[1]); center[2] = center[2] - floor(center[2]); // Convert back to Cartesian - ucell.TransposeMult( uFrac, center.Dptr() ); + frm.Frm().BoxCrd().UnitCell().TransposeMult( uFrac, center.Dptr() ); } else { - Image::WrapToCell0( U_cell0_coords_, frm.Frm(), distanceMask_, ucell, recip ); + Image::WrapToCell0( U_cell0_coords_, frm.Frm(), distanceMask_, frm.Frm().BoxCrd().UnitCell(), frm.Frm().BoxCrd().FracCell() ); } // Calculate closest distance of every solvent image to solute int mnum; @@ -416,7 +417,7 @@ Action::RetType Action_Closest::DoAction(int frameNum, ActionFrame& frm) { solvent_atom != Mol.solventAtoms.end(); ++solvent_atom) { // Convert to frac coords - Vec3 vFrac = recip * Vec3( frm.Frm().XYZ( *solvent_atom ) ); + Vec3 vFrac = frm.Frm().BoxCrd().FracCell() * Vec3( frm.Frm().XYZ( *solvent_atom ) ); // Wrap to primary unit cell vFrac[0] = vFrac[0] - floor(vFrac[0]); vFrac[1] = vFrac[1] - floor(vFrac[1]); @@ -427,7 +428,7 @@ Action::RetType Action_Closest::DoAction(int frameNum, ActionFrame& frm) { for (int iz = -1; iz != 2; iz++) { // Convert image back to Cartesian - Vec3 vCart = ucell.TransposeMult( vFrac + Vec3(ix, iy, iz) ); + Vec3 vCart = frm.Frm().BoxCrd().UnitCell().TransposeMult( vFrac + Vec3(ix, iy, iz) ); // Loop over all solute atoms for (unsigned int idx = 0; idx < U_cell0_coords_.size(); idx += 3) { @@ -482,7 +483,7 @@ Action::RetType Action_Closest::DoAction(int frameNum, ActionFrame& frm) { for (unsigned int idx = 0; idx < U_cell0_coords_.size(); idx += 3) { Vec3 Ucoord( U_cell0_coords_[idx], U_cell0_coords_[idx+1], U_cell0_coords_[idx+2] ); - if (image_.ImageType() == ORTHO) + if (imageOpt_.ImagingType() == ImageOption::ORTHO) Dist2 = DIST2_ImageOrtho( Vcoord, Ucoord, frm.Frm().BoxCrd() ); else Dist2 = DIST2_NoImage( Vcoord, Ucoord ); diff --git a/src/Action_Closest.h b/src/Action_Closest.h index 835428091b..f78f13e447 100644 --- a/src/Action_Closest.h +++ b/src/Action_Closest.h @@ -1,7 +1,7 @@ #ifndef INC_ACTION_CLOSEST_H #define INC_ACTION_CLOSEST_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" #include "CharMask.h" #include "ActionTopWriter.h" /// Modify the state so that only the closest solvent molecules are kept. @@ -30,7 +30,7 @@ class Action_Closest: public Action { Darray U_cell0_coords_; ///< Hold selected solute atoms, wrapped to cell0 if non-ortho. # endif - ImagedAction image_; ///< Imaging routines. + ImageOption imageOpt_; ///< Used to determine if imaging should be used. DataFile *outFile_; ///< Output file for data on closest molecules DataSet *framedata_; ///< Frame number for each closest molecule. DataSet *moldata_; ///< Mol# for each closest molecule. diff --git a/src/Action_DNAionTracker.cpp b/src/Action_DNAionTracker.cpp index f82634015b..3f83ced1c1 100644 --- a/src/Action_DNAionTracker.cpp +++ b/src/Action_DNAionTracker.cpp @@ -2,6 +2,7 @@ #include // sqrt #include "Action_DNAionTracker.h" #include "CpptrajStdio.h" +#include "DistRoutines.h" // CONSTRUCTOR Action_DNAionTracker::Action_DNAionTracker() : @@ -24,7 +25,7 @@ Action::RetType Action_DNAionTracker::Init(ArgList& actionArgs, ActionInit& init // Get keywords DataFile* outfile = init.DFL().AddDataFile(actionArgs.GetStringKey("out"), actionArgs); poffset_ = actionArgs.getKeyDouble("poffset", 5.0); - InitImaging( !actionArgs.hasKey("noimage") ); + imageOpt_.InitImaging( !actionArgs.hasKey("noimage") ); if (actionArgs.hasKey("shortest")) bintype_ = SHORTEST; else if (actionArgs.hasKey("counttopcone")) @@ -70,7 +71,7 @@ Action::RetType Action_DNAionTracker::Init(ArgList& actionArgs, ActionInit& init } mprintf(" saved to array named %s\n", distance_->legend()); mprintf(" Perpendicular offset for cone is %5.2f angstroms\n", poffset_); - if (!UseImage()) + if (!imageOpt_.UseImage()) mprintf(" Imaging has been disabled\n"); mprintf("\tPhosphate1 Mask [%s]\n", p1_.MaskString()); mprintf("\tPhosphate2 Mask [%s]\n", p2_.MaskString()); @@ -104,7 +105,7 @@ Action::RetType Action_DNAionTracker::Setup(ActionSetup& setup) { mprinterr("Error: dnaiontracker: No atoms in mask4\n"); return Action::ERR; } - SetupImaging( setup.CoordInfo().TrajBox().Type() ); + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); mprintf("\tPhosphate1 Mask [%s] %i atoms.\n", p1_.MaskString(), p1_.Nselected()); mprintf("\tPhosphate2 Mask [%s] %i atoms.\n", p2_.MaskString(), p2_.Nselected()); mprintf("\t Base Mask [%s] %i atoms.\n", base_.MaskString(), base_.Nselected()); @@ -114,13 +115,11 @@ Action::RetType Action_DNAionTracker::Setup(ActionSetup& setup) { } Action::RetType Action_DNAionTracker::DoAction(int frameNum, ActionFrame& frm) { - Matrix_3x3 ucell, recip; double d_tmp, dval; Vec3 P1, P2, BASE; - // Setup imaging info if necessary - if (ImageType()==NONORTHO) - frm.Frm().BoxCrd().ToRecip(ucell,recip); + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho()); // Get center for P1, P2, and Base if (useMass_) { P1 = frm.Frm().VCenterOfMass( p1_ ); @@ -133,15 +132,14 @@ Action::RetType Action_DNAionTracker::DoAction(int frameNum, ActionFrame& frm) { } // Calculate P -- P distance and centroid - double d_pp = DIST2(P1.Dptr(), P2.Dptr(), ImageType(), frm.Frm().BoxCrd(), ucell, recip); + double d_pp = DIST2(imageOpt_.ImagingType(), P1, P2, frm.Frm().BoxCrd()); Vec3 pp_centroid = (P1 + P2) / 2.0; // Cutoff^2 double d_cut = d_pp*0.25 + (poffset_*poffset_); // TODO: precalc offset^2 // Calculate P -- base centroid to median point - double d_pbase = DIST2(pp_centroid.Dptr(), BASE.Dptr(), ImageType(), frm.Frm().BoxCrd(), - ucell, recip); + double d_pbase = DIST2(imageOpt_.ImagingType(), pp_centroid, BASE, frm.Frm().BoxCrd()); //double d_min = DBL_MAX; if (bintype_ == SHORTEST) @@ -152,12 +150,9 @@ Action::RetType Action_DNAionTracker::DoAction(int frameNum, ActionFrame& frm) { for (AtomMask::const_iterator ion = ions_.begin(); ion != ions_.end(); ++ion) { const double* ionxyz = frm.Frm().XYZ(*ion); - double d_p1ion = DIST2(P1.Dptr(), ionxyz, ImageType(), frm.Frm().BoxCrd(), - ucell, recip); - double d_p2ion = DIST2(P2.Dptr(), ionxyz, ImageType(), frm.Frm().BoxCrd(), - ucell, recip); - double d_baseion = DIST2(BASE.Dptr(), ionxyz, ImageType(), frm.Frm().BoxCrd(), - ucell, recip); + double d_p1ion = DIST2(imageOpt_.ImagingType(), P1, ionxyz, frm.Frm().BoxCrd()); + double d_p2ion = DIST2(imageOpt_.ImagingType(), P2, ionxyz, frm.Frm().BoxCrd()); + double d_baseion = DIST2(imageOpt_.ImagingType(), BASE, ionxyz, frm.Frm().BoxCrd()); //mprintf("DEBUG: ion atom %i to P1 is %f\n", *ion+1, sqrt(d_p1ion)); //mprintf("DEBUG: ion atom %i to P2 is %f\n", *ion+1, sqrt(d_p2ion)); //mprintf("DEBUG: ion atom %i to base is %f\n", *ion+1, sqrt(d_baseion)); diff --git a/src/Action_DNAionTracker.h b/src/Action_DNAionTracker.h index a63d183fce..9f358acb3e 100644 --- a/src/Action_DNAionTracker.h +++ b/src/Action_DNAionTracker.h @@ -1,8 +1,8 @@ #ifndef INC_ACTION_DNAIONTRACKER_H #define INC_ACTION_DNAIONTRACKER_H #include "Action.h" -#include "ImagedAction.h" -class Action_DNAionTracker : public Action, ImagedAction { +#include "ImageOption.h" +class Action_DNAionTracker : public Action { public: Action_DNAionTracker(); DispatchObject* Alloc() const { return (DispatchObject*)new Action_DNAionTracker(); } @@ -18,6 +18,7 @@ class Action_DNAionTracker : public Action, ImagedAction { BINTYPE bintype_; // iarg3 double poffset_; // darg2 bool useMass_; + ImageOption imageOpt_; AtomMask p1_; AtomMask p2_; AtomMask base_; diff --git a/src/Action_Density.cpp b/src/Action_Density.cpp index 4e13e49edb..cfcdab1e4f 100644 --- a/src/Action_Density.cpp +++ b/src/Action_Density.cpp @@ -137,7 +137,6 @@ Action::RetType Action_Density::Init(ArgList& actionArgs, ActionInit& init, int density_ = init.DSL().AddSet(DataSet::DOUBLE, dsname, "DENSITY"); if (density_ == 0) return Action::ERR; if (outfile != 0) outfile->AddDataSet( density_ ); - image_.InitImaging( true ); // Hijack delta for storing sum of masses delta_ = 0.0; } else { @@ -224,8 +223,7 @@ Action::RetType Action_Density::HistSetup(ActionSetup& setup) { // Action_Density::DensitySetup() Action::RetType Action_Density::DensitySetup(ActionSetup& setup) { // Total system density setup - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); - if (!image_.ImagingEnabled()) { + if ( !setup.CoordInfo().TrajBox().HasBox() ) { mprintf("Warning: No unit cell information, total density cannot be calculated for '%s'\n", setup.Top().c_str()); return Action::SKIP; @@ -298,7 +296,8 @@ Action::RetType Action_Density::HistAction(int frameNum, ActionFrame& frm) { // Accumulate area Box const& box = frm.Frm().BoxCrd(); - area_.accumulate(box[area_coord_[0]] * box[area_coord_[1]]); + area_.accumulate(box.Param((Box::ParamType)area_coord_[0]) * + box.Param((Box::ParamType)area_coord_[1])); return Action::OK; } @@ -308,16 +307,8 @@ const double Action_Density::AMU_ANG_TO_G_CM3 = Constants::NA * 1E-24; // Action_Density::DensityAction() Action::RetType Action_Density::DensityAction(int frameNum, ActionFrame& frm) { - Matrix_3x3 ucell, recip; - double volume = 0.0; - if (image_.ImageType() == ORTHO) - volume = frm.Frm().BoxCrd().BoxX() * - frm.Frm().BoxCrd().BoxY() * - frm.Frm().BoxCrd().BoxZ(); - else if (image_.ImageType() == NONORTHO) - volume = frm.Frm().BoxCrd().ToRecip( ucell, recip ); // Total mass is in delta_ - double density = delta_ / (volume * AMU_ANG_TO_G_CM3); + double density = delta_ / (frm.Frm().BoxCrd().CellVolume() * AMU_ANG_TO_G_CM3); density_->Add(frameNum, &density); return Action::OK; } diff --git a/src/Action_Density.h b/src/Action_Density.h index d5be443bec..d92b70b625 100644 --- a/src/Action_Density.h +++ b/src/Action_Density.h @@ -8,7 +8,6 @@ #include "Action.h" #include "OnlineVarT.h" -#include "ImagedAction.h" #define ROUTINE_VERSION_STRING "1.0.3" // 1.0.3 - DRR Add 'restrict' @@ -55,7 +54,7 @@ class Action_Density : public Action { static const char* PropertyStr_[]; static const char* AxisStr_[]; static const double AMU_ANG_TO_G_CM3; - + // NOTE: DirectionType XYZ corresponds to XYZ in Box::ParamType enum DirectionType {DX = 0, DY, DZ}; enum PropertyType {NUMBER = 0, MASS, CHARGE, ELECTRON}; enum BinCoordType {CENTER = 0, EDGE}; @@ -78,7 +77,6 @@ class Action_Density : public Action { PropArray properties_; ///< Hold properties for each mask. DataSet* density_; ///< Hold total system density (if not binning) - ImagedAction image_; ///< Used to calculate system volume for total density. RestrictType restrictType_; ///< Used to restrict calculation to a certain shape. double cutVal_; ///< Cutoff to use if shape restriction in use. # ifdef MPI diff --git a/src/Action_Diffusion.cpp b/src/Action_Diffusion.cpp index cecee59e99..d176d41eae 100644 --- a/src/Action_Diffusion.cpp +++ b/src/Action_Diffusion.cpp @@ -53,7 +53,7 @@ Action::RetType Action_Diffusion::Init(ArgList& actionArgs, ActionInit& init, in trajComm_ = init.TrajComm(); # endif debug_ = debugIn; - image_.InitImaging( !(actionArgs.hasKey("noimage")) ); + imageOpt_.InitImaging( !(actionArgs.hasKey("noimage")) ); // Determine if this is old syntax or new. if (actionArgs.Nargs() > 2 && actionArgs.ArgIsMask(1) && validDouble(actionArgs[2])) { @@ -174,7 +174,7 @@ Action::RetType Action_Diffusion::Init(ArgList& actionArgs, ActionInit& init, in else mprintf("\tOnly average diffusion will be calculated.\n"); mprintf("\tData set base name: %s\n", avg_x_->Meta().Name().c_str()); - if (image_.UseImage()) + if (imageOpt_.UseImage()) mprintf("\tCorrections for imaging enabled.\n"); else mprintf("\tCorrections for imaging disabled.\n"); @@ -221,8 +221,8 @@ Action::RetType Action_Diffusion::Setup(ActionSetup& setup) { } // Set up imaging info for this parm - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); - if (image_.ImagingEnabled()) { + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); + if (imageOpt_.ImagingEnabled()) { mprintf("\tImaging enabled.\n"); # ifdef MPI if (trajComm_.Size() > 1) { @@ -299,7 +299,6 @@ Action::RetType Action_Diffusion::Setup(ActionSetup& setup) { // Action_Diffusion::DoAction() Action::RetType Action_Diffusion::DoAction(int frameNum, ActionFrame& frm) { - Matrix_3x3 ucell, recip; // Load initial frame if necessary if (initial_.empty()) { initial_ = frm.Frm(); @@ -321,10 +320,9 @@ Action::RetType Action_Diffusion::DoAction(int frameNum, ActionFrame& frm) { } } // Diffusion calculation - if (image_.ImageType() != NOIMAGE) { + if (imageOpt_.ImagingEnabled()) { + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); boxcenter_ = frm.Frm().BoxCrd().Center(); - if (image_.ImageType() == NONORTHO) - frm.Frm().BoxCrd().ToRecip(ucell, recip); } // For averaging over selected atoms double average2 = 0.0; @@ -338,7 +336,7 @@ Action::RetType Action_Diffusion::DoAction(int frameNum, ActionFrame& frm) { const double* iXYZ = initial_.XYZ(*at); // Calculate distance from initial position. double delx, dely, delz; - if ( image_.ImageType() == ORTHO ) { + if ( imageOpt_.ImagingType() == ImageOption::ORTHO ) { // Orthorhombic imaging // Calculate distance to previous frames coordinates. delx = XYZ[0] - previous_[idx ]; @@ -347,18 +345,18 @@ Action::RetType Action_Diffusion::DoAction(int frameNum, ActionFrame& frm) { // If the particle moved more than half the box, assume it was imaged // and adjust the distance of the total movement with respect to the // original frame. - if (delx > boxcenter_[0]) delta_[idx ] -= frm.Frm().BoxCrd().BoxX(); - else if (delx < -boxcenter_[0]) delta_[idx ] += frm.Frm().BoxCrd().BoxX(); - if (dely > boxcenter_[1]) delta_[idx+1] -= frm.Frm().BoxCrd().BoxY(); - else if (dely < -boxcenter_[1]) delta_[idx+1] += frm.Frm().BoxCrd().BoxY(); - if (delz > boxcenter_[2]) delta_[idx+2] -= frm.Frm().BoxCrd().BoxZ(); - else if (delz < -boxcenter_[2]) delta_[idx+2] += frm.Frm().BoxCrd().BoxZ(); + if (delx > boxcenter_[0]) delta_[idx ] -= frm.Frm().BoxCrd().Param(Box::X); + else if (delx < -boxcenter_[0]) delta_[idx ] += frm.Frm().BoxCrd().Param(Box::X); + if (dely > boxcenter_[1]) delta_[idx+1] -= frm.Frm().BoxCrd().Param(Box::Y); + else if (dely < -boxcenter_[1]) delta_[idx+1] += frm.Frm().BoxCrd().Param(Box::Y); + if (delz > boxcenter_[2]) delta_[idx+2] -= frm.Frm().BoxCrd().Param(Box::Z); + else if (delz < -boxcenter_[2]) delta_[idx+2] += frm.Frm().BoxCrd().Param(Box::Z); // Calculate the distance between this "fixed" coordinate // and the reference (initial) frame. delx = XYZ[0] + delta_[idx ] - iXYZ[0]; dely = XYZ[1] + delta_[idx+1] - iXYZ[1]; delz = XYZ[2] + delta_[idx+2] - iXYZ[2]; - } else if ( image_.ImageType() == NONORTHO ) { + } else if ( imageOpt_.ImagingType() == ImageOption::NONORTHO ) { // Non-orthorhombic imaging // Calculate distance to previous frames coordinates. delx = XYZ[0] - previous_[idx ]; @@ -374,11 +372,11 @@ Action::RetType Action_Diffusion::DoAction(int frameNum, ActionFrame& frm) { // Previous position in Cartesian space Vec3 pCart( previous_[idx], previous_[idx+1], previous_[idx+2] ); // Current position in fractional coords - Vec3 cFrac = recip * Vec3( XYZ[0], XYZ[1], XYZ[2] ); + Vec3 cFrac = frm.Frm().BoxCrd().FracCell() * Vec3( XYZ[0], XYZ[1], XYZ[2] ); // Look for imaged distance closer to previous than current position - double minDist2 = frm.Frm().BoxCrd().BoxX() * - frm.Frm().BoxCrd().BoxY() * - frm.Frm().BoxCrd().BoxZ(); + double minDist2 = frm.Frm().BoxCrd().Param(Box::X) * + frm.Frm().BoxCrd().Param(Box::Y) * + frm.Frm().BoxCrd().Param(Box::Z); Vec3 minCurr(0.0); for (int ix = -1; ix < 2; ix++) { for (int iy = -1; iy < 2; iy++) { @@ -386,7 +384,7 @@ Action::RetType Action_Diffusion::DoAction(int frameNum, ActionFrame& frm) { if (ix != 0 || iy != 0 || iz != 0) { // Ignore current position Vec3 ixyz(ix, iy, iz); // Current position shifted and back in Cartesian space - Vec3 IMG = ucell.TransposeMult(cFrac + ixyz); + Vec3 IMG = frm.Frm().BoxCrd().UnitCell().TransposeMult(cFrac + ixyz); // Distance from previous position to imaged current position Vec3 dxyz = IMG - pCart; double dist2 = dxyz.Magnitude2(); diff --git a/src/Action_Diffusion.h b/src/Action_Diffusion.h index a082a87e09..fd95ec7106 100644 --- a/src/Action_Diffusion.h +++ b/src/Action_Diffusion.h @@ -1,7 +1,7 @@ #ifndef INC_ACTION_DIFFUSION_H #define INC_ACTION_DIFFUSION_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" class Action_Diffusion : public Action { public: Action_Diffusion(); @@ -20,7 +20,7 @@ class Action_Diffusion : public Action { void CalcDiffForSet(unsigned int&, Dlist const&, int, std::string const&) const; void CalcDiffusionConst(unsigned int&, DataSet*, int, std::string const&) const; - ImagedAction image_; ///< Imaging routines + ImageOption imageOpt_; ///< Used to determine if imaging should be used. Frame initial_; ///< Initial frame (all atoms) Darray previous_; ///< Previous coordinates (selected atoms) DataSet* avg_x_; ///< Hold average diffusion in X direction each frame diff --git a/src/Action_Distance.cpp b/src/Action_Distance.cpp index 3e5f130cef..83d0303f14 100644 --- a/src/Action_Distance.cpp +++ b/src/Action_Distance.cpp @@ -1,6 +1,6 @@ -#include #include "Action_Distance.h" #include "CpptrajStdio.h" +#include "DistRoutines.h" // CONSTRUCTOR Action_Distance::Action_Distance() : @@ -28,7 +28,7 @@ Action::RetType Action_Distance::Init(ArgList& actionArgs, ActionInit& init, int { AssociatedData_NOE noe; // Get Keywords - image_.InitImaging( !(actionArgs.hasKey("noimage")) ); + imageOpt_.InitImaging( !(actionArgs.hasKey("noimage")) ); useMass_ = !(actionArgs.hasKey("geom")); DataFile* outfile = init.DFL().AddDataFile( actionArgs.GetStringKey("out"), actionArgs ); MetaData::scalarType stype = MetaData::UNDEFINED; @@ -95,7 +95,7 @@ Action::RetType Action_Distance::Init(ArgList& actionArgs, ActionInit& init, int Mask2_.MaskString(), Mask2_.Nselected(), refFrm.refName()); else if (mode_ == POINT) mprintf(" %s to point {%g %g %g}", Mask1_.MaskString(), a2_[0], a2_[1], a2_[2]); - if (!image_.UseImage()) + if (!imageOpt_.UseImage()) mprintf(", non-imaged"); if (useMass_) mprintf(", center of mass"); @@ -129,8 +129,8 @@ Action::RetType Action_Distance::Setup(ActionSetup& setup) { } } // Set up imaging info for this parm - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); - if (image_.ImagingEnabled()) + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); + if (imageOpt_.ImagingEnabled()) mprintf(", imaged"); else mprintf(", imaging off"); @@ -141,8 +141,8 @@ Action::RetType Action_Distance::Setup(ActionSetup& setup) { // Action_Distance::DoAction() Action::RetType Action_Distance::DoAction(int frameNum, ActionFrame& frm) { - double Dist; - Matrix_3x3 ucell, recip; + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); Vec3 a1; if ( mode_ == NORMAL ) { @@ -160,19 +160,7 @@ Action::RetType Action_Distance::DoAction(int frameNum, ActionFrame& frm) { a1 = frm.Frm().VGeometricCenter( Mask1_ ); } - switch ( image_.ImageType() ) { - case NONORTHO: - frm.Frm().BoxCrd().ToRecip(ucell, recip); - Dist = DIST2_ImageNonOrtho(a1, a2_, ucell, recip); - break; - case ORTHO: - Dist = DIST2_ImageOrtho(a1, a2_, frm.Frm().BoxCrd()); - break; - case NOIMAGE: - Dist = DIST2_NoImage(a1, a2_); - break; - } - Dist = sqrt(Dist); + double Dist = DIST(imageOpt_.ImagingType(), a1, a2_, frm.Frm().BoxCrd()); dist_->Add(frameNum, &Dist); diff --git a/src/Action_Distance.h b/src/Action_Distance.h index 6613b92a88..be6f9f7343 100644 --- a/src/Action_Distance.h +++ b/src/Action_Distance.h @@ -1,7 +1,7 @@ #ifndef INC_ACTION_DISTANCE_H #define INC_ACTION_DISTANCE_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" /// Action to calculate a distance between atoms in two masks. class Action_Distance: public Action { public: @@ -16,12 +16,12 @@ class Action_Distance: public Action { enum ModeType { NORMAL = 0, REF, POINT }; - AtomMask Mask1_; ///< Mask selecting first point - AtomMask Mask2_; ///< Mask selecting second point - ImagedAction image_; ///< Imaging routines. - Vec3 a2_; ///< Hold reference XYZ for REF or point XYZ - DataSet* dist_; ///< Will hold DataSet of calculated distances. - ModeType mode_; ///< Type of distance calculation. - bool useMass_; ///< If true, mass-weight distances. + AtomMask Mask1_; ///< Mask selecting first point + AtomMask Mask2_; ///< Mask selecting second point + ImageOption imageOpt_; ///< Used to determine if imaging should be used. + Vec3 a2_; ///< Hold reference XYZ for REF or point XYZ + DataSet* dist_; ///< Will hold DataSet of calculated distances. + ModeType mode_; ///< Type of distance calculation. + bool useMass_; ///< If true, mass-weight distances. }; #endif diff --git a/src/Action_FixImagedBonds.cpp b/src/Action_FixImagedBonds.cpp index 0ad1030d53..adfa67396a 100644 --- a/src/Action_FixImagedBonds.cpp +++ b/src/Action_FixImagedBonds.cpp @@ -13,7 +13,7 @@ void Action_FixImagedBonds::Help() const { Action::RetType Action_FixImagedBonds::Init(ArgList& actionArgs, ActionInit& init, int debugIn) { // Always image - image_.InitImaging( true ); + imageOpt_.InitImaging( true ); if (mask_.SetMaskString( actionArgs.GetMaskNext() )) return Action::ERR; mprintf(" FIXIMAGEDBONDS: Checking all bonds selected by mask '%s'\n", mask_.MaskString()); @@ -25,7 +25,7 @@ Action::RetType Action_FixImagedBonds::Init(ArgList& actionArgs, ActionInit& ini Action::RetType Action_FixImagedBonds::Setup(ActionSetup& setup) { // Need box info - if (setup.CoordInfo().TrajBox().Type()==Box::NOBOX) { + if (!setup.CoordInfo().TrajBox().HasBox()) { mprintf("Warning: Topology '%s' does not contain box information; required for imaging.\n", setup.Top().c_str()); return Action::SKIP; @@ -50,7 +50,12 @@ Action::RetType Action_FixImagedBonds::Setup(ActionSetup& setup) Natoms_ = (unsigned int)lastSelected + 1; mprintf("\tFirst selected atom %i, last selected atom %u\n", firstSelected_+1, Natoms_); // Set up imaging info for this parm - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); + // sanity check + if (!imageOpt_.ImagingEnabled()) { + mprinterr("Internal Error: Box info present but imaging could not be set up.\n"); + return Action::ERR; + } CurrentParm_ = setup.TopAddress(); @@ -62,12 +67,10 @@ Action::RetType Action_FixImagedBonds::Setup(ActionSetup& setup) // Action_FixImagedBonds::DoAction() Action::RetType Action_FixImagedBonds::DoAction(int frameNum, ActionFrame& frm) { + // NOTE: Imaging should always be enabled Box const& box = frm.Frm().BoxCrd(); - // Calculate box info needed for imaging based on cell type - if (image_.ImageType() == NONORTHO) - box.ToRecip(ucell_, recip_); - else - boxCenter_ = box.Center(); + imageOpt_.SetImageType( box.Is_X_Aligned_Ortho() ); + boxCenter_ = box.Center(); // Starting with the first atom, check every atom bonded to that atom // pseudo-recursively. Ensure that no bond length is longer than half // the box size. If it is adjust the position of the bonded atom to @@ -106,21 +109,21 @@ Action::RetType Action_FixImagedBonds::DoAction(int frameNum, ActionFrame& frm) Vec3 bondXYZ( frm.Frm().XYZ( *batom ) ); Vec3 delta = bondXYZ - currXYZ; Vec3 boxTrans(0.0); - if ( image_.ImageType() == ORTHO ) { + if ( imageOpt_.ImagingType() == ImageOption::ORTHO ) { // ----- Orthorhombic imaging ------------ // If the distance between current and bonded atom is more than half the box, // adjust the position of the bonded atom. - while (delta[0] > boxCenter_[0]) { delta[0] -= box.BoxX(); boxTrans[0] -= box.BoxX(); } - while (delta[0] < -boxCenter_[0]) { delta[0] += box.BoxX(); boxTrans[0] += box.BoxX(); } - while (delta[1] > boxCenter_[1]) { delta[1] -= box.BoxY(); boxTrans[1] -= box.BoxY(); } - while (delta[1] < -boxCenter_[1]) { delta[1] += box.BoxY(); boxTrans[1] += box.BoxY(); } - while (delta[2] > boxCenter_[2]) { delta[2] -= box.BoxZ(); boxTrans[2] -= box.BoxZ(); } - while (delta[2] < -boxCenter_[2]) { delta[2] += box.BoxZ(); boxTrans[2] += box.BoxZ(); } + while (delta[0] > boxCenter_[0]) { delta[0] -= box.Param(Box::X); boxTrans[0] -= box.Param(Box::X); } + while (delta[0] < -boxCenter_[0]) { delta[0] += box.Param(Box::X); boxTrans[0] += box.Param(Box::X); } + while (delta[1] > boxCenter_[1]) { delta[1] -= box.Param(Box::Y); boxTrans[1] -= box.Param(Box::Y); } + while (delta[1] < -boxCenter_[1]) { delta[1] += box.Param(Box::Y); boxTrans[1] += box.Param(Box::Y); } + while (delta[2] > boxCenter_[2]) { delta[2] -= box.Param(Box::Z); boxTrans[2] -= box.Param(Box::Z); } + while (delta[2] < -boxCenter_[2]) { delta[2] += box.Param(Box::Z); boxTrans[2] += box.Param(Box::Z); } } else { // ----- Non-orthorhombic imaging -------- - Vec3 fdelta = recip_ * delta; + Vec3 fdelta = box.FracCell() * delta; // DEBUG -// Vec3 dbgdelta = (recip_ * bondXYZ) - (recip_ * currXYZ); +// Vec3 dbgdelta = (box.FracCell() * bondXYZ) - (box.FracCell() * currXYZ); // fdelta.Print("fdelta"); // dbgdelta.Print("dbgdelta"); // If the distance between current and bonded atom is more than half the cell, @@ -131,8 +134,8 @@ Action::RetType Action_FixImagedBonds::DoAction(int frameNum, ActionFrame& frm) while (fdelta[1] < -0.5) { fdelta[1] += 1.0; boxTrans[1] += 1.0; } while (fdelta[2] > 0.5) { fdelta[2] -= 1.0; boxTrans[2] -= 1.0; } while (fdelta[2] < -0.5) { fdelta[2] += 1.0; boxTrans[2] += 1.0; } - boxTrans = ucell_.TransposeMult( boxTrans ); -// delta = ucell_.TransposeMult( fdelta ); // DEBUG + boxTrans = box.UnitCell().TransposeMult( boxTrans ); +// delta = box.UnitCell().TransposeMult( fdelta ); // DEBUG } // Translate the atom // if (boxTrans[0] != 0.0 || boxTrans[1] != 0.0 || boxTrans[2] != 0.0) diff --git a/src/Action_FixImagedBonds.h b/src/Action_FixImagedBonds.h index 8a3db2991c..89df01eb91 100644 --- a/src/Action_FixImagedBonds.h +++ b/src/Action_FixImagedBonds.h @@ -1,7 +1,7 @@ #ifndef INC_ACTION_FIXIMAGEDBONDS_H #define INC_ACTION_FIXIMAGEDBONDS_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" #include "CharMask.h" /// Fix bonds which have been distorted by e.g. by atom imaging. class Action_FixImagedBonds : public Action { @@ -15,11 +15,9 @@ class Action_FixImagedBonds : public Action { Action::RetType DoAction(int, ActionFrame&); void Print() {} - ImagedAction image_ ; ///< Imaging routines + ImageOption imageOpt_; ///< Used to determine if imaging should be used CharMask mask_; Vec3 boxCenter_; ///< Box center for current frame - Matrix_3x3 ucell_; ///< Unit cell matrix for current frame - Matrix_3x3 recip_; ///< Recip (frac) matrix for current frame Topology* CurrentParm_; std::vector atomVisited_; int firstSelected_; diff --git a/src/Action_GIST.cpp b/src/Action_GIST.cpp index 4f3745b73b..50f7e53b7f 100644 --- a/src/Action_GIST.cpp +++ b/src/Action_GIST.cpp @@ -8,6 +8,7 @@ #include "DataSet_GridDbl.h" #include "ProgressBar.h" #include "StringRoutines.h" +#include "DistRoutines.h" #ifdef _OPENMP # include #endif @@ -113,7 +114,7 @@ Action::RetType Action_GIST::Init(ArgList& actionArgs, ActionInit& init, int deb DataFile* file_dipolez = init.DFL().AddDataFile(prefix_ + "-dipolez-dens" + ext); // Other keywords includeIons_ = !actionArgs.hasKey("excludeions"); - image_.InitImaging( !(actionArgs.hasKey("noimage")) ); + imageOpt_.InitImaging( !(actionArgs.hasKey("noimage")), actionArgs.hasKey("nonortho") ); doOrder_ = actionArgs.hasKey("doorder"); doEij_ = actionArgs.hasKey("doeij"); #ifdef CUDA @@ -327,10 +328,12 @@ Action::RetType Action_GIST::Init(ArgList& actionArgs, ActionInit& init, int deb mprintf("\tSkipping water-water Eij matrix.\n"); mprintf("\tWater reference density: %6.4f molecules/Ang^3\n", BULK_DENS_); mprintf("\tSimulation temperature: %6.4f K\n", temperature_); - if (image_.UseImage()) + if (imageOpt_.UseImage()) mprintf("\tDistances will be imaged.\n"); else mprintf("\tDistances will not be imaged.\n"); + if (imageOpt_.ForceNonOrtho()) + mprintf("\tWill use non-orthogonal imaging routines for all cell types.\n"); gO_->GridInfo(); mprintf("\tNumber of voxels: %u, voxel volume: %f Ang^3\n", MAX_GRID_PT_, gO_->Bin().VoxelVolume()); @@ -345,6 +348,9 @@ Action::RetType Action_GIST::Init(ArgList& actionArgs, ActionInit& init, int deb "# Johannes Kraml, Anna S. Kamenik, Franz Waibl, Michael Schauperl, Klaus R. Liedl, JCTC (2019)\n" #endif ); +# ifdef GIST_USE_NONORTHO_DIST2 + mprintf("DEBUG: Using regular non-orthogonal distance routine.\n"); +# endif gist_init_.Stop(); return Action::OK; } @@ -356,11 +362,11 @@ Action::RetType Action_GIST::Setup(ActionSetup& setup) { gist_setup_.Start(); CurrentParm_ = setup.TopAddress(); // We need box info - if (setup.CoordInfo().TrajBox().Type() == Box::NOBOX) { + if (!setup.CoordInfo().TrajBox().HasBox()) { mprinterr("Error: Must have explicit solvent with periodic boundaries!"); return Action::ERR; } - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); #ifdef CUDA this->numberAtoms_ = setup.Top().Natom(); this->solvent_ = new bool[this->numberAtoms_]; @@ -494,7 +500,7 @@ Action::RetType Action_GIST::Setup(ActionSetup& setup) { N_ON_GRID_ = 0; if (!skipE_) { - if (image_.ImagingEnabled()) + if (imageOpt_.ImagingEnabled()) mprintf("\tImaging enabled for energy distance calculations.\n"); else mprintf("\tNo imaging will be performed for energy distance calculations.\n"); @@ -560,13 +566,15 @@ void Action_GIST::Ecalc(double rij2, double q1, double q2, NonbondType const& LJ /** Calculate the energy between all solute/solvent atoms and solvent atoms * on the grid. This is done after the intial GIST calculations * so that all waters have voxels assigned in atom_voxel_. + * NOTE: This routine modifies the coordinates in OnGrid_XYZ_ when the cell + * has nonorthogonal shape in order to properly satsify the minimum + * image convention, so any calculations that rely on the on grid + * coordinates (like Order()) must be done *BEFORE* this routine. */ void Action_GIST::NonbondEnergy(Frame const& frameIn, Topology const& topIn) { // Set up imaging info. - Matrix_3x3 ucell, recip; - if (image_.ImageType() == NONORTHO) { - frameIn.BoxCrd().ToRecip(ucell, recip); + if (imageOpt_.ImagingType() == ImageOption::NONORTHO) { // Wrap on-grid water coords back to primary cell TODO openmp double* ongrid_xyz = &OnGrid_XYZ_[0]; int maxXYZ = (int)OnGrid_XYZ_.size(); @@ -580,13 +588,13 @@ void Action_GIST::NonbondEnergy(Frame const& frameIn, Topology const& topIn) { double* XYZ = ongrid_xyz + idx; // Convert to frac coords - recip.TimesVec( XYZ, XYZ ); + frameIn.BoxCrd().FracCell().TimesVec( XYZ, XYZ ); // Wrap to primary cell XYZ[0] = XYZ[0] - floor(XYZ[0]); XYZ[1] = XYZ[1] - floor(XYZ[1]); XYZ[2] = XYZ[2] - floor(XYZ[2]); // Convert back to Cartesian - ucell.TransposeMult( XYZ, XYZ ); + frameIn.BoxCrd().UnitCell().TransposeMult( XYZ, XYZ ); } # ifdef _OPENMP } @@ -636,9 +644,9 @@ void Action_GIST::NonbondEnergy(Frame const& frameIn, Topology const& topIn) double qA1 = topIn[ a1 ].Charge(); // Charge of atom1 bool a1IsO = (topIn[ a1 ].Element() == Atom::OXYGEN); std::vector vImages; - if (image_.ImageType() == NONORTHO) { + if (imageOpt_.ImagingType() == ImageOption::NONORTHO) { // Convert to frac coords - Vec3 vFrac = recip * A1_XYZ; + Vec3 vFrac = frameIn.BoxCrd().FracCell() * A1_XYZ; // Wrap to primary unit cell vFrac[0] = vFrac[0] - floor(vFrac[0]); vFrac[1] = vFrac[1] - floor(vFrac[1]); @@ -649,7 +657,7 @@ void Action_GIST::NonbondEnergy(Frame const& frameIn, Topology const& topIn) for (int iy = -1; iy != 2; iy++) for (int iz = -1; iz != 2; iz++) // Convert image back to Cartesian - vImages.push_back( ucell.TransposeMult( vFrac + Vec3(ix,iy,iz) ) ); + vImages.push_back( frameIn.BoxCrd().UnitCell().TransposeMult( vFrac + Vec3(ix,iy,iz) ) ); } // Loop over all solvent atoms on the grid for (unsigned int gidx = 0; gidx < N_ON_GRID_; gidx++) @@ -665,7 +673,10 @@ void Action_GIST::NonbondEnergy(Frame const& frameIn, Topology const& topIn) // Calculate distance //gist_nonbond_dist_.Start(); double rij2; - if (image_.ImageType() == NONORTHO) { + if (imageOpt_.ImagingType() == ImageOption::NONORTHO) { +# ifdef GIST_USE_NONORTHO_DIST2 + rij2 = DIST2_ImageNonOrtho(A1_XYZ, A2_XYZ, frameIn.BoxCrd().UnitCell(), frameIn.BoxCrd().FracCell()); +# else rij2 = maxD_; for (std::vector::const_iterator vCart = vImages.begin(); vCart != vImages.end(); ++vCart) @@ -675,7 +686,8 @@ void Action_GIST::NonbondEnergy(Frame const& frameIn, Topology const& topIn) double z = (*vCart)[2] - A2_XYZ[2]; rij2 = std::min(rij2, x*x + y*y + z*z); } - } else if (image_.ImageType() == ORTHO) +# endif + } else if (imageOpt_.ImagingType() == ImageOption::ORTHO) rij2 = DIST2_ImageOrtho( A1_XYZ, A2_XYZ, frameIn.BoxCrd() ); else rij2 = DIST2_NoImage( A1_XYZ, A2_XYZ ); @@ -694,7 +706,10 @@ void Action_GIST::NonbondEnergy(Frame const& frameIn, Topology const& topIn) // Calculate distance //gist_nonbond_dist_.Start(); double rij2; - if (image_.ImageType() == NONORTHO) { + if (imageOpt_.ImagingType() == ImageOption::NONORTHO) { +# ifdef GIST_USE_NONORTHO_DIST2 + rij2 = DIST2_ImageNonOrtho(A1_XYZ, A2_XYZ, frameIn.BoxCrd().UnitCell(), frameIn.BoxCrd().FracCell()); +# else rij2 = maxD_; for (std::vector::const_iterator vCart = vImages.begin(); vCart != vImages.end(); ++vCart) @@ -704,7 +719,8 @@ void Action_GIST::NonbondEnergy(Frame const& frameIn, Topology const& topIn) double z = (*vCart)[2] - A2_XYZ[2]; rij2 = std::min(rij2, x*x + y*y + z*z); } - } else if (image_.ImageType() == ORTHO) +# endif + } else if (imageOpt_.ImagingType() == ImageOption::ORTHO) rij2 = DIST2_ImageOrtho( A1_XYZ, A2_XYZ, frameIn.BoxCrd() ); else rij2 = DIST2_NoImage( A1_XYZ, A2_XYZ ); @@ -804,6 +820,7 @@ void Action_GIST::Order(Frame const& frameIn) { } } order_norm_->UpdateVoxel(voxel1, (1.0 - (3.0/8)*sum)); + //mprintf("DBG: gidx= %u oidx1=%i voxel1= %i XYZ1={%g, %g, %g} sum= %g\n", gidx, oidx1, voxel1, XYZ1[0], XYZ1[1], XYZ1[2], sum); } // END loop over all solvent molecules } @@ -816,6 +833,21 @@ Action::RetType Action_GIST::DoAction(int frameNum, ActionFrame& frm) { OnGrid_idxs_.clear(); OnGrid_XYZ_.clear(); + // Determine imaging type +# ifdef DEBUG_GIST + //mprintf("DEBUG: Is_X_Aligned_Ortho() = %i Is_X_Aligned() = %i\n", (int)frm.Frm().BoxCrd().Is_X_Aligned_Ortho(), (int)frm.Frm().BoxCrd().Is_X_Aligned()); + frm.Frm().BoxCrd().UnitCell().Print("Ucell"); + frm.Frm().BoxCrd().FracCell().Print("Frac"); +# endif + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); +# ifdef DEBUG_GIST + switch (imageOpt_.ImagingType()) { + case ImageOption::NO_IMAGE : mprintf("DEBUG: No Image.\n"); break; + case ImageOption::ORTHO : mprintf("DEBUG: Orthogonal image.\n"); break; + case ImageOption::NONORTHO : mprintf("DEBUG: Nonorthogonal image.\n"); break; + } +# endif // CUDA necessary information size_t bin_i, bin_j, bin_k; @@ -985,21 +1017,23 @@ Action::RetType Action_GIST::DoAction(int frameNum, ActionFrame& frm) { } // END water is within 1.5 Ang of grid } // END loop over each solvent molecule - // Do energy calculation if requested - #ifndef CUDA - gist_nonbond_.Start(); - if (!skipE_) NonbondEnergy(frm.Frm(), *CurrentParm_); - gist_nonbond_.Stop(); - - - // Do order calculation if requested +# ifndef CUDA + // Do order calculation if requested. + // NOTE: This has to be done before the nonbond energy calc since + // the nonbond calc can modify the on-grid coordinates (for minimum + // image convention when cell is non-orthogonal). gist_order_.Start(); if (doOrder_) Order(frm.Frm()); gist_order_.Stop(); - #else + // Do nonbond energy calc if not skipping energy + gist_nonbond_.Start(); + if (!skipE_) NonbondEnergy(frm.Frm(), *CurrentParm_); + gist_nonbond_.Stop(); +# else /* CUDA */ + // Do nonbond energy calc on GPU if not skipping energy if (! this->skipE_) NonbondCuda(frm); - #endif +# endif /* CUDA */ gist_action_.Stop(); return Action::OK; @@ -1452,32 +1486,30 @@ void Action_GIST::NonbondCuda(ActionFrame frm) { std::vector > order_indices; this->gist_nonbond_.Start(); - Matrix_3x3 ucell_m, recip_m; float *recip = NULL; float *ucell = NULL; int boxinfo; // Check Boxinfo and write the necessary data into recip, ucell and boxinfo. - switch(this->image_.ImageType()) { - case NONORTHO: + switch(imageOpt_.ImagingType()) { + case ImageOption::NONORTHO: recip = new float[9]; ucell = new float[9]; - frm.Frm().BoxCrd().ToRecip(ucell_m, recip_m); for (int i = 0; i < 9; ++i) { - ucell[i] = (float) ucell_m.Dptr()[i]; - recip[i] = (float) recip_m.Dptr()[i]; + ucell[i] = (float) frm.Frm().BoxCrd().UnitCell()[i]; + recip[i] = (float) frm.Frm().BoxCrd().FracCell()[i]; } boxinfo = 2; break; - case ORTHO: + case ImageOption::ORTHO: recip = new float[9]; - for (int i = 0; i < 3; ++i) { - recip[i] = (float) frm.Frm().BoxCrd()[i]; - } + recip[0] = frm.Frm().BoxCrd().Param(Box::X); + recip[1] = frm.Frm().BoxCrd().Param(Box::Y); + recip[2] = frm.Frm().BoxCrd().Param(Box::Z); ucell = NULL; boxinfo = 1; break; - case NOIMAGE: + case ImageOption::NO_IMAGE: recip = NULL; ucell = NULL; boxinfo = 0; @@ -1531,20 +1563,18 @@ void Action_GIST::NonbondCuda(ActionFrame frm) { double sum = 0; Vec3 cent( frm.Frm().xAddress() + (headAtomIndex) * 3 ); std::vector vectors; - switch(this->image_.ImageType()) { - case NONORTHO: - case ORTHO: + switch(imageOpt_.ImagingType()) { + case ImageOption::NONORTHO: + case ImageOption::ORTHO: { - Matrix_3x3 ucell, recip; - frm.Frm().BoxCrd().ToRecip(ucell, recip); Vec3 vec(frm.Frm().xAddress() + (order_indices.at(headAtomIndex).at(0) * 3)); - vectors.push_back( MinImagedVec(vec, cent, ucell, recip)); + vectors.push_back( MinImagedVec(vec, cent, frm.Frm().BoxCrd().UnitCell(), frm.Frm().BoxCrd().FracCell())); vec = Vec3(frm.Frm().xAddress() + (order_indices.at(headAtomIndex).at(1) * 3)); - vectors.push_back( MinImagedVec(vec, cent, ucell, recip)); + vectors.push_back( MinImagedVec(vec, cent, frm.Frm().BoxCrd().UnitCell(), frm.Frm().BoxCrd().FracCell())); vec = Vec3(frm.Frm().xAddress() + (order_indices.at(headAtomIndex).at(2) * 3)); - vectors.push_back( MinImagedVec(vec, cent, ucell, recip)); + vectors.push_back( MinImagedVec(vec, cent, frm.Frm().BoxCrd().UnitCell(), frm.Frm().BoxCrd().FracCell())); vec = Vec3(frm.Frm().xAddress() + (order_indices.at(headAtomIndex).at(3) * 3)); - vectors.push_back( MinImagedVec(vec, cent, ucell, recip)); + vectors.push_back( MinImagedVec(vec, cent, frm.Frm().BoxCrd().UnitCell(), frm.Frm().BoxCrd().FracCell())); } break; default: diff --git a/src/Action_GIST.h b/src/Action_GIST.h index 0604fcf746..fc9120e170 100644 --- a/src/Action_GIST.h +++ b/src/Action_GIST.h @@ -1,7 +1,7 @@ #ifndef INC_ACTION_GIST_H #define INC_ACTION_GIST_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" #include "Timer.h" #ifdef CUDA #include "cuda_kernels/GistCudaSetup.cuh" @@ -27,8 +27,6 @@ class Action_GIST : public Action { void Print(); inline void TransEntropy(float,float,float,float,float,float,float,int,double&,double&) const; - static inline double Dist2(ImagingType, const double*, const double*, Box const&, - Matrix_3x3 const&, Matrix_3x3 const&); static inline void Ecalc(double, double, double, NonbondType const&, double&, double&); void NonbondEnergy(Frame const&, Topology const&); void Order(Frame const&); @@ -79,8 +77,8 @@ class Action_GIST : public Action { Vec3 gridcntr_; Vec3 griddim_; - ImagedAction image_; ///< Imaging routines. // NOTE: '*' = Updated in DoAction(). '+' = Updated in Setup(). + ImageOption imageOpt_; ///< Used to determine if imaging should be used.* // GIST float grid datasets DataSet_3D* gO_; ///< Solvent oxygen density DataSet_3D* gH_; ///< Solvent hydrogen density diff --git a/src/Action_HydrogenBond.cpp b/src/Action_HydrogenBond.cpp index 878350b970..2d8f57f0db 100644 --- a/src/Action_HydrogenBond.cpp +++ b/src/Action_HydrogenBond.cpp @@ -5,6 +5,7 @@ #include "Constants.h" #include "TorsionRoutines.h" #include "StringRoutines.h" // ByteString +#include "DistRoutines.h" #ifdef _OPENMP # include #endif @@ -70,7 +71,7 @@ Action::RetType Action_HydrogenBond::Init(ArgList& actionArgs, ActionInit& init, # endif debug_ = debugIn; // Get keywords - Image_.InitImaging( (actionArgs.hasKey("image")) ); + imageOpt_.InitImaging( (actionArgs.hasKey("image")) ); DataFile* DF = init.DFL().AddDataFile( actionArgs.GetStringKey("out"), actionArgs ); series_ = actionArgs.hasKey("series"); if (series_) { @@ -212,7 +213,7 @@ Action::RetType Action_HydrogenBond::Init(ArgList& actionArgs, ActionInit& init, if (UVseriesout_ != 0) mprintf("\tWriting solute-solvent time series to %s\n", UVseriesout_->DataFilename().full()); } - if (Image_.UseImage()) + if (imageOpt_.UseImage()) mprintf("\tImaging enabled.\n"); masterDSL_ = init.DslPtr(); @@ -230,7 +231,7 @@ inline bool IsFON(Atom const& atm) { // Action_HydrogenBond::Setup() Action::RetType Action_HydrogenBond::Setup(ActionSetup& setup) { CurrentParm_ = setup.TopAddress(); - Image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); // Set up generic mask if (!hasDonorMask_ || !hasAcceptorMask_) { @@ -538,14 +539,14 @@ Action::RetType Action_HydrogenBond::Setup(ActionSetup& setup) { } // Action_HydrogenBond::Angle() -double Action_HydrogenBond::Angle(const double* XA, const double* XH, const double* XD) const +double Action_HydrogenBond::Angle(const double* XA, const double* XH, const double* XD, Box const& boxIn) const { - if (Image_.ImageType() == NOIMAGE) + if (imageOpt_.ImagingType() == ImageOption::NO_IMAGE) return (CalcAngle(XA, XH, XD)); else { double angle; Vec3 VH = Vec3(XH); - Vec3 H_A = MinImagedVec(VH, Vec3(XA), ucell_, recip_); + Vec3 H_A = MinImagedVec(VH, Vec3(XA), boxIn.UnitCell(), boxIn.FracCell()); Vec3 H_D = Vec3(XD) - VH; double rha = H_A.Magnitude2(); double rhd = H_D.Magnitude2(); @@ -624,7 +625,7 @@ void Action_HydrogenBond::CalcSolvHbonds(int frameNum, double dist2, bool angleSatisfied = true; // For ions, donor atom will be same as h atom so no angle needed. if (d_atom != *h_atom) { - angle = Angle(XYZA, frmIn.XYZ(*h_atom), XYZD); + angle = Angle(XYZA, frmIn.XYZ(*h_atom), XYZD, frmIn.BoxCrd()); angleSatisfied = !(angle < acut_); } if (angleSatisfied) @@ -696,7 +697,7 @@ void Action_HydrogenBond::CalcSiteHbonds(int frameNum, double dist2, // Determine if angle cutoff is satisfied for (Iarray::const_iterator h_atom = SiteD.Hbegin(); h_atom != SiteD.Hend(); ++h_atom) { - double angle = Angle(XYZA, frmIn.XYZ(*h_atom), XYZD); + double angle = Angle(XYZA, frmIn.XYZ(*h_atom), XYZD, frmIn.BoxCrd()); if ( !(angle < acut_) ) { # ifdef _OPENMP @@ -715,9 +716,10 @@ Action::RetType Action_HydrogenBond::DoAction(int frameNum, ActionFrame& frm) { # ifdef TIMER t_action_.Start(); # endif - if (Image_.ImagingEnabled()) - frm.Frm().BoxCrd().ToRecip(ucell_, recip_); - + if (imageOpt_.ImagingEnabled()) { + //frm.Frm().BoxCrd().PrintDebug("hbond"); + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); + } // Loop over all solute donor sites # ifdef TIMER t_uu_.Start(); @@ -746,7 +748,7 @@ Action::RetType Action_HydrogenBond::DoAction(int frameNum, ActionFrame& frm) { Site const& Site1 = Both_[sidx1]; if (mol0 != (*CurrentParm_)[Site1.Idx()].MolNum()) { const double* XYZ1 = frm.Frm().XYZ( Site1.Idx() ); - double dist2 = DIST2( XYZ0, XYZ1, Image_.ImageType(), frm.Frm().BoxCrd(), ucell_, recip_ ); + double dist2 = DIST2( imageOpt_.ImagingType(), XYZ0, XYZ1, frm.Frm().BoxCrd() ); if ( !(dist2 > dcut2_) ) { // Site 0 donor, Site 1 acceptor @@ -761,7 +763,7 @@ Action::RetType Action_HydrogenBond::DoAction(int frameNum, ActionFrame& frm) { { if (mol0 != (*CurrentParm_)[*a_atom].MolNum()) { const double* XYZ1 = frm.Frm().XYZ( *a_atom ); - double dist2 = DIST2( XYZ0, XYZ1, Image_.ImageType(), frm.Frm().BoxCrd(), ucell_, recip_ ); + double dist2 = DIST2( imageOpt_.ImagingType(), XYZ0, XYZ1, frm.Frm().BoxCrd() ); if ( !(dist2 > dcut2_) ) CalcSiteHbonds(frameNum, dist2, Site0, XYZ0, *a_atom, XYZ1, frm.Frm(), numHB); } @@ -788,7 +790,7 @@ Action::RetType Action_HydrogenBond::DoAction(int frameNum, ActionFrame& frm) { { Site const& Site1 = Both_[sidx1]; const double* XYZ1 = frm.Frm().XYZ( Site1.Idx() ); - double dist2 = DIST2( XYZ0, XYZ1, Image_.ImageType(), frm.Frm().BoxCrd(), ucell_, recip_ ); + double dist2 = DIST2( imageOpt_.ImagingType(), XYZ0, XYZ1, frm.Frm().BoxCrd() ); if ( !(dist2 > dcut2_) ) { // Site 0 donor, Site 1 acceptor @@ -801,7 +803,7 @@ Action::RetType Action_HydrogenBond::DoAction(int frameNum, ActionFrame& frm) { for (Iarray::const_iterator a_atom = Acceptor_.begin(); a_atom != Acceptor_.end(); ++a_atom) { const double* XYZ1 = frm.Frm().XYZ( *a_atom ); - double dist2 = DIST2( XYZ0, XYZ1, Image_.ImageType(), frm.Frm().BoxCrd(), ucell_, recip_ ); + double dist2 = DIST2( imageOpt_.ImagingType(), XYZ0, XYZ1, frm.Frm().BoxCrd() ); if ( !(dist2 > dcut2_) ) CalcSiteHbonds(frameNum, dist2, Site0, XYZ0, *a_atom, XYZ1, frm.Frm(), numHB); } @@ -849,7 +851,7 @@ Action::RetType Action_HydrogenBond::DoAction(int frameNum, ActionFrame& frm) { for (unsigned int sidx = 0; sidx < bothEnd_; sidx++) { const double* UXYZ = frm.Frm().XYZ( Both_[sidx].Idx() ); - double dist2 = DIST2( VXYZ, UXYZ, Image_.ImageType(), frm.Frm().BoxCrd(), ucell_, recip_ ); + double dist2 = DIST2( imageOpt_.ImagingType(), VXYZ, UXYZ, frm.Frm().BoxCrd() ); if ( !(dist2 > dcut2_) ) { // Solvent site donor, solute site acceptor @@ -862,7 +864,7 @@ Action::RetType Action_HydrogenBond::DoAction(int frameNum, ActionFrame& frm) { for (unsigned int sidx = bothEnd_; sidx < Both_.size(); sidx++) { const double* UXYZ = frm.Frm().XYZ( Both_[sidx].Idx() ); - double dist2 = DIST2( VXYZ, UXYZ, Image_.ImageType(), frm.Frm().BoxCrd(), ucell_, recip_ ); + double dist2 = DIST2( imageOpt_.ImagingType(), VXYZ, UXYZ, frm.Frm().BoxCrd() ); if ( !(dist2 > dcut2_) ) // Solvent site acceptor, solute site donor CalcSolvHbonds(frameNum, dist2, Both_[sidx], UXYZ, Vsite.Idx(), VXYZ, frm.Frm(), numHB, true); @@ -871,7 +873,7 @@ Action::RetType Action_HydrogenBond::DoAction(int frameNum, ActionFrame& frm) { for (Iarray::const_iterator a_atom = Acceptor_.begin(); a_atom != Acceptor_.end(); ++a_atom) { const double* UXYZ = frm.Frm().XYZ( *a_atom ); - double dist2 = DIST2( VXYZ, UXYZ, Image_.ImageType(), frm.Frm().BoxCrd(), ucell_, recip_ ); + double dist2 = DIST2( imageOpt_.ImagingType(), VXYZ, UXYZ, frm.Frm().BoxCrd() ); if ( !(dist2 > dcut2_) ) // Solvent site donor, solute site acceptor CalcSolvHbonds(frameNum, dist2, Vsite, VXYZ, *a_atom, UXYZ, frm.Frm(), numHB, false); diff --git a/src/Action_HydrogenBond.h b/src/Action_HydrogenBond.h index bcd73dc3e4..5fc105764d 100644 --- a/src/Action_HydrogenBond.h +++ b/src/Action_HydrogenBond.h @@ -2,7 +2,7 @@ #define INC_ACTION_HYDROGENBOND_H #include #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" #include "DataSet_integer.h" #ifdef TIMER # include "Timer.h" @@ -28,7 +28,7 @@ class Action_HydrogenBond : public Action { class Hbond; class Bridge; - inline double Angle(const double*, const double*, const double*) const; + inline double Angle(const double*, const double*, const double*, Box const&) const; inline int UU_Set_Idx(int,int) const; inline DataSet_integer* UUset(int,int,int); void AddUU(double,double,int,int,int,int); @@ -76,8 +76,7 @@ class Action_HydrogenBond : public Action { AtomMask SolventDonorMask_; AtomMask SolventAcceptorMask_; AtomMask Mask_; - ImagedAction Image_; ///< Hold imaging info. - Matrix_3x3 ucell_, recip_; ///< Unit/recip cell for imaging. + ImageOption imageOpt_; ///< Used to determine if imaging should be performed # ifdef TIMER Timer t_action_; Timer t_uu_; diff --git a/src/Action_Image.cpp b/src/Action_Image.cpp index 12358b43b0..3355fd3fbc 100644 --- a/src/Action_Image.cpp +++ b/src/Action_Image.cpp @@ -11,7 +11,6 @@ Action_Image::Action_Image() : offset_(0.0), origin_(false), center_(false), - ortho_(false), useMass_(true), truncoct_(false), triclinic_(OFF), @@ -106,14 +105,11 @@ Action::RetType Action_Image::Init(ArgList& actionArgs, ActionInit& init, int de */ Action::RetType Action_Image::Setup(ActionSetup& setup) { // Check box type - if (setup.CoordInfo().TrajBox().Type() == Box::NOBOX) { + if (!setup.CoordInfo().TrajBox().HasBox()) { mprintf("Warning: Topology %s does not contain box information.\n", setup.Top().c_str()); return Action::SKIP; } - ortho_ = false; - if (setup.CoordInfo().TrajBox().Type()==Box::ORTHO && triclinic_==OFF) - ortho_ = true; // Setup atom pairs to be unwrapped. if (imageList_ != 0) delete imageList_; imageList_ = Image::CreateImageList(setup.Top(), imageMode_, maskExpression_, @@ -151,13 +147,8 @@ Action::RetType Action_Image::Setup(ActionSetup& setup) { // Action_Image::DoAction() Action::RetType Action_Image::DoAction(int frameNum, ActionFrame& frm) { - // Ortho - Vec3 bp, bm; - // Nonortho - Matrix_3x3 ucell, recip; - Vec3 fcom; - - if (ortho_) { + if (frm.Frm().BoxCrd().Is_X_Aligned_Ortho() && triclinic_ == OFF) { + Vec3 bp, bm; if (Image::SetupOrtho(frm.Frm().BoxCrd(), bp, bm, origin_)) { mprintf("Warning: Frame %i imaging failed, box lengths are zero.\n",frameNum+1); // TODO: Return OK for now so next frame is tried; eventually indicate SKIP? @@ -165,10 +156,11 @@ Action::RetType Action_Image::DoAction(int frameNum, ActionFrame& frm) { } Image::Ortho(frm.ModifyFrm(), bp, bm, offset_, *imageList_); } else { - frm.Frm().BoxCrd().ToRecip( ucell, recip ); + Vec3 fcom; if (truncoct_) fcom = Image::SetupTruncoct( frm.Frm(), ComMask_, useMass_, origin_ ); - Image::Nonortho( frm.ModifyFrm(), origin_, fcom, offset_, ucell, recip, truncoct_, + Image::Nonortho( frm.ModifyFrm(), origin_, fcom, offset_, + frm.Frm().BoxCrd().UnitCell(), frm.Frm().BoxCrd().FracCell(), truncoct_, *imageList_); } return Action::MODIFY_COORDS; diff --git a/src/Action_Image.h b/src/Action_Image.h index 54f1b42a8e..9c44fcfa30 100644 --- a/src/Action_Image.h +++ b/src/Action_Image.h @@ -30,8 +30,6 @@ class Action_Image: public Action { bool origin_; /// If true molecules will be imaged w.r.t. their center, otherwise first atom will be used bool center_; - /// True if orthorhombic cell, false otherwise. - bool ortho_; bool useMass_; bool truncoct_; enum TriclinicArg {OFF, FORCE, FAMILIAR}; diff --git a/src/Action_LIE.cpp b/src/Action_LIE.cpp index 019dd4e6c0..fd2b21426d 100644 --- a/src/Action_LIE.cpp +++ b/src/Action_LIE.cpp @@ -38,7 +38,7 @@ Action::RetType Action_LIE::Init(ArgList& actionArgs, ActionInit& init, int debu bool has_mask2 = false; // Use imaged distances unless requested otherwise - InitImaging(usepbc_); + imageOpt_.InitImaging(usepbc_); if (!doelec_ && !dovdw_) { mprinterr("Error: LIE: Cannot skip both ELEC and VDW calcs\n"); @@ -103,10 +103,11 @@ Action::RetType Action_LIE::Setup(ActionSetup& setup) { mprintf("\tLIE: %i Ligand Atoms, %i Surrounding Atoms\n", Mask1_.Nselected(), Mask2_.Nselected()); - if (setup.CoordInfo().TrajBox().Type() == Box::NOBOX) { + if (!setup.CoordInfo().TrajBox().HasBox()) { mprinterr("Error: LIE: Must have explicit solvent system with box info\n"); return Action::ERR; } + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); if (Mask1_.None() || Mask2_.None()) { mprintf("Warning: LIE: One or both masks have no atoms.\n"); @@ -149,28 +150,16 @@ double Action_LIE::Calculate_LJ(Frame const& frameIn, Topology const& parmIn) co maskatom1 != mask1_end; maskatom1++) { int crdidx1 = (*maskatom1) * 3; // index into coordinate array - Vec3 atm1 = Vec3(frameIn.CRD(crdidx1)); + const double* atm1 = frameIn.CRD(crdidx1); for (AtomMask::const_iterator maskatom2 = Mask2_.begin(); maskatom2 != mask2_end; maskatom2++) { int crdidx2 = (*maskatom2) * 3; // index into coordinate array - Vec3 atm2 = Vec3(frameIn.CRD(crdidx2)); + const double* atm2 = frameIn.CRD(crdidx2); - double dist2; // Get imaged distance - Matrix_3x3 ucell, recip; - switch( ImageType() ) { - case NONORTHO: - frameIn.BoxCrd().ToRecip(ucell, recip); - dist2 = DIST2_ImageNonOrtho(atm1, atm2, ucell, recip); - break; - case ORTHO: - dist2 = DIST2_ImageOrtho(atm1, atm2, frameIn.BoxCrd()); - break; - default: - dist2 = DIST2_NoImage(atm1, atm2); - } + double dist2 = DIST2(imageOpt_.ImagingType(), atm1, atm2, frameIn.BoxCrd()); if (dist2 > cut2vdw_) continue; // Here we add to our nonbonded (VDW) energy @@ -193,28 +182,16 @@ double Action_LIE::Calculate_Elec(Frame const& frameIn) const { maskatom1 != mask1_end; maskatom1++) { int crdidx1 = (*maskatom1) * 3; // index into coordinate array - Vec3 atm1 = Vec3(frameIn.CRD(crdidx1)); + const double* atm1 = frameIn.CRD(crdidx1); for (AtomMask::const_iterator maskatom2 = Mask2_.begin(); maskatom2 != mask2_end; maskatom2++) { int crdidx2 = (*maskatom2) * 3; // index into coordinate array - Vec3 atm2 = Vec3(frameIn.CRD(crdidx2)); + const double* atm2 = frameIn.CRD(crdidx2); - double dist2; // Get imaged distance - Matrix_3x3 ucell, recip; - switch( ImageType() ) { - case NONORTHO: - frameIn.BoxCrd().ToRecip(ucell, recip); - dist2 = DIST2_ImageNonOrtho(atm1, atm2, ucell, recip); - break; - case ORTHO: - dist2 = DIST2_ImageOrtho(atm1, atm2, frameIn.BoxCrd()); - break; - default: - dist2 = DIST2_NoImage(atm1, atm2); - } + double dist2 = DIST2(imageOpt_.ImagingType(), atm1, atm2, frameIn.BoxCrd()); if (dist2 > cut2elec_) continue; // Here we add to our electrostatic energy @@ -229,7 +206,10 @@ double Action_LIE::Calculate_Elec(Frame const& frameIn) const { // Action_LIE::action() Action::RetType Action_LIE::DoAction(int frameNum, ActionFrame& frm) { - + if (imageOpt_.ImagingEnabled()) { + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); + //mprintf("DEBUG: Image type is %i\n", (int)imageOpt_.ImagingType()); + } if (doelec_) { double e = Calculate_Elec(frm.Frm()); elec_->Add(frameNum, &e); diff --git a/src/Action_LIE.h b/src/Action_LIE.h index 327bcdea79..d98b0266b5 100644 --- a/src/Action_LIE.h +++ b/src/Action_LIE.h @@ -1,34 +1,17 @@ #ifndef INC_ACTION_LIE_H #define INC_ACTION_LIE_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" // Class: Action_LIE /** Action to calculate the Linear Interaction Energy (effectively the nonbonded * energies between two different masks */ -class Action_LIE: public Action, ImagedAction { +class Action_LIE: public Action { public: Action_LIE(); DispatchObject* Alloc() const { return (DispatchObject*)new Action_LIE(); } void Help() const; private: - DataSet *elec_; //< EEL data set - DataSet *vdw_; //< VDW data set - bool dovdw_; //< Calculate VDW contribution - bool doelec_; //< Calculate EEL contribution - AtomMask Mask1_; //< Ligand mask - AtomMask Mask2_; //< Surroundings mask - double cut2vdw_; //< Square of the cutoff for VDW - double dielc_; //< dielectric constant - double cut2elec_;//< Square of the cutoff for EEL - double onecut2_; //< 1 / sqrt of electrostatic cutoff - bool usepbc_; //< whether to use periodic boundary conditions - - Topology* CurrentParm_; //< Topology to get params from - - // Hold atom charges * 18.2223 - std::vector atom_charge_; - Action::RetType Init(ArgList&, ActionInit&, int); Action::RetType Setup(ActionSetup&); Action::RetType DoAction(int, ActionFrame&); @@ -38,5 +21,22 @@ class Action_LIE: public Action, ImagedAction { int SetupParms(Topology const&); double Calculate_LJ(Frame const&, Topology const&) const; double Calculate_Elec(Frame const&) const; + + DataSet *elec_; ///< EEL data set + DataSet *vdw_; ///< VDW data set + bool dovdw_; ///< Calculate VDW contribution + bool doelec_; ///< Calculate EEL contribution + AtomMask Mask1_; ///< Ligand mask + AtomMask Mask2_; ///< Surroundings mask + double cut2vdw_; ///< Square of the cutoff for VDW + double dielc_; ///< dielectric constant + double cut2elec_; ///< Square of the cutoff for EEL + double onecut2_; ///< 1 / sqrt of electrostatic cutoff + bool usepbc_; ///< whether to use periodic boundary conditions + Topology* CurrentParm_; ///< Topology to get params from + ImageOption imageOpt_; ///< Determine whether imaging should be used. + + /// Hold atom charges * 18.2223 + std::vector atom_charge_; }; #endif diff --git a/src/Action_MakeStructure.cpp b/src/Action_MakeStructure.cpp index 5b39e9405e..67e25b6af0 100644 --- a/src/Action_MakeStructure.cpp +++ b/src/Action_MakeStructure.cpp @@ -405,7 +405,6 @@ Action::RetType Action_MakeStructure::Setup(ActionSetup& setup) { mprintf("\n"); } // END loop over SS types CurrentParm_ = setup.TopAddress(); - Action::CheckImageRotationWarning(setup, "structure modification"); return Action::OK; } diff --git a/src/Action_MinImage.cpp b/src/Action_MinImage.cpp index e14c0e7a45..045adb70a6 100644 --- a/src/Action_MinImage.cpp +++ b/src/Action_MinImage.cpp @@ -23,8 +23,6 @@ void Action_MinImage::Help() const { Action::RetType Action_MinImage::Init(ArgList& actionArgs, ActionInit& init, int debugIn) { // Get Keywords - // Require imaging. - image_.InitImaging( true ); useMass_ = !(actionArgs.hasKey("geom")); calcUsingMask_ = actionArgs.hasKey("maskcenter"); DataFile* outfile = init.DFL().AddDataFile( actionArgs.GetStringKey("out"), actionArgs ); @@ -88,6 +86,11 @@ Action::RetType Action_MinImage::Init(ArgList& actionArgs, ActionInit& init, int /** Determine what atoms each mask pertains to for the current parm file. */ Action::RetType Action_MinImage::Setup(ActionSetup& setup) { + // Require PBC info + if (!setup.CoordInfo().TrajBox().HasBox() ) { + mprintf("Warning: No box information; imaging cannot be performed for topology %s\n", setup.Top().c_str()); + return Action::SKIP; + } if (setup.Top().SetupIntegerMask( Mask1_ )) return Action::ERR; if (setup.Top().SetupIntegerMask( Mask2_ )) return Action::ERR; mprintf("\t%s (%i atoms) to %s (%i atoms)\n",Mask1_.MaskString(), Mask1_.Nselected(), @@ -96,12 +99,6 @@ Action::RetType Action_MinImage::Setup(ActionSetup& setup) { mprintf("Warning: One or both masks have no atoms.\n"); return Action::SKIP; } - // Set up imaging info for this parm - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); - if (!image_.ImagingEnabled()) { - mprintf("Warning: Imaging cannot be performed for topology %s\n", setup.Top().c_str()); - return Action::SKIP; - } return Action::OK; } @@ -119,15 +116,15 @@ static void WriteMatrix(Matrix_3x3 const& ucell, PDBfile& pdbout, const char* na } */ -double Action_MinImage::MinNonSelfDist2(Vec3 const& a1, Vec3 const& a2) { +double Action_MinImage::MinNonSelfDist2(Vec3 const& a1, Vec3 const& a2, Box const& boxIn) { // a1.Print("A1"); // a2.Print("A2"); - Vec3 frac1 = recip_ * a1; // a1 in fractional coords + Vec3 frac1 = boxIn.FracCell() * a1; // a1 in fractional coords // NOTE: Do not use 'floor' here since we want to keep a1/a2 in same ref frame // frac1.Print("A1 fractional coords"); - Vec3 T1 = ucell_.TransposeMult(frac1); // a1 back in Cartesian space + Vec3 T1 = boxIn.UnitCell().TransposeMult(frac1); // a1 back in Cartesian space // pdbout_.WriteATOM("O1", 6, T1[0], T1[1], T1[2], "O1", 1.0); // DEBUG - Vec3 frac2 = recip_ * a2; // a2 in fractional coords + Vec3 frac2 = boxIn.FracCell() * a2; // a2 in fractional coords // frac2.Print("A2 fractional coords"); // Floor // Vec3 floor1(frac1[0] - floor(frac1[0]), frac1[1] - floor(frac1[1]), frac1[2] - floor(frac1[2])); @@ -141,8 +138,8 @@ double Action_MinImage::MinNonSelfDist2(Vec3 const& a1, Vec3 const& a2) { for (int iz = -1; iz < 2; iz++) { if (ix != 0 || iy != 0 || iz != 0) { // Ignore a2 self Vec3 ixyz(ix, iy, iz); -// Vec3 t1 = ucell_.TransposeMult(frac1 + ixyz); // DEBUG - Vec3 t2 = ucell_.TransposeMult(frac2 + ixyz); // a2 image back in Cartesian space +// Vec3 t1 = boxIn.UnitCell().TransposeMult(frac1 + ixyz); // DEBUG + Vec3 t2 = boxIn.UnitCell().TransposeMult(frac2 + ixyz); // a2 image back in Cartesian space // Write out imaged coordinates // std::string name1 = "T1" + integerToString(ndist); // DEBUG // std::string name2 = "T2" + integerToString(ndist); // DEBUG @@ -168,8 +165,6 @@ Action::RetType Action_MinImage::DoAction(int frameNum, ActionFrame& frm) { // pdbout_.OpenWrite("minimage.pdb"); double Dist2; - frm.Frm().BoxCrd().ToRecip(ucell_, recip_); - if (calcUsingMask_) { // Use center of mask1 and mask2 Vec3 a1, a2; @@ -185,7 +180,7 @@ Action::RetType Action_MinImage::DoAction(int frameNum, ActionFrame& frm) { // WriteMatrix( ucell, pdbout, "UNT", 3); // WriteMatrix( recip, pdbout, "RCP", 4); - Dist2 = MinNonSelfDist2(a1, a2); + Dist2 = MinNonSelfDist2(a1, a2, frm.Frm().BoxCrd()); Dist2 = sqrt( Dist2 ); } else { // Look at all atoms in mask1/mask2 @@ -206,7 +201,7 @@ Action::RetType Action_MinImage::DoAction(int frameNum, ActionFrame& frm) { a1 = Vec3(frm.Frm().XYZ( Mask1_[m1] )); for (m2 = 0; m2 < m2end; m2++) { - Dist2 = MinNonSelfDist2( a1, Vec3(frm.Frm().XYZ(Mask2_[m2])) ); + Dist2 = MinNonSelfDist2( a1, Vec3(frm.Frm().XYZ(Mask2_[m2])), frm.Frm().BoxCrd() ); if (Dist2 < minDist_[mythread]) { minDist_[mythread] = Dist2; minAtom1_[mythread] = Mask1_[m1]; diff --git a/src/Action_MinImage.h b/src/Action_MinImage.h index c3919516b1..4dbc606c8b 100644 --- a/src/Action_MinImage.h +++ b/src/Action_MinImage.h @@ -1,7 +1,6 @@ #ifndef INC_ACTION_MINIMAGE_H #define INC_ACTION_MINIMAGE_H #include "Action.h" -#include "ImagedAction.h" //#incl ude "PDBfile.h" // DEBUG /// Action to calculate minimum non-self distance between atoms in two masks. class Action_MinImage: public Action { @@ -15,10 +14,8 @@ class Action_MinImage: public Action { Action::RetType DoAction(int, ActionFrame&); void Print() {} - double MinNonSelfDist2(Vec3 const&, Vec3 const&); + double MinNonSelfDist2(Vec3 const&, Vec3 const&, Box const&); - ImagedAction image_; - Matrix_3x3 ucell_, recip_; DataSet* dist_; ///< Will hold DataSet of calculated distances. DataSet* atom1_; DataSet* atom2_; diff --git a/src/Action_NMRrst.cpp b/src/Action_NMRrst.cpp index b89514f43c..5f33fc0912 100644 --- a/src/Action_NMRrst.cpp +++ b/src/Action_NMRrst.cpp @@ -9,6 +9,7 @@ #include "AtomMap.h" #include "ViewRst.h" #include "BufferedLine.h" +#include "DistRoutines.h" // CONSTRUCTOR Action_NMRrst::Action_NMRrst() : @@ -67,7 +68,7 @@ Action::RetType Action_NMRrst::Init(ArgList& actionArgs, ActionInit& init, int d # endif debug_ = debugIn; // Get Keywords - Image_.InitImaging( !(actionArgs.hasKey("noimage")) ); + imageOpt_.InitImaging( !(actionArgs.hasKey("noimage")) ); useMass_ = !(actionArgs.hasKey("geom")); findNOEs_ = actionArgs.hasKey("findnoes"); findOutput_ = init.DFL().AddCpptrajFile(actionArgs.GetStringKey("findout"), "Found NOEs", @@ -161,7 +162,7 @@ Action::RetType Action_NMRrst::Init(ArgList& actionArgs, ActionInit& init, int d mprintf("\t\t[%s] to [%s]\n", mp->first.MaskString(), mp->second.MaskString()); mprintf("\tSpecified NOE data will be written to '%s'\n", specOutput_->Filename().full()); } - if (!Image_.UseImage()) + if (!imageOpt_.UseImage()) mprintf("\tNon-imaged"); else mprintf("\tImaged"); @@ -480,8 +481,8 @@ Action::RetType Action_NMRrst::Setup(ActionSetup& setup) { } } // Set up imaging info for this parm - Image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); - if (Image_.ImagingEnabled()) + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); + if (imageOpt_.ImagingEnabled()) mprintf("\tImaged.\n"); else mprintf("\tImaging off.\n"); @@ -516,10 +517,10 @@ void Action_NMRrst::ProcessNoeArray(NOEtypeArray& Narray, Frame const& frameIn, { for (unsigned int idx2 = 0; idx2 != my_noe->Site2().Nindices(); ++idx2) { - double dist2 = DIST2(frameIn.XYZ(my_noe->Site1().Idx(idx1)), + double dist2 = DIST2(imageOpt_.ImagingType(), + frameIn.XYZ(my_noe->Site1().Idx(idx1)), frameIn.XYZ(my_noe->Site2().Idx(idx2)), - Image_.ImageType(), frameIn.BoxCrd(), - ucell_, recip_); + frameIn.BoxCrd()); if (shortest_dist2 < 0.0 || dist2 < shortest_dist2) { shortest_dist2 = dist2; shortest_idx1 = idx1; @@ -534,11 +535,10 @@ void Action_NMRrst::ProcessNoeArray(NOEtypeArray& Narray, Frame const& frameIn, // Action_NMRrst::DoAction() Action::RetType Action_NMRrst::DoAction(int frameNum, ActionFrame& frm) { - double Dist; Vec3 a1, a2; - if (Image_.ImageType() == NONORTHO) - frm.Frm().BoxCrd().ToRecip(ucell_, recip_); + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); // NOEs from file. for (noeDataArray::iterator noe = NOEs_.begin(); noe != NOEs_.end(); ++noe) { if ( noe->active_ ) { @@ -550,12 +550,8 @@ Action::RetType Action_NMRrst::DoAction(int frameNum, ActionFrame& frm) { a2 = frm.Frm().VGeometricCenter( noe->dMask2_ ); } - switch ( Image_.ImageType() ) { - case NONORTHO: Dist = DIST2_ImageNonOrtho(a1, a2, ucell_, recip_); break; - case ORTHO: Dist = DIST2_ImageOrtho(a1, a2, frm.Frm().BoxCrd()); break; - case NOIMAGE: Dist = DIST2_NoImage(a1, a2); break; - } - Dist = sqrt(Dist); + double Dist = DIST(imageOpt_.ImagingType(), a1, a2, frm.Frm().BoxCrd()); + noe->dist_->Add(frameNum, &Dist); } } diff --git a/src/Action_NMRrst.h b/src/Action_NMRrst.h index b5ca70e174..56179786bc 100644 --- a/src/Action_NMRrst.h +++ b/src/Action_NMRrst.h @@ -1,7 +1,7 @@ #ifndef INC_ACTION_NMRRST_H #define INC_ACTION_NMRRST_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" #include "CharMask.h" class BufferedLine; // Class: Action_NMRrst @@ -57,8 +57,7 @@ class Action_NMRrst: public Action { int CheckSameResidue(Topology const&, AtomMask const&) const; void AnalyzeNoeArray(NOEtypeArray&, CpptrajFile*) const; - ImagedAction Image_; - Matrix_3x3 ucell_, recip_; + ImageOption imageOpt_; ///< Decide whether to use imaging std::string setname_; CpptrajFile* findOutput_; CpptrajFile* specOutput_; diff --git a/src/Action_NativeContacts.cpp b/src/Action_NativeContacts.cpp index b686e68b0f..e27e7a65b1 100644 --- a/src/Action_NativeContacts.cpp +++ b/src/Action_NativeContacts.cpp @@ -121,8 +121,7 @@ int Action_NativeContacts::SetupContactLists(Topology const& parmIn, Frame const */ #define SetNativeContact() { \ if (ValidContact(*c1, *c2, parmIn)) { \ - double Dist2 = DIST2(fIn.XYZ(*c1), fIn.XYZ(*c2), image_.ImageType(), \ - fIn.BoxCrd(), ucell_, recip_); \ + double Dist2 = DIST2(imageOpt_.ImagingType(), fIn.XYZ(*c1), fIn.XYZ(*c2), fIn.BoxCrd()); \ minDist2 = std::min( Dist2, minDist2 ); \ maxDist2 = std::max( Dist2, maxDist2 ); \ if (Dist2 < distance_) { \ @@ -263,7 +262,7 @@ Action::RetType Action_NativeContacts::Init(ArgList& actionArgs, ActionInit& ini masterDSL_ = init.DslPtr(); debug_ = debugIn; // Get Keywords - image_.InitImaging( !(actionArgs.hasKey("noimage")) ); + imageOpt_.InitImaging( !(actionArgs.hasKey("noimage")) ); double dist = actionArgs.getKeyDouble("distance", 7.0); byResidue_ = actionArgs.hasKey("byresidue"); resoffset_ = actionArgs.getKeyInt("resoffset", 0) + 1; @@ -403,7 +402,7 @@ Action::RetType Action_NativeContacts::Init(ArgList& actionArgs, ActionInit& ini if (saveNonNative_) mprintf("\tSaving non-native contacts as well (may use a lot of memory).\n"); mprintf("\tDistance cutoff is %g Angstroms,", sqrt(distance_)); - if (!image_.UseImage()) + if (!imageOpt_.UseImage()) mprintf(" imaging is off.\n"); else mprintf(" imaging is on.\n"); @@ -456,9 +455,7 @@ Action::RetType Action_NativeContacts::Init(ArgList& actionArgs, ActionInit& ini // Set up reference if necessary. if (!first_) { // Set up imaging info for ref parm - image_.SetupImaging( REF.CoordsInfo().TrajBox().Type() ); - if (image_.ImageType() == NONORTHO) - REF.Coord().BoxCrd().ToRecip(ucell_, recip_); + imageOpt_.SetupImaging( REF.CoordsInfo().TrajBox().HasBox() ); if (DetermineNativeContacts( REF.Parm(), REF.Coord() )) return Action::ERR; } return Action::OK; @@ -473,8 +470,8 @@ Action::RetType Action_NativeContacts::Setup(ActionSetup& setup) { if (Mask2_.MaskStringSet()) mprintf("\t%i potential contact sites for '%s'\n", Mask2_.Nselected(), Mask2_.MaskString()); // Set up imaging info for this parm - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); - if (image_.ImagingEnabled()) + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); + if (imageOpt_.ImagingEnabled()) mprintf("\tImaging enabled.\n"); else mprintf("\tImaging disabled.\n"); @@ -496,8 +493,7 @@ bool Action_NativeContacts::ValidContact(int a1, int a2, Topology const& parmIn) */ #define UpdateNativeContact(M1_, M2_, CI1_, CI2_) { \ if (ValidContact(M1_[c1], M2_[c2], *CurrentParm_)) { \ - double Dist2 = DIST2(frm.Frm().XYZ(M1_[c1]), frm.Frm().XYZ(M2_[c2]), \ - image_.ImageType(), frm.Frm().BoxCrd(), ucell_, recip_); \ + double Dist2 = DIST2(imageOpt_.ImagingType(), frm.Frm().XYZ(M1_[c1]), frm.Frm().XYZ(M2_[c2]), frm.Frm().BoxCrd()); \ minDist2 = std::min( Dist2, minDist2 ); \ maxDist2 = std::max( Dist2, maxDist2 ); \ if (Dist2 < distance_) { \ @@ -543,7 +539,8 @@ bool Action_NativeContacts::ValidContact(int a1, int a2, Topology const& parmIn) // Action_NativeContacts::DoAction() Action::RetType Action_NativeContacts::DoAction(int frameNum, ActionFrame& frm) { - if (image_.ImageType() == NONORTHO) frm.Frm().BoxCrd().ToRecip(ucell_, recip_); + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); if (first_) { mprintf("\tUsing first frame to determine native contacts.\n"); if (DetermineNativeContacts( *CurrentParm_, frm.Frm() )) return Action::ERR; diff --git a/src/Action_NativeContacts.h b/src/Action_NativeContacts.h index bc1f8a5872..399940b035 100644 --- a/src/Action_NativeContacts.h +++ b/src/Action_NativeContacts.h @@ -2,9 +2,9 @@ #define INC_ACTION_NATIVECONTACTS_H #include #include "Action.h" -#include "ImagedAction.h" #include "DataSet_MatrixDbl.h" #include "DataSet_integer.h" +#include "ImageOption.h" /// Calculate the number of native/non-native contacts based on distance /** Intended to combine and replace contacts, mindist, and maxdist actions. */ @@ -48,7 +48,7 @@ class Action_NativeContacts : public Action { bool seriesUpdated_; ///< True once time series have been updated for total # frames. bool saveNonNative_; ///< If true save details for non native contacts as well. bool determineNativeContacts_; ///< If false, skip native contact determination. - ImagedAction image_; ///< Hold imaging-related info/routines. + ImageOption imageOpt_; ///< Decide whether imaging is needed AtomMask Mask1_; ///< First mask in which to search AtomMask Mask2_; ///< Second mask in which to search Iarray contactIdx1_; ///< Hold atom/residue indices for Mask1 (for map) @@ -71,7 +71,6 @@ class Action_NativeContacts : public Action { const Topology* refParm_; ///< For printing out contact PDB. // TODO: Replace these with new DataSet type DataSetList* masterDSL_; - Matrix_3x3 ucell_, recip_; /// Define contact, atom pair. class contactType; /// Define contact pair. diff --git a/src/Action_OrderParameter.cpp b/src/Action_OrderParameter.cpp index f0a14efb59..140b996f4f 100644 --- a/src/Action_OrderParameter.cpp +++ b/src/Action_OrderParameter.cpp @@ -45,7 +45,7 @@ Action::RetType Action_OrderParameter::Init(ArgList& actionArgs, ActionInit& ini std::string mask; - InitImaging(true); + //imageOpt_.InitImaging(true); std::string outfileName = actionArgs.GetStringKey("out"); @@ -143,7 +143,7 @@ Action::RetType Action_OrderParameter::Setup(ActionSetup& setup) { std::vector::iterator mask; - SetupImaging(setup.CoordInfo().TrajBox().Type() ); + //imageOpt_.SetupImaging(setup.CoordInfo().TrajBox().HasBox() ); if (!scd_) { diff --git a/src/Action_OrderParameter.h b/src/Action_OrderParameter.h index 60595205f9..1a87845d6d 100644 --- a/src/Action_OrderParameter.h +++ b/src/Action_OrderParameter.h @@ -4,7 +4,6 @@ #define INC_ACTION_ORDERPARAMETER_H #include "Action.h" -#include "ImagedAction.h" #include "OnlineVarT.h" @@ -12,7 +11,7 @@ /** \author Hannes H. Loeffler */ -class Action_OrderParameter : public Action, ImagedAction { +class Action_OrderParameter : public Action { public: Action_OrderParameter(); @@ -48,6 +47,7 @@ class Action_OrderParameter : public Action, ImagedAction { std::vector > dbonds_; bool scd_; + //ImageOption imageOpt_; ///< Used to decide if imaging should be used. unsigned long maxbin_; std::vector > tailhist_; diff --git a/src/Action_PairDist.cpp b/src/Action_PairDist.cpp index 301260974b..60c92f58fc 100644 --- a/src/Action_PairDist.cpp +++ b/src/Action_PairDist.cpp @@ -15,15 +15,15 @@ Action_PairDist::Action_PairDist() : delta_(0.0), maxbin_(0), - same_mask_(false), - ub1_(0), - ub2_(0) + single_mask_(false), + nframes_(0) {} void Action_PairDist::Help() const { mprintf("\t[out ] mask [mask2 ] [delta ]\n" - "\t[maxdist ]\n" - " Calculate pair distribution function P(r) between two masks.\n" + "\t[maxdist ] [noimage]\n" + " Calculate pair distribution function P(r) within a single mask\n" + " or between two masks.\n" " If 'maxdist' is specified the initial histogram max size will be set to\n" " ; if larger distances are encountered the histogram will be\n" " resized appropriately.\n"); @@ -35,7 +35,8 @@ Action::RetType Action_PairDist::Init(ArgList& actionArgs, ActionInit& init, int # ifdef MPI trajComm_ = init.TrajComm(); # endif - InitImaging(true); + nframes_ = 0; + imageOpt_.InitImaging( !actionArgs.hasKey("noimage") ); delta_ = actionArgs.getKeyDouble("delta", 0.01); double maxDist = actionArgs.getKeyDouble("maxdist", -1.0); if (maxDist > 0.0) { @@ -44,30 +45,22 @@ Action::RetType Action_PairDist::Init(ArgList& actionArgs, ActionInit& init, int } DataFile* outfile = init.DFL().AddDataFile( actionArgs.GetStringKey("out"), actionArgs ); - + // Get first mask std::string mask1 = actionArgs.GetStringKey("mask"); - if (mask1.empty()) { mprinterr("Error: pairdist: No mask1 specified.\n"); return Action::ERR; } - if (mask1_.SetMaskString(mask1)) return Action::ERR; - + // Get second mask if specified std::string mask2 = actionArgs.GetStringKey("mask2"); - if (mask2.empty()) { - same_mask_ = true; - if (mask2_.SetMaskString(mask1)) return Action::ERR; + single_mask_ = true; } else { if (mask2_.SetMaskString(mask2)) return Action::ERR; - - if (mask1_.MaskExpression() != mask2_.MaskExpression() ) - same_mask_ = false; - else - same_mask_ = true; + single_mask_ = false; } - + // Set up data sets std::string dsname = actionArgs.GetStringNext(); if (dsname.empty()) dsname = init.DSL().GenerateDefaultName("PDIST"); @@ -87,7 +80,7 @@ Action::RetType Action_PairDist::Init(ArgList& actionArgs, ActionInit& init, int # endif mprintf(" PAIRDIST: Calculate P(r)"); - if (!same_mask_) + if (!single_mask_) mprintf(" between atoms selected by '%s' and '%s'\n", mask1_.MaskString(), mask2_.MaskString()); else mprintf(" for atoms selected by '%s'\n", mask1_.MaskString()); @@ -96,6 +89,10 @@ Action::RetType Action_PairDist::Init(ArgList& actionArgs, ActionInit& init, int mprintf("\tResolution is %f Ang.\n", delta_); if (maxDist > 0.0) mprintf("\tInitial histogram max distance= %f Ang\n", maxDist); + if (imageOpt_.UseImage()) + mprintf("\tImaging enabled if box info present.\n"); + else + mprintf("\tNo imaging.\n"); # ifdef MPI if (trajComm_.Size() > 1 && maxDist < 0.0) mprintf("Warning: Due to the way 'pairdist' currently accumulates data, the\n" @@ -109,98 +106,107 @@ Action::RetType Action_PairDist::Init(ArgList& actionArgs, ActionInit& init, int // Action_PairDist::Setup() Action::RetType Action_PairDist::Setup(ActionSetup& setup) { + // Set up first mask if (setup.Top().SetupIntegerMask(mask1_) ) return Action::ERR; - mprintf("\t"); mask1_.BriefMaskInfo(); - if (mask1_.None()) { mprintf("Warning: Mask has no atoms.\n"); return Action::SKIP; } - - if (setup.Top().SetupIntegerMask(mask2_) ) return Action::ERR; - - mask2_.BriefMaskInfo(); - mprintf("\n"); - - if (mask2_.None()) { - mprintf("Warning: PairDist::setup: Mask2 has no atoms.\n"); - return Action::SKIP; - } - - if (mask1_.MaskExpression() != mask2_.MaskExpression() && - mask1_.NumAtomsInCommon(mask2_) > 0) { - mprinterr("Error: mask expressions must be either " - "exactly the same\n\t(equivalent to mask2 omitted) or masks must " - "be non-overlapping.\n"); - return Action::ERR; - } - - if (same_mask_) { - ub1_ = mask1_.Nselected() - 1; - ub2_ = mask1_.Nselected(); - } else { - ub1_ = mask1_.Nselected(); - ub2_ = mask2_.Nselected(); + // Set up second mask if specified + if (!single_mask_) { + if (setup.Top().SetupIntegerMask(mask2_) ) return Action::ERR; + mask2_.BriefMaskInfo(); + mprintf("\n"); + if (mask2_.None()) { + mprintf("Warning: Second mask has no atoms.\n"); + return Action::SKIP; + } + int numInCommon = mask1_.NumAtomsInCommon( mask2_ ); + if (numInCommon > 0) { + mprinterr("Error: Masks must be non-overlapping (currently %i atoms in common.)\n", + numInCommon); + return Action::ERR; + } } - - SetupImaging(setup.CoordInfo().TrajBox().Type() ); + // See if imaging is possible + imageOpt_.SetupImaging(setup.CoordInfo().TrajBox().HasBox() ); + if (imageOpt_.ImagingEnabled()) + mprintf("\tDistances will be imaged.\n"); return Action::OK; } +/** Do histogram binning */ +void Action_PairDist::BinHist( std::vector& tmp, + const double* XYZ1, const double* XYZ2, Box const& box) +{ + double Dist = DIST(imageOpt_.ImagingType(), XYZ1, XYZ2, box); + + unsigned long bin = (unsigned long) (Dist / delta_); + // Resize on the fly if necessary + if (bin > maxbin_) { + maxbin_ = bin; + tmp.resize(maxbin_ + 1); + histogram_.resize(maxbin_ + 1); + } + //if (bin == 326) rprintf("DEBUG: Bin 326 frame %i idx1 %i idx2 %i %f\n", frame_, idx1_, idx2_, Dist); + tmp[bin]++; +} -// Action_PairDist::action() +// Action_PairDist::DoAction() Action::RetType Action_PairDist::DoAction(int frameNum, ActionFrame& frm) { - unsigned long bin, j; - double Dist = 0.0; - Matrix_3x3 ucell, recip; - Vec3 a1, a2; - std::vector tmp; // per frame histogram - - - tmp.resize(histogram_.size() ); - - for (unsigned long i = 0; i < ub1_; i++) { - for (same_mask_ ? j = i + 1 : j = 0; j < ub2_; j++) { - a1 = frm.Frm().XYZ(mask1_[i]); - a2 = frm.Frm().XYZ(mask2_[j]); - - switch (ImageType() ) { - case NONORTHO: - frm.Frm().BoxCrd().ToRecip(ucell, recip); - Dist = DIST2_ImageNonOrtho(a1, a2, ucell, recip); - break; - case ORTHO: - Dist = DIST2_ImageOrtho(a1, a2, frm.Frm().BoxCrd()); - break; - case NOIMAGE: - Dist = DIST2_NoImage(a1, a2); - break; + std::vector tmp(histogram_.size(), 0); // per frame histogram + + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); + + if (single_mask_) { + // Only 1 mask + for (int idx1 = 0; idx1 != mask1_.Nselected(); idx1++) { + for (int idx2 = idx1 + 1; idx2 != mask1_.Nselected(); idx2++) { + //frame_ = frameNum; // DEBUG + //idx1_ = idx1; // DEBUG + //idx2_ = idx2; // DEBUG + BinHist(tmp, frm.Frm().XYZ(mask1_[idx1]), frm.Frm().XYZ(mask1_[idx2]), frm.Frm().BoxCrd()); } - - bin = (unsigned long) (sqrt(Dist) / delta_); - - if (bin > maxbin_) { - maxbin_ = bin; - tmp.resize(maxbin_ + 1); - histogram_.resize(maxbin_ + 1); + } + } else { + // 2 non-overlapping masks + for (int idx1 = 0; idx1 != mask1_.Nselected(); idx1++) { + for (int idx2 = 0; idx2 != mask2_.Nselected(); idx2++) { + BinHist(tmp, frm.Frm().XYZ(mask1_[idx1]), frm.Frm().XYZ(mask2_[idx2]), frm.Frm().BoxCrd()); } - - tmp[bin]++; } } - // FIXME: may be inefficient to call accumulate() on every data point - // -> pass "array" to accumulate()? - for (unsigned long i = 0; i < tmp.size(); i++) { + // Update the overall histogram + for (unsigned long i = 0; i < tmp.size(); i++) histogram_[i].accumulate(tmp[i]); - } + + nframes_++; return Action::OK; } +/** Since the histogram can be resized on-the-fly, there may be bins in + * histogram_ not present at the start of the calculation. These bins + * need to have their n_ field updated to the actual number of frames + * so it is as if they were present from the start. + */ +void Action_PairDist::UpdateHistogramFrames() { + for (unsigned long i = 0; i < histogram_.size(); i++) + { + unsigned int ndata = (unsigned int)histogram_[i].nData(); + if (ndata != nframes_) { + //rprintf("DEBUG: Hist bin %lu frames does not match (%u vs %u)\n", i, ndata, nframes_); + for (unsigned int idx = ndata; idx < nframes_; idx++) + histogram_[i].accumulate( 0 ); + } + } +} + #ifdef MPI /** Calculate overall average/stdev for histogram bins using the parallel * form of the Online algorithm ( Chan, T.F.; Golub, G.H.; LeVeque, R.J. @@ -216,6 +222,27 @@ Action::RetType Action_PairDist::DoAction(int frameNum, ActionFrame& frm) { */ int Action_PairDist::SyncAction() { if (trajComm_.Size() > 1) { + //rprintf("DEBUG: Total number of frames: %u\n", nframes_); + // Ensure histogram bins have the correct count on this rank + UpdateHistogramFrames(); + // Get the total number of frames on all ranks. + unsigned int myframes = nframes_; + trajComm_.AllReduce(&nframes_, &myframes, 1, MPI_UNSIGNED, MPI_SUM); +/* + // DEBUG - Print out histogram on each rank. + for (int rank = 0; rank < trajComm_.Size(); rank++) { + if ( rank == trajComm_.Rank() ) { + rprintf("DEBUG: Histogram for rank.\n"); + for (unsigned long i = 0; i < histogram_.size(); i++) { + double dist = ((double) i + 0.5) * delta_; + rprintf("DEBUG:\t%12lu %12.4f %12.4f %12.4f %12.4f\n", i, dist, histogram_[i].mean(), histogram_[i].M2(), histogram_[i].nData()); + } + } + trajComm_.Barrier(); + } + trajComm_.Barrier(); + // END DEBUG +*/ std::vector buffer; unsigned long rank_size; if (trajComm_.Master()) { @@ -265,19 +292,21 @@ int Action_PairDist::SyncAction() { // Action_PairDist::print() void Action_PairDist::Print() { + // Ensure bins not present at the beginning are properly updated + UpdateHistogramFrames(); // Set DataSets X dim Dimension Xdim( 0.5 * delta_, delta_, "Distance" ); Pr_->SetDim(Dimension::X, Xdim); std_->SetDim(Dimension::X, Xdim); - double dist, Pr, sd; - + //mprintf("DEBUG: Final result:\n"); for (unsigned long i = 0; i < histogram_.size(); i++) { - Pr = histogram_[i].mean() / delta_; + //mprintf("DEBUG:\t%12lu %12.4f %12.4f %12.4f %12.4f\n", i, ((double) i + 0.5) * delta_, histogram_[i].mean(), histogram_[i].M2(), histogram_[i].nData()); + double Pr = histogram_[i].mean() / delta_; if (Pr > 0.0) { - dist = ((double) i + 0.5) * delta_; - sd = sqrt(histogram_[i].variance() ); + double dist = ((double) i + 0.5) * delta_; + double sd = sqrt(histogram_[i].variance() ); ((DataSet_Mesh*) Pr_)->AddXY(dist, Pr); ((DataSet_Mesh*) std_)->AddXY(dist, sd); } diff --git a/src/Action_PairDist.h b/src/Action_PairDist.h index e350bb7498..8240c571d0 100644 --- a/src/Action_PairDist.h +++ b/src/Action_PairDist.h @@ -3,11 +3,13 @@ #define INC_ACTION_PAIRDIST_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" #include "OnlineVarT.h" /** \author Hannes H. Loeffler + * Updated by DRR to ensure results do not change depending on # processes + * used and/or initial max size of the histogram. */ -class Action_PairDist : public Action, ImagedAction { +class Action_PairDist : public Action { public: Action_PairDist(); @@ -25,16 +27,19 @@ class Action_PairDist : public Action, ImagedAction { # endif void Print(); + inline void BinHist(std::vector&, const double*, const double*, Box const&); + void UpdateHistogramFrames(); + DataSet *Pr_; ///< distance vs P(r) DataSet *std_; ///< distance vs std AtomMask mask1_; AtomMask mask2_; - double delta_; ///< resolution - std::vector > histogram_; - unsigned long maxbin_; - - bool same_mask_; - unsigned long ub1_; - unsigned long ub2_; + double delta_; ///< histogram resolution + std::vector > histogram_; ///< The final histogram + unsigned long maxbin_; ///< Index of current maximum histogram bin + ImageOption imageOpt_; ///< Used to decide if imaging should be used + bool single_mask_; ///< True if only 1 mask specified, false if 2 + unsigned int nframes_; ///< Used to update ndata in bins not present at start + //int frame_, idx1_, idx2_; // DEBUG }; #endif diff --git a/src/Action_Principal.cpp b/src/Action_Principal.cpp index 6967a5f562..98cb9d4766 100644 --- a/src/Action_Principal.cpp +++ b/src/Action_Principal.cpp @@ -78,8 +78,6 @@ Action::RetType Action_Principal::Setup(ActionSetup& setup) { mprintf("Warning: No atoms selected for %s [%s].\n",setup.Top().c_str(), mask_.MaskString()); return Action::SKIP; } - if (doRotation_) - Action::CheckImageRotationWarning(setup, "principal alignment"); return Action::OK; } @@ -112,6 +110,7 @@ Action::RetType Action_Principal::DoAction(int frameNum, ActionFrame& frm) { // inverse rotation. if (doRotation_) { frm.ModifyFrm().Rotate( Inertia ); + frm.ModifyFrm().ModifyBox().RotateUcell( Inertia ); return Action::MODIFY_COORDS; } return Action::OK; diff --git a/src/Action_Radial.cpp b/src/Action_Radial.cpp index 02527054b3..c040ac3458 100644 --- a/src/Action_Radial.cpp +++ b/src/Action_Radial.cpp @@ -3,6 +3,7 @@ #include "Action_Radial.h" #include "CpptrajStdio.h" #include "Constants.h" // FOURTHIRDSPI +#include "DistRoutines.h" #ifdef _OPENMP # include #endif @@ -57,7 +58,7 @@ Action::RetType Action_Radial::Init(ArgList& actionArgs, ActionInit& init, int d # endif debug_ = debugIn; // Get Keywords - image_.InitImaging( !(actionArgs.hasKey("noimage")) ); + imageOpt_.InitImaging( !(actionArgs.hasKey("noimage")) ); std::string outfilename = actionArgs.GetStringKey("out"); // Default particle density (mols/Ang^3) for water based on 1.0 g/mL density_ = actionArgs.getKeyDouble("density",0.033456); @@ -223,7 +224,7 @@ Action::RetType Action_Radial::Init(ArgList& actionArgs, ActionInit& init, int d mprintf("\tNormalizing based on cell volume.\n"); else mprintf("\tNormalizing using particle density of %f molecules/Ang^3.\n",density_); - if (!image_.UseImage()) + if (!imageOpt_.UseImage()) mprintf("\tImaging disabled.\n"); if (numthreads_ > 1) mprintf("\tParallelizing RDF calculation with %i threads.\n",numthreads_); @@ -322,7 +323,7 @@ Action::RetType Action_Radial::Setup(ActionSetup& setup) { mprintf("Warning: Second mask has no atoms.\n"); return Action::SKIP; } - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); // If not computing center for mask 1 or 2, make the outer loop for distance // calculation correspond to the mask with the most atoms. @@ -382,7 +383,7 @@ Action::RetType Action_Radial::Setup(ActionSetup& setup) { } // Check volume information - if (useVolume_ && setup.CoordInfo().TrajBox().Type()==Box::NOBOX) { + if (useVolume_ && !setup.CoordInfo().TrajBox().HasBox()) { mprintf("Warning: 'volume' specified but no box information for %s, skipping.\n", setup.Top().c_str()); return Action::SKIP; @@ -396,7 +397,7 @@ Action::RetType Action_Radial::Setup(ActionSetup& setup) { mprintf("\t%i atoms in Mask1, %i atoms in Mask2\n", Mask1_.Nselected(), Mask2_.Nselected()); } - if (image_.ImagingEnabled()) + if (imageOpt_.ImagingEnabled()) mprintf("\tImaging on.\n"); else mprintf("\tImaging off.\n"); @@ -410,20 +411,17 @@ Action::RetType Action_Radial::Setup(ActionSetup& setup) { // NOTE: Because of maximum2 not essential to check idx>numBins? Action::RetType Action_Radial::DoAction(int frameNum, ActionFrame& frm) { double D; - Matrix_3x3 ucell, recip; int atom1, atom2; int nmask1, nmask2; int idx; # ifdef _OPENMP int mythread; # endif - - // Set imaging information and store volume if specified - // NOTE: Ucell and recip only needed for non-orthogonal boxes. - if (image_.ImagingEnabled() || useVolume_) { - D = frm.Frm().BoxCrd().ToRecip(ucell,recip); - if (useVolume_) volume_ += D; - } + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); + // Store volume if specified + if (useVolume_) + volume_ += frm.Frm().BoxCrd().CellVolume(); // --------------------------------------------- if ( rmode_ == NORMAL ) { // Calculation of all atoms in Mask1 to all atoms in Mask2 @@ -441,8 +439,7 @@ Action::RetType Action_Radial::DoAction(int frameNum, ActionFrame& frm) { for (nmask2 = 0; nmask2 < inner_max; nmask2++) { atom2 = InnerMask_[nmask2]; if (atom1 != atom2) { - D = DIST2( frm.Frm().XYZ(atom1), frm.Frm().XYZ(atom2), - image_.ImageType(), frm.Frm().BoxCrd(), ucell, recip); + D = DIST2( imageOpt_.ImagingType(), frm.Frm().XYZ(atom1), frm.Frm().XYZ(atom2), frm.Frm().BoxCrd() ); if (D <= maximum2_) { // NOTE: Can we modify the histogram to store D^2? D = sqrt(D); @@ -479,8 +476,7 @@ Action::RetType Action_Radial::DoAction(int frameNum, ActionFrame& frm) { for (nmask2 = 0; nmask2 < inner_max; nmask2++) { atom2 = InnerMask_[nmask2]; if ( (*currentParm_)[atom1].MolNum() != (*currentParm_)[atom2].MolNum() ) { - D = DIST2( frm.Frm().XYZ(atom1), frm.Frm().XYZ(atom2), - image_.ImageType(), frm.Frm().BoxCrd(), ucell, recip); + D = DIST2( imageOpt_.ImagingType(), frm.Frm().XYZ(atom1), frm.Frm().XYZ(atom2), frm.Frm().BoxCrd()); if (D <= maximum2_) { // NOTE: Can we modify the histogram to store D^2? D = sqrt(D); @@ -517,8 +513,7 @@ Action::RetType Action_Radial::DoAction(int frameNum, ActionFrame& frm) { { if (site1 != *site2) { Vec3 com2 = frm.Frm().VGeometricCenter( *site2 ); - D = DIST2(com1.Dptr(), com2.Dptr(), image_.ImageType(), - frm.Frm().BoxCrd(), ucell, recip); + D = DIST2(imageOpt_.ImagingType(), com1.Dptr(), com2.Dptr(), frm.Frm().BoxCrd()); if (D <= maximum2_) { D = sqrt(D); //mprintf("MASKLOOP: %10i %10i %10.4f\n",atom1,atom2,D); @@ -549,8 +544,7 @@ Action::RetType Action_Radial::DoAction(int frameNum, ActionFrame& frm) { # endif for (nmask2 = 0; nmask2 < mask2_max; nmask2++) { atom2 = InnerMask_[nmask2]; - D = DIST2(coord_center.Dptr(), frm.Frm().XYZ(atom2), image_.ImageType(), - frm.Frm().BoxCrd(), ucell, recip); + D = DIST2(imageOpt_.ImagingType(), coord_center.Dptr(), frm.Frm().XYZ(atom2), frm.Frm().BoxCrd()); if (D <= maximum2_) { // NOTE: Can we modify the histogram to store D^2? D = sqrt(D); diff --git a/src/Action_Radial.h b/src/Action_Radial.h index 0c255348b3..24e83df6b3 100644 --- a/src/Action_Radial.h +++ b/src/Action_Radial.h @@ -1,7 +1,7 @@ #ifndef INC_ACTION_RADIAL_H #define INC_ACTION_RADIAL_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" /// Calculate the radial distribution (pair correlation) function. class Action_Radial: public Action { public: @@ -25,7 +25,7 @@ class Action_Radial: public Action { # ifdef _OPENMP bool threadsCombined_; ///< True if CombineRdfThreads() has been called. # endif - ImagedAction image_; ///< Image routines. + ImageOption imageOpt_; ///< Used to decide if imaging should be used. Iarray RDF_; ///< Hold bin counts. std::vector rdf_thread_; ///< Hold bin count on each thread. AtomMask Mask1_; ///< Atoms to calculate RDF for. diff --git a/src/Action_RandomizeIons.cpp b/src/Action_RandomizeIons.cpp index 7712189a8b..d3b85ae9ea 100644 --- a/src/Action_RandomizeIons.cpp +++ b/src/Action_RandomizeIons.cpp @@ -1,6 +1,7 @@ #include // sqrt #include "Action_RandomizeIons.h" #include "CpptrajStdio.h" +#include "DistRoutines.h" // CONSTRUCTOR Action_RandomizeIons::Action_RandomizeIons() : @@ -28,7 +29,7 @@ Action::RetType Action_RandomizeIons::Init(ArgList& actionArgs, ActionInit& init if (ions_.SetMaskString( ionmask )) return Action::ERR; // Get Keywords - image_.InitImaging( !actionArgs.hasKey("noimage") ); + imageOpt_.InitImaging( !actionArgs.hasKey("noimage") ); int seed = actionArgs.getKeyInt("seed", -1); overlap_ = actionArgs.getKeyDouble("overlap", 3.5); min_ = actionArgs.getKeyDouble("by", 3.5); @@ -48,7 +49,7 @@ Action::RetType Action_RandomizeIons::Init(ArgList& actionArgs, ActionInit& init if (around_.MaskStringSet()) mprintf("\tNo ion can get closer than %.2f angstroms to atoms in mask '%s'\n", sqrt( min_ ), around_.MaskString()); - if (!image_.UseImage()) + if (!imageOpt_.UseImage()) mprintf("\tImaging of the coordinates will not be performed.\n"); if (seed > 0) mprintf("\tRandom number generator seed is %i\n", seed); @@ -109,7 +110,7 @@ Action::RetType Action_RandomizeIons::Setup(ActionSetup& setup) { solvMols_.push_back( Mol->MolUnit() ); } } - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); // Allocate solvent molecule considered for swap mask solvent_.resize( solvMols_.size() ); @@ -118,10 +119,8 @@ Action::RetType Action_RandomizeIons::Setup(ActionSetup& setup) { // Action_RandomizeIons::DoAction() Action::RetType Action_RandomizeIons::DoAction(int frameNum, ActionFrame& frm) { - Matrix_3x3 ucell, recip; - - if (image_.ImageType() == NONORTHO) - frm.Frm().BoxCrd().ToRecip(ucell, recip); + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); // Loop over all solvent molecules and mark those that are too close to the solute int n_active_solvent = 0; for (unsigned int idx = 0; idx != solvMols_.size(); idx++) { @@ -132,8 +131,7 @@ Action::RetType Action_RandomizeIons::DoAction(int frameNum, ActionFrame& frm) { const double* solventXYZ = frm.Frm().XYZ( solvMols_[idx].Front() ); for (AtomMask::const_iterator atom = around_.begin(); atom != around_.end(); ++atom) { - double dist = DIST2( solventXYZ, frm.Frm().XYZ(*atom), image_.ImageType(), - frm.Frm().BoxCrd(), ucell, recip); + double dist = DIST2( imageOpt_.ImagingType(), solventXYZ, frm.Frm().XYZ(*atom), frm.Frm().BoxCrd() ); if (dist < min_) { solvent_[idx] = false; //mprintf("RANDOMIZEIONS: water %i only %.2f ang from around @%i\n", @@ -178,8 +176,7 @@ Action::RetType Action_RandomizeIons::DoAction(int frameNum, ActionFrame& frm) { for (AtomMask::const_iterator ion2 = ions_.begin(); ion2 != ions_.end(); ++ion2) { if (*ion1 != *ion2) { - double dist = DIST2( solventXYZ, frm.Frm().XYZ(*ion2), image_.ImageType(), - frm.Frm().BoxCrd(), ucell, recip); + double dist = DIST2( imageOpt_.ImagingType(), solventXYZ, frm.Frm().XYZ(*ion2), frm.Frm().BoxCrd() ); if (dist < overlap_) { // This solvent mol is too close to another ion. solvent_[idx] = false; diff --git a/src/Action_RandomizeIons.h b/src/Action_RandomizeIons.h index ab6bc51693..5d31049f99 100644 --- a/src/Action_RandomizeIons.h +++ b/src/Action_RandomizeIons.h @@ -1,7 +1,7 @@ #ifndef INC_ACTION_RANDOMIZEIONS_H #define INC_ACTION_RANDOMIZEIONS_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" #include "Random.h" /// Used to randomize ion positions by swapping with solvent molecules. class Action_RandomizeIons : public Action { @@ -15,7 +15,7 @@ class Action_RandomizeIons : public Action { Action::RetType DoAction(int, ActionFrame&); void Print() {} - ImagedAction image_; ///< Imaging routines. + ImageOption imageOpt_; ///< Used to determine if imaging should be used. Random_Number RN_; ///< Random number generator. AtomMask ions_; ///< Mask of ions to be moved. AtomMask around_; ///< The 'around' mask (region of space for ions to avoid) diff --git a/src/Action_ReplicateCell.cpp b/src/Action_ReplicateCell.cpp index a357d85b0b..398e99395f 100644 --- a/src/Action_ReplicateCell.cpp +++ b/src/Action_ReplicateCell.cpp @@ -33,8 +33,6 @@ static inline int toDigit(char c) { // Action_ReplicateCell::Init() Action::RetType Action_ReplicateCell::Init(ArgList& actionArgs, ActionInit& init, int debugIn) { - // Require imaging. - image_.InitImaging( true ); // Set up output traj std::string trajfilename = actionArgs.GetStringKey("out"); topWriter_.InitTopWriter( actionArgs, "replicated cell", debugIn ); @@ -135,10 +133,9 @@ Action::RetType Action_ReplicateCell::Setup(ActionSetup& setup) { mprintf("Warning: One or both masks have no atoms.\n"); return Action::SKIP; } - // Set up imaging info for this parm - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); - if (!image_.ImagingEnabled()) { - mprintf("Warning: Imaging cannot be performed for topology %s\n", setup.Top().c_str()); + // Check unit cell info for this parm + if (!setup.CoordInfo().TrajBox().HasBox()) { + mprintf("Warning: No box info, cannot replica cell for topology %s\n", setup.Top().c_str()); return Action::SKIP; } // Create combined topology. @@ -179,7 +176,6 @@ Action::RetType Action_ReplicateCell::DoAction(int frameNum, ActionFrame& frm) { unsigned int id; Vec3 frac, t2; - frm.Frm().BoxCrd().ToRecip(ucell_, recip_); int shift = Mask1_.Nselected() * 3; # ifdef _OPENMP # pragma omp parallel private(idx, newFrameIdx, id) firstprivate(frac, t2) @@ -188,14 +184,14 @@ Action::RetType Action_ReplicateCell::DoAction(int frameNum, ActionFrame& frm) { # endif for (idx = 0; idx < Mask1_.Nselected(); idx++) { // Convert to fractional coords - frac = recip_ * Vec3(frm.Frm().XYZ( Mask1_[idx] )); + frac = frm.Frm().BoxCrd().FracCell() * Vec3(frm.Frm().XYZ( Mask1_[idx] )); //mprintf("DEBUG: Atom %i frac={ %g %g %g }\n", Mask1_[idx]+1, frac[0], frac[1], frac[2]); // replicate in each direction newFrameIdx = idx * 3; for (id = 0; id != directionArray_.size(); id+=3, newFrameIdx += shift) { // Convert back to Cartesian coords. - t2 = ucell_.TransposeMult(frac + Vec3(directionArray_[id ], + t2 = frm.Frm().BoxCrd().UnitCell().TransposeMult(frac + Vec3(directionArray_[id ], directionArray_[id+1], directionArray_[id+2])); combinedFrame_[newFrameIdx ] = t2[0]; diff --git a/src/Action_ReplicateCell.h b/src/Action_ReplicateCell.h index 891bba4752..fef43d4b85 100644 --- a/src/Action_ReplicateCell.h +++ b/src/Action_ReplicateCell.h @@ -1,7 +1,6 @@ #ifndef INC_ACTION_REPLICATECELL_H #define INC_ACTION_REPLICATECELL_H #include "Action.h" -#include "ImagedAction.h" #include "Trajout_Single.h" #include "ActionTopWriter.h" // Forward declares @@ -18,8 +17,6 @@ class Action_ReplicateCell: public Action { Action::RetType DoAction(int, ActionFrame&); void Print() {} - ImagedAction image_; ///< Imaging routines - Matrix_3x3 ucell_, recip_; ///< Matrices for imaging typedef std::vector Iarray; Iarray directionArray_; ///< Array of directions to replicate (x,y,z) ActionTopWriter topWriter_; ///< Used to write replicated cell topology diff --git a/src/Action_Rmsd.cpp b/src/Action_Rmsd.cpp index 23c6b2a1d4..86674f6629 100644 --- a/src/Action_Rmsd.cpp +++ b/src/Action_Rmsd.cpp @@ -354,10 +354,6 @@ Action::RetType Action_Rmsd::Setup(ActionSetup& setup) { else if (err == 2) return Action::ERR; } - // Warn if PBC and rotating - if (fit_ && mode_ == ROT_AND_TRANS) - Action::CheckImageRotationWarning(setup, "the RMS-fit"); - return Action::OK; } @@ -382,6 +378,7 @@ Action::RetType Action_Rmsd::DoAction(int frameNum, ActionFrame& frm) { switch (mode_) { case ROT_AND_TRANS: frm.ModifyFrm().Trans_Rot_Trans(tgtTrans_, rot_, REF_.RefTrans()); + frm.ModifyFrm().ModifyBox().RotateUcell( rot_ ); err = Action::MODIFY_COORDS; break; case TRANS_ONLY: diff --git a/src/Action_Rotate.cpp b/src/Action_Rotate.cpp index b5458a503d..0cc1590922 100644 --- a/src/Action_Rotate.cpp +++ b/src/Action_Rotate.cpp @@ -2,10 +2,16 @@ #include "CpptrajStdio.h" #include "Constants.h" -// CONSTRUCTOR +/** CONSTRUCTOR */ Action_Rotate::Action_Rotate() : - rmatrices_(0), delta_(0.0), mode_(ROTATE), inverse_(false) { } + rmatrices_(0), + delta_(0.0), + mode_(ROTATE), + inverse_(false), + all_atoms_selected_(false) +{ } +/** Action help. */ void Action_Rotate::Help() const { mprintf("\t[] { [x ] [y ] [z ] |\n" "\t axis0 axis1 |\n" @@ -15,6 +21,7 @@ void Action_Rotate::Help() const { " the specified data set.\n"); } +/** Initialize action. */ Action::RetType Action_Rotate::Init(ArgList& actionArgs, ActionInit& init, int debugIn) { double xrot = 0.0, yrot = 0.0, zrot = 0.0; @@ -75,6 +82,7 @@ Action::RetType Action_Rotate::Init(ArgList& actionArgs, ActionInit& init, int d return Action::OK; } +/** Set up action. */ Action::RetType Action_Rotate::Setup(ActionSetup& setup) { if ( setup.Top().SetupIntegerMask( mask_ ) ) return Action::ERR; mask_.MaskInfo(); @@ -82,6 +90,11 @@ Action::RetType Action_Rotate::Setup(ActionSetup& setup) { mprintf("Warning: No atoms selected.\n"); return Action::SKIP; } + all_atoms_selected_ = (mask_.Nselected() == setup.Top().Natom()); + if (all_atoms_selected_) + mprintf("\tAll atoms selected for rotation. Rotating unit cell vectors as well.\n"); + else + mprintf("\tNot all atoms selected for rotation. Not rotating unit cell vectors.\n"); if (mode_ == AXIS) { if ( setup.Top().SetupIntegerMask( axis0_ ) || setup.Top().SetupIntegerMask( axis1_ ) ) @@ -93,23 +106,32 @@ Action::RetType Action_Rotate::Setup(ActionSetup& setup) { return Action::SKIP; } } - Action::CheckImageRotationWarning(setup, "the rotation"); return Action::OK; } +/** Do action. */ Action::RetType Action_Rotate::DoAction(int frameNum, ActionFrame& frm) { switch (mode_) { - case ROTATE : frm.ModifyFrm().Rotate(RotMatrix_, mask_); break; + case ROTATE : + frm.ModifyFrm().Rotate(RotMatrix_, mask_); + if (all_atoms_selected_) + frm.ModifyFrm().ModifyBox().RotateUcell( RotMatrix_ ); + break; case DATASET: if (frm.TrajoutNum() >= (int)rmatrices_->Size()) { mprintf("Warning: Frame %i out of range for set '%s'\n", frm.TrajoutNum()+1, rmatrices_->legend()); return Action::ERR; } - if (inverse_) + if (inverse_) { frm.ModifyFrm().InverseRotate((*rmatrices_)[frm.TrajoutNum()], mask_); - else + if (all_atoms_selected_) + frm.ModifyFrm().ModifyBox().InverseRotateUcell( (*rmatrices_)[frm.TrajoutNum()] ); + } else { frm.ModifyFrm().Rotate((*rmatrices_)[frm.TrajoutNum()], mask_); + if (all_atoms_selected_) + frm.ModifyFrm().ModifyBox().RotateUcell( (*rmatrices_)[frm.TrajoutNum()] ); + } break; case AXIS : Vec3 a0 = frm.Frm().VCenterOfMass(axis0_); @@ -117,9 +139,12 @@ Action::RetType Action_Rotate::DoAction(int frameNum, ActionFrame& frm) { frm.Frm().VCenterOfMass(axis1_) ); RotMatrix_.CalcRotationMatrix(axisOfRotation, delta_); frm.ModifyFrm().Rotate(RotMatrix_, mask_); + if (all_atoms_selected_) + frm.ModifyFrm().ModifyBox().RotateUcell( RotMatrix_ ); // SetAxisOfRotation moves a0 to center; move back. frm.ModifyFrm().Translate( a0 ); break; } + return Action::MODIFY_COORDS; } diff --git a/src/Action_Rotate.h b/src/Action_Rotate.h index bf8fae91b1..4dd9c0ade2 100644 --- a/src/Action_Rotate.h +++ b/src/Action_Rotate.h @@ -22,5 +22,6 @@ class Action_Rotate : public Action { double delta_; ///< Degrees to rotate if mode is AXIS ModeType mode_; ///< Mode to use. bool inverse_; ///< If true perform an inverse rotation. + bool all_atoms_selected_; ///< If true all atoms selected for rotation }; #endif diff --git a/src/Action_STFC_Diffusion.cpp b/src/Action_STFC_Diffusion.cpp index 54ab3309c4..0c44e32676 100644 --- a/src/Action_STFC_Diffusion.cpp +++ b/src/Action_STFC_Diffusion.cpp @@ -94,7 +94,7 @@ Action::RetType Action_STFC_Diffusion::Init(ArgList& actionArgs, ActionInit& ini } calcType_ = DIST; // See if imaging is to be performed. - image_.InitImaging( !(actionArgs.hasKey("noimage")) ); + imageOpt_.InitImaging( !(actionArgs.hasKey("noimage")) ); } else if (actionArgs.Contains("lower")) { mprinterr("Error: 'lower' requires 'mask2'\n"); return Action::ERR; @@ -123,7 +123,7 @@ Action::RetType Action_STFC_Diffusion::Init(ArgList& actionArgs, ActionInit& ini else if (calcType_ == DIST) { mprintf("\t\tAtoms in mask 2 (%s) in the range %.3f to %.3f Angstrom will be used\n", mask2_.MaskString(), lcut, ucut); - if (image_.UseImage()) + if (imageOpt_.UseImage()) mprintf("\t\tDistances will be imaged.\n"); else mprintf("\t\tDistances will not be imaged.\n"); @@ -175,15 +175,15 @@ Action::RetType Action_STFC_Diffusion::Setup(ActionSetup& setup) { return Action::ERR; } // Set up imaging info - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); - if (image_.ImagingEnabled()) + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); + if (imageOpt_.ImagingEnabled()) mprintf("\tImaging distances.\n"); else mprintf("\tImaging off.\n"); } // Check for box - if ( setup.CoordInfo().TrajBox().Type()!=Box::NOBOX ) + if ( setup.CoordInfo().TrajBox().HasBox() ) hasBox_ = true; else hasBox_ = false; @@ -326,7 +326,8 @@ void Action_STFC_Diffusion::calculateMSD(const double* XYZ, int idx1, int idx2, // Action_STFC_Diffusion::DoAction() Action::RetType Action_STFC_Diffusion::DoAction(int frameNum, ActionFrame& frm) { double Time, average, avgx, avgy, avgz; - + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); // ----- Load initial frame if necessary ------- if ( initialxyz_.empty() ) { //mprintf("DEBUG: Initial frame is empty, mode %i\n", (int)calcType_); @@ -423,15 +424,7 @@ Action::RetType Action_STFC_Diffusion::DoAction(int frameNum, ActionFrame& frm) for ( AtomMask::const_iterator atom2 = mask2_.begin(); atom2 != mask2_.end(); ++atom2) { const double* XYZ2 = frm.Frm().XYZ(*atom2); - Matrix_3x3 ucell, recip; - switch ( image_.ImageType() ) { - case NONORTHO: - frm.Frm().BoxCrd().ToRecip(ucell, recip); - dist2 = DIST2_ImageNonOrtho(XYZ1, XYZ2, ucell, recip); - break; - case ORTHO: dist2 = DIST2_ImageOrtho(XYZ1, XYZ2, frm.Frm().BoxCrd()); break; - case NOIMAGE: dist2 = DIST2_NoImage(XYZ1, XYZ2); break; - } + dist2 = DIST2( imageOpt_.ImagingType(), XYZ1, XYZ2, frm.Frm().BoxCrd() ); // Find minimum distance. if (dist2 < minDist) { minDist = dist2; diff --git a/src/Action_STFC_Diffusion.h b/src/Action_STFC_Diffusion.h index fbe752241c..917c82ed6e 100644 --- a/src/Action_STFC_Diffusion.h +++ b/src/Action_STFC_Diffusion.h @@ -1,7 +1,7 @@ #ifndef INC_ACTION_STFC_DIFFUSION_H #define INC_ACTION_STFC_DIFFUSION_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" /** \author Hannes H. Loeffler * \author C++ adaptation by Daniel R. Roe */ @@ -45,6 +45,6 @@ class Action_STFC_Diffusion : public Action { Darray dSum2_; std::vector nInside_; int elapsedFrames_; - ImagedAction image_; ///< Imaging routines. + ImageOption imageOpt_; ///< Used to determine if distances should be imaged. }; #endif diff --git a/src/Action_Spam.cpp b/src/Action_Spam.cpp index 47e6163972..4331837888 100644 --- a/src/Action_Spam.cpp +++ b/src/Action_Spam.cpp @@ -105,7 +105,7 @@ Action::RetType Action_Spam::Init(ArgList& actionArgs, ActionInit& init, int deb # endif debug_ = debugIn; // Always use imaged distances - image_.InitImaging(true); + imageOpt_.InitImaging(true); // This is needed everywhere in this function scope std::string peaksname; @@ -267,24 +267,24 @@ Action::RetType Action_Spam::Init(ArgList& actionArgs, ActionInit& init, int deb Action::RetType Action_Spam::Setup(ActionSetup& setup) { // We need box info Box const& currentBox = setup.CoordInfo().TrajBox(); - if (currentBox.Type() == Box::NOBOX) { + if (!currentBox.HasBox()) { mprinterr("Error: SPAM: Must have explicit solvent with periodic boundaries!\n"); return Action::ERR; } // See if our box dimensions are too small for our cutoff... - if (currentBox.BoxX() < doublecut_ || - currentBox.BoxY() < doublecut_ || - currentBox.BoxZ() < doublecut_) + if (currentBox.Param(Box::X) < doublecut_ || + currentBox.Param(Box::Y) < doublecut_ || + currentBox.Param(Box::Z) < doublecut_) { mprinterr("Error: SPAM: The box appears to be too small for your cutoff!\n"); return Action::ERR; } // Set up imaging info for this parm - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); // SANITY CHECK - imaging should always be active. - if (!image_.ImagingEnabled()) { - mprinterr("Interal Error: Imaging info not properly set up for Action_Spam\n"); + if (!imageOpt_.ImagingEnabled()) { + mprinterr("Error: Imaging not possible for %s; required for SPAM.\n", setup.Top().c_str()); return Action::ERR; } // Set up the solvent_residues_ vector @@ -351,10 +351,12 @@ int Action_Spam::SetupParms(Topology const& ParmIn) { // Action_Spam::DoAction() Action::RetType Action_Spam::DoAction(int frameNum, ActionFrame& frm) { Nframes_++; + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); // Check that our box is still big enough... - overflow_ = overflow_ || frm.Frm().BoxCrd().BoxX() < doublecut_ || - frm.Frm().BoxCrd().BoxY() < doublecut_ || - frm.Frm().BoxCrd().BoxZ() < doublecut_; + overflow_ = overflow_ || frm.Frm().BoxCrd().Param(Box::X) < doublecut_ || + frm.Frm().BoxCrd().Param(Box::Y) < doublecut_ || + frm.Frm().BoxCrd().Param(Box::Z) < doublecut_; if (purewater_) return DoPureWater(frameNum, frm.Frm()); else @@ -393,8 +395,7 @@ double Action_Spam::Ecalc(int i, int j, double dist2) const { Action::RetType Action_Spam::DoPureWater(int frameNum, Frame const& frameIn) { t_action_.Start(); - frameIn.BoxCrd().ToRecip(ucell_, recip_); - int retVal = pairList_.CreatePairList(frameIn, ucell_, recip_, mask_); + int retVal = pairList_.CreatePairList(frameIn, frameIn.BoxCrd().UnitCell(), frameIn.BoxCrd().FracCell(), mask_); if (retVal != 0) { mprinterr("Error: Grid setup failed.\n"); return Action::ERR; @@ -493,17 +494,12 @@ double Action_Spam::Calculate_Energy(Frame const& frameIn, Residue const& res) { // Now loop through all atoms in the residue and loop through the pairlist to // get the energies for (int i = res.FirstAtom(); i < res.LastAtom(); i++) { - Vec3 atm1 = Vec3(frameIn.XYZ(i)); + const double* atm1 = frameIn.XYZ(i); for (int j = 0; j < CurrentParm_->Natom(); j++) { if (j >= res.FirstAtom() && j < res.LastAtom()) continue; - Vec3 atm2 = Vec3(frameIn.XYZ(j)); - double dist2; + const double* atm2 = frameIn.XYZ(j); // Get imaged distance - switch( image_.ImageType() ) { - case NONORTHO : dist2 = DIST2_ImageNonOrtho(atm1, atm2, ucell_, recip_); break; - case ORTHO : dist2 = DIST2_ImageOrtho(atm1, atm2, frameIn.BoxCrd()); break; - default : dist2 = DIST2_NoImage(atm1, atm2); break; - } + double dist2 = DIST2( imageOpt_.ImagingType(), atm1, atm2, frameIn.BoxCrd() ); if (dist2 < cut2_) { double qiqj = atom_charge_[i] * atom_charge_[j]; NonbondType const& LJ = CurrentParm_->GetLJparam(i, j); @@ -526,9 +522,6 @@ double Action_Spam::Calculate_Energy(Frame const& frameIn, Residue const& res) { /** Carries out SPAM analysis on a typical system */ Action::RetType Action_Spam::DoSPAM(int frameNum, Frame& frameIn) { t_action_.Start(); - // Calculate unit cell and fractional matrices for non-orthorhombic system - if ( image_.ImageType() == NONORTHO ) - frameIn.BoxCrd().ToRecip(ucell_, recip_); t_resCom_.Start(); /* A list of all solvent residues and the sites that they are reserved for. An * unreserved solvent residue has an index -1. At the end, we will go through diff --git a/src/Action_Spam.h b/src/Action_Spam.h index ffbc5a7758..de394fbfd0 100644 --- a/src/Action_Spam.h +++ b/src/Action_Spam.h @@ -1,7 +1,7 @@ #ifndef INC_ACTION_SPAM_H #define INC_ACTION_SPAM_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" #include "Vec3.h" #include "Timer.h" #include "PairList.h" @@ -62,11 +62,9 @@ class Action_Spam: public Action { int debug_; FxnType Inside_; ///< Function for determining if water is inside peak. - ImagedAction image_; ///< Imaging routines. + ImageOption imageOpt_; ///< Used to determine if imaging should be used. PairList pairList_; ///< Atom pair list (purewater_ only) Iarray watidx_; ///< Hold water index for each atom (starting from 0). - Matrix_3x3 ucell_; ///< Unit cell matrix - Matrix_3x3 recip_; ///< Fractional matrix std::string solvname_; ///< Name of the solvent residues double DG_BULK_; ///< SPAM free energy of the bulk solvent double DH_BULK_; ///< SPAM enthalpy of the bulk solvent diff --git a/src/Action_SymmetricRmsd.cpp b/src/Action_SymmetricRmsd.cpp index 1386797284..e5c71c8587 100644 --- a/src/Action_SymmetricRmsd.cpp +++ b/src/Action_SymmetricRmsd.cpp @@ -83,8 +83,6 @@ Action::RetType Action_SymmetricRmsd::Setup(ActionSetup& setup) { // Reference frame setup if (REF_.SetupRef(setup.Top(), tgtMask_.Nselected())) return Action::ERR; - if (SRMSD_.Fit()) - Action::CheckImageRotationWarning(setup, "the RMS fit"); return Action::OK; } @@ -106,8 +104,10 @@ Action::RetType Action_SymmetricRmsd::DoAction(int frameNum, ActionFrame& frm) { remapFrame_.SetCoordinatesByMap( frm.Frm(), targetMap_ ); frm.SetFrame( &remapFrame_ ); } - if ( SRMSD_.Fit() ) + if ( SRMSD_.Fit() ) { frm.ModifyFrm().Trans_Rot_Trans( SRMSD_.TgtTrans(), SRMSD_.RotMatrix(), REF_.RefTrans() ); + frm.ModifyFrm().ModifyBox().RotateUcell( SRMSD_.RotMatrix() ); + } REF_.PreviousRef( frm.Frm() ); return action_return_; diff --git a/src/Action_Unwrap.cpp b/src/Action_Unwrap.cpp index d0c626242f..4b639d0ae6 100644 --- a/src/Action_Unwrap.cpp +++ b/src/Action_Unwrap.cpp @@ -8,7 +8,6 @@ Action_Unwrap::Action_Unwrap() : imageList_(0), imageMode_(Image::BYATOM), RefParm_(0), - orthogonal_(false), center_(false) { } @@ -90,14 +89,11 @@ Action::RetType Action_Unwrap::Setup(ActionSetup& setup) { } } // Check box type - if (setup.CoordInfo().TrajBox().Type()==Box::NOBOX) { + if (!setup.CoordInfo().TrajBox().HasBox()) { mprintf("Error: unwrap: Parm %s does not contain box information.\n", setup.Top().c_str()); return Action::ERR; } - orthogonal_ = false; - if (setup.CoordInfo().TrajBox().Type()==Box::ORTHO) - orthogonal_ = true; // Setup atom pairs to be unwrapped. Always use CoM TODO why? if (imageList_ != 0) delete imageList_; @@ -124,18 +120,16 @@ Action::RetType Action_Unwrap::Setup(ActionSetup& setup) { // Action_Unwrap::DoAction() Action::RetType Action_Unwrap::DoAction(int frameNum, ActionFrame& frm) { - Matrix_3x3 ucell, recip; if (RefFrame_.empty()) { // Set reference structure if not already set RefFrame_ = frm.Frm(); return Action::OK; } - if (orthogonal_) + if (frm.Frm().BoxCrd().Is_X_Aligned_Ortho()) Image::UnwrapOrtho( frm.ModifyFrm(), RefFrame_, *imageList_, allEntities_ ); else { - frm.Frm().BoxCrd().ToRecip( ucell, recip ); - Image::UnwrapNonortho( frm.ModifyFrm(), RefFrame_, *imageList_, allEntities_, ucell, recip ); + Image::UnwrapNonortho( frm.ModifyFrm(), RefFrame_, *imageList_, allEntities_, frm.Frm().BoxCrd().UnitCell(), frm.Frm().BoxCrd().FracCell() ); } return Action::MODIFY_COORDS; diff --git a/src/Action_Unwrap.h b/src/Action_Unwrap.h index 77622810ff..59afec8b0e 100644 --- a/src/Action_Unwrap.h +++ b/src/Action_Unwrap.h @@ -22,7 +22,6 @@ class Action_Unwrap : public Action { std::string maskExpression_; ///< Expression selecting entities to unwrap Frame RefFrame_; ///< Reference frame, updated each DoAction Topology* RefParm_; ///< Reference topology - bool orthogonal_; ///< If true, cell is orthogonal bool center_; ///< If true, determine distances to centers Unit allEntities_; ///< Hold atoms to copy from target to reference # ifdef MPI diff --git a/src/Action_Vector.cpp b/src/Action_Vector.cpp index 098f5cc75e..3bb73512c2 100644 --- a/src/Action_Vector.cpp +++ b/src/Action_Vector.cpp @@ -198,7 +198,7 @@ Action::RetType Action_Vector::Init(ArgList& actionArgs, ActionInit& init, int d Action::RetType Action_Vector::Setup(ActionSetup& setup) { if (needBoxInfo_) { // Check for box info - if (setup.CoordInfo().TrajBox().Type() == Box::NOBOX) { + if (!setup.CoordInfo().TrajBox().HasBox()) { mprinterr("Error: vector box: No box information.\n", setup.Top().c_str()); return Action::ERR; @@ -419,23 +419,19 @@ void Action_Vector::CorrPlane(Frame const& currentFrame) { // Action_Vector::UnitCell() void Action_Vector::UnitCell(Box const& box) { - Matrix_3x3 ucell, recip; - box.ToRecip( ucell, recip ); switch ( mode_ ) { - case BOX_X: Vec_->AddVxyzo( ucell.Row1(), Vec3(0.0) ); break; - case BOX_Y: Vec_->AddVxyzo( ucell.Row2(), Vec3(0.0) ); break; - case BOX_Z: Vec_->AddVxyzo( ucell.Row3(), Vec3(0.0) ); break; - case BOX_CTR: Vec_->AddVxyz( ucell.TransposeMult(Vec3(0.5)) ); break; + case BOX_X : Vec_->AddVxyzo( box.UnitCell().Row1(), Vec3(0.0) ); break; + case BOX_Y : Vec_->AddVxyzo( box.UnitCell().Row2(), Vec3(0.0) ); break; + case BOX_Z : Vec_->AddVxyzo( box.UnitCell().Row3(), Vec3(0.0) ); break; + case BOX_CTR : Vec_->AddVxyz( box.UnitCell().TransposeMult(Vec3(0.5)) ); break; default: return; } } // Action_Vector::MinImage() void Action_Vector::MinImage(Frame const& frm) { - Matrix_3x3 ucell, recip; - frm.BoxCrd().ToRecip( ucell, recip ); Vec3 com1 = frm.VCenterOfMass(mask_); - Vec_->AddVxyzo( MinImagedVec(com1, frm.VCenterOfMass(mask2_), ucell, recip), com1 ); + Vec_->AddVxyzo( MinImagedVec(com1, frm.VCenterOfMass(mask2_), frm.BoxCrd().UnitCell(), frm.BoxCrd().FracCell()), com1 ); } /// \return The center of selected elements in given array. diff --git a/src/Action_Volmap.cpp b/src/Action_Volmap.cpp index bde15ec75e..bb4aeb1137 100644 --- a/src/Action_Volmap.cpp +++ b/src/Action_Volmap.cpp @@ -166,7 +166,7 @@ Action::RetType Action_Volmap::Init(ArgList& actionArgs, ActionInit& init, int d mprinterr("Error: Reference '%s' not found.\n", setup_arg.c_str()); return Action::ERR; } - if (REF->CoordsInfo().TrajBox().Type() != Box::ORTHO) { + if (REF->CoordsInfo().TrajBox().Is_X_Aligned_Ortho()) { mprinterr("Error: Reference '%s' does not have orthogonal box information.\n", setup_arg.c_str()); return Action::ERR; diff --git a/src/Action_Volume.cpp b/src/Action_Volume.cpp index db29b751ab..6cc0b25f5d 100644 --- a/src/Action_Volume.cpp +++ b/src/Action_Volume.cpp @@ -15,7 +15,6 @@ void Action_Volume::Help() const { // Action_Volume::Init() Action::RetType Action_Volume::Init(ArgList& actionArgs, ActionInit& init, int debugIn) { - image_.InitImaging( true ); // Get keywords DataFile* outfile = init.DFL().AddDataFile( actionArgs.GetStringKey("out"), actionArgs ); // Dataset @@ -33,8 +32,7 @@ Action::RetType Action_Volume::Init(ArgList& actionArgs, ActionInit& init, int d // Action_Volume::Setup() Action::RetType Action_Volume::Setup(ActionSetup& setup) { - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); - if (!image_.ImagingEnabled()) { + if (!setup.CoordInfo().TrajBox().HasBox()) { mprintf("Warning: No unit cell information, volume cannot be calculated for '%s'\n", setup.Top().c_str()); return Action::SKIP; @@ -45,14 +43,8 @@ Action::RetType Action_Volume::Setup(ActionSetup& setup) { // Action_Volume::DoAction() Action::RetType Action_Volume::DoAction(int frameNum, ActionFrame& frm) { - Matrix_3x3 ucell, recip; - double volume = 0.0; - if (image_.ImageType() == ORTHO) - volume = frm.Frm().BoxCrd().BoxX() * - frm.Frm().BoxCrd().BoxY() * - frm.Frm().BoxCrd().BoxZ(); - else if (image_.ImageType() == NONORTHO) - volume = frm.Frm().BoxCrd().ToRecip( ucell, recip ); + double volume = frm.Frm().BoxCrd().CellVolume(); + vol_->Add(frameNum, &volume); return Action::OK; diff --git a/src/Action_Volume.h b/src/Action_Volume.h index b0e50569bc..dace0eb614 100644 --- a/src/Action_Volume.h +++ b/src/Action_Volume.h @@ -1,7 +1,6 @@ #ifndef INC_ACTION_VOLUME_H #define INC_ACTION_VOLUME_H #include "Action.h" -#include "ImagedAction.h" /// Calculate unit cell volume. class Action_Volume: public Action { public: @@ -14,7 +13,6 @@ class Action_Volume: public Action { Action::RetType DoAction(int, ActionFrame&); void Print(); - ImagedAction image_; DataSet *vol_; }; #endif diff --git a/src/Action_Watershell.cpp b/src/Action_Watershell.cpp index 0938a802eb..ecd6525d40 100644 --- a/src/Action_Watershell.cpp +++ b/src/Action_Watershell.cpp @@ -10,7 +10,9 @@ #ifdef CUDA # include "CharMask.h" // CUDA Kernel wrappers -extern void Action_Closest_NoCenter(const double*,double*,const double*,double,int,int,int,ImagingType,const double*,const double*,const double*); +extern void Action_Closest_NoCenter(const double*,double*,const double*,double,int,int,int,ImageOption::Type,const double*,const double*,const double*); +#else +# include "DistRoutines.h" #endif // CONSTRUCTOR @@ -34,7 +36,7 @@ void Action_Watershell::Help() const { // Action_Watershell::Init() Action::RetType Action_Watershell::Init(ArgList& actionArgs, ActionInit& init, int debugIn) { - image_.InitImaging( !actionArgs.hasKey("noimage") ); + imageOpt_.InitImaging( !actionArgs.hasKey("noimage") ); // Get keywords std::string filename = actionArgs.GetStringKey("out"); lowerCutoff_ = actionArgs.getKeyDouble("lower", 3.4); @@ -82,7 +84,7 @@ Action::RetType Action_Watershell::Init(ArgList& actionArgs, ActionInit& init, i mprintf(" WATERSHELL:"); if (outfile != 0) mprintf(" Output to %s", outfile->DataFilename().full()); mprintf("\n"); - if (!image_.UseImage()) + if (!imageOpt_.UseImage()) mprintf("\tImaging is disabled.\n"); mprintf("\tThe first shell will contain solvent < %.3f angstroms from\n", lowerCutoff_); @@ -150,7 +152,7 @@ Action::RetType Action_Watershell::Setup(ActionSetup& setup) { NAtoms_ = setup.Top().Mol( first_solvent_mol ).NumAtoms(); for (AtomMask::const_iterator atm = solventMask_.begin(); atm != solventMask_.end(); ++atm) { int mol = setup.Top()[*atm].MolNum(); - if (NAtoms_ != setup.Top().Mol( mol ).NumAtoms()) { + if (NAtoms_ != (int)setup.Top().Mol( mol ).NumAtoms()) { mprinterr("Error: CUDA version of 'watershell' requires all solvent mols be same size.\n"); return Action::ERR; } @@ -183,8 +185,8 @@ Action::RetType Action_Watershell::Setup(ActionSetup& setup) { # endif #endif /* CUDA */ // Set up imaging - image_.SetupImaging( setup.CoordInfo().TrajBox().Type() ); - if (image_.ImagingEnabled()) + imageOpt_.SetupImaging( setup.CoordInfo().TrajBox().HasBox() ); + if (imageOpt_.ImagingEnabled()) mprintf("\tImaging is on.\n"); else mprintf("\tImaging is off.\n"); @@ -199,6 +201,8 @@ Action::RetType Action_Watershell::Setup(ActionSetup& setup) { Action::RetType Action_Watershell::DoAction(int frameNum, ActionFrame& frm) { int nlower = 0; int nupper = 0; + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( frm.Frm().BoxCrd().Is_X_Aligned_Ortho() ); # ifdef CUDA // Copy solvent atom coords to array unsigned int idx = 0; // Index into V_atom_coords_ @@ -210,9 +214,6 @@ Action::RetType Action_Watershell::DoAction(int frameNum, ActionFrame& frm) { V_atom_coords_[idx+1] = xyz[1]; V_atom_coords_[idx+2] = xyz[2]; } - Matrix_3x3 ucell, recip; - if (image_.ImageType() == NONORTHO) - frm.Frm().BoxCrd().ToRecip(ucell, recip); // Copy solute atom coords to array idx = 0; for (AtomMask::const_iterator atm = soluteMask_.begin(); @@ -226,8 +227,10 @@ Action::RetType Action_Watershell::DoAction(int frameNum, ActionFrame& frm) { Action_Closest_NoCenter( &V_atom_coords_[0], &V_distances_[0], &soluteCoords_[0], 9999999999999.0, NsolventMolecules_, NAtoms_, soluteMask_.Nselected(), - image_.ImageType(), - frm.Frm().BoxCrd().boxPtr(), ucell.Dptr(), recip.Dptr() ); + imageOpt_.ImagingType(), + frm.Frm().BoxCrd().XyzPtr(), + frm.Frm().BoxCrd().UnitCell().Dptr(), + frm.Frm().BoxCrd().FracCell().Dptr() ); // V_distances_ now has the closest distance of each solvent molecule to // solute. Determine shell status of each. @@ -249,12 +252,10 @@ Action::RetType Action_Watershell::DoAction(int frameNum, ActionFrame& frm) { # endif int* status = 0; - if (image_.ImageType() == NONORTHO) { + if (imageOpt_.ImagingType() == ImageOption::NONORTHO) { // ----- NON-ORTHORHOMBIC IMAGING ------------ - Matrix_3x3 ucell, recip; - frm.Frm().BoxCrd().ToRecip(ucell, recip); // Wrap all solute atoms back into primary cell, save coords. - Image::WrapToCell0( soluteCoords_, frm.Frm(), soluteMask_, ucell, recip ); + Image::WrapToCell0( soluteCoords_, frm.Frm(), soluteMask_, frm.Frm().BoxCrd().UnitCell(), frm.Frm().BoxCrd().FracCell() ); // Calculate every imaged distance of all solvent atoms to solute # ifdef _OPENMP # pragma omp parallel private(Vidx, mythread, status) @@ -270,7 +271,7 @@ Action::RetType Action_Watershell::DoAction(int frameNum, ActionFrame& frm) { int Vat = solventMask_[Vidx]; int currentRes = (*CurrentParm_)[ Vat ].ResNum(); // Convert to frac coords - Vec3 vFrac = recip * Vec3( frm.Frm().XYZ( Vat ) ); + Vec3 vFrac = frm.Frm().BoxCrd().FracCell() * Vec3( frm.Frm().XYZ( Vat ) ); // Wrap to primary unit cell vFrac[0] = vFrac[0] - floor(vFrac[0]); vFrac[1] = vFrac[1] - floor(vFrac[1]); @@ -281,7 +282,7 @@ Action::RetType Action_Watershell::DoAction(int frameNum, ActionFrame& frm) { for (int iz = -1; iz != 2; iz++) { // Convert image back to Cartesian - Vec3 vCart = ucell.TransposeMult( vFrac + Vec3(ix, iy, iz) ); + Vec3 vCart = frm.Frm().BoxCrd().UnitCell().TransposeMult( vFrac + Vec3(ix, iy, iz) ); // Loop over all solute atoms for (unsigned int idx = 0; idx < soluteCoords_.size(); idx += 3) { @@ -346,7 +347,7 @@ Action::RetType Action_Watershell::DoAction(int frameNum, ActionFrame& frm) { // Residue is not yet marked as 1st shell, calc distance Vec3 Ucoord( soluteCoords_[idx], soluteCoords_[idx+1], soluteCoords_[idx+2] ); double dist2; - if (image_.ImageType() == ORTHO) + if (imageOpt_.ImagingType() == ImageOption::ORTHO) dist2 = DIST2_ImageOrtho( Vcoord, Ucoord, frm.Frm().BoxCrd() ); else dist2 = DIST2_NoImage( Vcoord, Ucoord ); diff --git a/src/Action_Watershell.h b/src/Action_Watershell.h index 08391d3324..796c6f7f7a 100644 --- a/src/Action_Watershell.h +++ b/src/Action_Watershell.h @@ -1,7 +1,7 @@ #ifndef INC_ACTION_WATERSHELL_H #define INC_ACTION_WATERSHELL_H #include "Action.h" -#include "ImagedAction.h" +#include "ImageOption.h" /// Calculate number of solvent residues in 1st/2nd solvation shell. class Action_Watershell : public Action { public: @@ -17,7 +17,7 @@ class Action_Watershell : public Action { typedef std::vector Iarray; typedef std::vector Darray; - ImagedAction image_; ///< Hold imaging routines. + ImageOption imageOpt_; ///< Used to determine if imaging should be performed. AtomMask soluteMask_; ///< Selected solute atoms. AtomMask solventMask_; ///< Selected solvent atoms. double lowerCutoff_; ///< Solvent below this is in the first shell. diff --git a/src/Action_XtalSymm.cpp b/src/Action_XtalSymm.cpp index 93de822c1f..a8eb66fb65 100644 --- a/src/Action_XtalSymm.cpp +++ b/src/Action_XtalSymm.cpp @@ -206,9 +206,8 @@ const Vec3 corig = orig.VCenterOfMass(0, orig.Natom()); Vec3 cothr = othr.VCenterOfMass(0, othr.Natom()); Vec3 cdiff = cothr - corig; - Matrix_3x3 U, invU; - U = RefFrame_.BoxCrd().UnitCell(1.0); - RefFrame_.BoxCrd().ToRecip(U, invU); + Matrix_3x3 const& U = RefFrame_.BoxCrd().UnitCell(); + Matrix_3x3 const& invU = RefFrame_.BoxCrd().FracCell(); cdiff = invU * cdiff; const double nearTwo = 1.999999999; double minx = floor(cdiff[0] - nearTwo); @@ -665,8 +664,6 @@ Action::RetType Action_XtalSymm::DoAction(int frameNum, ActionFrame& frm) { int i, j; Frame orig; - Matrix_3x3 U, invU; - // Allocate space for the subunit frames orig = Frame(Masks_[0].Nselected()); @@ -683,8 +680,8 @@ Action::RetType Action_XtalSymm::DoAction(int frameNum, ActionFrame& frm) // Ensure this is only done once FIXME ok? refType_ = NONE; - U = RefFrame_.BoxCrd().UnitCell(1.0); - RefFrame_.BoxCrd().ToRecip(U, invU); + Matrix_3x3 const& U = RefFrame_.BoxCrd().UnitCell(); + Matrix_3x3 const& invU = RefFrame_.BoxCrd().FracCell(); XtalDock* leads = new XtalDock[nops_ * nops_ * 125]; // TODO vector? int nLead = 0; for (i = 0; i < nops_; i++) { @@ -820,8 +817,8 @@ Action::RetType Action_XtalSymm::DoAction(int frameNum, ActionFrame& frm) // Loop over all subunits, set them according to the correct displacements from // the original subunits (imaging considerations), and apply the transformations. - U = frm.Frm().BoxCrd().UnitCell(1.0); - frm.Frm().BoxCrd().ToRecip(U, invU); + Matrix_3x3 const& U = frm.Frm().BoxCrd().UnitCell(); + Matrix_3x3 const& invU = frm.Frm().BoxCrd().FracCell(); orig = Frame(Masks_[0].Nselected()); orig.SetCoordinates(frm.Frm(), Masks_[0]); diff --git a/src/BondSearch.cpp b/src/BondSearch.cpp index 5ca4c7e302..60fe897f11 100644 --- a/src/BondSearch.cpp +++ b/src/BondSearch.cpp @@ -29,7 +29,14 @@ Box CreateBoundingBox(Frame const& frameIn, Vec3& min) max += boffset; min -= boffset; Vec3 len = max - min; - box.SetBetaLengths(90.0, len[0], len[1], len[2]); + double xyzabg[6]; + xyzabg[Box::X] = len[0]; + xyzabg[Box::Y] = len[1]; + xyzabg[Box::Z] = len[2]; + xyzabg[Box::ALPHA] = 90.0; + xyzabg[Box::BETA] = 90.0; + xyzabg[Box::GAMMA] = 90.0; + box.SetupFromXyzAbg( xyzabg ); //mprintf("DEBUG: Min={%8.3f, %8.3f, %8.3f} Max={%8.3f, %8.3f, %8.3f}\n", // min[0], min[1], min[2], max[0], max[1], max[2]); return box; @@ -119,9 +126,9 @@ int BondSearch_Grid(Topology& top, Frame const& frameIn, double offset, int debu box.PrintInfo(); // Create grid indices. static const double spacing = 6.0; // TODO make this a parameter? - int nx = (int)ceil(box.BoxX() / spacing); - int ny = (int)ceil(box.BoxY() / spacing); - int nz = (int)ceil(box.BoxZ() / spacing); + int nx = (int)ceil(box.Param(Box::X) / spacing); + int ny = (int)ceil(box.Param(Box::Y) / spacing); + int nz = (int)ceil(box.Param(Box::Z) / spacing); int nynz = ny*nz; typedef std::vector Iarray; typedef std::vector I2array; @@ -354,7 +361,7 @@ int BondSearch_PL( Topology& top, Frame const& frameIn, double offset, int debug # endif // Pair list setup requires a box. Will need to create one if not present. Box box = frameIn.BoxCrd(); - if (box.Type() == Box::NOBOX) + if (!box.HasBox()) box = CreateBoundingBox(frameIn); box.PrintInfo(); @@ -364,9 +371,7 @@ int BondSearch_PL( Topology& top, Frame const& frameIn, double offset, int debug PairList PL; PL.InitPairList( cutoff, skinnb, debug ); PL.SetupPairList( box ); - Matrix_3x3 ucell, recip; - box.ToRecip( ucell, recip ); - int retVal = PL.CreatePairList( frameIn, ucell, recip, AtomMask(0, frameIn.Natom()) ); + int retVal = PL.CreatePairList( frameIn, box.UnitCell(), box.FracCell(), AtomMask(0, frameIn.Natom()) ); if (retVal != 0) { mprinterr("Error: Grid setup failed.\n"); return 1; diff --git a/src/Box.cpp b/src/Box.cpp index 167498d949..c378106592 100644 --- a/src/Box.cpp +++ b/src/Box.cpp @@ -1,10 +1,12 @@ -#include // cos, sin, sqrt +#include // cos, sin, sqrt, fabs #include "Box.h" #include "Constants.h" // DEGRAD #include "CpptrajStdio.h" +#include // std::copy -// CONSTRUCTOR -Box::Box() : btype_(NOBOX) //, debug_(0) +/** CONSTRUCTOR */ +Box::Box() : + cellVolume_(0) { box_[0] = 0; box_[1] = 0; @@ -14,17 +16,11 @@ Box::Box() : btype_(NOBOX) //, debug_(0) box_[5] = 0; } -Box::Box(const double* bIn) //: debug_(0) -{ - SetBox( bIn ); -} - -Box::Box(const float* bIn) { SetBox( bIn ); } - -Box::Box(Matrix_3x3 const& ucell) { SetBox( ucell ); } - -// COPY CONSTRUCTOR -Box::Box(const Box& rhs) : btype_(rhs.btype_) //, debug_(rhs.debug_) +/** COPY CONSTRUCTOR */ +Box::Box(const Box& rhs) : + unitCell_(rhs.unitCell_), + fracCell_(rhs.fracCell_), + cellVolume_(rhs.cellVolume_) //, debug_(rhs.debug_) { box_[0] = rhs.box_[0]; box_[1] = rhs.box_[1]; @@ -34,20 +30,73 @@ Box::Box(const Box& rhs) : btype_(rhs.btype_) //, debug_(rhs.debug_) box_[5] = rhs.box_[5]; } -// Assignment -Box &Box::operator=(const Box& rhs) { +/** Assignment */ +Box& Box::operator=(const Box& rhs) { if (&rhs == this) return *this; - //debug_ = rhs.debug_; - btype_ = rhs.btype_; box_[0] = rhs.box_[0]; box_[1] = rhs.box_[1]; box_[2] = rhs.box_[2]; box_[3] = rhs.box_[3]; box_[4] = rhs.box_[4]; box_[5] = rhs.box_[5]; + unitCell_ = rhs.unitCell_; + fracCell_ = rhs.fracCell_; + cellVolume_ = rhs.cellVolume_; return *this; } +/// Swap double precision +static inline void dswap(double& d1, double& d2) { + double dtemp = d1; + d1 = d2; + d2 = dtemp; +} + +/** Swap this box with given box. */ +void Box::swap(Box& rhs) { + dswap( box_[0], rhs.box_[0] ); + dswap( box_[1], rhs.box_[1] ); + dswap( box_[2], rhs.box_[2] ); + dswap( box_[3], rhs.box_[3] ); + dswap( box_[4], rhs.box_[4] ); + dswap( box_[5], rhs.box_[5] ); + for (int i=0; i<9; i++) { + dswap(unitCell_[i], rhs.unitCell_[i]); + dswap(fracCell_[i], rhs.fracCell_[i]); + } + dswap(cellVolume_, rhs.cellVolume_); +} + +#ifdef MPI +/** Sync box info to Comm master. */ +int Box::SyncBox(Parallel::Comm const& commIn) { + commIn.MasterBcast( box_, 6, MPI_DOUBLE ); + unitCell_.SyncMatrix( commIn ); + fracCell_.SyncMatrix( commIn ); + commIn.MasterBcast( &cellVolume_, 1, MPI_DOUBLE ); + return 0; +} + +/** Send box info to recvrank. */ +int Box::SendBox(int recvrank, Parallel::Comm const& commIn) { + commIn.Send( box_, 6, MPI_DOUBLE, recvrank, 1801 ); + unitCell_.SendMatrix(recvrank, commIn); + fracCell_.SendMatrix(recvrank, commIn); + commIn.Send( &cellVolume_, 1, MPI_DOUBLE, recvrank, 1802 ); + return 0; +} + +/** Get box info from recvrank. */ +int Box::RecvBox(int sendrank, Parallel::Comm const& commIn) { + commIn.Recv( box_, 6, MPI_DOUBLE, sendrank, 1801 ); + unitCell_.RecvMatrix(sendrank, commIn); + fracCell_.RecvMatrix(sendrank, commIn); + commIn.Recv( &cellVolume_, 1, MPI_DOUBLE, sendrank, 1802 ); + return 0; +} +#endif + +// ----------------------------------------------------------------------------- const double Box::TRUNCOCTBETA_ = 2.0*acos(1.0/sqrt(3.0))*Constants::RADDEG; /** This value is chosen so that TRUNCOCTBETA_ - TruncOctDelta_ is just @@ -63,234 +112,222 @@ const double Box::TruncOctMax_ = Box::TRUNCOCTBETA_ + Box::TruncOctDelta_; /** Used to detect low precision trunc. oct. angles (e.g. 109.47). */ const double Box::TruncOctEps_ = 0.001; -const char* Box::BoxNames_[] = { - "None", "Orthogonal", "Trunc. Oct.", "Rhombic Dodec.", "Non-orthogonal" +/** Used in IsEq. Larger value than SMALL in case we are reading from + * low-precision coordinates. + */ +const double Box::EqEps_ = 0.00001; + +/** Correspond to CellShapeType */ +const char* Box::CellShapeStr_[] = { + "None", + "Cubic", + "Tetragonal", + "Orthorhombic", + "Monoclinic", + "Triclinic", + "Hexagonal", + "Rhombohedral", + "Truncated octahedron", + "Rhombic dodecahedron" }; -// Box::SetBetaLengths() -void Box::SetBetaLengths(double beta, double xin, double yin, double zin) { - box_[0] = xin; - box_[1] = yin; - box_[2] = zin; - box_[3] = 0; - box_[4] = beta; - box_[5] = 0; - SetBoxType(); +/** Correspond to ParamType */ +const char* Box::ParamStr_[] = { "X", "Y", "Z", "alpha", "beta", "gamma" }; + +// ----------------------------------------------------------------------------- +/** \return True if angle is truncated octahedron within a certain range. */ +bool Box::IsTruncOct(double angle) { + return (angle > TruncOctMin_ && angle < TruncOctMax_); } -/** Set box from double[6] array */ -void Box::SetBox(const double* xyzabg) { - if (xyzabg == 0) { - mprinterr("Error: SetBox: Input array is null\n"); - return; - } - box_[0] = xyzabg[0]; - box_[1] = xyzabg[1]; - box_[2] = xyzabg[2]; - box_[3] = xyzabg[3]; - box_[4] = xyzabg[4]; - box_[5] = xyzabg[5]; - SetBoxType(); +/** \return True if the given truncated octahedral angle will cause imaging issues. */ +bool Box::BadTruncOctAngle(double angle) { + return (fabs( TRUNCOCTBETA_ - angle ) > TruncOctEps_); } -/** Set box from float[6] array */ -void Box::SetBox(const float* xyzabg) { - if (xyzabg == 0) { - mprinterr("Error: Box input array is null\n"); - return; - } - box_[0] = (double)xyzabg[0]; - box_[1] = (double)xyzabg[1]; - box_[2] = (double)xyzabg[2]; - box_[3] = (double)xyzabg[3]; - box_[4] = (double)xyzabg[4]; - box_[5] = (double)xyzabg[5]; - SetBoxType(); +/** \return True if 'lhs' is approximately equal to 'rhs' */ +bool Box::IsEq(double lhs, double rhs) { + return (fabs(rhs - lhs) < EqEps_); } -/** Set box from unit cell matrix. */ -void Box::SetBox(Matrix_3x3 const& ucell) { - Vec3 x_axis = ucell.Row1(); - Vec3 y_axis = ucell.Row2(); - Vec3 z_axis = ucell.Row3(); - box_[0] = x_axis.Normalize(); // A - box_[1] = y_axis.Normalize(); // B - box_[2] = z_axis.Normalize(); // C - box_[3] = y_axis.Angle( z_axis ) * Constants::RADDEG; // alpha - box_[4] = x_axis.Angle( z_axis ) * Constants::RADDEG; // beta - box_[5] = x_axis.Angle( y_axis ) * Constants::RADDEG; // gamma - SetBoxType(); +/** \return True if cell "A" axis is aligned along the X-axis (i.e. XYZ ABG reference). */ +bool Box::Is_X_Aligned() const { + if (fabs(unitCell_[1]) > Constants::SMALL) return false; + if (fabs(unitCell_[2]) > Constants::SMALL) return false; + if (fabs(unitCell_[5]) > Constants::SMALL) return false; + return true; } -void Box::SetBox(float A, float B, float C, float alpha, float beta, float gamma) -{ - box_[0] = A; - box_[1] = B; - box_[2] = C; - box_[3] = alpha; - box_[4] = beta; - box_[5] = gamma; - SetBoxType(); -} -// Box::SetTruncOct() -/** Set as truncated octahedron with all lengths set to whatever X is. */ -void Box::SetTruncOct() { - box_[1] = box_[0]; - box_[2] = box_[0]; - box_[3] = TRUNCOCTBETA_; - box_[4] = TRUNCOCTBETA_; - box_[5] = TRUNCOCTBETA_; - btype_ = TRUNCOCT; - mprintf("Info: Setting box to be perfect truncated octahedron (a=b=g=%g)\n", box_[3]); +/** \return True if cell "A" axis is aligned along the X-axis and cell vectors are + * orthogonal. + */ +bool Box::Is_X_Aligned_Ortho() const { + if (fabs(unitCell_[7]) > Constants::SMALL) return false; + if (fabs(unitCell_[6]) > Constants::SMALL) return false; + if (fabs(unitCell_[3]) > Constants::SMALL) return false; + if (fabs(unitCell_[5]) > Constants::SMALL) return false; + if (fabs(unitCell_[2]) > Constants::SMALL) return false; + if (fabs(unitCell_[1]) > Constants::SMALL) return false; + return true; } -// Box::SetNoBox() -void Box::SetNoBox() { - box_[0] = 0; - box_[1] = 0; - box_[2] = 0; - box_[3] = 0; - box_[4] = 0; - box_[5] = 0; - btype_ = NOBOX; +/** \return True if the matrix has symmetric off-diagonal elements. */ +bool Box::Is_Symmetric() const { + if (!IsEq(unitCell_[1], unitCell_[3])) return false; + if (!IsEq(unitCell_[2], unitCell_[6])) return false; + if (!IsEq(unitCell_[5], unitCell_[7])) return false; + return true; } -// Box::SetMissingInfo() -/** Set this box info from rhs if <= 0. */ -void Box::SetMissingInfo(const Box& rhs) { - if (box_[0] <= 0) box_[0] = rhs.box_[0]; - if (box_[1] <= 0) box_[1] = rhs.box_[1]; - if (box_[2] <= 0) box_[2] = rhs.box_[2]; - if (box_[3] <= 0) box_[3] = rhs.box_[3]; - if (box_[4] <= 0) box_[4] = rhs.box_[4]; - if (box_[5] <= 0) box_[5] = rhs.box_[5]; - SetBoxType(); +/** For debugging purposes, print XYZ ABG and unit/frac cell matrices. */ +void Box::printBoxStatus(const char* desc) const { + mprintf("DEBUG: [%s] Box: %s is_x_aligned= %i ortho= %i\n", desc, CellShapeName(), (int)Is_X_Aligned(), (int)Is_X_Aligned_Ortho()); + mprintf("DEBUG: XYZ= %12.4f %12.4f %8.3f ABG= %12.4f %12.4f %12.4f\n", + box_[0], box_[1], box_[2], box_[3], box_[4], box_[5]); + unitCell_.Print(desc); + fracCell_.Print("frac"); } -bool Box::IsTruncOct(double angle) { - return (angle > TruncOctMin_ && angle < TruncOctMax_); +/** For debugging purposes, more in-depth printout. */ +void Box::PrintDebug(const char* desc) const { + mprintf("DEBUG: %s Box: %s\n" + "DEBUG: %s XYZ= %12.4f %12.4f %12.4f ABG= %12.4f %12.4f %12.4f\n" + "DEBUG: %s Ucell = { %20.10E %20.10E %20.10E\n" + "DEBUG: %s %20.10E %20.10E %20.10E\n" + "DEBUG: %s %20.10E %20.10E %20.10E\n" + "DEBUG: %s Frac = { %20.10E %20.10E %20.10E\n" + "DEBUG: %s %20.10E %20.10E %20.10E\n" + "DEBUG: %s %20.10E %20.10E %20.10E\n" + "DEBUG: %s is_x_aligned= %i is_x_aligned_ortho= %i\n", + desc, CellShapeName(), + desc, box_[0], box_[1], box_[2], box_[3], box_[4], box_[5], + desc, unitCell_[0], unitCell_[1], unitCell_[2], + desc, unitCell_[3], unitCell_[4], unitCell_[5], + desc, unitCell_[6], unitCell_[7], unitCell_[8], + desc, fracCell_[0], fracCell_[1], fracCell_[2], + desc, fracCell_[3], fracCell_[4], fracCell_[5], + desc, fracCell_[6], fracCell_[7], fracCell_[8], + desc, (int)Is_X_Aligned(), (int)Is_X_Aligned_Ortho()); } -bool Box::BadTruncOctAngle(double angle) { - return (fabs( TRUNCOCTBETA_ - angle ) > TruncOctEps_); +/** \return Cell shape based on current XYZ (i.e. ABC) alpha beta gamma. */ +Box::CellShapeType Box::CellShape() const { + if (!HasBox()) return NO_SHAPE; + bool A_equals_B = IsEq( box_[X], box_[Y] ); + bool Lengths_Equal = A_equals_B && IsEq( box_[X], box_[Z] ); + //mprintf("DEBUG: Lengths_Equal= %i %g %g %g (deltas %g and %g)\n", (int)Lengths_Equal, box_[0], box_[1], box_[2], box_[0]-box_[1], box_[0]-box_[2]); + bool alpha_90 = IsEq( box_[ALPHA], 90.0 ); + bool beta_90 = IsEq( box_[BETA], 90.0 ); + bool gamma_90 = IsEq( box_[GAMMA], 90.0 ); + + if (alpha_90 && beta_90 && gamma_90) { + if (Lengths_Equal) + return CUBIC; + else if ( A_equals_B ) + return TETRAGONAL; + else + return ORTHORHOMBIC; + } else if (alpha_90 && gamma_90) { + return MONOCLINIC; + } else if (A_equals_B && alpha_90 && beta_90 && IsEq( box_[GAMMA], 120.0 )) { + return HEXAGONAL; + } else if (Lengths_Equal) { + if ( IsTruncOct( box_[ALPHA] ) && IsTruncOct( box_[BETA] ) && IsTruncOct( box_[GAMMA] ) ) + return OCTAHEDRAL; + else if (beta_90 && IsEq( box_[ALPHA], 60.0 ) && IsEq( box_[GAMMA], 60.0 )) + return RHOMBIC_DODECAHEDRON; + else if ( box_[ALPHA] < 120.0 && IsEq( box_[ALPHA], box_[BETA] ) && IsEq( box_[ALPHA], box_[GAMMA] ) ) + return RHOMBOHEDRAL; + } + return TRICLINIC; } -bool Box::IsAngle(double angle, double tgt) { - return (fabs(tgt - angle) < Constants::SMALL); -} - -// Box::SetBoxType() -/** Determine box type (none/ortho/nonortho) based on box angles. */ -void Box::SetBoxType() { - btype_ = NONORTHO; - bool noLengths = (box_[0] < Constants::SMALL && - box_[1] < Constants::SMALL && - box_[2] < Constants::SMALL); - bool noAngles = ( box_[3] <= 0 && box_[4] <= 0 && box_[5] <= 0); - if ( noLengths ) { - // No lengths, no box - btype_ = NOBOX; - if (!noAngles) - mprintf("Warning: Box length(s) <= 0.0; setting box to NONE.\n"); - } else if ( noAngles ) { - // No angles, no box - mprintf("Warning: Box angle(s) <= 0.0; setting box to NONE.\n"); - btype_ = NOBOX; - } else if (box_[3] == 90.0 && box_[4] == 90.0 && box_[5] == 90.0) - // All 90, orthogonal - btype_ = ORTHO; - else if ( IsTruncOct( box_[3] ) && IsTruncOct( box_[4] ) && IsTruncOct( box_[5] ) ) - // All 109.47, truncated octahedron - btype_ = TRUNCOCT; - else if ( IsAngle(box_[3],60.0) && IsAngle(box_[4],90.0) && IsAngle(box_[5],60.0) ) - // 60/90/60, rhombic dodecahedron - btype_ = RHOMBIC; - else if (box_[3] == 0 && box_[4] != 0 && box_[5] == 0) { - // Only beta angle is set (e.g. from Amber topology). - if (box_[4] == 90.0) { - btype_ = ORTHO; - box_[3] = 90.0; - box_[5] = 90.0; - //if (debug_>0) mprintf("\tSetting box to be orthogonal\n"); - } else if ( IsTruncOct( box_[4] ) ) { - btype_ = TRUNCOCT; - box_[3] = box_[4]; - box_[5] = box_[4]; - //if (debug_>0) mprintf("\tSetting box to be a truncated octahedron, angle is %lf\n",box_[3]); - } else if (box_[4] == 60.0) { - btype_ = RHOMBIC; - box_[3]=60.0; - box_[4]=90.0; - box_[5]=60.0; - //if (debug_>0) mprintf("\tSetting box to be a rhombic dodecahedron, alpha=gamma=60.0, beta=90.0\n"); - } else { - mprintf("Warning: Box: Unrecognized beta (%g); setting all angles to beta.\n",box_[4]); - box_[3] = box_[4]; - box_[5] = box_[4]; +/** Check the box for potential problems. It is expected that if this routine + * is called, valid box information is present. If not, this is an error. + * \return 1 if no box, 0 otherwise. + */ +int Box::CheckBox() const { + // Check for invalid lengths/angles + bool hasZeros = false; + for (int i = 0; i < 3; i++) { + if (box_[i] < Constants::SMALL) { + mprintf("Warning: Box %s vector length is zero.\n", ParamStr_[i]); + hasZeros = true; + } + } + for (int i = 3; i < 6; i++) { + if (box_[i] < Constants::SMALL) { + mprintf("Warning: Box %s angle is zero.\n", ParamStr_[i]); + hasZeros = true; } } - //if (debug_>0) mprintf("\tBox type is %s (beta=%lf)\n",TypeName(), box_[4]); - if (btype_ == TRUNCOCT) { - // Check for low-precision truncated octahedron angles. + if (hasZeros) return 1; + + CellShapeType cellShape = CellShape(); + // Check for low-precision truncated octahedron angles. + if (cellShape == OCTAHEDRAL) { if ( BadTruncOctAngle(box_[3]) || BadTruncOctAngle(box_[4]) || BadTruncOctAngle(box_[5]) ) mprintf("Warning: Low precision truncated octahedron angles detected (%g vs %g).\n" "Warning: If desired, the 'box' command can be used during processing\n" "Warning: to set higher-precision angles.\n", box_[4], TRUNCOCTBETA_); - } else if (btype_ == NONORTHO) { - // Check for skewed box. - const double boxFactor = 0.5005; - double Xaxis_X = box_[0]; - double Yaxis_X = box_[1]*cos(Constants::DEGRAD*box_[5]); - double Yaxis_Y = box_[1]*sin(Constants::DEGRAD*box_[5]); - double Zaxis_X = box_[2]*cos(Constants::DEGRAD*box_[4]); - double Zaxis_Y = (box_[1]*box_[2]*cos(Constants::DEGRAD*box_[3]) - Zaxis_X*Yaxis_X) / Yaxis_Y; - if ( fabs(Yaxis_X) > boxFactor * Xaxis_X || - fabs(Zaxis_X) > boxFactor * Xaxis_X || - fabs(Zaxis_Y) > boxFactor * Yaxis_Y ) - { - mprintf("Warning: Non-orthogonal box is too skewed to perform accurate imaging.\n" - "Warning: Images and imaged distances may not be the absolute minimum.\n"); - } } + // Check for skewed box. + const double boxFactor = 0.5005; + double Xaxis_X = unitCell_[0]; + double Yaxis_X = unitCell_[3]; + double Yaxis_Y = unitCell_[4]; + double Zaxis_X = unitCell_[6]; + double Zaxis_Y = unitCell_[7]; + if ( fabs(Yaxis_X) > boxFactor * Xaxis_X || + fabs(Zaxis_X) > boxFactor * Xaxis_X || + fabs(Zaxis_Y) > boxFactor * Yaxis_Y ) + { + mprintf("Warning: Box is too skewed to perform accurate imaging.\n" + "Warning: Images and imaged distances may not be the absolute minimum.\n"); + // TODO should this return 1? + } + return 0; } -// Box::ToRecip() -/** Use box coordinates to calculate unit cell and fractional matrix for use - * with imaging routines. Return cell volume. - */ -double Box::ToRecip(Matrix_3x3& ucell, Matrix_3x3& recip) const { - double u12x,u12y,u12z; - double u23x,u23y,u23z; - double u31x,u31y,u31z; - double volume,onevolume; - // If box lengths are zero no imaging possible - if (box_[0]==0.0 || box_[1]==0.0 || box_[2]==0.0) { - ucell.Zero(); - recip.Zero(); - return -1.0; - } - ucell[0] = box_[0]; // u(1,1) - ucell[1] = 0.0; // u(2,1) - ucell[2] = 0.0; // u(3,1) - ucell[3] = box_[1]*cos(Constants::DEGRAD*box_[5]); // u(1,2) - ucell[4] = box_[1]*sin(Constants::DEGRAD*box_[5]); // u(2,2) - ucell[5] = 0.0; // u(3,2) - ucell[6] = box_[2]*cos(Constants::DEGRAD*box_[4]); - ucell[7] = (box_[1]*box_[2]*cos(Constants::DEGRAD*box_[3]) - ucell[6]*ucell[3]) / ucell[4]; - ucell[8] = sqrt(box_[2]*box_[2] - ucell[6]*ucell[6] - ucell[7]*ucell[7]); +// Box::SetNoBox() +/** Remove all box information. */ +void Box::SetNoBox() { + box_[0] = 0; + box_[1] = 0; + box_[2] = 0; + box_[3] = 0; + box_[4] = 0; + box_[5] = 0; + unitCell_.Zero(); + fracCell_.Zero(); + cellVolume_ = 0; +} + +/** Print box info to STDOUT. */ +void Box::PrintInfo() const { + mprintf("\tBox: '%s' XYZ= { %8.3f %8.3f %8.3f } ABG= { %6.2f %6.2f %6.2f }\n", + CellShapeName(), box_[0], box_[1], box_[2], box_[3], box_[4], box_[5]); +} +// ----------------------------------------------------------------------------- +// Static calculation routines. + +/** Calculate fractional matrix from unit cell matrix. + * \return Volume of the unit cell. + */ +double Box::CalcFracFromUcell(Matrix_3x3& recip, Matrix_3x3 const& ucell) { // Get reciprocal vectors - u23x = ucell[4]*ucell[8] - ucell[5]*ucell[7]; - u23y = ucell[5]*ucell[6] - ucell[3]*ucell[8]; - u23z = ucell[3]*ucell[7] - ucell[4]*ucell[6]; - u31x = ucell[7]*ucell[2] - ucell[8]*ucell[1]; - u31y = ucell[8]*ucell[0] - ucell[6]*ucell[2]; - u31z = ucell[6]*ucell[1] - ucell[7]*ucell[0]; - u12x = ucell[1]*ucell[5] - ucell[2]*ucell[4]; - u12y = ucell[2]*ucell[3] - ucell[0]*ucell[5]; - u12z = ucell[0]*ucell[4] - ucell[1]*ucell[3]; - volume=ucell[0]*u23x + ucell[1]*u23y + ucell[2]*u23z; - onevolume = 1.0 / volume; + double u23x = ucell[4]*ucell[8] - ucell[5]*ucell[7]; + double u23y = ucell[5]*ucell[6] - ucell[3]*ucell[8]; + double u23z = ucell[3]*ucell[7] - ucell[4]*ucell[6]; + double u31x = ucell[7]*ucell[2] - ucell[8]*ucell[1]; + double u31y = ucell[8]*ucell[0] - ucell[6]*ucell[2]; + double u31z = ucell[6]*ucell[1] - ucell[7]*ucell[0]; + double u12x = ucell[1]*ucell[5] - ucell[2]*ucell[4]; + double u12y = ucell[2]*ucell[3] - ucell[0]*ucell[5]; + double u12z = ucell[0]*ucell[4] - ucell[1]*ucell[3]; + double volume = ucell[0]*u23x + ucell[1]*u23y + ucell[2]*u23z; + double onevolume = 1.0 / volume; recip[0] = u23x*onevolume; recip[1] = u23y*onevolume; @@ -305,51 +342,66 @@ double Box::ToRecip(Matrix_3x3& ucell, Matrix_3x3& recip) const { return volume; } -// Box::UnitCell() -Matrix_3x3 Box::UnitCell(double scale) const { - Matrix_3x3 ucell; - double by, bz; - switch (btype_) { - case NOBOX: ucell.Zero(); break; - case ORTHO: - ucell[0] = box_[0] * scale; - ucell[1] = 0.0; - ucell[2] = 0.0; - ucell[3] = 0.0; - ucell[4] = box_[1] * scale; - ucell[5] = 0.0; - ucell[6] = 0.0; - ucell[7] = 0.0; - ucell[8] = box_[2] * scale; - break; - case TRUNCOCT: - case RHOMBIC: - case NONORTHO: - by = box_[1] * scale; - bz = box_[2] * scale; - ucell[0] = box_[0] * scale; - ucell[1] = 0.0; - ucell[2] = 0.0; - ucell[3] = by*cos(Constants::DEGRAD*box_[5]); - ucell[4] = by*sin(Constants::DEGRAD*box_[5]); - ucell[5] = 0.0; - ucell[6] = bz*cos(Constants::DEGRAD*box_[4]); - ucell[7] = (by*bz*cos(Constants::DEGRAD*box_[3]) - ucell[6]*ucell[3]) / ucell[4]; - ucell[8] = sqrt(bz*bz - ucell[6]*ucell[6] - ucell[7]*ucell[7]); - break; +/** Calculate unit cell matrix from XYZ ABG array. + * NOTE: Since cos(90 deg.) is not numerically stable (i.e. it is never + * exactly 0.0), trap 90 deg. angles explicitly to ensure + * the unit cell vectors are properly orthogonal. + */ +void Box::CalcUcellFromXyzAbg(Matrix_3x3& ucell, const double* xyzabg) { + // A vector + ucell[0] = xyzabg[0]; // u(1,1) + ucell[1] = 0.0; // u(2,1) + ucell[2] = 0.0; // u(3,1) + // B vector + if ( fabs(xyzabg[5] - 90.0) < Constants::SMALL ) { + ucell[3] = 0.0; + ucell[4] = xyzabg[1]; + } else { + ucell[3] = xyzabg[1]*cos(Constants::DEGRAD*xyzabg[5]); // u(1,2) + ucell[4] = xyzabg[1]*sin(Constants::DEGRAD*xyzabg[5]); // u(2,2) } - return ucell; + ucell[5] = 0.0; // u(3,2) + // C vector + if ( fabs(xyzabg[4] - 90.0) < Constants::SMALL ) + ucell[6] = 0.0; + else + ucell[6] = xyzabg[2]*cos(Constants::DEGRAD*xyzabg[4]); + double y_z_cos_alpha; + if ( fabs(xyzabg[3] - 90.0) < Constants::SMALL ) + y_z_cos_alpha = 0.0; + else + y_z_cos_alpha = xyzabg[1]*xyzabg[2]*cos(Constants::DEGRAD*xyzabg[3]); + ucell[7] = (y_z_cos_alpha - ucell[6]*ucell[3]) / ucell[4]; + ucell[8] = sqrt(xyzabg[2]*xyzabg[2] - ucell[6]*ucell[6] - ucell[7]*ucell[7]); +/* + //The old code for reference. + ucell[0] = xyzabg[0]; // u(1,1) + ucell[1] = 0.0; // u(2,1) + ucell[2] = 0.0; // u(3,1) + ucell[3] = xyzabg[1]*cos(Constants::DEGRAD*xyzabg[5]); // u(1,2) + ucell[4] = xyzabg[1]*sin(Constants::DEGRAD*xyzabg[5]); // u(2,2) + ucell[5] = 0.0; // u(3,2) + ucell[6] = xyzabg[2]*cos(Constants::DEGRAD*xyzabg[4]); + ucell[7] = (xyzabg[1]*xyzabg[2]*cos(Constants::DEGRAD*xyzabg[3]) - ucell[6]*ucell[3]) / ucell[4]; + ucell[8] = sqrt(xyzabg[2]*xyzabg[2] - ucell[6]*ucell[6] - ucell[7]*ucell[7]); +*/ } -// Box::RecipLengths() -Vec3 Box::RecipLengths(Matrix_3x3 const& recip) { - return Vec3( 1.0/sqrt(recip[0]*recip[0] + recip[1]*recip[1] + recip[2]*recip[2]), - 1.0/sqrt(recip[3]*recip[3] + recip[4]*recip[4] + recip[5]*recip[5]), - 1.0/sqrt(recip[6]*recip[6] + recip[7]*recip[7] + recip[8]*recip[8]) ); +/** Calculate XYZ ABG array from unit cell matrix */ +void Box::CalcXyzAbgFromUcell(double* box, Matrix_3x3 const& ucell) { + Vec3 x_axis = ucell.Row1(); + Vec3 y_axis = ucell.Row2(); + Vec3 z_axis = ucell.Row3(); + box[0] = x_axis.Normalize(); // A + box[1] = y_axis.Normalize(); // B + box[2] = z_axis.Normalize(); // C + box[3] = y_axis.Angle( z_axis ) * Constants::RADDEG; // alpha + box[4] = x_axis.Angle( z_axis ) * Constants::RADDEG; // beta + box[5] = x_axis.Angle( y_axis ) * Constants::RADDEG; // gamma } -/** Convert symmetric shape matrix data to unit cell params (x, y, z, a, b, g) */ -void Box::ShapeToUcell(double* box, const double* boxtmp) +/** Convert symmetric shape matrix data to params x, y, z, a, b, g */ +void Box::CalcXyzAbgFromShape(double* box, const double* boxtmp) { double boxX = sqrt( boxtmp[0]*boxtmp[0] + boxtmp[1]*boxtmp[1] + boxtmp[3]*boxtmp[3] ); double boxY = sqrt( boxtmp[1]*boxtmp[1] + boxtmp[2]*boxtmp[2] + boxtmp[4]*boxtmp[4] ); @@ -369,36 +421,312 @@ void Box::ShapeToUcell(double* box, const double* boxtmp) box[5] = gamma; } -void Box::PrintInfo() const { - mprintf("\tBox: '%s' XYZ= { %8.3f %8.3f %8.3f } ABG= { %6.2f %6.2f %6.2f }\n", - BoxNames_[btype_], box_[0], box_[1], box_[2], box_[3], box_[4], box_[5]); +/** Convert unit cell parameters (X, Y, Z, a, b, g) to symmetric shape matrix + * (S11, S12, S22, S13, S23, S33). + */ +void Box::CalcShapeFromXyzAbg(double* shape, const double* box) +{ + // Calculate metric tensor HtH: + // HtH(i,j) = vi * vj + // where vx are basis vectors i and j. Given that v0 is a, v1 is b, v2 is c: + // a^2 a*b a*c + // HtH = b*a b^2 b*c + // c*a c*b c^2 + Matrix_3x3 HtH; + + HtH[0] = box[0] * box[0]; + HtH[4] = box[1] * box[1]; + HtH[8] = box[2] * box[2]; + + // Angles near 90 have elements set to 0.0. + // XY (gamma) + if (fabs(box[5] - 90.0) > Constants::SMALL) + HtH[3] = box[0]*box[1]*cos(Constants::DEGRAD*box[5]); + else + HtH[3] = 0.0; + HtH[1] = HtH[3]; + // XZ (beta) + if (fabs(box[4] - 90.0) > Constants::SMALL) + HtH[6] = box[0]*box[2]*cos(Constants::DEGRAD*box[4]); + else + HtH[6] = 0.0; + HtH[2] = HtH[6]; + // YZ (alpha) + if (fabs(box[3] - 90.0) > Constants::SMALL) + HtH[7] = box[1]*box[2]*cos(Constants::DEGRAD*box[3]); + else + HtH[7] = 0.0; + HtH[5] = HtH[7]; + + // Diagonalize HtH + //HtH.Print("HtH"); // DEBUG + Vec3 Evals; + if (HtH.Diagonalize( Evals )) { + mprinterr("Error: Could not diagonalize metric tensor.\n"); + for (int i=0; i<6; i++) shape[i] = 0.0; + return; + } + + if (Evals[0] < Constants::SMALL || + Evals[1] < Constants::SMALL || + Evals[2] < Constants::SMALL) + { + mprinterr("Error: Obtained negative eigenvalues when attempting to" + " diagonalize metric tensor.\n"); + return; + } + //Evals.Print("Cvals"); // DEBUG + //HtH.Print("Cpptraj"); // DEBUG + + double A = sqrt( Evals[0] ); + double B = sqrt( Evals[1] ); + double C = sqrt( Evals[2] ); + + shape[0] = A*HtH[0]*HtH[0] + B*HtH[1]*HtH[1] + C*HtH[2]*HtH[2]; + shape[2] = A*HtH[3]*HtH[3] + B*HtH[4]*HtH[4] + C*HtH[5]*HtH[5]; + shape[5] = A*HtH[6]*HtH[6] + B*HtH[7]*HtH[7] + C*HtH[8]*HtH[8]; + shape[1] = A*HtH[0]*HtH[3] + B*HtH[1]*HtH[4] + C*HtH[2]*HtH[5]; + shape[3] = A*HtH[0]*HtH[6] + B*HtH[1]*HtH[7] + C*HtH[2]*HtH[8]; + shape[4] = A*HtH[3]*HtH[6] + B*HtH[4]*HtH[7] + C*HtH[5]*HtH[8]; } -static inline void dswap(double& d1, double& d2) { - double dtemp = d1; - d1 = d2; - d2 = dtemp; +// ----------------------------------------------------------------------------- +// Setup routines + +/** Set unit cell, fractional cell, and XYZ ABG array from shape matrix. */ +int Box::SetupFromShapeMatrix(const double* shape) { + unitCell_[0] = shape[0]; + unitCell_[1] = shape[1]; + unitCell_[2] = shape[3]; + + unitCell_[3] = shape[1]; + unitCell_[4] = shape[2]; + unitCell_[5] = shape[4]; + + unitCell_[6] = shape[3]; + unitCell_[7] = shape[4]; + unitCell_[8] = shape[5]; + + CalcXyzAbgFromShape(box_, shape); + + cellVolume_ = CalcFracFromUcell(fracCell_, unitCell_); + +# ifdef DEBUG_BOX + printBoxStatus("SetupFromShapeMatrix"); +# endif + if (CheckBox()) { + SetNoBox(); + return 1; + } + return 0; } -static inline void bswap(Box::BoxType& b1, Box::BoxType& b2) { - Box::BoxType btemp = b1; - b1 = b2; - b2 = btemp; +/** Set up Xyz Abg array and frac cell from unit cell. */ +int Box::SetupFromUcell(const double* ucell) { + std::copy(ucell, ucell+9, unitCell_.Dptr()); + + CalcXyzAbgFromUcell(box_, unitCell_); + + cellVolume_ = CalcFracFromUcell(fracCell_, unitCell_); + +# ifdef DEBUG_BOX + printBoxStatus("SetupFromUcell"); +# endif + if (CheckBox()) { + SetNoBox(); + return 1; + } + return 0; } -void Box::swap(Box& rhs) { - bswap( btype_, rhs.btype_ ); - dswap( box_[0], rhs.box_[0] ); - dswap( box_[1], rhs.box_[1] ); - dswap( box_[2], rhs.box_[2] ); - dswap( box_[3], rhs.box_[3] ); - dswap( box_[4], rhs.box_[4] ); - dswap( box_[5], rhs.box_[5] ); +/** Set unit cell and fractional cell from XYZ ABG parameters. */ +int Box::SetupFromXyzAbg(double bx, double by, double bz, double ba, double bb, double bg) { + box_[0] = bx; + box_[1] = by; + box_[2] = bz; + box_[3] = ba; + box_[4] = bb; + box_[5] = bg; + + CalcUcellFromXyzAbg(unitCell_, box_); + + cellVolume_ = CalcFracFromUcell(fracCell_, unitCell_); + +# ifdef DEBUG_BOX + printBoxStatus("SetupFromXyzAbgIndividual"); +# endif + if (CheckBox()) { + SetNoBox(); + return 1; + } + return 0; } -#ifdef MPI -int Box::SyncBox(Parallel::Comm const& commIn) { - commIn.MasterBcast( &btype_, 1, MPI_INT ); - commIn.MasterBcast( box_, 6, MPI_DOUBLE ); + +/** Set unit cell and fractional cell from XYZ ABG array. */ +int Box::SetupFromXyzAbg(const double* xyzabg) { + box_[0] = xyzabg[0]; + box_[1] = xyzabg[1]; + box_[2] = xyzabg[2]; + box_[3] = xyzabg[3]; + box_[4] = xyzabg[4]; + box_[5] = xyzabg[5]; + + CalcUcellFromXyzAbg(unitCell_, xyzabg); + + cellVolume_ = CalcFracFromUcell(fracCell_, unitCell_); + +# ifdef DEBUG_BOX + printBoxStatus("SetupFromXyzAbg"); +# endif + if (CheckBox()) { + SetNoBox(); + return 1; + } return 0; } -#endif + +// ----------------------------------------------------------------------------- +// Assign routines + +/** Assign Xyz Abg array and frac cell from unit cell. */ +void Box::AssignFromUcell(const double* ucell) { + // Sanity check + //if (btype_ == NOBOX) { + // mprintf("Internal Error: AssignFromUcell(): No box has been set.\n"); + // return; + //} + + std::copy(ucell, ucell+9, unitCell_.Dptr()); + + CalcXyzAbgFromUcell(box_, unitCell_); + + cellVolume_ = CalcFracFromUcell(fracCell_, unitCell_); +# ifdef DEBUG_BOX + printBoxStatus("AssignFromUcell"); +# endif +} + +/** Assign from XYZ ABG parameters. */ +void Box::AssignFromXyzAbg(double bx, double by, double bz, double ba, double bb, double bg) { + // Sanity check + //if (btype_ == NOBOX) { + // mprintf("Internal Error: AssignFromXyzAbgIndividual(): No box has been set.\n"); + // return; + //} + + box_[0] = bx; + box_[1] = by; + box_[2] = bz; + box_[3] = ba; + box_[4] = bb; + box_[5] = bg; + + CalcUcellFromXyzAbg(unitCell_, box_); + + cellVolume_ = CalcFracFromUcell(fracCell_, unitCell_); +# ifdef DEBUG_BOX + printBoxStatus("AssignFromXyzAbgIndividual"); +# endif +} + +/** Assign from XYZ ABG array. */ +void Box::AssignFromXyzAbg(const double* xyzabg) { + // Sanity check + //if (btype_ == NOBOX) { + // mprintf("Internal Error: AssignFromXyzAbg(): No box has been set.\n"); + // return; + //} + // TODO detect orthogonal? + box_[0] = xyzabg[0]; + box_[1] = xyzabg[1]; + box_[2] = xyzabg[2]; + box_[3] = xyzabg[3]; + box_[4] = xyzabg[4]; + box_[5] = xyzabg[5]; + + CalcUcellFromXyzAbg(unitCell_, xyzabg); + //CalcUcellFromXyzAbg(unitCell_, btype_, box_, 1.0); + + cellVolume_ = CalcFracFromUcell(fracCell_, unitCell_); +# ifdef DEBUG_BOX + printBoxStatus("AssignFromXyzAbg"); +# endif +} + +/** Assign from symmetric shape matrix. */ +void Box::AssignFromShapeMatrix(const double* shape) { + // Sanity check + //if (btype_ == NOBOX) { + // mprintf("Internal Error: AssignFromShapeMatrix(): No box has been set.\n"); + // return; + //} + + unitCell_[0] = shape[0]; + unitCell_[1] = shape[1]; + unitCell_[2] = shape[3]; + + unitCell_[3] = shape[1]; + unitCell_[4] = shape[2]; + unitCell_[5] = shape[4]; + + unitCell_[6] = shape[3]; + unitCell_[7] = shape[4]; + unitCell_[8] = shape[5]; + + CalcXyzAbgFromShape(box_, shape); + + cellVolume_ = CalcFracFromUcell(fracCell_, unitCell_); +# ifdef DEBUG_BOX + printBoxStatus("AssignFromShapeMatrix"); +# endif +} + +// ----------------------------------------------------------------------------- +/** Rotate unit cell vectors; recalculate fractional cell vectors. */ +void Box::RotateUcell(Matrix_3x3 const& rot) { + if (!HasBox()) return; + // Rotate each unit cell vector + Vec3 ucellx = rot * unitCell_.Row1(); + Vec3 ucelly = rot * unitCell_.Row2(); + Vec3 ucellz = rot * unitCell_.Row3(); + //ucellx.Print("ucellx"); + //ucelly.Print("ucelly"); + //ucellz.Print("ucellz"); + // Set new unit cell matrix + unitCell_ = Matrix_3x3( ucellx[0], ucellx[1], ucellx[2], + ucelly[0], ucelly[1], ucelly[2], + ucellz[0], ucellz[1], ucellz[2] ); + //unitCell_.Print("RotatedUcell"); + // Recalculate the fractional cell; volume is unchanged. + CalcFracFromUcell(fracCell_, unitCell_); +} + +/** Inverse rotation of unit cell vectors; recalculate fractional cell vectors. */ +void Box::InverseRotateUcell(Matrix_3x3 const& rot) { + if (!HasBox()) return; + // Inverse rotate each unit cell vector + Vec3 ucellx = rot.TransposeMult( unitCell_.Row1() ); + Vec3 ucelly = rot.TransposeMult( unitCell_.Row2() ); + Vec3 ucellz = rot.TransposeMult( unitCell_.Row3() ); + // Set new unit cell matrix + unitCell_ = Matrix_3x3( ucellx[0], ucellx[1], ucellx[2], + ucelly[0], ucelly[1], ucelly[2], + ucellz[0], ucellz[1], ucellz[2] ); + // Recalculate the fractional cell; volume is unchanged. + CalcFracFromUcell(fracCell_, unitCell_); +} + +/** Set 'shape' with values for symmetric shape matrix from XYZ ABG array. */ +void Box::GetSymmetricShapeMatrix(double* shape) const { + CalcShapeFromXyzAbg(shape, box_); +} + +// Box::RecipLengths() +/** \return Vector containing reciprocal lengths from fractional cell matrix. + * Used primarily by the Ewald and PairList routines. + */ +Vec3 Box::RecipLengths() const { + return Vec3( 1.0/sqrt(fracCell_[0]*fracCell_[0] + fracCell_[1]*fracCell_[1] + fracCell_[2]*fracCell_[2]), + 1.0/sqrt(fracCell_[3]*fracCell_[3] + fracCell_[4]*fracCell_[4] + fracCell_[5]*fracCell_[5]), + 1.0/sqrt(fracCell_[6]*fracCell_[6] + fracCell_[7]*fracCell_[7] + fracCell_[8]*fracCell_[8]) ); +} diff --git a/src/Box.h b/src/Box.h index b5db28cbcc..051bd26380 100644 --- a/src/Box.h +++ b/src/Box.h @@ -5,78 +5,148 @@ #ifdef MPI # include "Parallel.h" #endif -/// Hold box information; 3xlengths, 3xangles. +/// Hold box information; unit and fractional cell vectors, 3xlengths, 3xangles. class Box { public: - enum BoxType { NOBOX=0, ORTHO, TRUNCOCT, RHOMBIC, NONORTHO }; - + /// Various box parameters; corresponds to XYZ ABG array. + enum ParamType { X=0, Y, Z, ALPHA, BETA, GAMMA }; + /// Cell shape types + enum CellShapeType { NO_SHAPE = 0, + CUBIC, TETRAGONAL, ORTHORHOMBIC, + MONOCLINIC, TRICLINIC, HEXAGONAL, + RHOMBOHEDRAL, OCTAHEDRAL, RHOMBIC_DODECAHEDRON }; + /// CONSTRUCTOR Box(); - Box(const double*); - Box(const float*); - Box(Matrix_3x3 const&); + /// COPY CONSTRUCTOR Box(const Box&); + /// ASSIGNMENT Box& operator=(const Box&); + /// SWAP + void swap(Box&); +# ifdef MPI + int SyncBox(Parallel::Comm const&); + int SendBox(int, Parallel::Comm const&); + int RecvBox(int, Parallel::Comm const&); +# endif + /// Remove all box information + void SetNoBox(); + /// Rotate unit/frac cell vectors + void RotateUcell(Matrix_3x3 const&); + /// Inverse rotate unit/frac cell vectors + void InverseRotateUcell(Matrix_3x3 const&); + /// \return Current cell shape based on lengths and angles + CellShapeType CellShape() const; + // ------------------------------------------- + // Setup routines; will set the box type and perform checks. + int SetupFromShapeMatrix(const double*); - const char* TypeName() const { return BoxNames_[btype_]; } + int SetupFromUcell(const double*); + + int SetupFromUcell(Matrix_3x3 const& ucell) { return SetupFromUcell(ucell.Dptr()); } + + int SetupFromXyzAbg(double,double,double,double,double,double); + + int SetupFromXyzAbg(const double*); + + // ------------------------------------------- + // Assign routines; just assign box lengths, not type; no checks. + void AssignFromUcell(const double*); + + void AssignFromXyzAbg(double,double,double,double,double,double); + + void AssignFromXyzAbg(const double*); + + void AssignFromShapeMatrix(const double*); + + // ------------------------------------------- + /// Set incoming array of length 6 with shape matrix; suitable for Charmm + void GetSymmetricShapeMatrix(double*) const; + + /// \return vector containing reciprocal lengths from fractional cell matrix + Vec3 RecipLengths() const; - void SetBetaLengths(double,double,double,double); - void SetBox(const double*); - void SetBox(const float*); - void SetBox(Matrix_3x3 const&); - void SetBox(float,float,float,float,float,float); - void SetTruncOct(); - void SetNoBox(); - void SetMissingInfo(const Box&); - /// Calculate Frac->Cart and Cart->Frac matrices. - double ToRecip(Matrix_3x3&, Matrix_3x3&) const; - /// Calculate unit cell matrix, optionally scaling lengths. - Matrix_3x3 UnitCell(double) const; /// Print Box info to STDOUT void PrintInfo() const; + /// Print box debug info to stdout + void PrintDebug(const char*) const; + /// \return Name of current cell shape + const char* CellShapeName() const { return CellShapeStr_[CellShape()]; } + /// \return Specified XYZ ABG parameter + double Param(ParamType p) const { return box_[p]; } + /// \return True if box info present + bool HasBox() const { return (box_[0] > 0); } + //bool HasBox() const { return (btype_ != NOBOX); } + /// \return Vector containing box center. + Vec3 Center() const { return Vec3(box_[0]/2.0, box_[1]/2.0, box_[2]/2.0); } + /// \return Vector containing box center. + // TODO Pretty sure this is the right way to calculate box center, but it breaks + // tests so more testing is needed. + //Vec3 Center() const { return (UnitCell().TransposeMult(Vec3(0.5))); } + /// \return Vector containing box lengths + Vec3 Lengths() const { return Vec3(box_[0], box_[1], box_[2]); } + /// \return the unit cell matrix. + /** The rows of this matrix represent the cell axes A, B C. + * Fractional coords F can be converted to Cartesian coords C via + * C = UnitCell().TransposeMult( F ) + */ + Matrix_3x3 const& UnitCell() const { return unitCell_; } + /// \return the fractional cell matrix. + /** Cartesian coords C can be converted to fractional coords F via + * F = FracCell() * C + */ + Matrix_3x3 const& FracCell() const { return fracCell_; } + /// \return the cell volume + double CellVolume() const { return cellVolume_; } + /// \return True if A is aligned X axis (xyz abg reference). + bool Is_X_Aligned() const; + /// \return True if X-aligned and cell is orthogonal. + bool Is_X_Aligned_Ortho() const; + /// \return True if unit cell off-diagonal elements are symmetric + bool Is_Symmetric() const; - void SetX(double xin) { box_[0] = xin; } - void SetY(double yin) { box_[1] = yin; } - void SetZ(double zin) { box_[2] = zin; } - void SetAlpha(double ain) { box_[3] = ain; } - void SetBeta(double bin) { box_[4] = bin; } - void SetGamma(double gin) { box_[5] = gin; } - - BoxType Type() const { return btype_; } - double BoxX() const { return box_[0]; } - double BoxY() const { return box_[1]; } - double BoxZ() const { return box_[2]; } - double Alpha() const { return box_[3]; } - double Beta() const { return box_[4]; } - double Gamma() const { return box_[5]; } - bool HasBox() const { return (btype_ != NOBOX); } - Vec3 Center() const { return Vec3(box_[0]/2.0, box_[1]/2.0, box_[2]/2.0); } - Vec3 Lengths() const { return Vec3(box_[0], box_[1], box_[2]); } - static Vec3 RecipLengths(Matrix_3x3 const&); - static void ShapeToUcell(double*, const double*); - void swap(Box&); - // For interfacing with file IO - double* boxPtr() { return box_; } - const double* boxPtr() const { return box_; } - - double const& operator[](int idx) const { return box_[idx]; } - double& operator[](int idx) { return box_[idx]; } -# ifdef MPI - int SyncBox(Parallel::Comm const&); -# endif + /// \return true if the given angle is suitable for a truncated octahedron + static bool IsTruncOct(double); + // \return Truncated oct angle in degrees TODO should this be in Constants? + static double TruncatedOctAngle() { return TRUNCOCTBETA_; } + + // For interfacing with file IO + /// Double pointer starting at lengths (XYZ) + const double* XyzPtr() const { return box_; } + /// Double pointer starting at angles (ABG) + const double* AbgPtr() const { return box_+3; } private: - static inline bool IsTruncOct(double); - static inline bool BadTruncOctAngle(double); - static inline bool IsAngle(double,double); - void SetBoxType(); - static const double TRUNCOCTBETA_; static const double TruncOctDelta_; static const double TruncOctMin_; static const double TruncOctMax_; static const double TruncOctEps_; - static const char* BoxNames_[]; - //int debug_; // TODO: Replace with ifdefs or just comment out? - BoxType btype_; ///< Box type - double box_[6]; ///< Box X Y Z alpha beta gamma + static const double EqEps_; + /// Names corresponding to ParamType + static const char* ParamStr_[]; + /// Names corresponding to CellShapeType + static const char* CellShapeStr_[]; + + static inline bool BadTruncOctAngle(double); + static inline bool IsEq(double,double); + + void printBoxStatus(const char*) const; + /// \return 1 if box has issues, 0 otherwise. + int CheckBox() const; + + /// Calculate fractional matrix from unit cell matrix. + static inline double CalcFracFromUcell(Matrix_3x3&, Matrix_3x3 const&); + /// Calculate unit cell matrix from XYZ ABG array. + static inline void CalcUcellFromXyzAbg(Matrix_3x3&, const double*); + /// Calculate XYZ ABG array from unit cell matrix + static void CalcXyzAbgFromUcell(double*, Matrix_3x3 const&); + /// Calculate XYZ ABG array from symmetric shape matrix + static void CalcXyzAbgFromShape(double*, const double*); + /// Calculate symmetric shape matrix from XYZ ABG array + static void CalcShapeFromXyzAbg(double*, const double*); + + double box_[6]; ///< Box X Y Z alpha beta gamma + Matrix_3x3 unitCell_; ///< Unit cell (Cartesian) matrix + Matrix_3x3 fracCell_; ///< Fractional coord. cell matrix + double cellVolume_; ///< Unit cell volume }; #endif diff --git a/src/BoxArgs.cpp b/src/BoxArgs.cpp new file mode 100644 index 0000000000..a9f63280b1 --- /dev/null +++ b/src/BoxArgs.cpp @@ -0,0 +1,128 @@ +#include "BoxArgs.h" +#include "ArgList.h" +#include "CpptrajStdio.h" +#include "Box.h" + +/** CONSTRUCTOR */ +BoxArgs::BoxArgs() { + for (int i = 0; i < 6; i++) { + xyzabg_[i] = 0; + setVar_[i] = false; + } +} + +/** Keywords for SetBoxArgs() */ +const char* BoxArgs::Keywords_XyzAbg() { + return "[x ] [y ] [z ] [alpha ] [beta ] [gamma ]"; +} + +/** Keyword for truncated oct. */ +const char* BoxArgs::Keywords_TruncOct() { + return "truncoct [x ]"; +} + +/** Set variables from argument list. */ +int BoxArgs::SetBoxArgs(ArgList& actionArgs) { + // TODO check for bad args? + if (actionArgs.Contains("x")) { xyzabg_[0] = actionArgs.getKeyDouble("x", 0.0); setVar_[0] = true; } + if (actionArgs.Contains("y")) { xyzabg_[1] = actionArgs.getKeyDouble("y", 0.0); setVar_[1] = true; } + if (actionArgs.Contains("z")) { xyzabg_[2] = actionArgs.getKeyDouble("z", 0.0); setVar_[2] = true; } + if (actionArgs.Contains("alpha")) { xyzabg_[3] = actionArgs.getKeyDouble("alpha", 0.0); setVar_[3] = true; } + if (actionArgs.Contains("beta")) { xyzabg_[4] = actionArgs.getKeyDouble("beta", 0.0); setVar_[4] = true; } + if (actionArgs.Contains("gamma")) { xyzabg_[5] = actionArgs.getKeyDouble("gamma", 0.0); setVar_[5] = true; } + if (actionArgs.hasKey("truncoct")) { + xyzabg_[3] = Box::TruncatedOctAngle(); + xyzabg_[4] = xyzabg_[3]; + xyzabg_[5] = xyzabg_[3]; + setVar_[3] = true; + setVar_[4] = true; + setVar_[5] = true; + // All lengths need to be the same + if (setVar_[1]) { mprintf("Warning: Only 'x' used for 'truncoct'\n"); setVar_[1] = false; } + if (setVar_[2]) { mprintf("Warning: Only 'x' used for 'truncoct'\n"); setVar_[2] = false; } + if (setVar_[0]) { + xyzabg_[1] = xyzabg_[0]; + xyzabg_[2] = xyzabg_[0]; + setVar_[1] = true; + setVar_[2] = true; + } + } + return 0; +} + +/** Set all angles to given value. */ +void BoxArgs::SetAngles(double angleIn) { + for (int i = 3; i < 6; i++) + { + xyzabg_[i] = angleIn; + setVar_[i] = true; + } +} + +/** Set all lengths to given value. */ +void BoxArgs::SetLengths(double lengthIn) { + for (int i = 0; i < 3; i++) + { + xyzabg_[i] = lengthIn; + setVar_[i] = true; + } +} + +/** Print set values of XYZ ABG array to STDOUT. */ +void BoxArgs::PrintXyzAbg() const { + if (setVar_[0]) mprintf(" X=%.3f", xyzabg_[0]); + if (setVar_[1]) mprintf(" Y=%.3f", xyzabg_[1]); + if (setVar_[2]) mprintf(" Z=%.3f", xyzabg_[2]); + if (setVar_[3]) mprintf(" A=%.3f", xyzabg_[3]); + if (setVar_[4]) mprintf(" B=%.3f", xyzabg_[4]); + if (setVar_[5]) mprintf(" G=%.3f", xyzabg_[5]); + mprintf("\n"); +} + +/** Used to set an empty param1 from the other params. */ +int BoxArgs::SetEmptyInfo(const char* str1, double& param1, + const char* str2, double param2, + const char* str3, double param3) +{ + mprintf("Warning: Box %s is empty.", str1); + if (param2 > 0) { + mprintf(" Setting from %s (%f)\n", str2, param2); + param1 = param2; + return 0; + } else if (param3 > 0) { + mprintf(" Setting from %s (%f)\n", str3, param3); + param1 = param3; + return 0; + } + mprintf("\n"); + mprinterr("Error: Nothing available to set box %s\n", str1); + return 1; +} + +/** Set any values in xyz abg array not already set with info from box. */ +int BoxArgs::SetMissingInfo(Box const& boxIn) { + for (int i = 0; i < 6; i++) { + if (!setVar_[i]) xyzabg_[i] = boxIn.Param((Box::ParamType)i); + //if (!setVar_[i]) mprintf("DEBUG: SetMissingInfo param %i boxIn= %12.4f\n", i, boxIn.Param((Box::ParamType)i)); + } + if (xyzabg_[Box::X] <= 0) { + if (SetEmptyInfo("X", xyzabg_[Box::X], "Y", xyzabg_[Box::Y], "Z", xyzabg_[Box::Z])) return 1; + } + if (xyzabg_[Box::Y] <= 0) { + if (SetEmptyInfo("Y", xyzabg_[Box::Y], "X", xyzabg_[Box::X], "Z", xyzabg_[Box::Z])) return 1; + } + if (xyzabg_[Box::Z] <= 0) { + if (SetEmptyInfo("Z", xyzabg_[Box::Z], "X", xyzabg_[Box::X], "Y", xyzabg_[Box::Y])) return 1; + } + if (xyzabg_[Box::ALPHA] <= 0) { + if (SetEmptyInfo("alpha", xyzabg_[Box::ALPHA], "beta", xyzabg_[Box::BETA], "gamma", xyzabg_[Box::GAMMA])) return 1; + } + if (xyzabg_[Box::BETA] <= 0) { + if (SetEmptyInfo("beta", xyzabg_[Box::BETA], "alpha", xyzabg_[Box::ALPHA], "gamma", xyzabg_[Box::GAMMA])) return 1; + } +if (xyzabg_[Box::GAMMA] <= 0) { + if (SetEmptyInfo("gamma", xyzabg_[Box::GAMMA], "alpha", xyzabg_[Box::ALPHA], "beta", xyzabg_[Box::BETA])) return 1; + } + + return 0; +} diff --git a/src/BoxArgs.h b/src/BoxArgs.h new file mode 100644 index 0000000000..02f25c2849 --- /dev/null +++ b/src/BoxArgs.h @@ -0,0 +1,31 @@ +#ifndef INC_BOXARGS_H +#define INC_BOXARGS_H +class ArgList; +class Box; +/// Hold XYZ ABG arguments for setting up a box. +class BoxArgs { + public: + BoxArgs(); + /// Keywords for setting XYZ ABG + static const char* Keywords_XyzAbg(); + /// Keywords for setting truncated octohedron + static const char* Keywords_TruncOct(); + /// Set box arguments from keywords + int SetBoxArgs(ArgList&); + /// Set all lengths to given value + void SetLengths(double); + /// Set all angles to given value + void SetAngles(double); + /// Set info not already set from given box + int SetMissingInfo(Box const&); + /// Print info that has been set to STDOUT + void PrintXyzAbg() const; + /// \return Pointer to XYZ ABG array + const double* XyzAbg() const { return xyzabg_; } + private: + static int SetEmptyInfo(const char*, double&, const char*, double, const char*, double); + + double xyzabg_[6]; ///< Hold box information to be set. + bool setVar_[6]; ///< If true, that part of the xyzabg_ array has been set. +}; +#endif diff --git a/src/CompactFrameArray.cpp b/src/CompactFrameArray.cpp new file mode 100644 index 0000000000..8ff454f10d --- /dev/null +++ b/src/CompactFrameArray.cpp @@ -0,0 +1,288 @@ +#include "CompactFrameArray.h" +#include "CpptrajStdio.h" +#include // std::fill + +/** CONSTRUCTOR */ +CompactFrameArray::CompactFrameArray() : + currentIdx_(-1), + maxIdx_(0) +{ + std::fill(componentIdx_, componentIdx_+CoordinateInfo::NCOMPONENTS, -1); +} + +/** COPY CONSTRUCTOR */ +CompactFrameArray::CompactFrameArray(CompactFrameArray const& rhs) : + compactFrames_(rhs.compactFrames_), + components_(rhs.components_), + offsets_(rhs.offsets_), + currentIdx_(rhs.currentIdx_), + maxIdx_(rhs.maxIdx_) +{ + std::copy(rhs.componentIdx_, rhs.componentIdx_+CoordinateInfo::NCOMPONENTS, componentIdx_); +} + +/** ASSIGNMENT OPERATOR */ +CompactFrameArray& CompactFrameArray::operator=(CompactFrameArray const& rhs) { + if (this == &rhs) return *this; + compactFrames_ = rhs.compactFrames_; + std::copy(rhs.componentIdx_, rhs.componentIdx_+CoordinateInfo::NCOMPONENTS, componentIdx_); + components_ = rhs.components_; + offsets_ = rhs.offsets_; + currentIdx_ = rhs.currentIdx_; + maxIdx_ = rhs.maxIdx_; + return *this; +} + +/** Allocate for specified number of frames. */ +void CompactFrameArray::Resize(int nframes) { + //rprintf("DEBUG: Calling CompactFrameArray::Resize for %i frames.\n", nframes); + if (nframes > 0 && !offsets_.empty()) { + compactFrames_.resize( offsets_.back() * nframes ); + maxIdx_ = nframes; + if (currentIdx_ >= maxIdx_) + currentIdx_ = maxIdx_ - 1; + } +} + +/** \return Size of a single frame in elements. */ +unsigned int CompactFrameArray::FrameSize() const { + if (offsets_.empty()) + return 0; + else + return (unsigned int)offsets_.back(); +} + +/** \return Total size of the array in bytes. */ +unsigned int CompactFrameArray::SizeInBytes() const { + return ( compactFrames_.size() * sizeof(float) + + CoordinateInfo::NCOMPONENTS * sizeof(int) + + components_.size() * sizeof(CoordinateInfo::Component) + + offsets_.size() * sizeof(long int) + + 2 * sizeof(int) // currentIdx_ and maxIdx_ + ); +} + +/** Compare components and offsets */ +bool CompactFrameArray::operator!=(CompactFrameArray const& rhs) const { + if (components_.size() != rhs.components_.size() || + offsets_.size() != rhs.offsets_.size()) + return true; + for (unsigned int cidx = 0; cidx != components_.size(); cidx++) + { + if (components_[cidx] != rhs.components_[cidx]) return true; + if (offsets_[cidx] != rhs.offsets_[cidx] ) return true; + } + if (offsets_.size() > 0 && offsets_.back() != rhs.offsets_.back()) + return true; + return false; +} + +/** Add component of specified size to array, update the offset. */ +void CompactFrameArray::addComponent(long int& currentOffset, CoordinateInfo::Component compIn, + long int sizeIn) +{ + componentIdx_[compIn] = components_.size(); + components_.push_back( compIn ); + offsets_.push_back( currentOffset ); + currentOffset += sizeIn; +} + +/** \return Size of a frame containing given coordinate info in bytes. */ +unsigned int CompactFrameArray::EstimateFrameSizeInBytes(CoordinateInfo const& cinfoIn, unsigned int natoms) +{ + unsigned int frameSize = 0; + if (cinfoIn.HasCrd()) frameSize += natoms * 3; + if (cinfoIn.HasVel()) frameSize += natoms * 3; + if (cinfoIn.HasForce()) frameSize += natoms * 3; + if (cinfoIn.HasBox()) frameSize += 9; + if (cinfoIn.HasTemp()) frameSize += 1; + if (cinfoIn.Has_pH()) frameSize += 1; + if (cinfoIn.HasRedOx()) frameSize += 1; + if (cinfoIn.HasTime()) frameSize += 1; + if (cinfoIn.HasStep()) frameSize += 1; + if (cinfoIn.HasReplicaDims()) frameSize += cinfoIn.ReplicaDimensions().Ndims(); + if (cinfoIn.HasRepIdx()) frameSize += 1; + if (cinfoIn.HasCrdIdx()) frameSize += 1; + + return frameSize * sizeof(float); +} + +/** Set up frame array. */ +int CompactFrameArray::SetupFrameArray(CoordinateInfo const& cinfoIn, unsigned int natoms, int nframes) +{ + std::fill(componentIdx_, componentIdx_+CoordinateInfo::NCOMPONENTS, -1); + components_.clear(); + offsets_.clear(); + long int currentOffset = 0; + + if (cinfoIn.HasCrd()) + addComponent(currentOffset, CoordinateInfo::POSITION, (long int)natoms * 3); + if (cinfoIn.HasVel()) + addComponent(currentOffset, CoordinateInfo::VELOCITY, (long int)natoms * 3); + if (cinfoIn.HasForce()) + addComponent(currentOffset, CoordinateInfo::FORCE, (long int)natoms * 3); + if (cinfoIn.HasBox()) + addComponent(currentOffset, CoordinateInfo::BOX, 9); + if (cinfoIn.HasTemp()) + addComponent(currentOffset, CoordinateInfo::TEMPERATURE, 1); + if (cinfoIn.Has_pH()) + addComponent(currentOffset, CoordinateInfo::PH, 1); + if (cinfoIn.HasRedOx()) + addComponent(currentOffset, CoordinateInfo::REDOX, 1); + if (cinfoIn.HasTime()) + addComponent(currentOffset, CoordinateInfo::TIME, 1); + if (cinfoIn.HasStep()) + addComponent(currentOffset, CoordinateInfo::STEP, 1); + if (cinfoIn.HasReplicaDims()) + addComponent(currentOffset, CoordinateInfo::REMD_INDICES, cinfoIn.ReplicaDimensions().Ndims()); + if (cinfoIn.HasRepIdx()) + addComponent(currentOffset, CoordinateInfo::REPIDX, 1); + if (cinfoIn.HasCrdIdx()) + addComponent(currentOffset, CoordinateInfo::CRDIDX, 1); + + // Final "offset" is the total frame size + offsets_.push_back( currentOffset ); + + // Allocate for specified number of frames + Resize(nframes); + currentIdx_ = -1; +/* + rprintf("DEBUG: CompactFrameArray (%u frames) has the following components:\n", maxIdx_); + for (unsigned int cidx = 0; cidx != components_.size(); cidx++) + rprintf("DEBUG:\t%20s : %li - %li\n", CoordinateInfo::ComponentStr(components_[cidx]), + offsets_[cidx], offsets_[cidx+1]); +*/ + return 0; +} + +// ----------------------------------------------------------------------------- +/// \return 1 and print a error message that the given component is not in the array. +static inline int ComponentNotFoundErr(CoordinateInfo::Component cmpt) { + mprinterr("Error: Component '%s' not present.\n", CoordinateInfo::ComponentStr(cmpt)); + return 1; +} + +/** Seek to frame, allocate if necessary. */ +void CompactFrameArray::SeekAndAllocate(unsigned int idx) { + if ((int)idx >= maxIdx_) { + compactFrames_.resize( (idx+1) * offsets_.back() ); + maxIdx_ = idx+1; + } + currentIdx_ = idx; + //rprintf("DBG: Called SeekAndAllocate(%u), currentIdx=%i maxIdx=%i\n", idx, currentIdx_, maxIdx_); + //unsigned int frameBeginIdx = idx * offsets_.back(); + //if (frameBeginIdx >= compactFrames_.size()) { + // } + //frameBegin_ = &compactFrames_[0] + frameBeginIdx; +} + +/** Advance to next frame, allocte if necessary. */ +void CompactFrameArray::NextAndAllocate() { + SeekAndAllocate( currentIdx_+1 ); +} + +/** Set component at current frame from given double pointer. */ +int CompactFrameArray::SetFromDblPtr(const double* ptrIn, CoordinateInfo::Component cmpt) +{ + int cidx = componentIdx_[cmpt]; + if (cidx < 0) return ComponentNotFoundErr(cmpt); + float* frameBegin = (&compactFrames_[0]) + (currentIdx_ * offsets_.back()); + const double* ptr = ptrIn; + for (long int i = offsets_[cidx]; i != offsets_[cidx+1]; ++i, ++ptr) + frameBegin[i] = (float)(*ptr); + return 0; +} + +/** Set component at current frame from given integer pointer. */ +int CompactFrameArray::SetFromIntPtr(const int* ptrIn, CoordinateInfo::Component cmpt) +{ + int cidx = componentIdx_[cmpt]; + if (cidx < 0) return ComponentNotFoundErr(cmpt); + float* frameBegin = (&compactFrames_[0]) + (currentIdx_ * offsets_.back()); + const int* ptr = ptrIn; + for (long int i = offsets_[cidx]; i != offsets_[cidx+1]; ++i, ++ptr) + frameBegin[i] = (float)(*ptr); + return 0; +} + +/** Set single value component at current frame. */ +int CompactFrameArray::SetFromDblVal(double dval, CoordinateInfo::Component cmpt) +{ + int cidx = componentIdx_[cmpt]; + if (cidx < 0) return ComponentNotFoundErr(cmpt); + float* frameBegin = (&compactFrames_[0]) + (currentIdx_ * offsets_.back()); + frameBegin[offsets_[cidx]] = (float)dval; + return 0; +} + +/** Set single value component at current frame. */ +int CompactFrameArray::SetFromIntVal(int ival, CoordinateInfo::Component cmpt) +{ + int cidx = componentIdx_[cmpt]; + if (cidx < 0) return ComponentNotFoundErr(cmpt); + float* frameBegin = (&compactFrames_[0]) + (currentIdx_ * offsets_.back()); + frameBegin[offsets_[cidx]] = (float)ival; + return 0; +} +// ----------------------------------------------------------------------------- +/** Copy component to given double pointer. */ +int CompactFrameArray::GetToDblPtr(double* ptrOut, unsigned int idx, CoordinateInfo::Component cmpt) +const +{ + int cidx = componentIdx_[cmpt]; + if (cidx < 0) return ComponentNotFoundErr(cmpt); + const float* frameBegin = (&compactFrames_[0]) + (idx * offsets_.back()); + double* ptr = ptrOut; + for (long int i = offsets_[cidx]; i != offsets_[cidx+1]; ++i, ++ptr) + *ptr = (double)(frameBegin[i]); + return 0; +} + +/** Copy component to given double pointer with mask. For use with coords, + * velocities, forces. + */ +int CompactFrameArray::GetToMaskDblPtr(double* ptrOut, std::vector const& selected, unsigned int idx, + CoordinateInfo::Component cmpt) +const +{ + int cidx = componentIdx_[cmpt]; + if (cidx < 0) return ComponentNotFoundErr(cmpt); + const float* frameBegin = (&compactFrames_[0]) + (idx * offsets_.back()); + // Loop over atom indices in the mask. + for (unsigned int j = 0; j != selected.size(); j++) + { + // Used for coordinate index in compactFrames_ + int frmIdx = 3*selected[j]; + // Used for coordinate index in ptrOut (Frame) + unsigned int ptrIdx = 3*j; + ptrOut[ptrIdx ] = (double)(frameBegin[offsets_[cidx] + frmIdx ]); + ptrOut[ptrIdx+1] = (double)(frameBegin[offsets_[cidx] + frmIdx+1]); + ptrOut[ptrIdx+2] = (double)(frameBegin[offsets_[cidx] + frmIdx+2]); + } + // ptrOut[j] = (double)(frameBegin[offsets_[cidx] + (3*selected[j])]); + + return 0; +} + +/** Copy component to given integer pointer. */ +int CompactFrameArray::GetToIntPtr(int* ptrOut, unsigned int idx, CoordinateInfo::Component cmpt) +const +{ + int cidx = componentIdx_[cmpt]; + if (cidx < 0) return ComponentNotFoundErr(cmpt); + const float* frameBegin = (&compactFrames_[0]) + (idx * offsets_.back()); + int* ptr = ptrOut; + for (long int i = offsets_[cidx]; i != offsets_[cidx+1]; ++i, ++ptr) + *ptr = (int)(frameBegin[i]); + return 0; +} + +/** \return Single value component. */ +float CompactFrameArray::GetVal(unsigned int idx, CoordinateInfo::Component cmpt) +const +{ + int cidx = componentIdx_[cmpt]; + if (cidx < 0) return ComponentNotFoundErr(cmpt); + const float* frameBegin = (&compactFrames_[0]) + (idx * offsets_.back()); + return frameBegin[offsets_[cidx]]; +} diff --git a/src/CompactFrameArray.h b/src/CompactFrameArray.h new file mode 100644 index 0000000000..dda632d25d --- /dev/null +++ b/src/CompactFrameArray.h @@ -0,0 +1,79 @@ +#ifndef INC_COMPACTFRAMEARRAY_H +#define INC_COMPACTFRAMEARRAY_H +#include "CoordinateInfo.h" +/// Hold a compact version of the time-depedent information contained in an array of Frames +class CompactFrameArray { + public: + /// CONSTRUCTOR + CompactFrameArray(); + /// COPY CONSTRUCTOR + CompactFrameArray(CompactFrameArray const&); + /// ASSIGNMENT + CompactFrameArray& operator=(CompactFrameArray const&); + + /// \return True if set up for any components + bool HasComponents() const { return !(components_.empty()); } + /// \return True if set up for specific component + bool HasComponent(CoordinateInfo::Component c) const { return (componentIdx_[c] > -1); } + /// \return Max number of frames that can fit in the array + int MaxFrames() const { return maxIdx_; } + /// \return Array size in bytes. + unsigned int SizeInBytes() const; + /// \return Size of a single frame in elements + unsigned int FrameSize() const; + /// \return True if components/offsets do not match + bool operator!=(CompactFrameArray const&) const; + + typedef std::vector::iterator iterator; + typedef std::vector::const_iterator const_iterator; + /// \return Modifiable iterator to beginning of specified frame + iterator frameBegin(unsigned int idx) { return compactFrames_.begin() + (idx * offsets_.back()); } + /// \return Const interator to beginning of specified frame + const_iterator frameBegin(unsigned int idx) const { return compactFrames_.begin() + (idx * offsets_.back()); } + + /// \return Pointer to beginning of specified frame + float* FramePtr(unsigned int idx) { return (&compactFrames_[0]) + (idx * offsets_.back()); } + /// \return Const pointer to beginning of specified frame + const float* FramePtr(unsigned int idx) const { return (&compactFrames_[0]) + (idx * offsets_.back()); } + + /// \return Frame size in bytes based on coordinate info and # atoms + static unsigned int EstimateFrameSizeInBytes(CoordinateInfo const&, unsigned int); + + /// Allocate for specified number of frames + void Resize(int); + /// Set up frame array to hold coordinate info with specified # atoms, optionally # frames. + int SetupFrameArray(CoordinateInfo const&, unsigned int, int); + + /// Seek to specified frame, allocate space if necessary. + void SeekAndAllocate(unsigned int); + /// Advance to next frame, allocate space if necessary. + void NextAndAllocate(); + /// Copy component from double array to specified frame + int SetFromDblPtr(const double*, CoordinateInfo::Component); + /// Copy component from integer array to specified frame + int SetFromIntPtr(const int*, CoordinateInfo::Component); + /// Copy component from double value to specified frame + int SetFromDblVal(double, CoordinateInfo::Component); + /// Copy component from integer value to specified frame + int SetFromIntVal(int, CoordinateInfo::Component); + + /// Copy component from specified frame to double array + int GetToDblPtr(double*, unsigned int, CoordinateInfo::Component) const; + /// Copy parts of component from specified frame to double array + int GetToMaskDblPtr(double*, std::vector const&, unsigned int, CoordinateInfo::Component) const; + /// Copy component from specified frame to integer array + int GetToIntPtr(int*, unsigned int, CoordinateInfo::Component) const; + /// \return component for specified frame (assumes size is 1) + float GetVal(unsigned int, CoordinateInfo::Component) const; + private: + void addComponent(long int&, CoordinateInfo::Component, long int); + + typedef std::vector Farray; + Farray compactFrames_; ///< Array storing all info. + int componentIdx_[CoordinateInfo::NCOMPONENTS]; ///< Index into arrays for each component + std::vector components_; ///< List info contained in this array. + std::vector offsets_; ///< Offsets for each component present. + int currentIdx_; ///< Current frame position. -1 indicates empty array. + int maxIdx_; ///< Max frame position. +}; +#endif diff --git a/src/CoordinateInfo.cpp b/src/CoordinateInfo.cpp index 96e6472ed0..d2fcb20b8d 100644 --- a/src/CoordinateInfo.cpp +++ b/src/CoordinateInfo.cpp @@ -71,9 +71,29 @@ CoordinateInfo::CoordinateInfo(int e, ReplicaDimArray const& r, Box const& b, useRemdValues_(u) {} +/** \return Character string corresponding to given component. */ +const char* CoordinateInfo::ComponentStr(Component cmptIn) { + switch (cmptIn) { + case POSITION : return "Position"; + case VELOCITY : return "Velocity"; + case FORCE : return "Force"; + case BOX : return "Box"; + case TEMPERATURE : return "Temperature"; + case PH : return "pH"; + case REDOX : return "RedOx"; + case TIME : return "Time"; + case STEP : return "Step"; + case REMD_INDICES : return "REMD_indices"; + case REPIDX : return "Replica_indices"; + case CRDIDX : return "Coord_indices"; + case NCOMPONENTS : break; + } + return 0; +} + /** DEBUG: Print info to stdout. */ void CoordinateInfo::PrintCoordInfo(const char* name, const char* parm) const { - mprintf("DBG: '%s' parm '%s' CoordInfo={ box type %s", name, parm, box_.TypeName()); + mprintf("DBG: '%s' parm '%s' CoordInfo={ box type %s", name, parm, box_.CellShapeName()); if (remdDim_.Ndims() > 0) mprintf(", %i rep dims", remdDim_.Ndims()); if (hasCrd_) mprintf(", coords"); if (hasVel_) mprintf(", velocities"); diff --git a/src/CoordinateInfo.h b/src/CoordinateInfo.h index 538c5c4fe3..107b3df909 100644 --- a/src/CoordinateInfo.h +++ b/src/CoordinateInfo.h @@ -14,6 +14,13 @@ class CoordinateInfo { CoordinateInfo(Box const&, bool, bool, bool, bool); /// CONSTRUCTOR - ensemble size, remd dims, box, coords, velocity, force, temp., pH, redox, time, step, has repidx, has crdidx, use remd values CoordinateInfo(int, ReplicaDimArray const&, Box const&, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool); + /// Enumerate the various information that can be part of a Frame. + enum Component { POSITION=0, VELOCITY, FORCE, BOX, TEMPERATURE, + PH, REDOX, TIME, STEP, REMD_INDICES, + REPIDX, CRDIDX, + NCOMPONENTS }; + static const char* ComponentStr(Component); + bool HasBox() const { return box_.HasBox(); } const Box& TrajBox() const { return box_; } int EnsembleSize() const { return ensembleSize_; } diff --git a/src/DataIO_CCP4.cpp b/src/DataIO_CCP4.cpp index f16800950d..fa1437ce23 100644 --- a/src/DataIO_CCP4.cpp +++ b/src/DataIO_CCP4.cpp @@ -148,8 +148,14 @@ int DataIO_CCP4::ReadData(FileName const& fname, if (gridDS == 0) return 1; DataSet_GridFlt& grid = static_cast( *gridDS ); // Allocate grid from dims and spacing. FIXME OK to assume zero origin? + double xyzabg[6]; + const float* boxptr = buffer.f + 10; + for (int i = 0; i < 6; i++) + xyzabg[i] = (double)boxptr[i]; + Box gridBox; + gridBox.SetupFromXyzAbg( xyzabg ); if (grid.Allocate_N_O_Box( buffer.i[7], buffer.i[8], buffer.i[9], - Vec3(0.0), Box(buffer.f + 10) ) != 0) + Vec3(0.0), gridBox ) != 0) { mprinterr("Error: Could not allocate grid.\n"); return 1; @@ -248,13 +254,14 @@ int DataIO_CCP4::WriteSet3D( DataSetList::const_iterator const& setIn, CpptrajFi buffer.i[7] = (int)grid.NX(); buffer.i[8] = (int)grid.NY(); buffer.i[9] = (int)grid.NZ(); - Box box( grid.Bin().Ucell() ); - buffer.f[10] = (float)box[0]; - buffer.f[11] = (float)box[1]; - buffer.f[12] = (float)box[2]; - buffer.f[13] = (float)box[3]; - buffer.f[14] = (float)box[4]; - buffer.f[15] = (float)box[5]; + Box box; + box.SetupFromUcell( grid.Bin().Ucell() ); + buffer.f[10] = (float)box.Param(Box::X); + buffer.f[11] = (float)box.Param(Box::Y); + buffer.f[12] = (float)box.Param(Box::Z); + buffer.f[13] = (float)box.Param(Box::ALPHA); + buffer.f[14] = (float)box.Param(Box::BETA); + buffer.f[15] = (float)box.Param(Box::GAMMA); buffer.i[16] = 1; // Cols = X buffer.i[17] = 2; // Rows = Y buffer.i[18] = 3; // Secs = Z diff --git a/src/DataIO_OpenDx.cpp b/src/DataIO_OpenDx.cpp index 33de0ad57f..95d2aa7ff2 100644 --- a/src/DataIO_OpenDx.cpp +++ b/src/DataIO_OpenDx.cpp @@ -155,7 +155,9 @@ int DataIO_OpenDx::LoadGrid(const char* filename, DataSet& ds) delta[0] *= (double)nx; delta[1] *= (double)nx; delta[2] *= (double)nx; delta[3] *= (double)ny; delta[4] *= (double)ny; delta[5] *= (double)ny; delta[6] *= (double)nz; delta[7] *= (double)nz; delta[8] *= (double)nz; - err = grid.Allocate_N_O_Box(nx,ny,nz, Vec3(oxyz), Box(delta)); + Box dxBox; + dxBox.SetupFromUcell(delta); + err = grid.Allocate_N_O_Box(nx,ny,nz, Vec3(oxyz), dxBox); } else err = grid.Allocate_N_O_D(nx,ny,nz, Vec3(oxyz), Vec3(delta[0],delta[4],delta[8])); if (err != 0) { diff --git a/src/DataIO_Std.cpp b/src/DataIO_Std.cpp index 9f0158cd5d..5236045c37 100644 --- a/src/DataIO_Std.cpp +++ b/src/DataIO_Std.cpp @@ -592,7 +592,7 @@ int DataIO_Std::Read_3D(std::string const& fname, dvals[0] *= (double)dims_[0]; dvals[1] *= (double)dims_[0]; dvals[2] *= (double)dims_[0]; dvals[3] *= (double)dims_[1]; dvals[4] *= (double)dims_[1]; dvals[5] *= (double)dims_[1]; dvals[6] *= (double)dims_[2]; dvals[7] *= (double)dims_[2]; dvals[8] *= (double)dims_[2]; - gridBox = Box(Matrix_3x3(dvals)); + gridBox.SetupFromUcell(dvals); } ptr = buffer.Line(); } diff --git a/src/DataIO_Xplor.cpp b/src/DataIO_Xplor.cpp index b2f373d73f..7eba1b3b8a 100644 --- a/src/DataIO_Xplor.cpp +++ b/src/DataIO_Xplor.cpp @@ -50,9 +50,10 @@ int DataIO_Xplor::ReadData(FileName const& fname, CellDim+3, CellDim+4, CellDim+5) != 6 ) return ErrorMsg("Error: Could not read cell dimensions.\n"); // Determine if grid is orthogonal and allocate. - Box box( CellDim ); + Box box; + box.SetupFromXyzAbg( CellDim ); int err = 0; - if (box.Type() == Box::ORTHO) { + if (box.Is_X_Aligned_Ortho()) { // Allocate orthogonal grid Vec3 spacing( CellDim[0] / (double)GridPts[0], CellDim[1] / (double)GridPts[3], @@ -64,8 +65,7 @@ int DataIO_Xplor::ReadData(FileName const& fname, } else { // Allocate non-orthogonal grid. Determine where origin is based on ucell // and start grid points. - Matrix_3x3 ucell, recip; - box.ToRecip(ucell, recip); + Matrix_3x3 const& ucell = box.UnitCell(); // Turn ucell into delta. Use X axis only. Vec3 origin( (ucell[0] / (double)GridPts[0]) * (double)GridPts[1], (ucell[1] / (double)GridPts[0]) * (double)GridPts[1], @@ -146,11 +146,13 @@ void DataIO_Xplor::WriteXplorHeader(CpptrajFile& outfile, outfile.Printf("%8i\n%s\n",1,legend.c_str()); else outfile.Printf("%8i\n%s\n",1,remark_.c_str()); // FIXME check length - Box box( ucell ); + Box box; + box.SetupFromUcell( ucell ); outfile.Printf("%8i%8i%8i%8i%8i%8i%8i%8i%8i\n" "%12.5f%12.5f%12.5f%12.5f%12.5f%12.5f\nZYX\n", nx, bx, ex, ny, by, ey, nz, bz, ez, - box[0], box[1], box[2], box[3], box[4], box[5]); + box.Param(Box::X), box.Param(Box::Y), box.Param(Box::Z), + box.Param(Box::ALPHA), box.Param(Box::BETA), box.Param(Box::GAMMA)); } // DataIO_Xplor::WriteSet3D() diff --git a/src/DataSetList.cpp b/src/DataSetList.cpp index 413a411c7e..323f4995eb 100644 --- a/src/DataSetList.cpp +++ b/src/DataSetList.cpp @@ -753,9 +753,11 @@ int DataSetList::SynchronizeData(Parallel::Comm const& commIn) { // DEBUG rprintf("DEBUG: SYNCING SETS\n"); for (int rank = 0; rank != commIn.Size(); rank++) { - if (rank == commIn.Rank()) - for (DataListType::const_iterator ds = SetsToSync.begin(); ds != SetsToSync.end(); ++ds) - rprintf("SET '%s'\n", (*ds)->legend()); + if (rank == commIn.Rank()) { + std::vector::const_iterator sz = size_on_rank.begin(); + for (DataListType::const_iterator ds = SetsToSync.begin(); ds != SetsToSync.end(); ++ds, ++sz) + rprintf("SET '%s' %i\n", (*ds)->legend(), *sz); + } commIn.Barrier(); } # endif diff --git a/src/DataSet_3D.cpp b/src/DataSet_3D.cpp index b19eb7d2e1..a8b425e69d 100644 --- a/src/DataSet_3D.cpp +++ b/src/DataSet_3D.cpp @@ -102,8 +102,10 @@ void DataSet_3D::GridInfo() const { oxyz[2] + (NZ()/2)*gb.DZ()); //mprintf("\tGrid max : %8.3f %8.3f %8.3f\n", grid.MX(), grid.MY(), grid.MZ()); } else { - Box box(gridBin_->Ucell()); - mprintf("\t\tBox: %s ABC={%g %g %g} abg={%g %g %g}\n", box.TypeName(), - box[0], box[1], box[2], box[3], box[4], box[5]); + Box box; + box.SetupFromUcell(gridBin_->Ucell()); + mprintf("\t\tBox: %s ABC={%g %g %g} abg={%g %g %g}\n", box.CellShapeName(), + box.Param(Box::X), box.Param(Box::Y), box.Param(Box::Z), + box.Param(Box::ALPHA), box.Param(Box::BETA), box.Param(Box::GAMMA)); } } diff --git a/src/DataSet_Coords_CRD.cpp b/src/DataSet_Coords_CRD.cpp index bb94b973b6..7a69f97872 100644 --- a/src/DataSet_Coords_CRD.cpp +++ b/src/DataSet_Coords_CRD.cpp @@ -1,73 +1,156 @@ #include "DataSet_Coords_CRD.h" #include "CpptrajStdio.h" #include "StringRoutines.h" // ByteString +#include // std::copy + +/** CONSTRUCTOR */ +DataSet_Coords_CRD::DataSet_Coords_CRD() : + DataSet_Coords(COORDS), + framesToReserve_(0) +{} /** Reserve space for coords. */ int DataSet_Coords_CRD::Allocate(SizeArray const& sizeIn) { - if (!sizeIn.empty()) - coords_.reserve( sizeIn[0] ); + //rprintf("DEBUG: Calling Allocate: SizeArray[0]= %zu framesToReserve= %i\n", sizeIn[0], framesToReserve_); + if (!sizeIn.empty()) { + framesToReserve_ = (int)sizeIn[0]; + if (frames_.HasComponents()) + frames_.Resize( framesToReserve_ ); + } return 0; } /** Allocate space in coords_ array. */ int DataSet_Coords_CRD::MemAlloc( SizeArray const& sizeIn ) { - mprintf("DEBUG: Resize %s to %zu\n", legend(), sizeIn[0]); + //rprintf("DEBUG: MemAlloc resize %s to %zu\n", legend(), sizeIn[0]); if (!sizeIn.empty()) { - coords_.resize( sizeIn[0] ); + framesToReserve_ = (int)sizeIn[0]; + frames_.Resize( framesToReserve_ ); } return 0; } -/** Copy block from incoming set of same type. */ +/** Copy block from incoming set of same type. + * \param startIdx Position in this set to copy to. + * \param dptrIn Set to copy from. + * \param pos Position in dptrIn to copy from. + * \param nelts Number of elements from dptrIn to copy. + */ void DataSet_Coords_CRD::CopyBlock(size_t startIdx, DataSet const* dptrIn, size_t pos, size_t nelts) { DataSet_Coords_CRD const& setIn = static_cast( *dptrIn ); // Check that this is compatible - if (numCrd_ == 0) { + if (!frames_.HasComponents()) { CoordsSetup( setIn.top_, setIn.cInfo_ ); } else { - if (numCrd_ != setIn.numCrd_ || numBoxCrd_ != setIn.numBoxCrd_) { + if (frames_ != setIn.frames_) { mprinterr("Error: Cannot set %s sizes do not match set %s, cannot copy.\n", legend(), setIn.legend()); return; } } - CRDarray::iterator begin = coords_.begin() + startIdx; - std::fill( begin, begin + nelts, std::vector( numCrd_+numBoxCrd_ ) ); - CRDarray::const_iterator ptr = setIn.coords_.begin() + pos; - std::copy( ptr, ptr + nelts, begin ); + CompactFrameArray::iterator begin = frames_.frameBegin(startIdx); + CompactFrameArray::const_iterator ptr = setIn.frames_.frameBegin(pos); + std::copy( ptr, ptr + (nelts*frames_.FrameSize()), begin); } /** Set up COORDS with given Topology and coordinate info. */ int DataSet_Coords_CRD::CoordsSetup(Topology const& topIn, CoordinateInfo const& cInfoIn) { top_ = topIn; cInfo_ = cInfoIn; - numCrd_ = top_.Natom() * 3; - if (cInfo_.TrajBox().HasBox()) - numBoxCrd_ = 6; - else - numBoxCrd_ = 0; - // FIXME: The COORDS DataSet cannot store things like rep dims, times, or - // temperatures. Remove these from the CoordinateInfo and warn. - if (cInfo_.ReplicaDimensions().Ndims() > 0) { - mprintf("Warning: COORDS data sets do not store replica dimensions.\n"); - cInfo_.SetReplicaDims( ReplicaDimArray() ); + + if (frames_.SetupFrameArray(cInfo_, topIn.Natom(), framesToReserve_)) { + mprinterr("Internal Error: Could not set up CompactFrameArray for '%s'\n", legend()); + return 1; } - if (cInfo_.HasTemp()) { - mprintf("Warning: COORDS data sets do not store temperatures.\n"); - cInfo_.SetTemperature( false ); + + return 0; +} + +/** Convert frame to CompactFrame */ +static inline void FrameToArray(CompactFrameArray& frames_, Frame const& fIn) { + if (frames_.HasComponent(CoordinateInfo::POSITION)) frames_.SetFromDblPtr(fIn.xAddress(), CoordinateInfo::POSITION); + if (frames_.HasComponent(CoordinateInfo::VELOCITY)) frames_.SetFromDblPtr(fIn.vAddress(), CoordinateInfo::VELOCITY); + if (frames_.HasComponent(CoordinateInfo::FORCE)) frames_.SetFromDblPtr(fIn.fAddress(), CoordinateInfo::FORCE); + if (frames_.HasComponent(CoordinateInfo::BOX)) { + // Prefer storing XYZ ABG if possible; loses less info, especially when converting to float. + if (fIn.BoxCrd().Is_X_Aligned()) { + double dtmp[9]; + std::copy(fIn.BoxCrd().XyzPtr(), fIn.BoxCrd().XyzPtr()+6, dtmp); + std::fill(dtmp+6, dtmp+9, 0); + frames_.SetFromDblPtr(dtmp, CoordinateInfo::BOX); + } else { + frames_.SetFromDblPtr(fIn.BoxCrd().UnitCell().Dptr(), CoordinateInfo::BOX); + } } - if (cInfo_.HasTime()) { - mprintf("Warning: COORDS data sets do not store times.\n"); - cInfo_.SetTime( false ); + if (frames_.HasComponent(CoordinateInfo::TEMPERATURE)) frames_.SetFromDblVal(fIn.Temperature(), CoordinateInfo::TEMPERATURE); + if (frames_.HasComponent(CoordinateInfo::PH)) frames_.SetFromDblVal(fIn.pH(), CoordinateInfo::PH); + if (frames_.HasComponent(CoordinateInfo::REDOX)) frames_.SetFromDblVal(fIn.RedOx(), CoordinateInfo::REDOX); + if (frames_.HasComponent(CoordinateInfo::TIME)) frames_.SetFromDblVal(fIn.Time(), CoordinateInfo::TIME); + if (frames_.HasComponent(CoordinateInfo::STEP)) frames_.SetFromIntVal(fIn.Step(), CoordinateInfo::STEP); + if (frames_.HasComponent(CoordinateInfo::REMD_INDICES)) frames_.SetFromIntPtr(fIn.iAddress(), CoordinateInfo::REMD_INDICES); + if (frames_.HasComponent(CoordinateInfo::REPIDX)) frames_.SetFromIntVal(fIn.RepIdx(), CoordinateInfo::REPIDX); + if (frames_.HasComponent(CoordinateInfo::CRDIDX)) frames_.SetFromIntVal(fIn.CrdIdx(), CoordinateInfo::CRDIDX); +} + +/** Add frame to array. */ +void DataSet_Coords_CRD::AddFrame(Frame const& fIn) { + frames_.NextAndAllocate(); + + FrameToArray(frames_, fIn); +} + +/** Copy frame to specified position in array. */ +void DataSet_Coords_CRD::SetCRD(int idx, Frame const& fIn) { + frames_.SeekAndAllocate(idx); + + FrameToArray(frames_, fIn); +} + +/** Non-coord-related array to Frame */ +static inline void ArrayToFrame(int idx, Frame& fOut, CompactFrameArray const& frames_) { + // TODO should not have to check incoming box + if (fOut.BoxCrd().HasBox() && frames_.HasComponent(CoordinateInfo::BOX)) { + double dtmp[9]; + frames_.GetToDblPtr(dtmp, idx, CoordinateInfo::BOX); + // Box may be stored as XYZ ABG or unit cell vectors. If last three elements are all zero + // it is the former, otherwise the latter. + if (dtmp[6] != 0 || dtmp[7] != 0 || dtmp[8] != 0) + fOut.ModifyBox().AssignFromUcell( dtmp ); + else + fOut.ModifyBox().AssignFromXyzAbg( dtmp ); } - return 0; + if (frames_.HasComponent(CoordinateInfo::TEMPERATURE)) fOut.SetTemperature(frames_.GetVal(idx, CoordinateInfo::TEMPERATURE)); + if (frames_.HasComponent(CoordinateInfo::PH)) fOut.Set_pH(frames_.GetVal(idx, CoordinateInfo::PH)); + if (frames_.HasComponent(CoordinateInfo::REDOX)) fOut.SetRedOx(frames_.GetVal(idx, CoordinateInfo::REDOX)); + if (frames_.HasComponent(CoordinateInfo::TIME)) fOut.SetTime(frames_.GetVal(idx, CoordinateInfo::TIME)); + if (frames_.HasComponent(CoordinateInfo::STEP)) fOut.SetStep(frames_.GetVal(idx, CoordinateInfo::STEP)); + if (frames_.HasComponent(CoordinateInfo::REMD_INDICES)) frames_.GetToIntPtr(fOut.iAddress(), idx, CoordinateInfo::REMD_INDICES); + if (frames_.HasComponent(CoordinateInfo::REPIDX)) fOut.SetRepIdx(frames_.GetVal(idx, CoordinateInfo::REPIDX)); + if (frames_.HasComponent(CoordinateInfo::CRDIDX)) fOut.SetCrdIdx(frames_.GetVal(idx, CoordinateInfo::CRDIDX)); } +/** 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); + 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); + ArrayToFrame(idx, fOut, frames_); +} + +/* size_t DataSet_Coords_CRD::sizeInBytes(size_t nframes, size_t natom, size_t nbox) { size_t frame_size_bytes = ((natom * 3UL) + nbox) * sizeof(float); return ((nframes * frame_size_bytes) + sizeof(CRDarray)); -} +}*/ #ifdef MPI int DataSet_Coords_CRD::Sync(size_t total, std::vector const& rank_frames, @@ -76,16 +159,22 @@ int DataSet_Coords_CRD::Sync(size_t total, std::vector const& rank_frames, if (commIn.Size()==1) return 0; if (commIn.Master()) { // Resize for total number of frames. - coords_.resize( total, std::vector( numCrd_+numBoxCrd_ ) ); - int cidx = rank_frames[0]; // Index on master + frames_.Resize( total ); + int cidx = rank_frames[0]; // Frame Index on master // Receive data from each rank for (int rank = 1; rank < commIn.Size(); rank++) { - for (int ridx = 0; ridx != rank_frames[rank]; ridx++, cidx++) - commIn.SendMaster( &(coords_[cidx][0]), numCrd_+numBoxCrd_, rank, MPI_FLOAT ); + //rprintf("DEBUG: MASTER RECEIVE from rank %i cidx=%i rank_frames=%i FrameSize=%u\n", + // rank, cidx, rank_frames[rank], frames_.FrameSize()); + commIn.SendMaster( frames_.FramePtr(cidx), rank_frames[rank]*frames_.FrameSize(), + rank, MPI_FLOAT ); + cidx += rank_frames[rank]; } - } else // Send data to master - for (unsigned int ridx = 0; ridx != coords_.size(); ++ridx) - commIn.SendMaster( &(coords_[ridx][0]), numCrd_+numBoxCrd_, commIn.Rank(), MPI_FLOAT ); + } else {// Send data to master + //rprintf("DEBUG: RANK %i SEND TO MASTER Size=%zu FrameSize=%u\n", + // commIn.Rank(), Size(), frames_.FrameSize()); + commIn.SendMaster( frames_.FramePtr(0), Size()*frames_.FrameSize(), + commIn.Rank(), MPI_FLOAT ); + } return 0; } #endif diff --git a/src/DataSet_Coords_CRD.h b/src/DataSet_Coords_CRD.h index 9f4831319a..1d52da42c0 100644 --- a/src/DataSet_Coords_CRD.h +++ b/src/DataSet_Coords_CRD.h @@ -1,12 +1,14 @@ #ifndef INC_DATASET_COORDS_CRD_H #define INC_DATASET_COORDS_CRD_H #include "DataSet_Coords.h" +#include "CompactFrameArray.h" +/// Hold a reduced-precision array of Frames class DataSet_Coords_CRD : public DataSet_Coords { public: - DataSet_Coords_CRD() : DataSet_Coords(COORDS), numCrd_(0), numBoxCrd_(0) {} + DataSet_Coords_CRD(); static DataSet* Alloc() { return (DataSet*)new DataSet_Coords_CRD(); } // ----- DataSet functions ------------------- - size_t Size() const { return coords_.size(); } + size_t Size() const { return frames_.MaxFrames(); } // TODO should this use current index instead? SizeArray DimSizes() const { return SizeArray(1, Size()); } # ifdef MPI int Sync(size_t, std::vector const&, Parallel::Comm const&); @@ -15,37 +17,27 @@ class DataSet_Coords_CRD : public DataSet_Coords { void Add(size_t, const void*) {} int Allocate(SizeArray const&); /// \return Size in bytes of set - size_t MemUsageInBytes() const { return EstSizeInBytes(Size()); } + size_t MemUsageInBytes() const { return frames_.SizeInBytes(); } int MemAlloc(SizeArray const&); void CopyBlock(size_t, const DataSet*, size_t, size_t); // ----- DataSet_Coords functions ------------ /// Add a frame. - inline void AddFrame(Frame const& fIn) { - coords_.push_back( fIn.ConvertToCRD(numBoxCrd_, cInfo_.HasVel()) ); - } + void AddFrame(Frame const&); + /// Set CRD at position with frame. + void SetCRD(int, Frame const&); /// Get a frame at position. - inline void GetFrame(int idx, Frame& fIn) { - fIn.SetFromCRD( coords_[idx], numCrd_, numBoxCrd_, cInfo_.HasVel() ); - } + void GetFrame(int, Frame&); /// Get a frame at position corresponding to mask. - inline void GetFrame(int idx, Frame& fIn, AtomMask const& mIn) { - fIn.SetFromCRD( coords_[idx], mIn, numCrd_, numBoxCrd_, cInfo_.HasVel() ); - } - /// Set CRD at position with frame. - inline void SetCRD(int idx, Frame const& fIn) { - coords_[idx] = fIn.ConvertToCRD(numBoxCrd_, cInfo_.HasVel()); - } + void GetFrame(int, Frame&, AtomMask const&); /// Set topology and coordinate information int CoordsSetup(Topology const&, CoordinateInfo const&); // ------------------------------------------- /// \return estimated size in bytes for given # of frames. - size_t EstSizeInBytes(size_t nframes) const { return sizeInBytes(nframes, Top().Natom(), numBoxCrd_); } + size_t EstSizeInBytes(size_t nframes) const { return nframes*frames_.EstimateFrameSizeInBytes(CoordsInfo(), Top().Natom()); } private: - static size_t sizeInBytes(size_t, size_t, size_t); + //static size_t sizeInBytes(size_t, size_t, size_t); - typedef std::vector CRDarray; - CRDarray coords_; ///< Array of coordinate frames. - int numCrd_; ///< Number of coordinates - int numBoxCrd_; ///< Number of box coords (0 or 6). + CompactFrameArray frames_; + int framesToReserve_; ///< Frames to reserve set by Allocate() for use in CoordsSetup() }; #endif diff --git a/src/DistRoutines.cpp b/src/DistRoutines.cpp index a7a9f81f90..767280d3e7 100644 --- a/src/DistRoutines.cpp +++ b/src/DistRoutines.cpp @@ -1,18 +1,6 @@ #include // sqrt #include "DistRoutines.h" - -/** \param a1 First set of XYZ coordinates. - * \param a2 Second set of XYZ coordinates. - * \param ucell Unit cell vectors. - * \param recip Fractional cell vectors. - * \return the shortest imaged distance^2 between the coordinates. - */ -double DIST2_ImageNonOrtho(Vec3 const& a1, Vec3 const& a2, - Matrix_3x3 const& ucell, Matrix_3x3 const& recip) -{ - int ixyz[3]; - return DIST2_ImageNonOrthoRecip(recip * a2, recip * a1, -1.0, ixyz, ucell); -} +#include "Box.h" /** \param a1 First set of XYZ coordinates. * \param a2 Second set of XYZ coordinates. @@ -308,13 +296,46 @@ double DIST2_ImageNonOrthoRecip(Vec3 const& f1, Vec3 const& f2, double minIn, return(min); } +/** \param a1 First set of XYZ coordinates. + * \param a2 Second set of XYZ coordinates. + * \param ucell Unit cell vectors. + * \param recip Fractional cell vectors. + * \return the shortest imaged distance^2 between the coordinates. + */ +double DIST2_ImageNonOrtho(Vec3 const& a1, Vec3 const& a2, + Matrix_3x3 const& ucell, Matrix_3x3 const& recip) +{ + int ixyz[3]; + return DIST2_ImageNonOrthoRecip(recip * a2, recip * a1, -1.0, ixyz, ucell); +} + +/** \param a1 First set of XYZ coordinates. + * \param a2 Second set of XYZ coordinates. + * \param ucell Unit cell vectors. + * \param recip Fractional cell vectors. + * \return the shortest imaged distance^2 between the coordinates. + */ +double DIST2_ImageNonOrtho(const double* a1, const double* a2, + Matrix_3x3 const& ucell, Matrix_3x3 const& recip) +{ + int ixyz[3]; + Vec3 f1( ((recip[0]*a1[0]) + (recip[1]*a1[1]) + (recip[2]*a1[2])), + ((recip[3]*a1[0]) + (recip[4]*a1[1]) + (recip[5]*a1[2])), + ((recip[6]*a1[0]) + (recip[7]*a1[1]) + (recip[8]*a1[2])) ); + Vec3 f2( ((recip[0]*a2[0]) + (recip[1]*a2[1]) + (recip[2]*a2[2])), + ((recip[3]*a2[0]) + (recip[4]*a2[1]) + (recip[5]*a2[2])), + ((recip[6]*a2[0]) + (recip[7]*a2[1]) + (recip[8]*a2[2])) ); + return DIST2_ImageNonOrthoRecip(f1, f2, -1.0, ixyz, ucell); +} + // Frame::DIST2_ImageOrtho() /** Return the minimum orthorhombic imaged distance^2 between coordinates a1 * and a2. */ -double DIST2_ImageOrtho(Vec3 const& a1, Vec3 const& a2, Box const& box) { +double DIST2_ImageOrtho(const double* a1, const double* a2, Box const& box) +{ // If box lengths are zero no imaging possible - if (box[0]==0.0 || box[1]==0.0 || box[2]==0.0) return -1.0; + if (box.Param(Box::X)==0.0 || box.Param(Box::Y)==0.0 || box.Param(Box::Z)==0.0) return -1.0; double x = a1[0] - a2[0]; double y = a1[1] - a2[1]; double z = a1[2] - a2[2]; @@ -323,20 +344,27 @@ double DIST2_ImageOrtho(Vec3 const& a1, Vec3 const& a2, Box const& box) { if (y<0) y=-y; if (z<0) z=-z; // Get rid of multiples of box lengths - while (x > box[0]) x = x - box[0]; - while (y > box[1]) y = y - box[1]; - while (z > box[2]) z = z - box[2]; + while (x > box.Param(Box::X)) x = x - box.Param(Box::X); + while (y > box.Param(Box::Y)) y = y - box.Param(Box::Y); + while (z > box.Param(Box::Z)) z = z - box.Param(Box::Z); // Find shortest distance in periodic reference - double D = box[0] - x; + double D = box.Param(Box::X) - x; if (D < x) x = D; - D = box[1] - y; + D = box.Param(Box::Y) - y; if (D < y) y = D; - D = box[2] - z; + D = box.Param(Box::Z) - z; if (D < z) z = D; return (x*x + y*y + z*z); } +/** Return the minimum orthorhombic imaged distance^2 between coordinates a1 + * and a2. + */ +double DIST2_ImageOrtho(Vec3 const& a1, Vec3 const& a2, Box const& box) { + return DIST2_ImageOrtho(a1.Dptr(), a2.Dptr(), box); +} + // Frame::DIST2_NoImage() /** Return distance^2 between coordinates in a1 and a2. */ @@ -350,23 +378,41 @@ double DIST2_NoImage(const double* a1, const double* a2) { return (x*x + y*y + z*z); } +/// \return Distance squared, no imaging. double DIST2_NoImage( Vec3 const& a1, Vec3 const& a2 ) { Vec3 vec = a1 - a2; return vec.Magnitude2(); } +/// \return Distance, no imaging. double DIST_NoImage( Vec3 const& a1, Vec3 const& a2 ) { Vec3 vec = a1 - a2; return sqrt( vec.Magnitude2() ); } -double DIST2(const double* a1, const double* a2, ImagingType itype, - Box const& box, Matrix_3x3 const& ucell, Matrix_3x3 const& recip) -{ - if (itype==NOIMAGE) - return DIST2_NoImage( a1, a2 ); - else if (itype==ORTHO) - return DIST2_ImageOrtho( a1, a2, box ); +/** \return Distance squared using either minimum-image convention or no imaging. */ +double DIST2(ImageOption::Type itype, const double* a1, const double* a2, Box const& box) { +/* if (imagingEnabled) { + if (is_ortho) + return DIST2_ImageOrtho(a1, a2, box); + else + return DIST2_ImageNonOrtho(a1, a2, box.UnitCell(), box.FracCell()); + } else + return DIST2_NoImage(a1, a2);*/ + if (itype == ImageOption::NO_IMAGE) + return DIST2_NoImage(a1, a2); + else if (itype == ImageOption::ORTHO) + return DIST2_ImageOrtho(a1, a2, box); else // NONORTHO - return DIST2_ImageNonOrtho( a1, a2, ucell, recip ); + return DIST2_ImageNonOrtho(a1, a2, box.UnitCell(), box.FracCell()); +} + +/** \return Distance squared using either minimum-image convention or no imaging. */ +double DIST2(ImageOption::Type itype, Vec3 const& a1, Vec3 const& a2, Box const& box) { + return DIST2(itype, a1.Dptr(), a2.Dptr(), box); +} + +/** \return Distance using either minimum-image convention or no imaging. */ +double DIST(ImageOption::Type itype, Vec3 const& a1, Vec3 const& a2, Box const& box) { + return sqrt(DIST2(itype, a1.Dptr(), a2.Dptr(), box)); } diff --git a/src/DistRoutines.h b/src/DistRoutines.h index 1bc883da01..8a0acf9c0a 100644 --- a/src/DistRoutines.h +++ b/src/DistRoutines.h @@ -1,19 +1,38 @@ #ifndef INC_DISTROUTINES_H #define INC_DISTROUTINES_H -#include "Box.h" +class Vec3; +class Matrix_3x3; +class Box; +#include "ImageOption.h" /*! \file DistRoutines.h \brief A collection of routines used to calculate distance. */ -// TODO: Move ImagingType to Box, include Box instead of Vec3, create recipInfo type -/// Potential imaging types -enum ImagingType { NOIMAGE=0, ORTHO, NONORTHO }; -double DIST2_ImageNonOrtho(Vec3 const&, Vec3 const&, Matrix_3x3 const&, Matrix_3x3 const&); +/// \return Vector representing minimum imaged distance between two points. Vec3 MinImagedVec(Vec3 const&, Vec3 const&, Matrix_3x3 const&, Matrix_3x3 const&); + +/// \return Distance squared between points in fractional space, general unit cell imaging. double DIST2_ImageNonOrthoRecip(Vec3 const&, Vec3 const&, double, int*, Matrix_3x3 const&); +/// \return Distance squared between points in Cartesian space, general unit cell imaging. +double DIST2_ImageNonOrtho(Vec3 const&, Vec3 const&, Matrix_3x3 const&, Matrix_3x3 const&); +/// \return Distance squared between points in Cartesian space, general unit cell imaging. +double DIST2_ImageNonOrtho(const double*, const double*, Matrix_3x3 const&, Matrix_3x3 const&); + +/// \return Distance squared, X-aligned and orthogonal imaging. +double DIST2_ImageOrtho(const double*, const double*, Box const&); +/// \return Distance squared, X-aligned and orthogonal imaging. double DIST2_ImageOrtho(Vec3 const&, Vec3 const&, Box const&); + +/// \return Distance squared, no imaging. double DIST2_NoImage(const double*, const double*); +/// \return Distance squared, no imaging double DIST2_NoImage( Vec3 const&, Vec3 const& ); +/// \return Distance, no imaging. double DIST_NoImage( Vec3 const&, Vec3 const& ); -double DIST2(const double*, const double*, ImagingType, Box const&, - Matrix_3x3 const&, Matrix_3x3 const&); + +/// \return Distance squared using minimum-image convention or no imaging. +double DIST2(ImageOption::Type, const double*, const double*, Box const&); +// \return Distance squared using minimum-image convention or no imaging. +double DIST2(ImageOption::Type, Vec3 const&, Vec3 const&, Box const&); +// \return Distance using minimum-image convention or no imaging. +double DIST(ImageOption::Type, Vec3 const&, Vec3 const&, Box const&); #endif diff --git a/src/Energy.cpp b/src/Energy.cpp index 328e759080..4e71df345f 100644 --- a/src/Energy.cpp +++ b/src/Energy.cpp @@ -367,8 +367,6 @@ double Energy_Amber::E_DirectSum(Frame const& fIn, Topology const& tIn, AtomMask double Edirect = E_Elec(fIn, tIn, mask, Excluded); // Sum over images. double Eimage = 0.0; - Matrix_3x3 ucell, recip; - fIn.BoxCrd().ToRecip(ucell, recip); // Cache npoints values, excluding this cell (0,0,0) std::vector Cells; int Ncells = (2*n_points)+1; @@ -386,14 +384,14 @@ double Energy_Amber::E_DirectSum(Frame const& fIn, Topology const& tIn, AtomMask // Inner loop over atoms (j) for (AtomMask::const_iterator atom2 = mask.begin(); atom2 != mask.end(); ++atom2) { - Vec3 frac2 = recip * Vec3(fIn.XYZ( *atom2 )); // atom j in fractional coords + Vec3 frac2 = fIn.BoxCrd().FracCell() * Vec3(fIn.XYZ( *atom2 )); // atom j in fractional coords double qiqj = QFAC * tIn[*atom1].Charge() * tIn[*atom2].Charge(); // Loop over images of atom j for (std::vector::const_iterator ixyz = Cells.begin(); ixyz != Cells.end(); ++ixyz) { // mprintf("DEBUG: Atom %4i to %4i Image %3i %3i %3i", *atom1+1, *atom2+1, ix, iy, iz); // atom j image back in Cartesian space minus atom i in Cartesian space. - Vec3 dxyz = ucell.TransposeMult(frac2 + *ixyz) - T1; + Vec3 dxyz = fIn.BoxCrd().UnitCell().TransposeMult(frac2 + *ixyz) - T1; double rij2 = dxyz.Magnitude2(); double rij = sqrt(rij2); // mprintf(" Distance= %g\n", rij); diff --git a/src/Energy_Sander.cpp b/src/Energy_Sander.cpp index a4d9a8fd4a..7e135d61af 100644 --- a/src/Energy_Sander.cpp +++ b/src/Energy_Sander.cpp @@ -262,7 +262,7 @@ int Energy_Sander::CommonInit(Topology const& topIn, Frame& fIn) { // TODO const else input_.ntb = 0; mprintf("Warning: 'ntb' not specified; setting to %i based on box type '%s'\n", - input_.ntb, fIn.BoxCrd().TypeName()); + input_.ntb, fIn.BoxCrd().CellShapeName()); } if (!specified_cut_) { if (input_.ntb == 0) @@ -339,7 +339,16 @@ int Energy_Sander::CommonInit(Topology const& topIn, Frame& fIn) { // TODO const if (isActive_[i]) mprintf(" %s", Estring_[i]); mprintf("\n"); } - return sander_setup_mm(top_filename_.full(), fIn.xAddress(), fIn.bAddress(), &input_); + // TODO copying box to temp array bc the sander API has double* instead + // of const double*, which I think is wrong. + double tmpbox[6]; + tmpbox[0] = fIn.BoxCrd().Param(Box::X); + tmpbox[1] = fIn.BoxCrd().Param(Box::Y); + tmpbox[2] = fIn.BoxCrd().Param(Box::Z); + tmpbox[3] = fIn.BoxCrd().Param(Box::ALPHA); + tmpbox[4] = fIn.BoxCrd().Param(Box::BETA); + tmpbox[5] = fIn.BoxCrd().Param(Box::GAMMA); + return sander_setup_mm(top_filename_.full(), fIn.xAddress(), tmpbox, &input_); } // Energy_Sander::CalcEnergy() @@ -347,8 +356,8 @@ int Energy_Sander::CalcEnergy(Frame& fIn) { if (!is_setup()) return 1; set_positions( fIn.xAddress() ); - set_box( fIn.BoxCrd().BoxX(), fIn.BoxCrd().BoxY(), fIn.BoxCrd().BoxZ(), - fIn.BoxCrd().Alpha(), fIn.BoxCrd().Beta(), fIn.BoxCrd().Gamma() ); + set_box( fIn.BoxCrd().Param(Box::X), fIn.BoxCrd().Param(Box::Y), fIn.BoxCrd().Param(Box::Z), + fIn.BoxCrd().Param(Box::ALPHA), fIn.BoxCrd().Param(Box::BETA), fIn.BoxCrd().Param(Box::GAMMA) ); energy_forces( &energy_, &(forces_[0]) ); return 0; }; @@ -358,8 +367,9 @@ int Energy_Sander::CalcEnergyForces(Frame& fIn) { if (!is_setup()) return 1; set_positions( fIn.xAddress() ); - set_box( fIn.BoxCrd().BoxX(), fIn.BoxCrd().BoxY(), fIn.BoxCrd().BoxZ(), - fIn.BoxCrd().Alpha(), fIn.BoxCrd().Beta(), fIn.BoxCrd().Gamma() ); + set_box( fIn.BoxCrd().Param(Box::X), fIn.BoxCrd().Param(Box::Y), fIn.BoxCrd().Param(Box::Z), + fIn.BoxCrd().Param(Box::ALPHA), fIn.BoxCrd().Param(Box::BETA), fIn.BoxCrd().Param(Box::GAMMA) ); + energy_forces( &energy_, fIn.fAddress() ); return 0; } diff --git a/src/EnsembleIn_Single.cpp b/src/EnsembleIn_Single.cpp index 363b500140..a5858e5a51 100644 --- a/src/EnsembleIn_Single.cpp +++ b/src/EnsembleIn_Single.cpp @@ -225,7 +225,7 @@ void EnsembleIn_Single::EnsembleInfo(int showExtended) const { mprintf("'%s' (REMD ensemble size %i) ",Traj().Filename().base(), ensembleSize_); eio_->Info(); mprintf(", Parm %s",Traj().Parm()->c_str()); - if (cInfo_.HasBox()) mprintf(" (%s box)", cInfo_.TrajBox().TypeName()); + if (cInfo_.HasBox()) mprintf(" (%s box)", cInfo_.TrajBox().CellShapeName()); if (showExtended==1) Traj().Counter().PrintFrameInfo(); if (debug_>0) mprintf(", %i atoms, Box %i",Traj().Parm()->Natom(),(int)cInfo_.HasBox()); diff --git a/src/Ewald.cpp b/src/Ewald.cpp index 07c44b9a03..ae56508226 100644 --- a/src/Ewald.cpp +++ b/src/Ewald.cpp @@ -194,10 +194,11 @@ int Ewald::CheckInput(Box const& boxIn, int debugIn, double cutoffIn, double dsu return 1; } char dir[3] = {'X', 'Y', 'Z'}; + // NOTE: First 3 box parameters are X Y Z for (int i = 0; i < 3; i++) { - if (cutoff_ > boxIn[i]/2.0) { + if (cutoff_ > boxIn.Param((Box::ParamType)i)/2.0) { mprinterr("Error: Cutoff must be less than half the box length (%g > %g, %c)\n", - cutoff_, boxIn[i]/2.0, dir[i]); + cutoff_, boxIn.Param((Box::ParamType)i)/2.0, dir[i]); return 1; } } @@ -240,14 +241,12 @@ int Ewald::CheckInput(Box const& boxIn, int debugIn, double cutoffIn, double dsu } /** Initialize and set up pairlist. */ -int Ewald::Setup_Pairlist(Box const& boxIn, Vec3 const& recipLengths, double skinnbIn) { +int Ewald::Setup_Pairlist(Box const& boxIn, double skinnbIn) { if (pairList_.InitPairList(cutoff_, skinnbIn, debug_)) return 1; - if (pairList_.SetupPairList( boxIn.Type(), recipLengths )) return 1; + if (pairList_.SetupPairList( boxIn )) return 1; # ifdef DEBUG_PAIRLIST // Write grid PDB PDBfile gridpdb; - Matrix_3x3 ucell, recip; - boxIn.ToRecip(ucell, recip); gridpdb.OpenWrite("gridpoints.pdb"); for (int iz = 0; iz != pairList_.NZ(); iz++) for (int iy = 0; iy != pairList_.NY(); iy++) @@ -255,7 +254,7 @@ int Ewald::Setup_Pairlist(Box const& boxIn, Vec3 const& recipLengths, double ski double fx = (double)ix / (double)pairList_.NX(); double fy = (double)iy / (double)pairList_.NY(); double fz = (double)iz / (double)pairList_.NZ(); - Vec3 cart = ucell.TransposeMult( Vec3(fx,fy,fz) ); + Vec3 cart = boxIn.UnitCell().TransposeMult( Vec3(fx,fy,fz) ); gridpdb.WriteHET(1, cart[0], cart[1], cart[2]); } gridpdb.CloseFile(); @@ -511,11 +510,10 @@ double Ewald::CalcEnergy_NoPairList(Frame const& frameIn, Topology const& topIn, AtomMask const& maskIn) { t_total_.Start(); - Matrix_3x3 ucell, recip; - double volume = frameIn.BoxCrd().ToRecip(ucell, recip); + double volume = frameIn.BoxCrd().CellVolume(); double e_self = Self( volume ); // Place atoms in pairlist. This calcs frac/imaged coords. - pairList_.CreatePairList(frameIn, ucell, recip, maskIn); + pairList_.CreatePairList(frameIn, frameIn.BoxCrd().UnitCell(), frameIn.BoxCrd().FracCell(), maskIn); double e_recip = Recip_Regular( recip, volume ); diff --git a/src/Ewald.h b/src/Ewald.h index 7b6f6b1204..7d8fc8c007 100644 --- a/src/Ewald.h +++ b/src/Ewald.h @@ -41,8 +41,8 @@ class Ewald { double Vdw_Correction(double); /// Box, debug, cutoff, dsum tol, ew coeff, lj coeff, switch window, erfc dx, nb skin int CheckInput(Box const&, int, double, double, double, double, double, double, double); - /// Set up pair list - int Setup_Pairlist(Box const&, Vec3 const&, double); + /// Set up pair list for given box and NB "skin" size + int Setup_Pairlist(Box const&, double); /// Calculate sum q, sum q^2. Calls setup for vdw correction void CalculateCharges(Topology const&, AtomMask const&); /// Calculate VDW C6 parameters for LJ PME diff --git a/src/Ewald_ParticleMesh.cpp b/src/Ewald_ParticleMesh.cpp index 5786c2d113..14550fe9e2 100644 --- a/src/Ewald_ParticleMesh.cpp +++ b/src/Ewald_ParticleMesh.cpp @@ -70,13 +70,13 @@ int Ewald_ParticleMesh::DetermineNfft(int& nfft1, int& nfft2, int& nfft3, Box co { if (nfft1 < 1) { // Need even dimension for X direction - nfft1 = ComputeNFFT( (boxIn.BoxX() + 1.0) * 0.5 ); + nfft1 = ComputeNFFT( (boxIn.Param(Box::X) + 1.0) * 0.5 ); nfft1 *= 2; } if (nfft2 < 1) - nfft2 = ComputeNFFT( boxIn.BoxY() ); + nfft2 = ComputeNFFT( boxIn.Param(Box::Y) ); if (nfft3 < 1) - nfft3 = ComputeNFFT( boxIn.BoxZ() ); + nfft3 = ComputeNFFT( boxIn.Param(Box::Z) ); if (nfft1 < 1 || nfft2 < 1 || nfft3 < 1) { mprinterr("Error: Bad NFFT values: %i %i %i\n", nfft1, nfft2, nfft3); @@ -123,10 +123,7 @@ int Ewald_ParticleMesh::Init(Box const& boxIn, double cutoffIn, double dsumTolIn mprintf("\n"); // Set up pair list - Matrix_3x3 ucell, recip; - boxIn.ToRecip(ucell, recip); - Vec3 recipLengths = boxIn.RecipLengths(recip); - if (Setup_Pairlist(boxIn, recipLengths, skinnbIn)) return 1; + if (Setup_Pairlist(boxIn, skinnbIn)) return 1; return 0; } @@ -187,8 +184,8 @@ double Ewald_ParticleMesh::Recip_ParticleMesh(Box const& boxIn) // 5 = the beta lattice parameter in degrees. // 6 = the gamma lattice parameter in degrees. // 7 = lattice type - pme_object_.setLatticeVectors(boxIn.BoxX(), boxIn.BoxY(), boxIn.BoxZ(), - boxIn.Alpha(), boxIn.Beta(), boxIn.Gamma(), + pme_object_.setLatticeVectors(boxIn.Param(Box::X), boxIn.Param(Box::Y), boxIn.Param(Box::Z), + boxIn.Param(Box::ALPHA), boxIn.Param(Box::BETA), boxIn.Param(Box::GAMMA), PMEInstanceD::LatticeType::XAligned); double erecip = pme_object_.computeERec(0, chargesD, coordsD); @@ -213,9 +210,20 @@ double Ewald_ParticleMesh::LJ_Recip_ParticleMesh(Box const& boxIn) //auto pme_vdw = std::unique_ptr(new PMEInstanceD()); pme_vdw_.setup(6, lw_coeff_, order_, nfft1, nfft2, nfft3, -1.0, 0); - pme_vdw_.setLatticeVectors(boxIn.BoxX(), boxIn.BoxY(), boxIn.BoxZ(), - boxIn.Alpha(), boxIn.Beta(), boxIn.Gamma(), - PMEInstanceD::LatticeType::XAligned); + PMEInstanceD::LatticeType lattice = PMEInstanceD::LatticeType::XAligned; + // TODO just pass in Ucell when helPME supports it + //boxIn.PrintDebug("pme"); + if (!boxIn.Is_X_Aligned()) { + if (boxIn.Is_Symmetric()) + lattice = PMEInstanceD::LatticeType::ShapeMatrix; + else { + mprinterr("Error: Unit cell is not X-aligned or symmetric; cannot set PME recip grid.\n"); + return 0; + } + } + pme_vdw_.setLatticeVectors(boxIn.Param(Box::X), boxIn.Param(Box::Y), boxIn.Param(Box::Z), + boxIn.Param(Box::ALPHA), boxIn.Param(Box::BETA), boxIn.Param(Box::GAMMA), + lattice); double evdwrecip = pme_vdw_.computeERec(0, cparamD, coordsD); t_recip_.Stop(); return evdwrecip; @@ -226,12 +234,11 @@ int Ewald_ParticleMesh::CalcNonbondEnergy(Frame const& frameIn, AtomMask const& double& e_elec, double& e_vdw) { t_total_.Start(); - Matrix_3x3 ucell, recip; - double volume = frameIn.BoxCrd().ToRecip(ucell, recip); + double volume = frameIn.BoxCrd().CellVolume(); double e_self = Self( volume ); double e_vdw_lr_correction; - int retVal = pairList_.CreatePairList(frameIn, ucell, recip, maskIn); + int retVal = pairList_.CreatePairList(frameIn, frameIn.BoxCrd().UnitCell(), frameIn.BoxCrd().FracCell(), maskIn); if (retVal != 0) { mprinterr("Error: Grid setup failed.\n"); return 1; diff --git a/src/Ewald_Regular.cpp b/src/Ewald_Regular.cpp index 3a4a45e94c..e023af9f72 100644 --- a/src/Ewald_Regular.cpp +++ b/src/Ewald_Regular.cpp @@ -106,8 +106,6 @@ int Ewald_Regular::Init(Box const& boxIn, double cutoffIn, double dsumTolIn, dou return 1; rsumTol_ = rsumTolIn; maxexp_ = maxexpIn; - Matrix_3x3 ucell, recip; - boxIn.ToRecip(ucell, recip); if (mlimitsIn != 0) std::copy(mlimitsIn, mlimitsIn+3, mlimit_); else @@ -129,16 +127,15 @@ int Ewald_Regular::Init(Box const& boxIn, double cutoffIn, double dsumTolIn, dou // Set defaults if necessary if (rsumTol_ < Constants::SMALL) rsumTol_ = 5E-5; - Vec3 recipLengths = boxIn.RecipLengths(recip); if (maxmlim_ > 0) - maxexp_ = FindMaxexpFromMlim(mlimit_, recip); + maxexp_ = FindMaxexpFromMlim(mlimit_, boxIn.FracCell()); else { if ( maxexp_ < Constants::SMALL ) maxexp_ = FindMaxexpFromTol(ew_coeff_, rsumTol_); // eigmin typically bigger than this unless cell is badly distorted. double eigmin = 0.5; // Calculate lengths of reciprocal vectors - GetMlimits(mlimit_, maxexp_, eigmin, recipLengths, recip); + GetMlimits(mlimit_, maxexp_, eigmin, boxIn.RecipLengths(), boxIn.FracCell()); maxmlim_ = mlimit_[0]; maxmlim_ = std::max(maxmlim_, mlimit_[1]); maxmlim_ = std::max(maxmlim_, mlimit_[2]); @@ -152,7 +149,7 @@ int Ewald_Regular::Init(Box const& boxIn, double cutoffIn, double dsumTolIn, dou //mprintf("\t Erfc table dx= %g, size= %zu\n", erfcTableDx_, erfc_table_.size()/4); mprintf("\t mlimits= {%i,%i,%i} Max=%i\n", mlimit_[0], mlimit_[1], mlimit_[2], maxmlim_); // Set up pair list - if (Setup_Pairlist(boxIn, recipLengths, skinnbIn)) return 1; + if (Setup_Pairlist(boxIn, skinnbIn)) return 1; return 0; } @@ -384,19 +381,18 @@ int Ewald_Regular::CalcNonbondEnergy(Frame const& frameIn, AtomMask const& maskI double& e_elec, double& e_vdw) { t_total_.Start(); - Matrix_3x3 ucell, recip; - double volume = frameIn.BoxCrd().ToRecip(ucell, recip); + double volume = frameIn.BoxCrd().CellVolume(); double e_self = Self( volume ); double e_vdwr = Vdw_Correction( volume ); - int retVal = pairList_.CreatePairList(frameIn, ucell, recip, maskIn); + int retVal = pairList_.CreatePairList(frameIn, frameIn.BoxCrd().UnitCell(), frameIn.BoxCrd().FracCell(), maskIn); if (retVal != 0) { mprinterr("Error: Grid setup failed.\n"); return 1; } // MapCoords(frameIn, ucell, recip, maskIn); - double e_recip = Recip_Regular( recip, volume ); + double e_recip = Recip_Regular( frameIn.BoxCrd().FracCell(), volume ); e_vdw = 0.0; double e_direct = Direct( pairList_, e_vdw ); if (debug_ > 0) diff --git a/src/Exec_CombineCoords.cpp b/src/Exec_CombineCoords.cpp index 30e7a282cc..542ebc39d8 100644 --- a/src/Exec_CombineCoords.cpp +++ b/src/Exec_CombineCoords.cpp @@ -61,10 +61,10 @@ Exec::RetType Exec_CombineCoords::Execute(CpptrajState& State, ArgList& argIn) { boxStatus = SET; } else if (boxStatus == SET) { // Make sure it is the same type of box. TODO Check angles - if (combinedBox.Type() != CRD[setnum]->CoordsInfo().TrajBox().Type()) + if (combinedBox.CellShape() != CRD[setnum]->CoordsInfo().TrajBox().CellShape()) { mprintf("Warning: COORDS '%s' box type '%s' differs from other COORDS. Disabling box.\n", - CRD[setnum]->legend(), CRD[setnum]->CoordsInfo().TrajBox().TypeName()); + CRD[setnum]->legend(), CRD[setnum]->CoordsInfo().TrajBox().CellShapeName()); combinedBox.SetNoBox(); boxStatus = INVALID; } @@ -107,16 +107,20 @@ Exec::RetType Exec_CombineCoords::Execute(CpptrajState& State, ArgList& argIn) { output += input.size(); } // Box info - if (combinedBox.Type() != Box::NOBOX) { - double* cBox = CombinedFrame.bAddress(); - // Only use angles from first coords set. - std::copy(InputFrames[0].bAddress(), InputFrames[0].bAddress()+6, cBox); + if (combinedBox.HasBox()) { + // Use angles from first coords set. + double cBox[6]; + for (int i = 0; i < 6; i++) + cBox[i] = InputFrames[0].BoxCrd().Param((Box::ParamType)i); + //double* cBox = CombinedFrame.bAddress(); + //std::copy(InputFrames[0].bAddress(), InputFrames[0].bAddress()+6, cBox); for (unsigned int setnum = 1; setnum < CRD.size(); ++setnum) { // Use max X/Y/Z among coords - cBox[0] = std::max(cBox[0], InputFrames[setnum].BoxCrd().BoxX()); - cBox[1] = std::max(cBox[1], InputFrames[setnum].BoxCrd().BoxY()); - cBox[2] = std::max(cBox[2], InputFrames[setnum].BoxCrd().BoxZ()); + cBox[0] = std::max(cBox[0], InputFrames[setnum].BoxCrd().Param(Box::X)); + cBox[1] = std::max(cBox[1], InputFrames[setnum].BoxCrd().Param(Box::Y)); + cBox[2] = std::max(cBox[2], InputFrames[setnum].BoxCrd().Param(Box::Z)); } + CombinedFrame.ModifyBox().SetupFromXyzAbg( cBox ); } CombinedCrd->AddFrame( CombinedFrame ); } diff --git a/src/Exec_ParmBox.cpp b/src/Exec_ParmBox.cpp index c545996b8c..20a784dbbc 100644 --- a/src/Exec_ParmBox.cpp +++ b/src/Exec_ParmBox.cpp @@ -1,35 +1,35 @@ #include "Exec_ParmBox.h" #include "CpptrajStdio.h" +#include "BoxArgs.h" void Exec_ParmBox::Help() const { - mprintf("\t[%s] [nobox] [truncoct]\n", DataSetList::TopIdxArgs); - mprintf("\t[x ] [y ] [z ] [alpha ] [beta ] [gamma ]\n" - " Set the box info for specified topology (currently only relevant for Amber\n" + mprintf("\t[%s]\n", DataSetList::TopIdxArgs); + mprintf("\t{ nobox |\n" + "\t %s |\n" + "\t %s}\n", BoxArgs::Keywords_XyzAbg(), BoxArgs::Keywords_TruncOct()); + mprintf(" Set the box info for specified topology (currently only relevant for Amber\n" " Topology/ASCII coords). If 'nobox' is specified, remove box info. If\n" " 'truncoct' specified, set truncated octahedron with lengths = .\n"); } Exec::RetType Exec_ParmBox::Execute(CpptrajState& State, ArgList& argIn) { - Box pbox; + BoxArgs boxArgs; bool nobox = false; if ( argIn.hasKey("nobox") ) nobox = true; else { - pbox.SetX( argIn.getKeyDouble("x",0) ); - pbox.SetY( argIn.getKeyDouble("y",0) ); - pbox.SetZ( argIn.getKeyDouble("z",0) ); - pbox.SetAlpha( argIn.getKeyDouble("alpha",0) ); - pbox.SetBeta( argIn.getKeyDouble("beta",0) ); - pbox.SetGamma( argIn.getKeyDouble("gamma",0) ); + if (boxArgs.SetBoxArgs( argIn )) return CpptrajState::ERR; } Topology* parm = State.DSL().GetTopByIndex( argIn ); if (parm == 0) return CpptrajState::ERR; + Box pbox; if (nobox) mprintf("\tRemoving box information from parm %i:%s\n", parm->Pindex(), parm->c_str()); - else + else { // Fill in missing parm box information from specified parm - pbox.SetMissingInfo( parm->ParmBox() ); - if (argIn.hasKey("truncoct")) pbox.SetTruncOct(); + if (boxArgs.SetMissingInfo( parm->ParmBox() )) return CpptrajState::ERR; + pbox.SetupFromXyzAbg( boxArgs.XyzAbg() ); + } parm->SetParmBox( pbox ); parm->ParmBox().PrintInfo(); return CpptrajState::OK; diff --git a/src/FileIO_Std.cpp b/src/FileIO_Std.cpp index 128fc262f2..42e142756c 100644 --- a/src/FileIO_Std.cpp +++ b/src/FileIO_Std.cpp @@ -55,7 +55,10 @@ int FileIO_Std::Read(void *buffer, size_t num_bytes) { int FileIO_Std::Write(const void *buffer, size_t num_bytes) { size_t numwrite = fwrite(buffer, 1, num_bytes, fp_); // NOTE: Check for errors here. - if (numwrite != num_bytes) return 1; + if (numwrite != num_bytes) { + perror("Error during FileIO_Std::Write"); + return 1; + } return 0; } diff --git a/src/Frame.cpp b/src/Frame.cpp index 9300cab1b4..f80fea3287 100644 --- a/src/Frame.cpp +++ b/src/Frame.cpp @@ -260,75 +260,6 @@ Frame &Frame::operator=(Frame rhs) { return *this; } -// ---------- CONVERT TO/FROM CRDtype ------------------------------------------ -// Frame::SetFromCRD() -void Frame::SetFromCRD(CRDtype const& farray, int numCrd, int numBoxCrd, bool hasVel) { - int f_ncoord = numCrd; - if (f_ncoord > maxnatom_*3) { - mprinterr("Error: Float array size (%i) > max #coords in frame (%i)\n", - f_ncoord, maxnatom_*3); - return; - } - ncoord_ = f_ncoord; - natom_ = ncoord_ / 3; - for (int ix = 0; ix < ncoord_; ++ix) - X_[ix] = (double)farray[ix]; - if (hasVel && V_ != 0) { - for (int iv = 0; iv < ncoord_; ++iv) - V_[iv] = (double)farray[f_ncoord++]; - } - for (int ib = 0; ib < numBoxCrd; ++ib) - box_[ib] = (double)farray[f_ncoord++]; -} - -// Frame::SetFromCRD() -void Frame::SetFromCRD(CRDtype const& crdIn, AtomMask const& mask, int numCrd, - int numBoxCrd, bool hasVel) -{ - if (mask.Nselected() > maxnatom_) { - mprinterr("Internal Error: Selected # atoms in float array (%i) > max #atoms in frame (%i)\n", - mask.Nselected(), maxnatom_); - return; - } - natom_ = mask.Nselected(); - ncoord_ = natom_ * 3; - unsigned int ix = 0; - unsigned int iv = 0; - for (AtomMask::const_iterator atom = mask.begin(); atom != mask.end(); ++atom) { - unsigned int xoffset = ((unsigned int)(*atom)) * 3; - X_[ix++] = (double)crdIn[xoffset ]; - X_[ix++] = (double)crdIn[xoffset+1]; - X_[ix++] = (double)crdIn[xoffset+2]; - if (hasVel && V_ != 0) { - unsigned int voffset = numCrd + xoffset; - V_[iv++] = (double)crdIn[voffset ]; - V_[iv++] = (double)crdIn[voffset+1]; - V_[iv++] = (double)crdIn[voffset+2]; - } - } - int f_ncoord = (int)crdIn.size() - numBoxCrd; - for (int ib = 0; ib < numBoxCrd; ++ib) - box_[ib] = (double)crdIn[f_ncoord++]; -} - -// Frame::ConvertToCRD() -Frame::CRDtype Frame::ConvertToCRD(int numBoxCrd, bool hasVel) const { - int nvel; - if (hasVel) - nvel = ncoord_; - else - nvel = 0; - CRDtype farray; - farray.reserve( ncoord_ + nvel + numBoxCrd ); - for (int ix = 0; ix < ncoord_; ++ix) - farray.push_back( (float)X_[ix] ); - for (int iv = 0; iv < nvel; ++iv ) - farray.push_back( (float)V_[iv] ); - for (int ib = 0; ib < numBoxCrd; ++ib) - farray.push_back( (float)box_[ib] ); - return farray; -} - // ---------- ACCESS INTERNAL DATA --------------------------------------------- // Frame::DataSize() /** Size of Frame in memory. */ @@ -1431,7 +1362,7 @@ void Frame::SetOrthoBoundingBox(std::vector const& Radii, double offset) xyzabg[3] = 90.0; xyzabg[4] = 90.0; xyzabg[5] = 90.0; - box_.SetBox(xyzabg); + box_.SetupFromXyzAbg(xyzabg); } #ifdef MPI @@ -1444,7 +1375,7 @@ int Frame::SendFrame(int recvrank, Parallel::Comm const& commIn) { commIn.Send( V_, ncoord_, MPI_DOUBLE, recvrank, 1215 ); if (F_ != 0) commIn.Send( F_, ncoord_, MPI_DOUBLE, recvrank, 1218 ); - commIn.Send( box_.boxPtr(), 6, MPI_DOUBLE, recvrank, 1213 ); + box_.SendBox(recvrank, commIn); commIn.Send( &T_, 1, MPI_DOUBLE, recvrank, 1214 ); commIn.Send( &pH_, 1, MPI_DOUBLE, recvrank, 1219 ); commIn.Send( &redox_, 1, MPI_DOUBLE, recvrank, 1220 ); @@ -1464,7 +1395,7 @@ int Frame::RecvFrame(int sendrank, Parallel::Comm const& commIn) { commIn.Recv( V_, ncoord_, MPI_DOUBLE, sendrank, 1215 ); if (F_ != 0) commIn.Recv( F_, ncoord_, MPI_DOUBLE, sendrank, 1218 ); - commIn.Recv( box_.boxPtr(), 6, MPI_DOUBLE, sendrank, 1213 ); + box_.RecvBox(sendrank, commIn); commIn.Recv( &T_, 1, MPI_DOUBLE, sendrank, 1214 ); commIn.Recv( &pH_, 1, MPI_DOUBLE, sendrank, 1219 ); commIn.Recv( &redox_, 1, MPI_DOUBLE, sendrank, 1220 ); diff --git a/src/Frame.h b/src/Frame.h index 2080f8b405..5315e56eb9 100644 --- a/src/Frame.h +++ b/src/Frame.h @@ -46,18 +46,10 @@ class Frame { Frame(int, double*); Frame(const Frame&); Frame& operator=(Frame); - typedef std::vector RemdIdxType; ///< For dealing with replica indices TODO put in ReplicaInfo - typedef std::vector RemdValType; /// < For reading replica values - // ------------------------------------------- - /// This type interfaces with DataSet_Coords_CRD - typedef std::vector CRDtype; - /// Assign given CRDtype to this frame. - void SetFromCRD(CRDtype const&, int, int, bool); - /// Assign selected atoms from given CRDtype to this frame. - void SetFromCRD(CRDtype const&, AtomMask const&, int, int, bool); - /// Convert this frame to CRDtype. - CRDtype ConvertToCRD(int, bool) const; - // ------------------------------------------- + /// For dealing with replica indices TODO put in ReplicaInfo + typedef std::vector RemdIdxType; + /// For reading replica values + typedef std::vector RemdValType; /// \return Size of Frame in memory size_t DataSize() const; /// Print XYZ coordinates for given atom. @@ -104,12 +96,10 @@ class Frame { int RepIdx() const { return repidx_; } /// \return overall coordinate index int CrdIdx() const { return crdidx_; } - /// Set box alpha, beta, and gamma - inline void SetBoxAngles(const double*); /// Set box from another box void SetBox( Box const& b ) { box_ = b; } /// Modify box in place - Box& SetBox() { return box_; } + Box& ModifyBox() { return box_; } /// Set temperature void SetTemperature(double tIn) { T_ = tIn; } /// Set step @@ -120,6 +110,10 @@ class Frame { void SetRedOx(double rIn) { redox_ = rIn; } /// Set time void SetTime(double tIn) { time_ = tIn; } + /// Set replica index + void SetRepIdx(int rIn) { repidx_ = rIn; } + /// Set coordinate index + void SetCrdIdx(int cIn) { crdidx_ = cIn; } /// Set masses void SetMass(std::vector const&); /// Copy atoms from input frame to here @@ -130,7 +124,6 @@ class Frame { inline double* xAddress() { return X_; } inline double* vAddress() { return V_; } inline double* fAddress() { return F_; } - inline double* bAddress() { return box_.boxPtr(); } inline double* tAddress() { return &T_; } inline double* mAddress() { return &time_; } inline int* iAddress() { return &remd_indices_[0]; } @@ -139,7 +132,6 @@ class Frame { inline const double* xAddress() const { return X_; } inline const double* vAddress() const { return V_; } inline const double* fAddress() const { return F_; } - inline const double* bAddress() const { return box_.boxPtr(); } inline const double* tAddress() const { return &T_; } inline const double* mAddress() const { return &time_; } inline const int* iAddress() const { return &remd_indices_[0]; } @@ -299,11 +291,6 @@ class Frame { inline bool ReallocateX(int); }; // ---------- INLINE FUNCTION DEFINITIONS -------------------------------------- -void Frame::SetBoxAngles(const double* boxAngle) { - box_.SetAlpha( boxAngle[0] ); - box_.SetBeta( boxAngle[1] ); - box_.SetGamma( boxAngle[2] ); -} bool Frame::CheckCoordsInvalid() const { if (natom_ > 1) { diff --git a/src/GridAction.cpp b/src/GridAction.cpp index 670a4858ed..9b90847204 100644 --- a/src/GridAction.cpp +++ b/src/GridAction.cpp @@ -41,7 +41,7 @@ DataSet_GridFlt* GridAction::GridInit(const char* callingRoutine, ArgList& argIn mprinterr("Error: Reference '%s' not found.\n", refname.c_str()); return 0; } - if (REF->CoordsInfo().TrajBox().Type() == Box::NOBOX) { + if (!(REF->CoordsInfo().TrajBox().HasBox())) { mprinterr("Error: Reference '%s' does not have box information.\n", refname.c_str()); return 0; } @@ -148,9 +148,9 @@ void GridAction::GridInfo(DataSet_GridFlt const& grid) { int GridAction::GridSetup(Topology const& currentParm, CoordinateInfo const& cInfo) { // Check box if (mode_ == BOX) { - if (cInfo.TrajBox().Type() != Box::ORTHO) { + if (!cInfo.TrajBox().Is_X_Aligned_Ortho()) { mprintf("Warning: Code to shift to the box center is not yet\n"); - mprintf("Warning: implemented for non-orthorhomibic unit cells.\n"); + mprintf("Warning: implemented for non-orthorhombic unit cells.\n"); mprintf("Warning: Shifting to the origin instead.\n"); mode_ = ORIGIN; } diff --git a/src/GridBin.h b/src/GridBin.h index 5e4307ef43..0136a86265 100644 --- a/src/GridBin.h +++ b/src/GridBin.h @@ -131,8 +131,9 @@ class GridBin_Nonortho : public GridBin { nx_ = (double)nxIn; ny_ = (double)nyIn; nz_ = (double)nzIn; OXYZ_ = oxyzIn; // Get unit cell and fractional cell vectors (recip). - double vol = boxIn.ToRecip( ucell_, recip_ ); - voxelvolume_ = vol / (nx_ * ny_ * nz_); + ucell_ = boxIn.UnitCell(); + recip_ = boxIn.FracCell(); + voxelvolume_ = boxIn.CellVolume() / (nx_ * ny_ * nz_); } private: double nx_, ny_, nz_; ///< Number of bins in double precision. diff --git a/src/ImageOption.h b/src/ImageOption.h new file mode 100644 index 0000000000..fde9a1024d --- /dev/null +++ b/src/ImageOption.h @@ -0,0 +1,69 @@ +#ifndef INC_IMAGEOPTION_H +#define INC_IMAGEOPTION_H +/// Used to determine if imaging should be used. Imaging disabled when no box present. +/** This class should be used in conjunction with the routines in DistRoutines.h + * when imaging may or may not be desired. + * First, InitImaging() should be called with true if imaging desired if + * possible, false otherwise. + * Second, SetupImaging() should be called with true if box info is + * present, false otherwise. + * Third, SetImageType() should be called with true if the box is X-aligned + * and orthogonal, false otherwise. + * The ImagingType() function will then return the appropriate imaging type + * for the box. + */ +class ImageOption { + public: + /// Different imaging types. + enum Type { NO_IMAGE = 0, ORTHO, NONORTHO }; + /// CONSTRUCTOR + ImageOption() : type_(NO_IMAGE), useImage_(false), imagingEnabled_(false), forceNonortho_(false) {} + /// Determine if imaging is desired. Optionally force nonortho. + void InitImaging(bool imagingDesired, bool forceNonOrthoIn) { + useImage_ = imagingDesired; + forceNonortho_ = forceNonOrthoIn; + type_ = NO_IMAGE; + } + /// Determine if imaging is desired. + void InitImaging(bool imagingDesired) { InitImaging(imagingDesired, false); } + /// Determine if imaging possible if desired. + void SetupImaging(bool hasBox) { + type_ = NO_IMAGE; + if (useImage_) { + // Imaging desired if possible. + if (hasBox) + imagingEnabled_ = true; + else + imagingEnabled_ = false; + } else + // No imaging desired. + imagingEnabled_ = false; + } + /// \return True if imaging is desired. + bool UseImage() const { return useImage_; } + /// \return True if imaging desired and currently possible. + bool ImagingEnabled() const { return imagingEnabled_; } + /// \return True if forcing use of non-ortho imaging. + bool ForceNonOrtho() const { return forceNonortho_; } + /// \return Current imaging type + Type ImagingType() const { return type_; } + /// Determine imaging type given current options and if cell is x_aligned orthogonal + /** NOTE: This should only be called if imaging is enabled. */ + void SetImageType(bool is_x_aligned_ortho) { + //if (imagingEnabled_) { + if (forceNonortho_) + type_ = NONORTHO; + else if (is_x_aligned_ortho) + type_ = ORTHO; + else + type_ = NONORTHO; + //} else + // type_ = NO_IMAGE; + } + private: + Type type_; ///< Current imaging type based on current cell. + bool useImage_; ///< If true, imaging desired if possible. + bool imagingEnabled_; ///< If true, imaging is possible and should be on. + bool forceNonortho_; ///< If true, non-ortho imaging will be used if possible. +}; +#endif diff --git a/src/ImageRoutines.cpp b/src/ImageRoutines.cpp index aea9494c44..e79b5746a3 100644 --- a/src/ImageRoutines.cpp +++ b/src/ImageRoutines.cpp @@ -108,9 +108,9 @@ void Image::Nonortho(Frame& frameIn, bool origin, Vec3 const& fcom, Vec3 const& double min = -1.0; if (truncoct) - min = 100.0 * (frameIn.BoxCrd().BoxX()*frameIn.BoxCrd().BoxX()+ - frameIn.BoxCrd().BoxY()*frameIn.BoxCrd().BoxY()+ - frameIn.BoxCrd().BoxZ()*frameIn.BoxCrd().BoxZ()); + min = 100.0 * (frameIn.BoxCrd().Param(Box::X)*frameIn.BoxCrd().Param(Box::X)+ + frameIn.BoxCrd().Param(Box::Y)*frameIn.BoxCrd().Param(Box::Y)+ + frameIn.BoxCrd().Param(Box::Z)*frameIn.BoxCrd().Param(Box::Z)); // Loop over atom pairs for (unsigned int idx = 0; idx != AtomPairs.nEntities(); idx++) @@ -182,7 +182,7 @@ int Image::SetupOrtho(Box const& boxIn, Vec3& bp, Vec3& bm, bool origin) { bp = boxIn.Center(); bm.SetVec( -bp[0], -bp[1], -bp[2] ); } else { - bp.SetVec( boxIn.BoxX(), boxIn.BoxY(), boxIn.BoxZ() ); + bp.SetVec( boxIn.Param(Box::X), boxIn.Param(Box::Y), boxIn.Param(Box::Z) ); bm.Zero(); } if (bp.IsZero()) return 1; @@ -200,9 +200,9 @@ void Image::Ortho(Frame& frameIn, Vec3 const& bp, Vec3 const& bm, Vec3 const& of List const& AtomPairs) { Vec3 Coord; - Vec3 offset(offIn[0] * frameIn.BoxCrd()[0], - offIn[1] * frameIn.BoxCrd()[1], - offIn[2] * frameIn.BoxCrd()[2]); + Vec3 offset(offIn[0] * frameIn.BoxCrd().Param(Box::X), + offIn[1] * frameIn.BoxCrd().Param(Box::Y), + offIn[2] * frameIn.BoxCrd().Param(Box::Z)); // Loop over atom pairs for (unsigned int idx = 0; idx != AtomPairs.nEntities(); idx++) { @@ -227,16 +227,17 @@ Vec3 Image::Ortho(Vec3 const& Coord, Vec3 const& bp, Vec3 const& bm, Box const& { Vec3 trans; // Determine how far Coord is out of box + // Note Box::Param 0 1 2 is X Y Z for (int i = 0; i < 3; ++i) { trans[i] = 0.0; double crd = Coord[i]; while (crd < bm[i]) { - crd += BoxVec[i]; - trans[i] += BoxVec[i]; + crd += BoxVec.Param((Box::ParamType)i); + trans[i] += BoxVec.Param((Box::ParamType)i); } while (crd > bp[i]) { - crd -= BoxVec[i]; - trans[i] -= BoxVec[i]; + crd -= BoxVec.Param((Box::ParamType)i); + trans[i] -= BoxVec.Param((Box::ParamType)i); } } return trans; diff --git a/src/ImagedAction.h b/src/ImagedAction.h deleted file mode 100644 index f54132e1ec..0000000000 --- a/src/ImagedAction.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef INC_IMAGEDACTION_H -#define INC_IMAGEDACTION_H -#include "DistRoutines.h" -// TODO: Add ucell and recip to here -class ImagedAction { - public: - ImagedAction() : imageType_(NOIMAGE), useImage_(false) {} - - void InitImaging( bool imageIn ) { useImage_ = imageIn; } - - void SetupImaging( Box::BoxType parmboxtype ) { - if (!useImage_) - // Imaging disabled - imageType_ = NOIMAGE; - else { - if (parmboxtype == Box::NOBOX) { - imageType_ = NOIMAGE; - //if (debug>0) - // mprintf(" Warning: No box info in %s, disabling imaging.\n",currentParm->c_str()); - } else if (parmboxtype == Box::ORTHO) - imageType_ = ORTHO; - else - imageType_ = NONORTHO; - } - } - - /// Return true if imaging is currently enabled. - bool ImagingEnabled() const { return (imageType_ != NOIMAGE); } - bool UseImage() const { return useImage_; } ///< True if imaging is desired. - ImagingType ImageType() const { return imageType_; } ///< Return type of imaging. - private: - ImagingType imageType_; ///< Type of imaging to be performed. - bool useImage_; ///< If true, use imaging. -}; -#endif diff --git a/src/Matrix_3x3.cpp b/src/Matrix_3x3.cpp index d0da58d582..3960939479 100644 --- a/src/Matrix_3x3.cpp +++ b/src/Matrix_3x3.cpp @@ -361,6 +361,21 @@ void Matrix_3x3::Transpose() { M_[7] = U5; } +/** Multiply all elements by scalar. */ +Matrix_3x3& Matrix_3x3::operator*=(double fac) { + for (int i = 0; i < 9; i++) + M_[i] *= fac; + return *this; +} + +/** \return Matrix with all elements multiplied by a scalar. */ +Matrix_3x3 Matrix_3x3::operator*(double fac) const { + Matrix_3x3 result; + for (int i = 0; i < 9; i++) + result[i] = M_[i] * fac; + return result; +} + // Matrix_3x3::operator*=() Matrix_3x3& Matrix_3x3::operator*=(const Matrix_3x3& rhs) { double Row[9]; @@ -516,3 +531,19 @@ Vec3 Matrix_3x3::AxisOfRotation(double theta) { } return Vec3(0.0, 0.0, 0.0); } + +#ifdef MPI +void Matrix_3x3::SyncMatrix(Parallel::Comm const& commIn) { + commIn.MasterBcast( M_, 9, MPI_DOUBLE ); +} + +int Matrix_3x3::SendMatrix(int recvrank, Parallel::Comm const& commIn) { + commIn.Send( M_, 9, MPI_DOUBLE, recvrank, 1900 ); + return 0; +} + +int Matrix_3x3::RecvMatrix(int sendrank, Parallel::Comm const& commIn) { + commIn.Recv( M_, 9, MPI_DOUBLE, sendrank, 1900 ); + return 0; +} +#endif diff --git a/src/Matrix_3x3.h b/src/Matrix_3x3.h index 614d5f3896..689b392e0b 100644 --- a/src/Matrix_3x3.h +++ b/src/Matrix_3x3.h @@ -1,6 +1,9 @@ #ifndef INC_MATRIX_3X3_H #define INC_MATRIX_3X3_H #include "Vec3.h" +#ifdef MPI +#include "Parallel.h" +#endif class Matrix_3x3 { public: Matrix_3x3() {} @@ -34,8 +37,15 @@ class Matrix_3x3 { int Diagonalize_Sort_Chirality(Vec3&,int); void Transpose(); + /// \return Matrix with rows and columns transposed. inline Matrix_3x3 Transposed() const; + /// \return Result of multiplying this matrix times given 3x3 matrix TODO split into a void and const version Matrix_3x3& operator*=(const Matrix_3x3&); + /// Multiply all elements of this matrix by scalar + Matrix_3x3& operator*=(double); + /// \return Result of multiplying this matrix times given scalar + Matrix_3x3 operator*(double) const; + void RotationAroundZ(double, double); void RotationAroundY(double, double); void CalcRotationMatrix(Vec3 const&, double); @@ -85,6 +95,11 @@ class Matrix_3x3 { // TODO: Get rid of this const double* Dptr() const { return M_; } double* Dptr() { return M_; } +# ifdef MPI + void SyncMatrix(Parallel::Comm const&); + int SendMatrix(int, Parallel::Comm const&); + int RecvMatrix(int, Parallel::Comm const&); +# endif private: double M_[9]; // The following three variables are set during Diagonalize_Sort. They diff --git a/src/NetcdfFile.cpp b/src/NetcdfFile.cpp index 1104a7415d..c0936ba514 100644 --- a/src/NetcdfFile.cpp +++ b/src/NetcdfFile.cpp @@ -295,6 +295,21 @@ int NetcdfFile::SetupTime() { if (time == NC_FILL_FLOAT) { mprintf("Warning: NetCDF file time variable defined but empty. Disabling.\n"); timeVID_ = -1; + } else { + // If first 2 values are 0, this is another indication of a bad time variable. + if (ncframe_ > 1) { + float time1; + start_[0] = 1; + if (NC::CheckErr(nc_get_vara_float(ncid_, timeVID_, start_, count_, &time1))) { + mprinterr("Error: Getting second time value for NetCDF file.\n"); + return -1; + } + if (time1 == 0 && time1 == time) + { + mprintf("Warning: NetCDF file time variable defined but all zero. Disabling.\n"); + timeVID_ = -1; + } + } } } return 0; @@ -441,7 +456,13 @@ int NetcdfFile::SetupBox() { } if (ncdebug_ > 0) mprintf("\tNetCDF Box: XYZ={%f %f %f} ABG={%f %f %f}\n", boxCrd[0], boxCrd[1], boxCrd[2], boxCrd[3], boxCrd[4], boxCrd[5]); - nc_box_.SetBox( boxCrd ); + if (nc_box_.SetupFromXyzAbg( boxCrd )) { + mprintf("Warning: NetCDF file unit cell variables appear to be empty; disabling box.\n"); + cellLengthVID_ = -1; + cellAngleVID_ = -1; + nc_box_.SetNoBox(); + return -1; + } return 0; } // No box information @@ -886,6 +907,9 @@ int NetcdfFile::NC_create(std::string const& Name, NCTYPE typeIn, int natomIn, } // Box Info if (coordInfo.HasBox()) { + // Check x-aligned + if (!coordInfo.TrajBox().Is_X_Aligned()) + mprintf("Warning: Unit cell is not X-aligned. Box cannot be properly stored as Amber NetCDF\n"); // Cell Spatial if ( NC::CheckErr( nc_def_dim( ncid_, NCCELL_SPATIAL, 3, &cell_spatialDID_)) ) { mprinterr("Error: Defining cell spatial dimension.\n"); diff --git a/src/PairList.cpp b/src/PairList.cpp index 887f1eeffa..a383a3511c 100644 --- a/src/PairList.cpp +++ b/src/PairList.cpp @@ -34,23 +34,17 @@ int PairList::InitPairList(double cutIn, double skinNBin, int debugIn) { return 0; } -int PairList::SetupPairList(Box const& boxIn) { - Matrix_3x3 ucell, recip; - boxIn.ToRecip(ucell, recip); - return SetupPairList( boxIn.Type(), boxIn.RecipLengths(recip) ); -} - // PairList::SetupPairList() -int PairList::SetupPairList(Box::BoxType typeIn, Vec3 const& recipLengthsIn) { +int PairList::SetupPairList(Box const& boxIn) { Timer t_setup; t_setup.Start(); - if (typeIn == Box::NOBOX) { - mprinterr("Error: Pair list code currently requires box coordinates.\n"); + if (!boxIn.HasBox()) { + mprinterr("Error: Pair list code currently requires box information.\n"); return 1; } // Allocate/reallocate memory - if (SetupGrids(recipLengthsIn)) return 1; + if (SetupGrids(boxIn.RecipLengths())) return 1; t_setup.Stop(); t_setup.WriteTiming(1, "Pair List Setup:"); mprintf("\tGrid dimensions: %i %i %i (%zu total).\n", nGridX_, nGridY_, nGridZ_, cells_.size()); @@ -83,7 +77,7 @@ int PairList::CreatePairList(Frame const& frmIn, Matrix_3x3 const& ucell, FillTranslateVec(ucell); // If box size has changed a lot this will reallocate grid t_gridpointers_.Start(); - if (SetupGrids(frmIn.BoxCrd().RecipLengths(recip))) return -1; + if (SetupGrids(frmIn.BoxCrd().RecipLengths())) return -1; t_gridpointers_.Stop(); // Place atoms in grid cells t_map_.Start(); @@ -129,7 +123,7 @@ int PairList::GridUnitCell(Frame const& frmIn, Matrix_3x3 const& ucell, Frac_.clear(); Frac_.reserve( maskIn.Nselected() ); int nOffGrid = 0; - if (frmIn.BoxCrd().Type() == Box::ORTHO) { + if (frmIn.BoxCrd().Is_X_Aligned_Ortho()) { // Orthogonal imaging for (AtomMask::const_iterator atom = maskIn.begin(); atom != maskIn.end(); ++atom) { diff --git a/src/PairList.h b/src/PairList.h index a6a5dd3c63..2d43657fa5 100644 --- a/src/PairList.h +++ b/src/PairList.h @@ -25,8 +25,6 @@ class PairList { PairList(); /// Initialize pair list with given cutoff, "skin", and debug level. int InitPairList(double,double,int); - /// Setup pair list grid cells based on given box type and vector of recip lengths. - int SetupPairList(Box::BoxType, Vec3 const&); /// Setup pair list grid cells using given box int SetupPairList(Box const&); /// Create pair list from Frame, unit cell and recip matrices, and mask. diff --git a/src/Parallel.h b/src/Parallel.h index 81cf0624f1..532315c0f9 100644 --- a/src/Parallel.h +++ b/src/Parallel.h @@ -19,7 +19,6 @@ * necessary. * Send/Receive Tags: All Comm Send()/Recv() tags should be noted here in order. * 1212 : Frame::X_ - * 1213 : Frame::box_ * 1214 : Frame::T_ * 1215 : Frame::V_ * 1216 : Frame::remd_indices_ @@ -37,6 +36,10 @@ * 1600+X: Ensemble sort * 1700 : DataSet_MatrixFlt size * 1701 : DataSet_MatrixFlt buffer + * 1800 : Box::btype_ + * 1801 : Box::box_ + * 1802 : Box::cellVolume_ + * 1900 : Matrix_3x3::M_ */ class Parallel { public: diff --git a/src/Parm_Amber.cpp b/src/Parm_Amber.cpp index 97ce57aa75..77ff5b64cb 100644 --- a/src/Parm_Amber.cpp +++ b/src/Parm_Amber.cpp @@ -272,19 +272,17 @@ int Parm_Amber::ReadParm(FileName const& fname, Topology& TopIn ) { } // Check box info if (values_[IFBOX] > 0) { - if (parmbox_.Type() == Box::NOBOX) { + if (!parmbox_.HasBox()) { if (ptype_ != CHAMBER) mprintf("Warning: Prmtop missing Box information.\n"); - // ifbox 2: truncated octahedron for certain - if (values_[IFBOX] == 2) - parmbox_.SetTruncOct(); + // Check for IFBOX/BoxType mismatch + if (values_[IFBOX]==2 && parmbox_.CellShape() != Box::OCTAHEDRAL) { + mprintf("Warning: Amber Parm Box should be Truncated Octahedron (ifbox==2)\n" + " but BOX_DIMENSIONS indicate %s - may cause imaging problems.\n", + parmbox_.CellShapeName()); + } } } - // Check for IFBOX/BoxType mismatch - if (values_[IFBOX]==2 && parmbox_.Type() != Box::TRUNCOCT) { - mprintf("Warning: Amber Parm Box should be Truncated Octahedron (ifbox==2)\n"); - mprintf(" but BOX_DIMENSIONS indicate %s - may cause imaging problems.\n", - parmbox_.TypeName()); - } + TopIn.SetParmBox( parmbox_ ); // DEBUG @@ -1031,11 +1029,35 @@ int Parm_Amber::ReadIrotat(Topology& TopIn, FortranData const& FMT) { // Parm_Amber::ReadBox() int Parm_Amber::ReadBox(FortranData const& FMT) { if (SetupBuffer(F_PARMBOX, 4, FMT)) return 1; - double beta = atof(file_.NextElement()); - double bx = atof(file_.NextElement()); - double by = atof(file_.NextElement()); - double bz = atof(file_.NextElement()); - parmbox_.SetBetaLengths( beta, bx, by, bz ); + double xyzabg[6]; + xyzabg[Box::BETA] = atof(file_.NextElement()); + xyzabg[Box::X ] = atof(file_.NextElement()); + xyzabg[Box::Y ] = atof(file_.NextElement()); + xyzabg[Box::Z ] = atof(file_.NextElement()); + //parmbox_.SetBetaLengths( beta, bx, by, bz ); + // Only beta angle is set (e.g. from Amber topology). + if (xyzabg[Box::BETA] == 90.0) { + xyzabg[Box::ALPHA] = 90.0; + xyzabg[Box::GAMMA] = 90.0; + if (debug_>0) mprintf("\tAmber topology box is orthogonal.\n"); + } else if ( Box::IsTruncOct( xyzabg[Box::BETA] ) ) { + // Use trunc oct angle from Box; higher precision + //xyzabg[Box::BETA ] = Box::TruncatedOctAngle(); + xyzabg[Box::ALPHA] = xyzabg[Box::BETA]; + xyzabg[Box::GAMMA] = xyzabg[Box::BETA]; + if (debug_>0) mprintf("\tAmber topology box is truncated octahedron.\n"); + } else if (xyzabg[Box::BETA] == 60.0) { + xyzabg[Box::ALPHA] = 60.0; + xyzabg[Box::BETA] = 90.0; + xyzabg[Box::GAMMA] = 60.0; + if (debug_>0) mprintf("\tAmber topology box is rhombic dodecahedron, alpha=gamma=60.0, beta=90.0.\n"); + } else { + mprintf("Warning: AmberParm: Unrecognized beta (%g); setting all angles to beta.\n", xyzabg[Box::BETA]); + xyzabg[Box::ALPHA] = xyzabg[Box::BETA]; + xyzabg[Box::GAMMA] = xyzabg[Box::BETA]; + } + parmbox_.SetupFromXyzAbg( xyzabg ); + return 0; } @@ -1772,12 +1794,21 @@ int Parm_Amber::WriteParm(FileName const& fname, Topology const& TopOut) { } // Determine value of ifbox - int ifbox; - switch ( TopOut.ParmBox().Type() ) { - case Box::NOBOX : ifbox = 0; break; - case Box::ORTHO : ifbox = 1; break; - case Box::TRUNCOCT : ifbox = 2; break; - default: ifbox = 3; break; // General triclinic + int ifbox = 0; + Box::CellShapeType cellShape = TopOut.ParmBox().CellShape(); + if ( cellShape != Box::NO_SHAPE ) { + if (cellShape == Box::CUBIC || cellShape == Box::TETRAGONAL || cellShape == Box::ORTHORHOMBIC) { + // Orthorhombic + if (!TopOut.ParmBox().Is_X_Aligned_Ortho()) + mprintf("Warning: Parm box shape is orthorhombic but cell is not X-aligned.\n"); + ifbox = 1; + } else if (cellShape == Box::OCTAHEDRAL) { + // Truncated octahedron + ifbox = 2; + } else { + // General triclinic + ifbox = 3; + } } // POINTERS @@ -2234,10 +2265,16 @@ int Parm_Amber::WriteParm(FileName const& fname, Topology const& TopOut) { } // BOX DIMENSIONS if (BufferAlloc(F_PARMBOX, 4)) return 1; - file_.DblToBuffer( TopOut.ParmBox().Beta() ); - file_.DblToBuffer( TopOut.ParmBox().BoxX() ); - file_.DblToBuffer( TopOut.ParmBox().BoxY() ); - file_.DblToBuffer( TopOut.ParmBox().BoxZ() ); + double beta; + // Special case: Rhombic dodecahedron stores alpha/gamma (60) instead of beta (90) + if (cellShape == Box::RHOMBIC_DODECAHEDRON) + beta = 60.0; + else + beta = TopOut.ParmBox().Param(Box::BETA); + file_.DblToBuffer( beta ); + file_.DblToBuffer( TopOut.ParmBox().Param(Box::X) ); + file_.DblToBuffer( TopOut.ParmBox().Param(Box::Y) ); + file_.DblToBuffer( TopOut.ParmBox().Param(Box::Z) ); file_.FlushBuffer(); } diff --git a/src/Parm_CIF.cpp b/src/Parm_CIF.cpp index 9da136cc3c..9447de233e 100644 --- a/src/Parm_CIF.cpp +++ b/src/Parm_CIF.cpp @@ -125,7 +125,9 @@ int Parm_CIF::ReadParm(FileName const& fname, Topology &TopIn) { cif_box[5] = convertToDouble( cellblock.Data("angle_gamma") ); mprintf("\tRead cell info from CIF: a=%g b=%g c=%g alpha=%g beta=%g gamma=%g\n", cif_box[0], cif_box[1], cif_box[2], cif_box[3], cif_box[4], cif_box[5]); - TopIn.SetParmBox( Box(cif_box) ); + Box parmBox; + parmBox.SetupFromXyzAbg( cif_box ); + TopIn.SetParmBox( parmBox ); } return 0; diff --git a/src/Parm_PDB.cpp b/src/Parm_PDB.cpp index 82350f7b12..4c1be9c17c 100644 --- a/src/Parm_PDB.cpp +++ b/src/Parm_PDB.cpp @@ -93,7 +93,9 @@ int Parm_PDB::ReadParm(FileName const& fname, Topology &TopIn) { if (readBox_ && infile.RecType() == PDBfile::CRYST1) { // Box info from CRYST1 record. infile.pdb_Box_verbose( XYZ ); - TopIn.SetParmBox( XYZ ); + Box pbox; + pbox.SetupFromXyzAbg( XYZ ); + TopIn.SetParmBox( pbox ); } else if (infile.RecType() == PDBfile::CONECT && readConect) { // BOND - first element will be atom, next few are bonded atoms. // To avoid duplicates only add the bond if atom2 > atom1 diff --git a/src/RPNcalc.cpp b/src/RPNcalc.cpp index f5ef18931a..64f5cabef2 100644 --- a/src/RPNcalc.cpp +++ b/src/RPNcalc.cpp @@ -798,8 +798,9 @@ int RPNcalc::TokenLoop(DataSetList& DSL) const { G1.Bin().GridOrigin()[2]); tempDS = LocalList.AddSet(DataSet::GRID_FLT, MetaData("TEMP", T-tokens_.begin())); DataSet_GridFlt& G0 = static_cast( *tempDS ); - G0.Allocate_N_O_Box(G1.NX(), G1.NY(), G1.NZ(), G1.Bin().GridOrigin(), - Box(G1.Bin().Ucell())); + Box tempBox; + tempBox.SetupFromUcell( G1.Bin().Ucell() ); + G0.Allocate_N_O_Box(G1.NX(), G1.NY(), G1.NZ(), G1.Bin().GridOrigin(), tempBox); G1.GridInfo(); G0.GridInfo(); for (unsigned int n = 0; n != G1.Size(); n++) diff --git a/src/RemdReservoirNC.cpp b/src/RemdReservoirNC.cpp index bb3a083dd6..afc2848db7 100644 --- a/src/RemdReservoirNC.cpp +++ b/src/RemdReservoirNC.cpp @@ -66,13 +66,14 @@ int RemdReservoirNC::WriteReservoir(unsigned int set, Frame const& frame, double } // Write box if (cellLengthVID_ != -1) { + // TODO Check if Box is normal? count_[1] = 3; count_[2] = 0; - if (NC::CheckErr(nc_put_vara_double(ncid_,cellLengthVID_,start_,count_,frame.bAddress())) ) { + if (NC::CheckErr(nc_put_vara_double(ncid_,cellLengthVID_,start_,count_,frame.BoxCrd().XyzPtr())) ) { mprinterr("Error: Writing cell lengths.\n"); return 1; } - if (NC::CheckErr(nc_put_vara_double(ncid_,cellAngleVID_,start_,count_, frame.bAddress()+3)) ) { + if (NC::CheckErr(nc_put_vara_double(ncid_,cellAngleVID_,start_,count_, frame.BoxCrd().AbgPtr())) ) { mprinterr("Error: Writing cell angles.\n"); return 1; } diff --git a/src/StructureCheck.cpp b/src/StructureCheck.cpp index 840ebd19b0..5903737ccd 100644 --- a/src/StructureCheck.cpp +++ b/src/StructureCheck.cpp @@ -4,6 +4,7 @@ #include "Topology.h" #include "CpptrajStdio.h" #include "CharMask.h" +#include "DistRoutines.h" #ifdef _OPENMP # include #endif @@ -28,7 +29,7 @@ int StructureCheck::SetOptions(bool imageOn, bool checkBonds, bool saveProblemsI double overlapCut, double bondLengthOffset, double bondMinOffset, double pairListCut) { - image_.InitImaging( imageOn ); + imageOpt_.InitImaging( imageOn ); bondcheck_ = checkBonds; saveProblems_ = saveProblemsIn; debug_ = debugIn; @@ -87,7 +88,7 @@ void StructureCheck::SetupBondList(AtomMask const& iMask, Topology const& top) { // StructureCheck::Setup() int StructureCheck::Setup(Topology const& topIn, Box const& boxIn) { - image_.SetupImaging( boxIn.Type() ); + imageOpt_.SetupImaging( boxIn.HasBox() ); bondList_.clear(); // Set up first mask if ( topIn.SetupIntegerMask( Mask1_ ) ) return 1; @@ -123,7 +124,7 @@ int StructureCheck::Setup(Topology const& topIn, Box const& boxIn) // Check if pairlist should be used. ExclusionArray::SelfOpt ex_self_opt = ExclusionArray::NO_EXCLUDE_SELF; ExclusionArray::ListOpt ex_list_opt = ExclusionArray::ONLY_GREATER_IDX; - if (image_.ImagingEnabled() && !Mask2_.MaskStringSet()) { + if (imageOpt_.ImagingEnabled() && !Mask2_.MaskStringSet()) { mprintf("\tUsing pair list.\n"); if (pairList_.InitPairList( plcut_, 0.1, debug_ )) { mprinterr("Error: StructureCheck: Could not init pair list.\n"); @@ -211,11 +212,12 @@ int StructureCheck::CheckBonds(Frame const& currentFrame) /** Check for bad overlaps; use a pair list to speed things up. * \return Number of bad overlaps. */ -int StructureCheck::PL1_CheckOverlap(Frame const& currentFrame, Matrix_3x3 const& ucell, - Matrix_3x3 const& recip) +int StructureCheck::PL1_CheckOverlap(Frame const& currentFrame) { int Nproblems = 0; - int retVal = pairList_.CreatePairList(currentFrame, ucell, recip, Mask1_); + int retVal = pairList_.CreatePairList(currentFrame, + currentFrame.BoxCrd().UnitCell(), + currentFrame.BoxCrd().FracCell(), Mask1_); if (retVal < 0) { // Treat grid setup failure as one problem. mprinterr("Error: Grid setup failed.\n"); @@ -317,12 +319,11 @@ int StructureCheck::PL1_CheckOverlap(Frame const& currentFrame, Matrix_3x3 const /** Check for and record non-bonded clashes. */ void StructureCheck::DistanceCheck(Frame const& currentFrame, int atom1, int atom2, - Matrix_3x3 const& ucell, Matrix_3x3 const& recip, Parray& problemAtoms, int& Nproblems) const { - double D2 = DIST2( currentFrame.XYZ(atom1), currentFrame.XYZ(atom2), - image_.ImageType(), currentFrame.BoxCrd(), ucell, recip); + double D2 = DIST2( imageOpt_.ImagingType(), currentFrame.XYZ(atom1), currentFrame.XYZ(atom2), + currentFrame.BoxCrd()); if (D2 < nonbondcut2_) { ++Nproblems; if (saveProblems_) { @@ -332,8 +333,7 @@ const } // StructureCheck::Mask2_CheckOverlap() -int StructureCheck::Mask2_CheckOverlap(Frame const& currentFrame, Matrix_3x3 const& ucell, - Matrix_3x3 const& recip) +int StructureCheck::Mask2_CheckOverlap(Frame const& currentFrame) { problemAtoms_.clear(); int Nproblems = 0; @@ -354,7 +354,7 @@ int StructureCheck::Mask2_CheckOverlap(Frame const& currentFrame, Matrix_3x3 con for (int nmask2 = 0; nmask2 < inner_max; nmask2++) { int atom2 = InnerMask_[nmask2]; if (atom1 != atom2) { - DistanceCheck(currentFrame, atom1, atom2, ucell, recip, + DistanceCheck(currentFrame, atom1, atom2, # ifdef _OPENMP thread_problemAtoms_[mythread], # else @@ -373,8 +373,7 @@ int StructureCheck::Mask2_CheckOverlap(Frame const& currentFrame, Matrix_3x3 con } // StructureCheck::Mask1_CheckOverlap() -int StructureCheck::Mask1_CheckOverlap(Frame const& currentFrame, Matrix_3x3 const& ucell, - Matrix_3x3 const& recip) +int StructureCheck::Mask1_CheckOverlap(Frame const& currentFrame) { problemAtoms_.clear(); int Nproblems = 0; @@ -406,7 +405,7 @@ int StructureCheck::Mask1_CheckOverlap(Frame const& currentFrame, Matrix_3x3 con if (nmask2 == *ex) ++ex; else { - DistanceCheck(currentFrame, atom1, atom2, ucell, recip, + DistanceCheck(currentFrame, atom1, atom2, # ifdef _OPENMP thread_problemAtoms_[mythread], # else @@ -419,7 +418,7 @@ int StructureCheck::Mask1_CheckOverlap(Frame const& currentFrame, Matrix_3x3 con // Now, no more interactions to exclude. for (; nmask2 < mask1_max; nmask2++) { atom2 = Mask1_[nmask2]; - DistanceCheck(currentFrame, atom1, atom2, ucell, recip, + DistanceCheck(currentFrame, atom1, atom2, # ifdef _OPENMP thread_problemAtoms_[mythread], # else @@ -438,14 +437,13 @@ int StructureCheck::Mask1_CheckOverlap(Frame const& currentFrame, Matrix_3x3 con // StructureCheck::CheckOverlaps() int StructureCheck::CheckOverlaps(Frame const& currentFrame) { - Matrix_3x3 ucell, recip; - if (checkType_ == PL_1_MASK || image_.ImageType() == NONORTHO) - currentFrame.BoxCrd().ToRecip(ucell, recip); + if (imageOpt_.ImagingEnabled()) + imageOpt_.SetImageType( currentFrame.BoxCrd().Is_X_Aligned_Ortho() ); int Nproblems = 0; switch (checkType_) { - case PL_1_MASK : Nproblems = PL1_CheckOverlap(currentFrame, ucell, recip); break; - case NO_PL_2_MASKS : Nproblems = Mask2_CheckOverlap(currentFrame, ucell, recip); break; - case NO_PL_1_MASK : Nproblems = Mask1_CheckOverlap(currentFrame, ucell, recip); break; + case PL_1_MASK : Nproblems = PL1_CheckOverlap(currentFrame); break; + case NO_PL_2_MASKS : Nproblems = Mask2_CheckOverlap(currentFrame); break; + case NO_PL_1_MASK : Nproblems = Mask1_CheckOverlap(currentFrame); break; } return Nproblems; } diff --git a/src/StructureCheck.h b/src/StructureCheck.h index 75f066ff01..ea5a452913 100644 --- a/src/StructureCheck.h +++ b/src/StructureCheck.h @@ -1,7 +1,7 @@ #ifndef INC_STRUCTURECHECK_H #define INC_STRUCTURECHECK_H #include "PairList.h" -#include "ImagedAction.h" +#include "ImageOption.h" #include "ExclusionArray.h" #include "AtomMask.h" #include "ParameterTypes.h" @@ -24,7 +24,7 @@ class StructureCheck { AtomMask const& Mask1() const { return Mask1_; } AtomMask const& Mask2() const { return Mask2_; } - ImagedAction const& Image() const { return image_; } + ImageOption const& ImageOpt() const { return imageOpt_; } bool CheckBonds() const { return bondcheck_; } double BondOffset() const { return bondoffset_; } double BondMinOffset() const { return bondMinOffset_; } @@ -79,16 +79,15 @@ class StructureCheck { /// Add selected bonds in topology to list to be checked. void SetupBondList(AtomMask const&, Topology const&); /// PairList version of CheckOverlap, 1 mask - int PL1_CheckOverlap(Frame const&, Matrix_3x3 const&, Matrix_3x3 const&); + int PL1_CheckOverlap(Frame const&); /// Non-pairlist version of CheckOverlap, 1 mask - int Mask1_CheckOverlap(Frame const&, Matrix_3x3 const&, Matrix_3x3 const&); + int Mask1_CheckOverlap(Frame const&); /// Non-pairlist version of CheckOverlap, 2 masks - int Mask2_CheckOverlap(Frame const&, Matrix_3x3 const&, Matrix_3x3 const&); + int Mask2_CheckOverlap(Frame const&); /// Sort problem list; combine results from threads for OpenMP void ConsolidateProblems(); /// Check for/record non-bonded interaction problem - inline void DistanceCheck(Frame const&, int, int, Matrix_3x3 const&, Matrix_3x3 const&, - Parray&, int&) const; + inline void DistanceCheck(Frame const&, int, int, Parray&, int&) const; # ifdef _OPENMP std::vector thread_problemAtoms_; # endif @@ -96,7 +95,7 @@ class StructureCheck { PairList pairList_; ///< Atom pair list ExclusionArray Excluded_; ///< Hold excluded atoms for pair list. - ImagedAction image_; ///< Hold imaging routines and info. + ImageOption imageOpt_; ///< Used to determine if imaging should be used. Parray bondList_; ///< Array of bonds to check. AtomMask Mask1_; ///< Mask of atoms to check. AtomMask Mask2_; ///< Optional mask of atoms to check against atoms in Mask1 diff --git a/src/SymmetricRmsdCalc.cpp b/src/SymmetricRmsdCalc.cpp index ddb01c6453..f145a50c8a 100644 --- a/src/SymmetricRmsdCalc.cpp +++ b/src/SymmetricRmsdCalc.cpp @@ -129,6 +129,8 @@ double SymmetricRmsdCalc::SymmRMSD_CenteredRef(Frame const& selectedTgt, Frame c // Since tgtRemap is moved to origin during RMSD calc and centeredREF // should already be at the origin, just rotate. tgtRemap_.Rotate( rotMatrix_ ); + // Since tgtRemap_ is only ever used privately, no need to rotate unit cell + //tgtRemap_.ModifyBox().RotateUcell( rotMatrix_ ); } // Correct RMSD for symmetry for (AtomIndexArray::const_iterator symmatoms = SymmetricAtomIndices_.begin(); diff --git a/src/TinkerFile.cpp b/src/TinkerFile.cpp index a83ad40cab..f924eb8a21 100644 --- a/src/TinkerFile.cpp +++ b/src/TinkerFile.cpp @@ -5,6 +5,8 @@ #include "ArgList.h" #include "CpptrajStdio.h" #include "StringRoutines.h" +#include "Frame.h" +#include "Atom.h" // CONSTRUCTOR TinkerFile::TinkerFile() : natom_(0), hasBox_(false) {} @@ -155,7 +157,7 @@ int TinkerFile::OpenTinker() { mprinterr("Error: Expected 6 box coordinates.\n"); return 1; } - box_.SetBox( bp ); + box_.SetupFromXyzAbg( bp ); } // Close and reopen the file. file_.CloseFile(); @@ -201,7 +203,8 @@ int TinkerFile::NextTinkerFrame() { * \return -1 if an error occurs. * \return 1 if more frames to read. */ -int TinkerFile::ReadNextTinkerFrame(double* Xptr, double* box) { +int TinkerFile::ReadNextTinkerFrame(Frame& frameOut) { + double* Xptr = frameOut.xAddress(); // Title line if (file_.Line() == 0) return 0; if (CheckTitleLine()) return -1; @@ -217,8 +220,10 @@ int TinkerFile::ReadNextTinkerFrame(double* Xptr, double* box) { file_.LineNumber(), nbox); return -1; } + double xyzabg[6]; for (int b = 0; b != nbox; b++) - box[b] = atof( file_.NextToken() ); + xyzabg[b] = atof( file_.NextToken() ); + frameOut.ModifyBox().AssignFromXyzAbg( xyzabg ); } // Coords for (int atidx = 0; atidx < natom_; atidx++) { diff --git a/src/TinkerFile.h b/src/TinkerFile.h index 90d5b6b15b..c73b2b12fa 100644 --- a/src/TinkerFile.h +++ b/src/TinkerFile.h @@ -1,8 +1,9 @@ #ifndef INC_TINKERFILE_H #define INC_TINKERFILE_H #include "BufferedLine.h" -#include "Atom.h" -#include "Frame.h" +#include "Box.h" +class Frame; +class Atom; /// Use to access Tinker XYZ/ARC files. class TinkerFile { public: @@ -15,7 +16,7 @@ class TinkerFile { int OpenTinker(); int NextTinkerFrame(); - int ReadNextTinkerFrame(double*, double*); + int ReadNextTinkerFrame(Frame&); void Rewind() { file_.CloseFile(); file_.OpenFileRead( tinkerName_ ); diff --git a/src/Topology.cpp b/src/Topology.cpp index 7873369a2e..3536f285bd 100644 --- a/src/Topology.cpp +++ b/src/Topology.cpp @@ -72,21 +72,21 @@ void Topology::SetBoxFromTraj(Box const& boxIn) { } } else { // Incoming box. - if ( boxIn.BoxX() < Constants::SMALL || - boxIn.BoxY() < Constants::SMALL || - boxIn.BoxZ() < Constants::SMALL ) + if ( boxIn.Param(Box::X) < Constants::SMALL || + boxIn.Param(Box::Y) < Constants::SMALL || + boxIn.Param(Box::Z) < Constants::SMALL ) { - // Incoming box has no lengths - disable parm box. + // Incoming box has no lengths - disable parm box. TODO is this check necessary/desirable? mprintf("Warning: Box information present in trajectory but lengths are zero.\n" "Warning: DISABLING BOX in topology '%s'!\n", c_str()); parmBox_.SetNoBox(); } else { // Incoming box is valid. Indicate if current box type differs from // incoming box type. - if (parmBox_.Type() != boxIn.Type()) { + if (parmBox_.CellShape() != boxIn.CellShape()) { mprintf("Warning: Trajectory box type is '%s' but topology box type is '%s'.\n" "Warning: Setting topology box information from trajectory.\n", - boxIn.TypeName(), parmBox_.TypeName()); + boxIn.CellShapeName(), parmBox_.CellShapeName()); } parmBox_ = boxIn; } @@ -291,7 +291,7 @@ void Topology::Summary() const { s2 = dihedrals_.size(); if (s1 + s2 > 0) mprintf("\t\t%zu dihedrals (%zu with H, %zu other).\n", s1+s2, s1, s2); - mprintf("\t\tBox: %s\n", parmBox_.TypeName()); + mprintf("\t\tBox: %s\n", parmBox_.CellShapeName()); if (NsolventMolecules_>0) { mprintf("\t\t%i solvent molecules.\n", NsolventMolecules_); } @@ -319,7 +319,7 @@ void Topology::Brief(const char* heading) const { else mprintf(" %s,", c_str()); mprintf(" %zu atoms, %zu res, box: %s, %zu mol", atoms_.size(), - residues_.size(), parmBox_.TypeName(), molecules_.size()); + residues_.size(), parmBox_.CellShapeName(), molecules_.size()); if (NsolventMolecules_>0) mprintf(", %i solvent", NsolventMolecules_); if (heading != 0) diff --git a/src/TrajIOarray.cpp b/src/TrajIOarray.cpp index 262405d5da..d5782feeb5 100644 --- a/src/TrajIOarray.cpp +++ b/src/TrajIOarray.cpp @@ -293,7 +293,7 @@ int TrajIOarray::SetupIOarray(ArgList& argIn, TrajFrameCounter& counter, // Check coordinate info of all files 0 1 2 3 4 5 std::vector Info( iSize * ensComm.Size() ); // box, vel, temp, time, force, nRepDims int rank_info[iSize]; - rank_info[0] = (int)cInfo.TrajBox().Type(); + rank_info[0] = (int)cInfo.TrajBox().HasBox(); // TODO should this be CellShape()? rank_info[1] = (int)cInfo.HasVel(); rank_info[2] = (int)cInfo.HasTemp(); rank_info[3] = (int)cInfo.HasTime(); diff --git a/src/Traj_AmberCoord.cpp b/src/Traj_AmberCoord.cpp index dc0082efeb..d4d0893566 100644 --- a/src/Traj_AmberCoord.cpp +++ b/src/Traj_AmberCoord.cpp @@ -114,11 +114,17 @@ int Traj_AmberCoord::readFrame(int set, Frame& frameIn) { // Get Coordinates; offset is hasREMD (size in bytes of REMD header) file_.BufferBeginAt(headerSize_); file_.BufferToDouble(frameIn.xAddress(), natom3_); - if (numBoxCoords_ != 0) { - file_.BufferToDouble(frameIn.bAddress(), numBoxCoords_); + if (numBoxCoords_ != 0) { + double xyzabg[6]; + file_.BufferToDouble(xyzabg, numBoxCoords_); // Set box angles to parmtop default if not read in - if (numBoxCoords_==3) - frameIn.SetBoxAngles( boxAngle_ ); + if (numBoxCoords_==3) { + //frameIn.SetBoxAngles( boxAngle_ ); + xyzabg[Box::ALPHA] = boxAngle_[0]; + xyzabg[Box::BETA] = boxAngle_[1]; + xyzabg[Box::GAMMA] = boxAngle_[2]; + } + frameIn.ModifyBox().AssignFromXyzAbg( xyzabg ); } return 0; } @@ -157,8 +163,11 @@ int Traj_AmberCoord::writeFrame(int set, Frame const& frameOut) { case FRC : file_.DoubleToBuffer(frameOut.fAddress(), natom3_, outfmt_); break; } - if (numBoxCoords_ != 0) - file_.DoubleToBuffer(frameOut.bAddress(), numBoxCoords_, outfmt_); + if (numBoxCoords_ != 0) { + if (!frameOut.BoxCrd().Is_X_Aligned()) + mprintf("Warning: Set %i; unit cell is not X-aligned. Box cannot be properly stored as Amber ASCII trajectory.\n", set+1); + file_.DoubleToBuffer(frameOut.BoxCrd().XyzPtr(), numBoxCoords_, outfmt_); + } if (file_.WriteFrame()) return 1; @@ -214,16 +223,16 @@ int Traj_AmberCoord::setupTrajin(FileName const& fname, Topology* trajParm) numBoxCoords_ = 0; } else if (numBoxCoords_ == 3) { // Box lengths only, ortho. or truncated oct. Use default parm angles. - if (trajParm->ParmBox().Type() == Box::NOBOX) + if (!trajParm->ParmBox().HasBox()) mprintf("Warning: Trajectory only contains box lengths and topology has no box info.\n" "Warning: To set box angles for topology use the 'parmbox' command.\n"); - box[3] = boxAngle_[0] = trajParm->ParmBox().Alpha(); - box[4] = boxAngle_[1] = trajParm->ParmBox().Beta(); - box[5] = boxAngle_[2] = trajParm->ParmBox().Gamma(); - boxInfo.SetBox( box ); + box[3] = boxAngle_[0] = trajParm->ParmBox().Param(Box::ALPHA); + box[4] = boxAngle_[1] = trajParm->ParmBox().Param(Box::BETA); + box[5] = boxAngle_[2] = trajParm->ParmBox().Param(Box::GAMMA); + boxInfo.SetupFromXyzAbg( box ); } else if (numBoxCoords_ == 6) { // General triclinic. Set lengths and angles. - boxInfo.SetBox( box ); + boxInfo.SetupFromXyzAbg( box ); } else { mprinterr("Error: In %s, expect only 3 or 6 box coords, got %i\n" "Error: Box line=[%s]\n", @@ -389,13 +398,25 @@ int Traj_AmberCoord::setupTrajout(FileName const& fname, Topology* trajParm, natom3_ = trajParm->Natom() * 3; file_.SetupFrameBuffer( natom3_, 8, 10 ); // If box coords are present, allocate extra space for them - switch (CoordInfo().TrajBox().Type()) { - case Box::NOBOX : numBoxCoords_ = 0; break; - case Box::ORTHO : - case Box::TRUNCOCT: numBoxCoords_ = 3; break; - default : numBoxCoords_ = 6; + Box::CellShapeType cellShape = CoordInfo().TrajBox().CellShape(); + switch (cellShape) { + case Box::NO_SHAPE : + numBoxCoords_ = 0; + break; + case Box::CUBIC : + case Box::TETRAGONAL : + case Box::ORTHORHOMBIC : + case Box::OCTAHEDRAL : + numBoxCoords_ = 3; + break; + default: + numBoxCoords_ = 6; } file_.ResizeBuffer( numBoxCoords_ ); + // Warn if not X-aligned + if (numBoxCoords_ > 0 && !CoordInfo().TrajBox().Is_X_Aligned()) + mprintf("Warning: Unit cell is not X-aligned. Box cannot be properly stored as Amber ASCII trajectory.\n"); + if (debug_>0) rprintf("(%s): Each frame has %lu bytes.\n", file_.Filename().base(), file_.FrameSize()); diff --git a/src/Traj_AmberNetcdf.cpp b/src/Traj_AmberNetcdf.cpp index 9f65b1b384..157a7fe14d 100644 --- a/src/Traj_AmberNetcdf.cpp +++ b/src/Traj_AmberNetcdf.cpp @@ -261,18 +261,20 @@ int Traj_AmberNetcdf::readFrame(int set, Frame& frameIn) { // Read box info if (cellLengthVID_ != -1) { + double xyzabg[6]; count_[1] = 3; count_[2] = 0; - if (NC::CheckErr(nc_get_vara_double(ncid_, cellLengthVID_, start_, count_, frameIn.bAddress()))) + if (NC::CheckErr(nc_get_vara_double(ncid_, cellLengthVID_, start_, count_, xyzabg))) { mprinterr("Error: Getting cell lengths for frame %i.\n", set+1); return 1; } - if (NC::CheckErr(nc_get_vara_double(ncid_, cellAngleVID_, start_, count_, frameIn.bAddress()+3))) + if (NC::CheckErr(nc_get_vara_double(ncid_, cellAngleVID_, start_, count_, xyzabg+3))) { mprinterr("Error: Getting cell angles for frame %i.\n", set+1); return 1; } + frameIn.ModifyBox().AssignFromXyzAbg( xyzabg ); } return 0; @@ -358,16 +360,18 @@ int Traj_AmberNetcdf::writeFrame(int set, Frame const& frameOut) { // Write box if (cellLengthVID_ != -1) { + if (!frameOut.BoxCrd().Is_X_Aligned()) + mprintf("Warning: Set %i; unit cell is not X-aligned. Box cannot be properly stored as Amber NetCDF trajectory.\n", set+1); count_[1] = 3; count_[2] = 0; if (NC::CheckErr(nc_put_vara_double(ncid_, cellLengthVID_, start_, count_, - frameOut.bAddress())) ) + frameOut.BoxCrd().XyzPtr())) ) { mprinterr("Error: Writing cell lengths frame %i.\n", set+1); return 1; } if (NC::CheckErr(nc_put_vara_double(ncid_, cellAngleVID_, start_, count_, - frameOut.bAddress()+3)) ) + frameOut.BoxCrd().AbgPtr())) ) { mprinterr("Error: Writing cell angles frame %i.\n", set+1); return 1; @@ -497,11 +501,13 @@ int Traj_AmberNetcdf::parallelReadFrame(int set, Frame& frameIn) { pcount_[2] = 0; if (cellLengthVID_ != -1) { pcount_[1] = 3; + double xyzabg[6]; //err = ncmpi_get_vara_double_all(ncid_, cellLengthVID_, pstart_, pcount_, frameIn.bAddress()); - err = ncmpi_get_vara_double(ncid_, cellLengthVID_, pstart_, pcount_, frameIn.bAddress()); + err = ncmpi_get_vara_double(ncid_, cellLengthVID_, pstart_, pcount_, xyzabg); if (checkPNCerr(err)) return Parallel::Abort(err); //err = ncmpi_get_vara_double_all(ncid_, cellAngleVID_, pstart_, pcount_, frameIn.bAddress()+3); - err = ncmpi_get_vara_double(ncid_, cellAngleVID_, pstart_, pcount_, frameIn.bAddress()+3); + err = ncmpi_get_vara_double(ncid_, cellAngleVID_, pstart_, pcount_, xyzabg+3); + frameIn.ModifyBox().AssignFromXyzAbg( xyzabg ); } if (TempVID_ != -1) { //err = ncmpi_get_vara_double_all(ncid_, TempVID_, pstart_, pcount_, frameIn.tAddress()); @@ -556,10 +562,10 @@ int Traj_AmberNetcdf::parallelWriteFrame(int set, Frame const& frameOut) { if (cellLengthVID_ != -1) { pcount_[1] = 3; //err = ncmpi_put_vara_double_all(ncid_, cellLengthVID_, pstart_, pcount_, frameOut.bAddress()); - err = ncmpi_put_vara_double(ncid_, cellLengthVID_, pstart_, pcount_, frameOut.bAddress()); + err = ncmpi_put_vara_double(ncid_, cellLengthVID_, pstart_, pcount_, frameOut.BoxCrd().XyzPtr()); if (checkPNCerr(err)) return Parallel::Abort(err); //err = ncmpi_put_vara_double_all(ncid_, cellAngleVID_, pstart_, pcount_, frameOut.bAddress()+3); - err = ncmpi_put_vara_double(ncid_, cellAngleVID_, pstart_, pcount_, frameOut.bAddress()+3); + err = ncmpi_put_vara_double(ncid_, cellAngleVID_, pstart_, pcount_, frameOut.BoxCrd().AbgPtr()); } if (TempVID_ != -1) { //err = ncmpi_put_vara_double_all(ncid_, TempVID_, pstart_, pcount_, frameOut.tAddress()); diff --git a/src/Traj_AmberRestart.cpp b/src/Traj_AmberRestart.cpp index db13815d51..06aea4ec5e 100644 --- a/src/Traj_AmberRestart.cpp +++ b/src/Traj_AmberRestart.cpp @@ -111,6 +111,8 @@ int Traj_AmberRestart::setupTrajout(FileName const& fname, Topology* trajParm, file_.ResizeBuffer( natom3_ ); // If box coords are present, allocate extra space for them if (CoordInfo().HasBox()) { + if (!CoordInfo().TrajBox().Is_X_Aligned()) + mprintf("Warning: Unit cell is not X-aligned. Box cannot be properly stored as Amber ASCII restart.\n"); numBoxCoords_ = 6; file_.ResizeBuffer( numBoxCoords_ ); } @@ -157,7 +159,7 @@ int Traj_AmberRestart::getBoxAngles(std::string const& boxline, Box& trajBox) { trajBox.SetNoBox(); numBoxCoords_ = 0; } else if (numBoxCoords_==6) { - trajBox.SetBox(box); + trajBox.SetupFromXyzAbg(box); } else { mprinterr("Error: Expected 6 box coords in restart box coord line, got %i.\n", numBoxCoords_); @@ -315,8 +317,8 @@ int Traj_AmberRestart::readFrame(int set, Frame& frameIn) { } } // Get box from buffer if present - if (numBoxCoords_!=0) - std::copy(boxInfo_.boxPtr(), boxInfo_.boxPtr()+6, frameIn.bAddress()); + if (numBoxCoords_!=0) + frameIn.SetBox( boxInfo_ ); return 0; } @@ -363,8 +365,11 @@ int Traj_AmberRestart::writeFrame(int set, Frame const& frameOut) { if (CoordInfo().HasVel() && frameOut.HasVelocity()) file_.DoubleToBuffer(frameOut.vAddress(), natom3_, "%12.7f"); // Write box to buffer - if (numBoxCoords_!=0) - file_.DoubleToBuffer(frameOut.bAddress(), numBoxCoords_, "%12.7f"); + if (numBoxCoords_!=0) { + if (!frameOut.BoxCrd().Is_X_Aligned()) + mprintf("Warning: Set %i; unit cell is not X-aligned. Box cannot be properly stored as Amber ASCII restart.\n", set+1); + file_.DoubleToBuffer(frameOut.BoxCrd().XyzPtr(), numBoxCoords_, "%12.7f"); + } if (file_.WriteFrame()) return 1; diff --git a/src/Traj_AmberRestartNC.cpp b/src/Traj_AmberRestartNC.cpp index 5fc3c6b6be..4baf768394 100644 --- a/src/Traj_AmberRestartNC.cpp +++ b/src/Traj_AmberRestartNC.cpp @@ -193,18 +193,20 @@ int Traj_AmberRestartNC::readFrame(int set, Frame& frameIn) { // Read box info if (cellLengthVID_ != -1) { + double xyzabg[6]; count_[0] = 3; count_[1] = 0; - if (NC::CheckErr(nc_get_vara_double(ncid_, cellLengthVID_, start_, count_, frameIn.bAddress()))) + if (NC::CheckErr(nc_get_vara_double(ncid_, cellLengthVID_, start_, count_, xyzabg))) { mprinterr("Error: Getting cell lengths, frame %i.\n", set+1); return 1; } - if (NC::CheckErr(nc_get_vara_double(ncid_,cellAngleVID_,start_,count_,frameIn.bAddress()+3))) + if (NC::CheckErr(nc_get_vara_double(ncid_, cellAngleVID_, start_, count_, xyzabg+3))) { mprinterr("Error: Getting cell angles, frame %i.\n", set+1); return 1; } + frameIn.ModifyBox().AssignFromXyzAbg( xyzabg ); } return 0; @@ -288,14 +290,16 @@ int Traj_AmberRestartNC::writeFrame(int set, Frame const& frameOut) { // write box if (cellLengthVID_ != -1) { + if (!frameOut.BoxCrd().Is_X_Aligned()) + mprintf("Warning: Set %i; unit cell is not X-aligned. Box cannot be properly stored as Amber NetCDF restart.\n", set+1); count_[0] = 3; count_[1] = 0; - if (NC::CheckErr(nc_put_vara_double(ncid_,cellLengthVID_,start_,count_,frameOut.bAddress()))) + if (NC::CheckErr(nc_put_vara_double(ncid_,cellLengthVID_,start_,count_,frameOut.BoxCrd().XyzPtr()))) { mprinterr("Error: Writing cell lengths, frame %i.\n", set+1); return 1; } - if (NC::CheckErr(nc_put_vara_double(ncid_,cellAngleVID_,start_,count_,frameOut.bAddress()+3))) + if (NC::CheckErr(nc_put_vara_double(ncid_,cellAngleVID_,start_,count_,frameOut.BoxCrd().AbgPtr()))) { mprinterr("Error: Writing cell angles, frame %i.\n", set+1); return 1; diff --git a/src/Traj_CIF.cpp b/src/Traj_CIF.cpp index f3035358d1..2492636250 100644 --- a/src/Traj_CIF.cpp +++ b/src/Traj_CIF.cpp @@ -80,7 +80,7 @@ int Traj_CIF::setupTrajin(FileName const& fname, Topology* trajParm) cif_box[5] = convertToDouble( cellblock.Data("angle_gamma") ); mprintf("\tRead cell info from CIF: a=%g b=%g c=%g alpha=%g beta=%g gamma=%g\n", cif_box[0], cif_box[1], cif_box[2], cif_box[3], cif_box[4], cif_box[5]); - boxInfo_.SetBox( cif_box); + boxInfo_.SetupFromXyzAbg( cif_box); } // Set traj info - No velocity, temperature, time. SetCoordInfo( CoordinateInfo( boxInfo_, false, false, false ) ); @@ -105,7 +105,7 @@ int Traj_CIF::readFrame(int set, Frame& frameIn) { *(Xptr++) = convertToDouble( (*line)[Cartn_y_col_] ); *(Xptr++) = convertToDouble( (*line)[Cartn_z_col_] ); } - std::copy( boxInfo_.boxPtr(), boxInfo_.boxPtr() + 6, frameIn.bAddress() ); + frameIn.SetBox( boxInfo_ ); return 0; } diff --git a/src/Traj_CharmmDcd.cpp b/src/Traj_CharmmDcd.cpp index 7a608ef72a..a447998b23 100644 --- a/src/Traj_CharmmDcd.cpp +++ b/src/Traj_CharmmDcd.cpp @@ -282,15 +282,22 @@ int Traj_CharmmDcd::setupTrajin(FileName const& fname, Topology* trajParm) mprintf("Warning: bzip2 files. Cannot check # of frames. Will try to read %i\n",dcdframes_); } // Load box info so that it can be checked. - double box[6]; - memset( box, 0, 6*sizeof(double)); + //double box[6]; + //memset( box, 0, 6*sizeof(double)); + Box box; if (boxBytes_) { - if (charmmCellType_ == SHAPE) - mprintf("\tVersion >= 22; assuming shape matrix is stored.\n"); - if (ReadBox( box )) return TRAJIN_ERR; + double boxtmp[6]; + if (ReadBox( boxtmp )) return TRAJIN_ERR; + if (charmmCellType_ == SHAPE) { + mprintf("\tVersion >= 22; assuming shape matrix is stored.\n"); + box.SetupFromShapeMatrix( boxtmp ); + } else { + mprintf("\tVersion < 22; assuming X-aligned cell.\n"); + box.SetupFromXyzAbg( boxtmp ); + } } // Set traj info: No velocity, temperature, or time. - SetCoordInfo( CoordinateInfo( Box(box), false, false, false ) ); + SetCoordInfo( CoordinateInfo( box, false, false, false ) ); // If there are fixed atoms read the first frame now // TODO: Deal with fixed atoms closeTraj(); @@ -424,75 +431,6 @@ int Traj_CharmmDcd::readDcdHeader() { return 0; } -/** Convert unit cell parameters (X, Y, Z, a, b, g) to symmetric shape matrix - * (S11, S12, S22, S13, S23, S33). - */ -static inline void UcellToShape(double* shape, const double* box) -{ - // Calculate metric tensor HtH: - // HtH(i,j) = vi * vj - // where vx are basis vectors i and j. Given that v0 is a, v1 is b, v2 is c: - // a^2 a*b a*c - // HtH = b*a b^2 b*c - // c*a c*b c^2 - Matrix_3x3 HtH; - - HtH[0] = box[0] * box[0]; - HtH[4] = box[1] * box[1]; - HtH[8] = box[2] * box[2]; - - // Angles near 90 have elements set to 0.0. - // XY (gamma) - if (fabs(box[5] - 90.0) > Constants::SMALL) - HtH[3] = box[0]*box[1]*cos(Constants::DEGRAD*box[5]); - else - HtH[3] = 0.0; - HtH[1] = HtH[3]; - // XZ (beta) - if (fabs(box[4] - 90.0) > Constants::SMALL) - HtH[6] = box[0]*box[2]*cos(Constants::DEGRAD*box[4]); - else - HtH[6] = 0.0; - HtH[2] = HtH[6]; - // YZ (alpha) - if (fabs(box[3] - 90.0) > Constants::SMALL) - HtH[7] = box[1]*box[2]*cos(Constants::DEGRAD*box[3]); - else - HtH[7] = 0.0; - HtH[5] = HtH[7]; - - // Diagonalize HtH - //HtH.Print("HtH"); // DEBUG - Vec3 Evals; - if (HtH.Diagonalize( Evals )) { - mprinterr("Error: Could not diagonalize metric tensor.\n"); - for (int i=0; i<6; i++) shape[i] = 0.0; - return; - } - - if (Evals[0] < Constants::SMALL || - Evals[1] < Constants::SMALL || - Evals[2] < Constants::SMALL) - { - mprinterr("Error: Obtained negative eigenvalues when attempting to" - " diagonalize metric tensor.\n"); - return; - } - //Evals.Print("Cvals"); // DEBUG - //HtH.Print("Cpptraj"); // DEBUG - - double A = sqrt( Evals[0] ); - double B = sqrt( Evals[1] ); - double C = sqrt( Evals[2] ); - - shape[0] = A*HtH[0]*HtH[0] + B*HtH[1]*HtH[1] + C*HtH[2]*HtH[2]; - shape[2] = A*HtH[3]*HtH[3] + B*HtH[4]*HtH[4] + C*HtH[5]*HtH[5]; - shape[5] = A*HtH[6]*HtH[6] + B*HtH[7]*HtH[7] + C*HtH[8]*HtH[8]; - shape[1] = A*HtH[0]*HtH[3] + B*HtH[1]*HtH[4] + C*HtH[2]*HtH[5]; - shape[3] = A*HtH[0]*HtH[6] + B*HtH[1]*HtH[7] + C*HtH[2]*HtH[8]; - shape[4] = A*HtH[3]*HtH[6] + B*HtH[4]*HtH[7] + C*HtH[5]*HtH[8]; -} - /** Convert 'cos( angle in radians)' back to degrees. Trap 0 (90 degrees) * for numerical stability. */ @@ -503,14 +441,14 @@ static inline double CosRadToDeg( double BoxInRad ) { } // Traj_CharmmDcd::ReadBox() -int Traj_CharmmDcd::ReadBox(double* box) { - double boxtmp[6]; +int Traj_CharmmDcd::ReadBox(double* boxtmp) { if ( ReadBlock(48) < 0) return 1; file_.Read(boxtmp, sizeof(double)*6); if (isBigEndian_) endian_swap8(boxtmp,6); if ( ReadBlock(-1) < 0) return 1; - if (charmmCellType_ == SHAPE) { - Box::ShapeToUcell(box, boxtmp); +// if (charmmCellType_ == SHAPE) { +// boxOut.SetupFromShapeMatrix( boxtmp ); + //Box::ShapeToUcell(box, boxtmp); /* mprintf("\nDEBUG: Original matrix: %g %g %g %g %g %g\n", boxtmp[0], boxtmp[1], boxtmp[2], boxtmp[3], boxtmp[4], boxtmp[5]); @@ -525,8 +463,10 @@ int Traj_CharmmDcd::ReadBox(double* box) { mprintf("Warning:\t\tPossible issue with element %i: %g %g (%g)\n", i, boxtmp[i], shape[i], boxtmp[i] - shape[i]); */ - } else { +// } else { + if (charmmCellType_ != SHAPE) { // Box lengths + double box[6]; box[0] = boxtmp[0]; box[1] = boxtmp[2]; box[2] = boxtmp[5]; @@ -548,6 +488,14 @@ int Traj_CharmmDcd::ReadBox(double* box) { box[4] = boxtmp[3]; box[5] = boxtmp[1]; } + //boxOut.SetupFromXyzAbg( box ); + boxtmp[0] = box[0]; + boxtmp[1] = box[1]; + boxtmp[2] = box[2]; + boxtmp[3] = box[3]; + boxtmp[4] = box[4]; + boxtmp[5] = box[5]; + //mprintf("DEBUG: charmm box read ucell: %f %f %f %f %f %f\n", boxtmp[0], boxtmp[1], boxtmp[2], boxtmp[3], boxtmp[4], boxtmp[5]); } return 0; } @@ -593,7 +541,12 @@ int Traj_CharmmDcd::readFrame(int set, Frame& frameIn) { seekToFrame( set ); // Load box info if (boxBytes_ != 0) { - if (ReadBox( frameIn.bAddress() )) return 1; + double box[6]; + if (ReadBox( box )) return 1; + if (charmmCellType_ == SHAPE) + frameIn.ModifyBox().AssignFromShapeMatrix( box ); + else + frameIn.ModifyBox().AssignFromXyzAbg( box ); } return readXYZ(frameIn.xAddress()); } @@ -603,7 +556,12 @@ int Traj_CharmmDcd::readVelocity(int set, Frame& frameIn) { seekToFrame( set ); // Load box info if (boxBytes_ != 0) { - if (ReadBox( frameIn.bAddress() )) return 1; + double box[6]; + if (ReadBox( box )) return 1; + if (charmmCellType_ == SHAPE) + frameIn.ModifyBox().AssignFromShapeMatrix( box ); + else + frameIn.ModifyBox().AssignFromXyzAbg( box ); } return readXYZ(frameIn.vAddress()); } @@ -650,6 +608,30 @@ int Traj_CharmmDcd::setupTrajout(FileName const& fname, Topology* trajParm, { if (!append) { SetCoordInfo( cInfoIn ); + // Check if the cell is symmetric for SHAPE, or X-aligned for UCELL + if (CoordInfo().TrajBox().HasBox()) { + bool box_ok = true; + if (charmmCellType_ == UNKNOWN || charmmCellType_ == SHAPE) { + if (!CoordInfo().TrajBox().Is_Symmetric()) { + box_ok = false; + mprintf("Warning: Unit cell matrix is not symmetric.\n"); + if (charmmCellType_ == UNKNOWN) { + if (CoordInfo().TrajBox().Is_X_Aligned()) { + mprintf("Warning: Storing 3xlengths and 3x angles instead of shape matrix.\n"); + charmmCellType_ = UCELL; + box_ok = true; + } + } + } + } else if (charmmCellType_ == UCELL) { + if (!CoordInfo().TrajBox().Is_X_Aligned()) { + box_ok = false; + mprintf("Warning: Unit cell is not X-aligned.\n"); + } + } + if (!box_ok) + mprintf("Warning: Box cannot be properly stored as Charmm DCD.\n"); + } dcdatom_ = trajParm->Natom(); // dcdframes = trajParm->parmFrames; dcdframes_ = 0; @@ -765,23 +747,38 @@ int Traj_CharmmDcd::writeFrame(int set, Frame const& frameOut) { // Box coords - 6 doubles, 48 bytes if (boxBytes_ != 0) { double boxtmp[6]; - if (charmmCellType_ == SHAPE) - UcellToShape( boxtmp, frameOut.BoxCrd().boxPtr() ); - else { + if (charmmCellType_ == SHAPE) { + if (!frameOut.BoxCrd().Is_Symmetric()) + mprintf("Warning: Set %i; unit cell is not symmetric. Box cannot be properly stored as Charmm DCD.\n", set+1); + //frameOut.BoxCrd().GetSymmetricShapeMatrix( boxtmp ); + Matrix_3x3 const& ucell = frameOut.BoxCrd().UnitCell(); + boxtmp[0] = ucell[0]; // XX + boxtmp[1] = ucell[1]; // XY + boxtmp[2] = ucell[4]; // YY + boxtmp[3] = ucell[2]; // XZ + boxtmp[4] = ucell[5]; // YZ + boxtmp[5] = ucell[8]; // ZZ + } else { + if (!frameOut.BoxCrd().Is_X_Aligned()) + mprintf("Warning: Set %i; unit cell is not X-aligned. Box cannot be properly stored as Charmm DCD.\n", set+1); /* The format for the 'box' array used in cpptraj is not the same as the * one used for NAMD/CHARMM dcd files. Refer to the reading routine above * for a description of the box info. */ - boxtmp[0] = frameOut.BoxCrd().BoxX(); - boxtmp[2] = frameOut.BoxCrd().BoxY(); - boxtmp[5] = frameOut.BoxCrd().BoxZ(); + boxtmp[0] = frameOut.BoxCrd().Param(Box::X); + boxtmp[2] = frameOut.BoxCrd().Param(Box::Y); + boxtmp[5] = frameOut.BoxCrd().Param(Box::Z); // The angles must be reported in cos(angle) format - boxtmp[1] = cos(frameOut.BoxCrd().Gamma() * Constants::DEGRAD); - boxtmp[3] = cos(frameOut.BoxCrd().Beta() * Constants::DEGRAD); - boxtmp[4] = cos(frameOut.BoxCrd().Alpha() * Constants::DEGRAD); + // TODO set cos(90) to zero? + boxtmp[1] = cos(frameOut.BoxCrd().Param(Box::GAMMA) * Constants::DEGRAD); + boxtmp[3] = cos(frameOut.BoxCrd().Param(Box::BETA ) * Constants::DEGRAD); + boxtmp[4] = cos(frameOut.BoxCrd().Param(Box::ALPHA) * Constants::DEGRAD); } WriteBlock(48); - file_.Write(boxtmp, sizeof(double)*6); + if (file_.Write(boxtmp, sizeof(double)*6)) { + mprinterr("Error: Failed writing box for DCD trajectory frame %i\n", set+1); + return 1; + } WriteBlock(48); } // Put X coords into xyz arrays @@ -797,15 +794,24 @@ int Traj_CharmmDcd::writeFrame(int set, Frame const& frameOut) { } // Write x coords WriteBlock(coordinate_size_); - file_.Write(xcoord_, coordinate_size_); + if (file_.Write(xcoord_, coordinate_size_)) { + mprinterr("Error: Failed writing X coordinates for DCD trajectory frame %i\n", set+1); + return 1; + } WriteBlock(coordinate_size_); // Write y coords WriteBlock(coordinate_size_); - file_.Write(ycoord_, coordinate_size_); + if (file_.Write(ycoord_, coordinate_size_)) { + mprinterr("Error: Failed writing Y coordinates for DCD trajectory frame %i\n", set+1); + return 1; + } WriteBlock(coordinate_size_); // Write z coords WriteBlock(coordinate_size_); - file_.Write(zcoord_, coordinate_size_); + if (file_.Write(zcoord_, coordinate_size_)) { + mprinterr("Error: Failed writing Z coordinates for DCD trajectory frame %i\n", set+1); + return 1; + } WriteBlock(coordinate_size_); // Update frame count dcdframes_++; diff --git a/src/Traj_CharmmRestart.cpp b/src/Traj_CharmmRestart.cpp index a14ad9a3f2..2ade1794e3 100644 --- a/src/Traj_CharmmRestart.cpp +++ b/src/Traj_CharmmRestart.cpp @@ -141,13 +141,11 @@ int Traj_CharmmRestart::setupTrajin(FileName const& fname, Topology* trajParm) if (debug_ > 0) mprintf("DEBUG: Shape Matrix: %g %g %g %g %g %g\n", bs[0], bs[1], bs[2], bs[3], bs[4], bs[5]); - double bp[6]; - Box::ShapeToUcell( bp, bs ); - cbox_.SetBox( bp ); + cbox_.SetupFromShapeMatrix( bs ); if (debug_ > 0) mprintf("DEBUG: Unit cell: %g %g %g %g %g %g\n", - cbox_.BoxX(), cbox_.BoxY(), cbox_.BoxZ(), - cbox_.Alpha(), cbox_.Beta(), cbox_.Gamma()); + cbox_.Param(Box::X), cbox_.Param(Box::Y), cbox_.Param(Box::Z), + cbox_.Param(Box::ALPHA), cbox_.Param(Box::BETA), cbox_.Param(Box::GAMMA)); // Seek down to !NATOM while (ptr != 0 && ptr[1] != '!') ptr = infile.Line(); diff --git a/src/Traj_DTR.cpp b/src/Traj_DTR.cpp index 7a50040be1..4fd925e0b1 100644 --- a/src/Traj_DTR.cpp +++ b/src/Traj_DTR.cpp @@ -132,8 +132,8 @@ int Traj_DTR::setupTrajin(FileName const& fname, Topology* trajParm) return 1; } - tmpBox.SetBox( Tstep.A, Tstep.B, Tstep.C, - Tstep.alpha, Tstep.beta, Tstep.gamma ); + tmpBox.SetupFromXyzAbg( Tstep.A, Tstep.B, Tstep.C, + Tstep.alpha, Tstep.beta, Tstep.gamma ); SetCoordInfo( CoordinateInfo(tmpBox, has_vel, false, true) ); @@ -163,8 +163,8 @@ int Traj_DTR::readFrame(int set, Frame& frameIn) { FloatToDouble(frameIn.vAddress(), Tstep.velocities, bufsize_); // Set box - frameIn.SetBox().SetBox( Tstep.A, Tstep.B, Tstep.C, - Tstep.alpha, Tstep.beta, Tstep.gamma ); + frameIn.ModifyBox().AssignFromXyzAbg( Tstep.A, Tstep.B, Tstep.C, + Tstep.alpha, Tstep.beta, Tstep.gamma ); // Time frameIn.SetTime( Tstep.physical_time ); diff --git a/src/Traj_GmxDump.cpp b/src/Traj_GmxDump.cpp index c4b400bc36..4876bd439f 100644 --- a/src/Traj_GmxDump.cpp +++ b/src/Traj_GmxDump.cpp @@ -161,15 +161,21 @@ int Traj_GmxDump::writeFrame(int set, Frame const& frameOut) { if (CoordInfo().HasForce()) writeVectorArray( frameOut.fAddress(), "FORCES", 0, 3, natoms_, 3, Constants::AMBER_FRC_TO_GMX ); if (CoordInfo().HasBox()) { - Matrix_3x3 Ucell = frameOut.BoxCrd().UnitCell( Constants::ANG_TO_NM ); - // Already scaled by UnitCell() + //Matrix_3x3 Ucell = frameOut.BoxCrd().UnitCell( Constants::ANG_TO_NM ); + Matrix_3x3 Ucell = frameOut.BoxCrd().UnitCell(); + // Convert from Ang. to NM + Ucell *= Constants::ANG_TO_NM; + // Write scaled array. writeVectorArray( Ucell.Dptr(), "BOX SHAPE", 0, 3, 1, 9, 1.0); } } else { // Generic TRR format if (CoordInfo().HasBox()) { - Matrix_3x3 Ucell = frameOut.BoxCrd().UnitCell( Constants::ANG_TO_NM ); - // Already scaled by UnitCell() + //Matrix_3x3 Ucell = frameOut.BoxCrd().UnitCell( Constants::ANG_TO_NM ); + Matrix_3x3 Ucell = frameOut.BoxCrd().UnitCell(); + // Convert from Ang. to NM + Ucell *= Constants::ANG_TO_NM; + // Write scaled array writeVectorArray( Ucell.Dptr(), "box", 3, 6, 3, 3, 1.0); } if (CoordInfo().HasCrd()) diff --git a/src/Traj_GmxTng.cpp b/src/Traj_GmxTng.cpp index 2093bf8f33..71c6f45165 100644 --- a/src/Traj_GmxTng.cpp +++ b/src/Traj_GmxTng.cpp @@ -314,7 +314,9 @@ int Traj_GmxTng::setupTrajin(FileName const& fname, Topology* trajParm) } // END loop over blocks // Set up coordinate info. Box, coord, vel, force, time - SetCoordInfo( CoordinateInfo( Box(boxShape), hasPos, hasVel, hasFrc, (tpf > 0.0) ) ); + Box tngBox; + tngBox.SetupFromUcell( boxShape ); + SetCoordInfo( CoordinateInfo( tngBox, hasPos, hasVel, hasFrc, (tpf > 0.0) ) ); // Set up blocks that are actually there. blockIds_.clear(); @@ -405,9 +407,9 @@ int Traj_GmxTng::readFrame(int set, Frame& frameIn) { } // ----- Box ----------------------- if ( blockId == TNG_TRAJ_BOX_SHAPE ) { // TODO switch? - Matrix_3x3 boxShape(0.0); - convertArray(boxShape.Dptr(), (float*)values_, 9, tngfac_); - frameIn.SetBox( Box(boxShape) ); + double boxShape[9]; + convertArray(boxShape, (float*)values_, 9, tngfac_); + frameIn.ModifyBox().AssignFromUcell( boxShape ); //mprintf("DEBUG: box set %i %g %g %g\n", set, // frameIn.BoxCrd().BoxX(), // frameIn.BoxCrd().BoxY(), diff --git a/src/Traj_GmxTrX.cpp b/src/Traj_GmxTrX.cpp index 96ad35d5fd..0fb4f7d80e 100644 --- a/src/Traj_GmxTrX.cpp +++ b/src/Traj_GmxTrX.cpp @@ -285,10 +285,9 @@ int Traj_GmxTrX::openTrajin() { /** Read box information from current frame. * \param boxOut Double array of length 6 containing {X Y Z alpha beta gamma} + * \param xyz double array of length 9 containing X{xyz} Y{xyz} Z{xyz} */ -int Traj_GmxTrX::ReadBox(double* boxOut) { - // xyz is an array of length 9 containing X{xyz} Y{xyz} Z{xyz}. - double xyz[9]; +int Traj_GmxTrX::ReadBox(double* xyz) { float f_boxIn[9]; switch (precision_) { case sizeof(float): @@ -303,6 +302,10 @@ int Traj_GmxTrX::ReadBox(double* boxOut) { break; default: return 1; } + // Convert from nm to Ang. + for (int i = 0; i < 9; i++) + xyz[i] *= Constants::NM_TO_ANG; +/* // Calculate box lengths // NOTE: GROMACS units are nm boxOut[0] = sqrt((xyz[0]*xyz[0] + xyz[1]*xyz[1] + xyz[2]*xyz[2])) * Constants::NM_TO_ANG; @@ -323,7 +326,7 @@ int Traj_GmxTrX::ReadBox(double* boxOut) { boxOut[3] = acos( (xyz[3]*xyz[6] + xyz[4]*xyz[7] + xyz[5]*xyz[8]) * 100.0 / (boxOut[1]* boxOut[2]) ) * 90.0/Constants::PIOVER2; } - //mprintf("DEBUG:\tTRX Box Angles: %f %f %f\n", boxOut[3], boxOut[4], boxOut[5]); + //mprintf("DEBUG:\tTRX Box Angles: %f %f %f\n", boxOut[3], boxOut[4], boxOut[5]);*/ return 0; } @@ -388,13 +391,15 @@ int Traj_GmxTrX::setupTrajin(FileName const& fname, Topology* trajParm) nframes = TRAJIN_UNK; } // Load box info so that it can be checked. - double box[6]; - box[0]=0.0; box[1]=0.0; box[2]=0.0; box[3]=0.0; box[4]=0.0; box[5]=0.0; + Box gbox; + //box[0]=0.0; box[1]=0.0; box[2]=0.0; box[3]=0.0; box[4]=0.0; box[5]=0.0; if ( box_size_ > 0 ) { - if ( ReadBox( box ) ) return TRAJIN_ERR; + double ucell[9]; + if ( ReadBox( ucell ) ) return TRAJIN_ERR; + gbox.SetupFromUcell( ucell ); } // Box, coords, velocity, force, time - CoordinateInfo myCoordInfo(Box(box), true, (v_size_ > 0), (f_size_ > 0), true); + CoordinateInfo myCoordInfo(gbox, true, (v_size_ > 0), (f_size_ > 0), true); myCoordInfo.SetStep( true ); SetCoordInfo( myCoordInfo ); closeTraj(); @@ -492,7 +497,9 @@ int Traj_GmxTrX::readFrame(int set, Frame& frameIn) { frameIn.SetTime( timestep_ ); // Read box info if (box_size_ > 0) { - if (ReadBox( frameIn.bAddress() )) return 1; + double ucell[9]; + if (ReadBox( ucell )) return 1; + frameIn.ModifyBox().AssignFromUcell( ucell ); } // Blank read past virial/pressure tensor file_.Seek( file_.Tell() + vir_size_ + pres_size_ ); @@ -646,8 +653,11 @@ int Traj_GmxTrX::writeFrame(int set, Frame const& frameOut) { write_real( lambda_ ); // Write box // NOTE: GROMACS units are nm + int err = 0; if (box_size_ > 0) { - Matrix_3x3 ucell = frameOut.BoxCrd().UnitCell( Constants::ANG_TO_NM ); + //Matrix_3x3 ucell = frameOut.BoxCrd().UnitCell( Constants::ANG_TO_NM ); + Matrix_3x3 ucell = frameOut.BoxCrd().UnitCell(); + ucell *= Constants::ANG_TO_NM; //mprintf("BoxX: %g %g %g BoxY: %g %g %g BoxZ: %g %g %g\n", // ucell[0], ucell[1], ucell[2], // ucell[3], ucell[4], ucell[5], @@ -657,10 +667,14 @@ int Traj_GmxTrX::writeFrame(int set, Frame const& frameOut) { for (int i = 0; i < 9; i++) f_ucell[i] = (float)ucell[i]; if (swapBytes_) endian_swap( f_ucell, 9 ); - file_.Write( f_ucell, box_size_ ); + err = file_.Write( f_ucell, box_size_ ); } else { // double if (swapBytes_) endian_swap8( ucell.Dptr(), 9 ); - file_.Write( ucell.Dptr(), box_size_ ); + err = file_.Write( ucell.Dptr(), box_size_ ); + } + if (err != 0) { + mprinterr("Error: Could not write box for TRR frame %i\n", set+1); + return 1; } } // Write coords/velo/forces @@ -679,7 +693,7 @@ int Traj_GmxTrX::writeFrame(int set, Frame const& frameOut) { for (int ir = 0; ir < natom3_; ir++, ix++) farray_[ix] = (float)(Fptr[ir] * Constants::AMBER_FRC_TO_GMX); if (swapBytes_) endian_swap( farray_, arraySize_ ); - file_.Write( farray_, x_size_ + v_size_ + f_size_ ); + err = file_.Write( farray_, x_size_ + v_size_ + f_size_ ); } else { // double for (; ix < natom3_; ix++) darray_[ix] = (Xptr[ix] * Constants::ANG_TO_NM); @@ -690,7 +704,11 @@ int Traj_GmxTrX::writeFrame(int set, Frame const& frameOut) { for (int ir = 0; ir < natom3_; ir++, ix++) darray_[ix] = (Fptr[ir] * Constants::AMBER_FRC_TO_GMX); if (swapBytes_) endian_swap8( darray_, arraySize_ ); - file_.Write( darray_, x_size_ + v_size_ + f_size_ ); + err = file_.Write( darray_, x_size_ + v_size_ + f_size_ ); + } + if (err != 0) { + mprinterr("Error: Could not write coords for TRR frame %i\n", set+1); + return 1; } return 0; } diff --git a/src/Traj_GmxXtc.cpp b/src/Traj_GmxXtc.cpp index 40f21f01a0..454cd4309d 100644 --- a/src/Traj_GmxXtc.cpp +++ b/src/Traj_GmxXtc.cpp @@ -55,7 +55,12 @@ int Traj_GmxXtc::setupTrajin(FileName const& fnameIn, Topology* trajParm) Frame tmp( natoms_ ); // First frame offset is always zero frameOffsets_.push_back( 0 ); - if (readFrame(0, tmp)) return TRAJIN_ERR; + double ucell[9]; + for (int i = 0; i < 9; i++) ucell[i] = 0; + if (readXtcFrame(0, tmp, ucell)) return TRAJIN_ERR; + // Set system box + Box xtcBox; + xtcBox.SetupFromUcell( ucell ); // Determine total number of frames // FIXME in parallel every thread is doing this which is unnecessary. int nframes = TRAJIN_UNK; @@ -121,7 +126,7 @@ int Traj_GmxXtc::setupTrajin(FileName const& fnameIn, Topology* trajParm) */ closeTraj(); // Box, coords, no velocity, no force, yes time - SetCoordInfo( CoordinateInfo(tmp.BoxCrd(), true, false, false, true) ); + SetCoordInfo( CoordinateInfo(xtcBox, true, false, false, true) ); return nframes; } @@ -189,6 +194,19 @@ void Traj_GmxXtc::closeTraj() { // Traj_GmxXtc::readFrame() int Traj_GmxXtc::readFrame(int set, Frame& frameIn) { + double ucell[9]; + int err = readXtcFrame(set, frameIn, ucell); + if (err == 0) + frameIn.ModifyBox().AssignFromUcell( ucell ); + return err; +} + +/** Read coordinates and box info from specified frame from XTC file. + * \param set Frame number to read. + * \param frameIn Frame to read coords (in Ang.) into. + * \param ucell Array of length 9, will be set with X{xyz} Y{xyz} Z{xyz} in Ang. + */ +int Traj_GmxXtc::readXtcFrame(int set, Frame& frameIn, double* ucell) { if (xdr_seek(xd_, frameOffsets_[set], SEEK_SET) != 0) { mprinterr("Error: Could not seek in XTC file, frame %i\n", set+1); return 1; @@ -204,11 +222,10 @@ int Traj_GmxXtc::readFrame(int set, Frame& frameIn) { for (int kx = 0; kx < DIM; kx++) frameIn[idx++] = (double)vec_[ix][kx] * Constants::NM_TO_ANG; idx = 0; - Matrix_3x3 ucell; for (int ii = 0; ii < DIM; ii++) for (int ij = 0; ij < DIM; ij++) ucell[idx++] = (double)box_[ii][ij] * Constants::NM_TO_ANG; - frameIn.SetBox( Box(ucell) ); + //ucell.Print("GmxRead"); return 0; } @@ -219,7 +236,9 @@ int Traj_GmxXtc::writeFrame(int set, Frame const& frameOut) { time = (float)frameOut.Time(); else time = (float)(dt_ * (double)set); - Matrix_3x3 Ucell = frameOut.BoxCrd().UnitCell( Constants::ANG_TO_NM ); + //Matrix_3x3 Ucell = frameOut.BoxCrd().UnitCell( Constants::ANG_TO_NM ); + Matrix_3x3 Ucell = frameOut.BoxCrd().UnitCell() * Constants::ANG_TO_NM; + //Ucell *= Constants::ANG_TO_NM; int idx = 0; for (int ii = 0; ii < DIM; ii++) for (int ij = 0; ij < DIM; ij++) diff --git a/src/Traj_GmxXtc.h b/src/Traj_GmxXtc.h index 2e1cc4f06e..5f2ea3a79b 100644 --- a/src/Traj_GmxXtc.h +++ b/src/Traj_GmxXtc.h @@ -37,6 +37,9 @@ class Traj_GmxXtc : public TrajectoryIO { void parallelCloseTraj(); # endif # ifndef NO_XDRFILE + /// Read coordinates and box info from XTC file + int readXtcFrame(int,Frame&,double*); + std::vector frameOffsets_; ///< Frame offsets for reading XDRFILE* xd_; ///< Hold XDR file metadata rvec* vec_; ///< Temporary location for holding XDR frame data diff --git a/src/Traj_Gro.cpp b/src/Traj_Gro.cpp index cabebf84f6..18d1aa0a39 100644 --- a/src/Traj_Gro.cpp +++ b/src/Traj_Gro.cpp @@ -55,32 +55,36 @@ double Traj_Gro::GetTimeValue(const char* line) const { } // Traj_Gro::GetBox() -Box Traj_Gro::GetBox(const char* line) const { +/** \return true if box coords detected in line, false otherwise. + * \param ucell Array of length 9 set with unit cell vectors, X{xyz} Y{xyz} Z{xyz} + * \param line Line to scan. + */ +bool Traj_Gro::GetBox(double* ucell, const char* line) const { float fXYZ[9]; - Box groBox; int nbox = sscanf( line, "%f %f %f %f %f %f %f %f %f", fXYZ, fXYZ+1, fXYZ+2, fXYZ+3, fXYZ+4, fXYZ+5, fXYZ+6, fXYZ+7, fXYZ+8); if (nbox == 3) { // Box lengths. Convert nm->Ang. Assume orthogonal FIXME OK? - double dXYZ[6]; - dXYZ[0] = (double)fXYZ[0]; - dXYZ[1] = (double)fXYZ[1]; - dXYZ[2] = (double)fXYZ[2]; - for (int i = 0; i != 3; i++) dXYZ[i] *= Constants::NM_TO_ANG; - dXYZ[3] = 90.0; - dXYZ[4] = 90.0; - dXYZ[5] = 90.0; - groBox.SetBox( dXYZ ); + ucell[0] = (double)fXYZ[0] * Constants::NM_TO_ANG; + ucell[1] = 0; + ucell[2] = 0; + + ucell[3] = 0; + ucell[4] = (double)fXYZ[1] * Constants::NM_TO_ANG; + ucell[5] = 0; + + ucell[6] = 0; + ucell[7] = 0; + ucell[8] = (double)fXYZ[2] * Constants::NM_TO_ANG; + + return true; } else if (nbox == 9) { // Box vectors. Convert nm->Ang. - Matrix_3x3 ucell; - ucell[0] = (double)fXYZ[0]; ucell[1] = (double)fXYZ[3]; ucell[2] = (double)fXYZ[4]; // X - ucell[3] = (double)fXYZ[5]; ucell[4] = (double)fXYZ[1]; ucell[5] = (double)fXYZ[6]; // Y - ucell[6] = (double)fXYZ[7]; ucell[7] = (double)fXYZ[8]; ucell[8] = (double)fXYZ[2]; // Z - for (int i = 0; i != 9; i++) ucell[i] *= Constants::NM_TO_ANG; - groBox.SetBox( ucell ); + for (int i = 0; i != 9; i++) + ucell[i] = fXYZ[i] * Constants::NM_TO_ANG; + return true; } // Otherwise assume no box. - return groBox; + return false; } // Traj_Gro::openTrajin() @@ -146,8 +150,11 @@ int Traj_Gro::setupTrajin(FileName const& fnameIn, Topology* trajParm) // v1(x) v2(y) v3(z) [v1(y) v1(z) v2(x) v2(z) v3(x) v3(y)] ptr = file_.Line(); Box groBox; - if (ptr != 0) - groBox = GetBox( ptr ); + if (ptr != 0) { + double ucell[9]; + if (GetBox(ucell, ptr)) + groBox.SetupFromUcell( ucell ); + } // Set trajectory information. No temperature info. SetCoordInfo( CoordinateInfo(groBox, hasV, false, hasTime) ); SetTitle( title ); @@ -156,7 +163,7 @@ int Traj_Gro::setupTrajin(FileName const& fnameIn, Topology* trajParm) // are more frames. bool hasMultipleFrames = false; if (ptr != 0) { - if (groBox.Type() == Box::NOBOX) // Assume another title read. + if (!groBox.HasBox()) // Assume another title read. hasMultipleFrames = true; else { ptr = file_.Line(); // Read line after box info @@ -166,7 +173,7 @@ int Traj_Gro::setupTrajin(FileName const& fnameIn, Topology* trajParm) } // Set up some info for performing blank reads. linesToRead_ = natom_; - if (groBox.Type() != Box::NOBOX) + if (groBox.HasBox()) linesToRead_ += 1; int nframes = 1; if (hasMultipleFrames) { @@ -240,7 +247,9 @@ int Traj_Gro::readFrame(int fnum, Frame& frm) { // Box read if (CoordInfo().HasBox()) { ptr = file_.Line(); - frm.SetBox( GetBox(ptr) ); + double ucell[9]; + if (GetBox(ucell, ptr)) + frm.ModifyBox().AssignFromUcell( ucell ); } ++currentSet_; diff --git a/src/Traj_Gro.h b/src/Traj_Gro.h index e1f467e527..b7dd8ae0f8 100644 --- a/src/Traj_Gro.h +++ b/src/Traj_Gro.h @@ -23,7 +23,7 @@ class Traj_Gro : public TrajectoryIO { int processReadArgs(ArgList&) { return 0; } double GetTimeValue(const char*) const; - Box GetBox(const char*) const; + bool GetBox(double*, const char*) const; BufferedLine file_; int debug_; diff --git a/src/Traj_NcEnsemble.cpp b/src/Traj_NcEnsemble.cpp index b8a1db317a..63dadd227c 100644 --- a/src/Traj_NcEnsemble.cpp +++ b/src/Traj_NcEnsemble.cpp @@ -269,24 +269,26 @@ int Traj_NcEnsemble::readArray(int set, FrameArray& f_ensemble) { // Read Box if (cellLengthVID_ != -1) { count_[2] = 3; + double xyzabg[6]; # ifdef HAS_PNETCDF - if (checkPNCerr(ncmpi_get_vara_double_all(ncid_, cellLengthVID_, start_, count_, frm.bAddress()))) + if (checkPNCerr(ncmpi_get_vara_double_all(ncid_, cellLengthVID_, start_, count_, xyzabg))) # else - if (NC::CheckErr(nc_get_vara_double(ncid_, cellLengthVID_, start_, count_, frm.bAddress()))) + if (NC::CheckErr(nc_get_vara_double(ncid_, cellLengthVID_, start_, count_, xyzabg))) # endif { rprinterr("Error: Getting cell lengths for frame %i.\n", set+1); return 1; } # ifdef HAS_PNETCDF - if (checkPNCerr(ncmpi_get_vara_double_all(ncid_, cellAngleVID_, start_, count_, frm.bAddress()+3))) + if (checkPNCerr(ncmpi_get_vara_double_all(ncid_, cellAngleVID_, start_, count_, xyzabg+3))) # else - if (NC::CheckErr(nc_get_vara_double(ncid_, cellAngleVID_, start_, count_, frm.bAddress()+3))) + if (NC::CheckErr(nc_get_vara_double(ncid_, cellAngleVID_, start_, count_, xyzabg+3))) # endif { rprinterr("Error: Getting cell angles for frame %i.\n", set+1); return 1; } + frm.ModifyBox().AssignFromXyzAbg( xyzabg ); } // Read Temperature if (TempVID_!=-1) { @@ -380,20 +382,22 @@ int Traj_NcEnsemble::writeArray(int set, FramePtrArray const& Farray) { } // Write box if (cellLengthVID_ != -1) { + if (!frm->BoxCrd().Is_X_Aligned()) + mprintf("Warning: Set %i; unit cell is not X-aligned. Box cannot be properly stored as Amber NetCDF ensemble.\n", set+1); count_[2] = 3; # ifdef HAS_PNETCDF - if (ncmpi_put_vara_double_all(ncid_,cellLengthVID_,start_,count_,frm->bAddress())) + if (ncmpi_put_vara_double_all(ncid_,cellLengthVID_,start_,count_,frm->BoxCrd().XyzPtr())) # else - if (NC::CheckErr(nc_put_vara_double(ncid_,cellLengthVID_,start_,count_,frm->bAddress())) ) + if (NC::CheckErr(nc_put_vara_double(ncid_,cellLengthVID_,start_,count_,frm->BoxCrd().XyzPtr())) ) # endif { mprinterr("Error: Writing cell lengths frame %i.\n", set+1); return 1; } # ifdef HAS_PNETCDF - if (ncmpi_put_vara_double_all(ncid_,cellAngleVID_,start_,count_,frm->bAddress()+3)) + if (ncmpi_put_vara_double_all(ncid_,cellAngleVID_,start_,count_,frm->BoxCrd().AbgPtr())) # else - if (NC::CheckErr(nc_put_vara_double(ncid_,cellAngleVID_,start_,count_,frm->bAddress()+3))) + if (NC::CheckErr(nc_put_vara_double(ncid_,cellAngleVID_,start_,count_,frm->BoxCrd().AbgPtr()))) # endif { mprinterr("Error: Writing cell angles frame %i.\n", set+1); diff --git a/src/Traj_PDBfile.cpp b/src/Traj_PDBfile.cpp index 2dff2d61aa..51c3621567 100644 --- a/src/Traj_PDBfile.cpp +++ b/src/Traj_PDBfile.cpp @@ -112,7 +112,10 @@ int Traj_PDBfile::setupTrajin(FileName const& fname, Topology* trajParm) // Read in box information double box_crd[6]; file_.pdb_Box_verbose( box_crd ); - boxInfo.SetBox( box_crd ); + if (boxInfo.SetupFromXyzAbg( box_crd )) { + mprintf("Warning: Box information in PDB appears invalid; disabling box.\n"); + boxInfo.SetNoBox(); + } } // Skip non-ATOM records if (file_.RecType() != PDBfile::ATOM) continue; @@ -198,8 +201,11 @@ int Traj_PDBfile::readFrame(int set, Frame& frameIn) while (atom < pdbAtom_) { if ( file_.NextRecord() == PDBfile::END_OF_FILE ) return 1; // Skip non-ATOM records - if ( file_.RecType() == PDBfile::CRYST1 ) - file_.pdb_Box_terse( frameIn.bAddress() ); + if ( file_.RecType() == PDBfile::CRYST1) { + double xyzabg[6]; + file_.pdb_Box_terse( xyzabg ); + frameIn.ModifyBox().AssignFromXyzAbg( xyzabg ); + } else if ( file_.RecType() == PDBfile::ATOM ) { // Check if we are filtering alt loc IDs if (keepAltLoc_ != ' ') { @@ -726,8 +732,10 @@ int Traj_PDBfile::setupTrajout(FileName const& fname, Topology* trajParm, if ( file_.OpenFile() ) return 1; if (!Title().empty()) file_.WriteTITLE( Title() ); } - write_cryst1_ = (CoordInfo().TrajBox().Type() != Box::NOBOX); + write_cryst1_ = (CoordInfo().TrajBox().HasBox()); if (write_cryst1_) { + if (!CoordInfo().TrajBox().Is_X_Aligned()) + mprintf("Warning: Unit cell is not X-aligned. Box cannot be properly stored in PBD CRYST1.\n"); if (pdbWriteMode_==MODEL) mprintf("Warning: For PDB with MODEL, box coords for first frame only will be written to CRYST1.\n"); if (space_group_.empty()) @@ -818,6 +826,15 @@ void Traj_PDBfile::WriteBonds() { } } +/** Write the CRYST1 record from box. */ +void Traj_PDBfile::writeBox(int set, Box const& box) { + if (write_cryst1_) { + if (!box.Is_X_Aligned()) + mprintf("Warning: Set %i; unit cell is not X-aligned. Box cannot be properly stored in PDB CRYST1.\n", set+1); + file_.WriteCRYST1( box.XyzPtr(), space_group_.c_str() ); + } +} + // Traj_PDBfile::writeFrame() /** Write the frame (model) to PDB file. */ int Traj_PDBfile::writeFrame(int set, Frame const& frameOut) { @@ -827,14 +844,12 @@ int Traj_PDBfile::writeFrame(int set, Frame const& frameOut) { if (!Title().empty()) file_.WriteTITLE( Title() ); WriteDisulfides(frameOut); - if (write_cryst1_) - file_.WriteCRYST1( frameOut.BoxCrd().boxPtr(), space_group_.c_str() ); + writeBox( set, frameOut.BoxCrd() ); } else { // Write disulfides/box coords, first frame only. if (firstframe_) { WriteDisulfides(frameOut); - if (write_cryst1_) - file_.WriteCRYST1( frameOut.BoxCrd().boxPtr(), space_group_.c_str() ); + writeBox( set, frameOut.BoxCrd() ); firstframe_ = false; } } diff --git a/src/Traj_PDBfile.h b/src/Traj_PDBfile.h index 49628a2971..719b287eaf 100644 --- a/src/Traj_PDBfile.h +++ b/src/Traj_PDBfile.h @@ -47,6 +47,7 @@ class Traj_PDBfile: public TrajectoryIO { void WriteDisulfides(Frame const&); void WriteBonds(); + void writeBox(int, Box const&); /// Used to set up B-factor/occupancy data from DataSets int AssignData(Darray&, DataSet*, Topology const&, bool, const char*, double) const; /// Used to scale Bfactor/occupancy data between set values diff --git a/src/Traj_Tinker.cpp b/src/Traj_Tinker.cpp index d22c332613..a0c86ec5af 100644 --- a/src/Traj_Tinker.cpp +++ b/src/Traj_Tinker.cpp @@ -70,7 +70,7 @@ int Traj_Tinker::readFrame(int set, Frame& frameIn) { if (file_.NextTinkerFrame()==-1) return 1; currentSet_++; } - if (file_.ReadNextTinkerFrame( frameIn.xAddress(), frameIn.bAddress() ) != 1) + if (file_.ReadNextTinkerFrame( frameIn ) != 1) return 1; currentSet_++; return 0; diff --git a/src/Trajin_Single.cpp b/src/Trajin_Single.cpp index de6b1cbd3e..653d80a7f0 100644 --- a/src/Trajin_Single.cpp +++ b/src/Trajin_Single.cpp @@ -160,7 +160,7 @@ void Trajin_Single::PrintInfo(int showExtended) const { trajio_->Info(); mprintf(", Parm %s",Traj().Parm()->c_str()); if (trajio_->CoordInfo().HasBox()) - mprintf(" (%s box)", trajio_->CoordInfo().TrajBox().TypeName()); + mprintf(" (%s box)", trajio_->CoordInfo().TrajBox().CellShapeName()); if (showExtended==1) Traj().Counter().PrintFrameInfo(); if (debug_>0) mprintf(", %i atoms, Box %i",Traj().Parm()->Natom(),(int)trajio_->CoordInfo().HasBox()); diff --git a/src/Version.h b/src/Version.h index 125cff020a..fc791362f4 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.33.0" +#define CPPTRAJ_INTERNAL_VERSION "V5.0.0" /// PYTRAJ relies on this #define CPPTRAJ_VERSION_STRING CPPTRAJ_INTERNAL_VERSION #endif diff --git a/src/cpptrajdepend b/src/cpptrajdepend index 5201b3ab3c..6a75f1e013 100644 --- a/src/cpptrajdepend +++ b/src/cpptrajdepend @@ -1,4 +1,3 @@ -Action.o : Action.cpp Action.h ActionState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h ActionFrameCounter.o : ActionFrameCounter.cpp ActionFrameCounter.h ArgList.h CpptrajStdio.h ActionList.o : ActionList.cpp Action.h ActionList.h ActionState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h ActionTopWriter.o : ActionTopWriter.cpp ActionTopWriter.h ArgList.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ParmFile.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h TypeNameHolder.h Unit.h Vec3.h @@ -8,85 +7,85 @@ Action_AreaPerMol.o : Action_AreaPerMol.cpp Action.h ActionState.h Action_AreaPe Action_AtomMap.o : Action_AtomMap.cpp Action.h ActionState.h Action_AtomMap.h ArgList.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h MapAtom.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h StructureMapper.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_AtomicCorr.o : Action_AtomicCorr.cpp Action.h ActionState.h Action_AtomicCorr.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixFlt.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_AtomicFluct.o : Action_AtomicFluct.cpp Action.h ActionFrameCounter.h ActionState.h Action_AtomicFluct.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Mesh.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PDBfile.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h Spline.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_AutoImage.o : Action_AutoImage.cpp Action.h ActionState.h Action_AutoImage.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageRoutines.h ImageTypes.h Image_List.h Image_List_Unit.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_AutoImage.o : Action_AutoImage.cpp Action.h ActionState.h Action_AutoImage.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h ImageRoutines.h ImageTypes.h Image_List.h Image_List_Unit.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Average.o : Action_Average.cpp Action.h ActionFrameCounter.h ActionState.h Action_Average.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajectoryFile.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h Action_Bounds.o : Action_Bounds.cpp Action.h ActionState.h Action_Bounds.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_3D.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h GridBin.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_Box.o : Action_Box.cpp Action.h ActionState.h Action_Box.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Box.o : Action_Box.cpp Action.h ActionState.h Action_Box.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h BoxArgs.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Center.o : Action_Center.cpp Action.h ActionState.h Action_Center.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Channel.o : Action_Channel.cpp Action.h ActionState.h Action_Channel.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 GridBin.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_CheckChirality.o : Action_CheckChirality.cpp Action.h ActionState.h Action_CheckChirality.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Mesh.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h Spline.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h -Action_CheckStructure.o : Action_CheckStructure.cpp Action.h ActionState.h Action_CheckStructure.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_double.h DataSet_integer.h DataSet_string.h Dimension.h DispatchObject.h DistRoutines.h ExclusionArray.h FileIO.h FileName.h FileTypes.h Frame.h ImagedAction.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StructureCheck.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_Closest.o : Action_Closest.cpp Action.h ActionState.h ActionTopWriter.h Action_Closest.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageRoutines.h ImageTypes.h ImagedAction.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_CheckStructure.o : Action_CheckStructure.cpp Action.h ActionState.h Action_CheckStructure.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_double.h DataSet_integer.h DataSet_string.h Dimension.h DispatchObject.h ExclusionArray.h FileIO.h FileName.h FileTypes.h Frame.h ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StructureCheck.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Closest.o : Action_Closest.cpp Action.h ActionState.h ActionTopWriter.h Action_Closest.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h ImageRoutines.h ImageTypes.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_ClusterDihedral.o : Action_ClusterDihedral.cpp Action.h ActionState.h Action_ClusterDihedral.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_integer.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h -Action_Contacts.o : Action_Contacts.cpp Action.h ActionState.h Action_Contacts.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_CreateCrd.o : Action_CreateCrd.cpp Action.h ActionState.h Action_CreateCrd.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Contacts.o : Action_Contacts.cpp Action.h ActionState.h Action_Contacts.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_CreateCrd.o : Action_CreateCrd.cpp Action.h ActionState.h Action_CreateCrd.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CompactFrameArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_CreateReservoir.o : Action_CreateReservoir.cpp Action.h ActionState.h Action_CreateReservoir.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.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 NetcdfFile.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h RemdReservoirNC.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_DNAionTracker.o : Action_DNAionTracker.cpp Action.h ActionState.h Action_DNAionTracker.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_DSSP.o : Action_DSSP.cpp Action.h ActionState.h Action_DSSP.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_Density.o : Action_Density.cpp Action.h ActionState.h Action_Density.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_Diffusion.o : Action_Diffusion.cpp Action.h ActionState.h Action_Diffusion.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_DNAionTracker.o : Action_DNAionTracker.cpp Action.h ActionState.h Action_DNAionTracker.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_DSSP.o : Action_DSSP.cpp Action.h ActionState.h Action_DSSP.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Density.o : Action_Density.cpp Action.h ActionState.h Action_Density.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.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 OnlineVarT.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Diffusion.o : Action_Diffusion.cpp Action.h ActionState.h Action_Diffusion.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Dihedral.o : Action_Dihedral.cpp Action.h ActionState.h Action_Dihedral.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h Action_DihedralRMS.o : Action_DihedralRMS.cpp Action.h ActionState.h Action_DihedralRMS.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceAction.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h Action_Dipole.o : Action_Dipole.cpp Action.h ActionState.h Action_Dipole.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_DistRmsd.o : Action_DistRmsd.cpp Action.h ActionState.h Action_DistRmsd.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceAction.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_Distance.o : Action_Distance.cpp Action.h ActionState.h Action_Distance.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Distance.o : Action_Distance.cpp Action.h ActionState.h Action_Distance.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Energy.o : Action_Energy.cpp Action.h ActionState.h Action_Energy.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h Energy.h Ewald.h Ewald_ParticleMesh.h Ewald_Regular.h ExclusionArray.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SplineFxnTable.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h helpme_standalone.h Action_Esander.o : Action_Esander.cpp Action.h ActionState.h Action_Esander.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h Energy_Sander.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_FilterByData.o : Action_FilterByData.cpp Action.h ActionState.h Action_FilterByData.h ArgList.h Array1D.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_FixAtomOrder.o : Action_FixAtomOrder.cpp Action.h ActionState.h ActionTopWriter.h Action_FixAtomOrder.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomTopType.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_FixImagedBonds.o : Action_FixImagedBonds.cpp Action.h ActionState.h Action_FixImagedBonds.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_GIST.o : Action_GIST.cpp Action.h ActionState.h Action_GIST.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_2D.h DataSet_3D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_GridDbl.h DataSet_GridFlt.h DataSet_MatrixFlt.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h Grid.h GridBin.h ImagedAction.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h cuda_kernels/GistCudaSetup.cuh +Action_FixImagedBonds.o : Action_FixImagedBonds.cpp Action.h ActionState.h Action_FixImagedBonds.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_GIST.o : Action_GIST.cpp Action.h ActionState.h Action_GIST.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_2D.h DataSet_3D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_GridDbl.h DataSet_GridFlt.h DataSet_MatrixFlt.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h Grid.h GridBin.h ImageOption.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h cuda_kernels/GistCudaSetup.cuh Action_Grid.o : Action_Grid.cpp Action.h ActionState.h Action_Grid.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 MaskArray.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PDBfile.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_GridFreeEnergy.o : Action_GridFreeEnergy.cpp Action.h ActionState.h Action_GridFreeEnergy.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_HydrogenBond.o : Action_HydrogenBond.cpp Action.h ActionState.h Action_HydrogenBond.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_integer.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h +Action_HydrogenBond.o : Action_HydrogenBond.cpp Action.h ActionState.h Action_HydrogenBond.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_integer.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h Action_Image.o : Action_Image.cpp Action.h ActionState.h Action_Image.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h ImageRoutines.h ImageTypes.h Image_List.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_InfraredSpectrum.o : Action_InfraredSpectrum.cpp Action.h ActionState.h Action_InfraredSpectrum.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h Corr.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Vector.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 ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h PubFFT.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Jcoupling.o : Action_Jcoupling.cpp Action.h ActionState.h Action_Jcoupling.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h BufferedLine.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h Action_LESsplit.o : Action_LESsplit.cpp Action.h ActionFrameCounter.h ActionState.h Action_LESsplit.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajectoryFile.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h -Action_LIE.o : Action_LIE.cpp Action.h ActionState.h Action_LIE.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_LIE.o : Action_LIE.cpp Action.h ActionState.h Action_LIE.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_LipidOrder.o : Action_LipidOrder.cpp Action.h ActionState.h Action_LipidOrder.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_MakeStructure.o : Action_MakeStructure.cpp Action.h ActionState.h Action_MakeStructure.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h Action_Mask.o : Action_Mask.cpp Action.h ActionFrameCounter.h ActionState.h Action_Mask.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajectoryFile.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h -Action_Matrix.o : Action_Matrix.cpp Action.h ActionFrameCounter.h ActionState.h Action_Matrix.h ArgList.h Array1D.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixDbl.h DataSet_Vector.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_MinImage.o : Action_MinImage.cpp Action.h ActionState.h Action_MinImage.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Matrix.o : Action_Matrix.cpp Action.h ActionFrameCounter.h ActionState.h Action_Matrix.h ArgList.h Array1D.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixDbl.h DataSet_Vector.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImageOption.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_MinImage.o : Action_MinImage.cpp Action.h ActionState.h Action_MinImage.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Molsurf.o : Action_Molsurf.cpp Action.h ActionState.h Action_Molsurf.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h molsurf.h Action_MultiDihedral.o : Action_MultiDihedral.cpp Action.h ActionState.h Action_MultiDihedral.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_double.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h Action_MultiVector.o : Action_MultiVector.cpp Action.h ActionState.h Action_MultiVector.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Vector.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_NAstruct.o : Action_NAstruct.cpp Action.h ActionState.h Action_NAstruct.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h AxisType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_float.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PDBfile.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_NMRrst.o : Action_NMRrst.cpp Action.h ActionState.h Action_NMRrst.h ArgList.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h BaseIOtype.h Box.h BufferedLine.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_double.h DataSet_float.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImagedAction.h MapAtom.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h ViewRst.h -Action_NativeContacts.o : Action_NativeContacts.cpp Action.h ActionState.h Action_NativeContacts.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixDbl.h DataSet_integer.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImagedAction.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PDBfile.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_OrderParameter.o : Action_OrderParameter.cpp Action.h ActionState.h Action_OrderParameter.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 OnlineVarT.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_NAstruct.o : Action_NAstruct.cpp Action.h ActionState.h Action_NAstruct.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h AxisType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_float.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PDBfile.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_NMRrst.o : Action_NMRrst.cpp Action.h ActionState.h Action_NMRrst.h ArgList.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h BaseIOtype.h Box.h BufferedLine.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_double.h DataSet_float.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImageOption.h MapAtom.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h ViewRst.h +Action_NativeContacts.o : Action_NativeContacts.cpp Action.h ActionState.h Action_NativeContacts.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixDbl.h DataSet_integer.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImageOption.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PDBfile.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_OrderParameter.o : Action_OrderParameter.cpp Action.h ActionState.h Action_OrderParameter.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OnlineVarT.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Outtraj.o : Action_Outtraj.cpp Action.h ActionFrameCounter.h ActionState.h Action_Outtraj.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.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 OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajectoryFile.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h -Action_PairDist.o : Action_PairDist.cpp Action.h ActionState.h Action_PairDist.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Mesh.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h Spline.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_PairDist.o : Action_PairDist.cpp Action.h ActionState.h Action_PairDist.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Mesh.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OnlineVarT.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h Spline.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Pairwise.o : Action_Pairwise.cpp Action.h ActionFrameCounter.h ActionState.h Action_Pairwise.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixDbl.h Dimension.h DispatchObject.h ExclusionArray.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h PDBfile.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajectoryFile.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h Action_Principal.o : Action_Principal.cpp Action.h ActionState.h Action_Principal.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Mat3x3.h DataSet_Vector.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Projection.o : Action_Projection.cpp Action.h ActionFrameCounter.h ActionState.h Action_Projection.h ArgList.h Array1D.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixDbl.h DataSet_Modes.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Pucker.o : Action_Pucker.cpp Action.h ActionState.h Action_Pucker.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h Action_Radgyr.o : Action_Radgyr.cpp Action.h ActionState.h Action_Radgyr.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_Radial.o : Action_Radial.cpp Action.h ActionState.h Action_Radial.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_RandomizeIons.o : Action_RandomizeIons.cpp Action.h ActionState.h Action_RandomizeIons.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Random.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Radial.o : Action_Radial.cpp Action.h ActionState.h Action_Radial.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_RandomizeIons.o : Action_RandomizeIons.cpp Action.h ActionState.h Action_RandomizeIons.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Random.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Remap.o : Action_Remap.cpp Action.h ActionState.h ActionTopWriter.h Action_Remap.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_ReplicateCell.o : Action_ReplicateCell.cpp Action.h ActionFrameCounter.h ActionState.h ActionTopWriter.h Action_ReplicateCell.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajectoryFile.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h +Action_ReplicateCell.o : Action_ReplicateCell.cpp Action.h ActionFrameCounter.h ActionState.h ActionTopWriter.h Action_ReplicateCell.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajectoryFile.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h Action_Rmsd.o : Action_Rmsd.cpp Action.h ActionState.h Action_Rmsd.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Mesh.h DataSet_Vector.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceAction.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h Spline.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Rotate.o : Action_Rotate.cpp Action.h ActionState.h Action_Rotate.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Mat3x3.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_RunningAvg.o : Action_RunningAvg.cpp Action.h ActionState.h Action_RunningAvg.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_STFC_Diffusion.o : Action_STFC_Diffusion.cpp Action.h ActionState.h Action_STFC_Diffusion.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_STFC_Diffusion.o : Action_STFC_Diffusion.cpp Action.h ActionState.h Action_STFC_Diffusion.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Scale.o : Action_Scale.cpp Action.h ActionState.h Action_Scale.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_SetVelocity.o : Action_SetVelocity.cpp Action.h ActionState.h Action_SetVelocity.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h Constraints.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Random.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_Spam.o : Action_Spam.cpp Action.h ActionState.h Action_Spam.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataIO_Peaks.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Mesh.h DataSet_Vector_Scalar.h DataSet_double.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h HistBin.h ImagedAction.h KDE.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OnlineVarT.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h Spline.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Spam.o : Action_Spam.cpp Action.h ActionState.h Action_Spam.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataIO_Peaks.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Mesh.h DataSet_Vector_Scalar.h DataSet_double.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h HistBin.h ImageOption.h KDE.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OnlineVarT.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h Spline.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Strip.o : Action_Strip.cpp Action.h ActionState.h ActionTopWriter.h Action_Strip.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_Surf.o : Action_Surf.cpp Action.h ActionState.h Action_Surf.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_SymmetricRmsd.o : Action_SymmetricRmsd.cpp Action.h ActionState.h Action_SymmetricRmsd.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 Hungarian.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceAction.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h SymmetricRmsdCalc.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Surf.o : Action_Surf.cpp Action.h ActionState.h Action_Surf.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_SymmetricRmsd.o : Action_SymmetricRmsd.cpp Action.h ActionState.h Action_SymmetricRmsd.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 Hungarian.h ImageOption.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceAction.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h SymmetricRmsdCalc.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Temperature.o : Action_Temperature.cpp Action.h ActionState.h Action_Temperature.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h Constraints.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Time.o : Action_Time.cpp Action.h ActionState.h Action_Time.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Translate.o : Action_Translate.cpp Action.h ActionState.h Action_Translate.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Unstrip.o : Action_Unstrip.cpp Action.h ActionState.h Action_Unstrip.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Unwrap.o : Action_Unwrap.cpp Action.h ActionState.h Action_Unwrap.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h ImageRoutines.h ImageTypes.h Image_List.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_Vector.o : Action_Vector.cpp Action.h ActionState.h Action_Vector.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Vector.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Vector.o : Action_Vector.cpp Action.h ActionState.h Action_Vector.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Vector.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_VelocityAutoCorr.o : Action_VelocityAutoCorr.cpp Action.h ActionState.h Action_VelocityAutoCorr.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h Corr.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Vector.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 ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h PubFFT.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_Volmap.o : Action_Volmap.cpp Action.h ActionState.h Action_Volmap.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_3D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_GridDbl.h DataSet_GridFlt.h Dimension.h DispatchObject.h FileIO.h FileName.h FileTypes.h Frame.h Grid.h GridBin.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SplineFxnTable.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_Volume.o : Action_Volume.cpp Action.h ActionState.h Action_Volume.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Action_Watershell.o : Action_Watershell.cpp Action.h ActionState.h Action_Watershell.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageRoutines.h ImageTypes.h ImagedAction.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Volume.o : Action_Volume.cpp Action.h ActionState.h Action_Volume.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +Action_Watershell.o : Action_Watershell.cpp Action.h ActionState.h Action_Watershell.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ImageOption.h ImageRoutines.h ImageTypes.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Action_XtalSymm.o : Action_XtalSymm.cpp Action.h ActionState.h Action_XtalSymm.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SpaceGroup.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h AnalysisList.o : AnalysisList.cpp ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Analysis_AmdBias.o : Analysis_AmdBias.cpp ActionState.h Analysis.h AnalysisState.h Analysis_AmdBias.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h @@ -129,7 +128,7 @@ Analysis_Statistics.o : Analysis_Statistics.cpp ActionState.h Analysis.h Analysi Analysis_TI.o : Analysis_TI.cpp ActionState.h Analysis.h AnalysisState.h Analysis_TI.h ArgList.h Array1D.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Mesh.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Random.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h Spline.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Analysis_Timecorr.o : Analysis_Timecorr.cpp ActionState.h Analysis.h AnalysisState.h Analysis_Timecorr.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h Corr.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Vector.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 ParameterHolders.h ParameterSet.h ParameterTypes.h PubFFT.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Analysis_VectorMath.o : Analysis_VectorMath.cpp ActionState.h Analysis.h AnalysisState.h Analysis_VectorMath.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Vector.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h -Analysis_Wavelet.o : Analysis_Wavelet.cpp ActionFrameCounter.h ActionState.h Analysis.h AnalysisState.h Analysis_Wavelet.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ClusterMap.h ComplexArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixFlt.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ParmFile.h ProgressBar.h ProgressTimer.h PubFFT.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajectoryFile.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h +Analysis_Wavelet.o : Analysis_Wavelet.cpp ActionFrameCounter.h ActionState.h Analysis.h AnalysisState.h Analysis_Wavelet.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ClusterMap.h ComplexArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixFlt.h Dimension.h DispatchObject.h DistRoutines.h FileIO.h FileName.h FileTypes.h Frame.h ImageOption.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ParmFile.h ProgressBar.h ProgressTimer.h PubFFT.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajectoryFile.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h ArgList.o : ArgList.cpp ArgList.h CpptrajStdio.h StringRoutines.h Array1D.o : Array1D.cpp ArgList.h Array1D.h AssociatedData.h Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h FileIO.h FileName.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h AssociatedData.o : AssociatedData.cpp ArgList.h AssociatedData.h CpptrajStdio.h @@ -137,8 +136,9 @@ Atom.o : Atom.cpp Atom.h CpptrajStdio.h NameType.h SymbolExporting.h AtomMap.o : AtomMap.cpp Atom.h AtomMap.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h MapAtom.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h TypeNameHolder.h Unit.h Vec3.h AtomMask.o : AtomMask.cpp Atom.h AtomMask.h CpptrajStdio.h MaskToken.h Molecule.h NameType.h Residue.h Segment.h SymbolExporting.h Unit.h AxisType.o : AxisType.cpp ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h AxisType.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h FileIO.h FileName.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PDBfile.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h -BondSearch.o : BondSearch.cpp Atom.h AtomMask.h AtomType.h BondSearch.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h FileName.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +BondSearch.o : BondSearch.cpp Atom.h AtomMask.h AtomType.h BondSearch.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h FileName.h Frame.h ImageOption.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h Box.o : Box.cpp Box.h Constants.h CpptrajStdio.h Matrix_3x3.h Parallel.h Vec3.h +BoxArgs.o : BoxArgs.cpp ArgList.h Box.h BoxArgs.h CpptrajStdio.h Matrix_3x3.h Parallel.h Vec3.h BufferedFrame.o : BufferedFrame.cpp BufferedFrame.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h Parallel.h TextFormat.h BufferedLine.o : BufferedLine.cpp BufferedLine.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h Parallel.h ByteRoutines.o : ByteRoutines.cpp @@ -159,7 +159,8 @@ 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 ActionTopWriter.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_EvalPlateau.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_Slope.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 AtomMap.h AtomMask.h AtomType.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 Constants.h Constraints.h ControlBlock.h ControlBlock_For.h CoordinateInfo.h Corr.h Cph.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.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 ExclusionArray.h Exec.h Exec_AddMissingRes.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_Emin.h Exec_GenerateAmberRst.h Exec_Graft.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_PrepareForLeap.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_Set.h Exec_Show.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 ParameterSet.h ParameterTypes.h PubFFT.h RPNcalc.h Random.h Range.h ReferenceAction.h ReferenceFrame.h RemdReservoirNC.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h Spline.h SplineFxnTable.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 TypeNameHolder.h Unit.h Vec3.h cuda_kernels/GistCudaSetup.cuh molsurf.h +Command.o : Command.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h ActionTopWriter.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_EvalPlateau.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_Slope.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 AtomMap.h AtomMask.h AtomType.h AxisType.h BaseIOtype.h Box.h BoxArgs.h BufferedLine.h CharMask.h ClusterDist.h ClusterList.h ClusterMap.h ClusterNode.h ClusterSieve.h Cmd.h CmdInput.h CmdList.h Command.h CompactFrameArray.h ComplexArray.h Constants.h Constraints.h ControlBlock.h ControlBlock_For.h CoordinateInfo.h Corr.h Cph.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.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 Energy.h Energy_Sander.h EnsembleIn.h EnsembleOutList.h ExclusionArray.h Exec.h Exec_AddMissingRes.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_Emin.h Exec_GenerateAmberRst.h Exec_Graft.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_PrepareForLeap.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_Set.h Exec_Show.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 ImageOption.h ImageTypes.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 ParameterSet.h ParameterTypes.h PubFFT.h RPNcalc.h Random.h Range.h ReferenceAction.h ReferenceFrame.h RemdReservoirNC.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h Spline.h SplineFxnTable.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 TypeNameHolder.h Unit.h Vec3.h cuda_kernels/GistCudaSetup.cuh molsurf.h +CompactFrameArray.o : CompactFrameArray.cpp Box.h CompactFrameArray.h CoordinateInfo.h CpptrajStdio.h Matrix_3x3.h Parallel.h ReplicaDimArray.h Vec3.h ComplexArray.o : ComplexArray.cpp ArrayIterator.h ComplexArray.h Constraints.o : Constraints.cpp ArgList.h Atom.h AtomMask.h AtomType.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h TypeNameHolder.h Unit.h Vec3.h ControlBlock_For.o : ControlBlock_For.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h ControlBlock.h ControlBlock_For.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.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 ForLoop.h ForLoop_dataSetBlocks.h ForLoop_integer.h ForLoop_list.h ForLoop_mask.h ForLoop_overSets.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h @@ -168,7 +169,7 @@ Corr.o : Corr.cpp ArrayIterator.h ComplexArray.h Corr.h PubFFT.h Cph.o : Cph.cpp Cph.h NameType.h Cpptraj.o : Cpptraj.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Cmd.h CmdInput.h CmdList.h Command.h Constants.h CoordinateInfo.h Cpptraj.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.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 ParameterHolders.h ParameterSet.h ParameterTypes.h ParmFile.h Range.h ReadLine.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h TopInfo.h Topology.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Version.h CpptrajFile.o : CpptrajFile.cpp CpptrajFile.h CpptrajStdio.h FileIO.h FileIO_Bzip2.h FileIO_Gzip.h FileIO_Mpi.h FileIO_MpiShared.h FileIO_Std.h FileName.h Parallel.h StringRoutines.h -CpptrajState.o : CpptrajState.cpp Action.h ActionList.h ActionState.h Action_CreateCrd.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_Coords_TRJ.h DataSet_Topology.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleNavigator.h EnsembleOutList.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajFrameIndex.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h +CpptrajState.o : CpptrajState.cpp Action.h ActionList.h ActionState.h Action_CreateCrd.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CompactFrameArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_Coords_TRJ.h DataSet_Topology.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleNavigator.h EnsembleOutList.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajFrameIndex.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h CpptrajStdio.o : CpptrajStdio.cpp Parallel.h CurveFit.o : CurveFit.cpp CurveFit.h DataFile.o : DataFile.cpp ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h BaseIOtype.h Box.h BufferedLine.h ClusterDist.h ClusterSieve.h Constants.h CoordinateInfo.h Cph.h CpptrajFile.h CpptrajStdio.h DataFile.h DataIO.h DataIO_CCP4.h DataIO_CharmmFastRep.h DataIO_CharmmOutput.h DataIO_CharmmRepLog.h DataIO_CharmmRtfPrm.h DataIO_Cmatrix.h DataIO_Cpout.h DataIO_Evecs.h DataIO_Gnuplot.h DataIO_Grace.h DataIO_Mdout.h DataIO_NC_Cmatrix.h DataIO_OpenDx.h DataIO_Peaks.h DataIO_RemLog.h DataIO_Std.h DataIO_VecTraj.h DataIO_XVG.h DataIO_Xplor.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Cmatrix.h DataSet_Cmatrix_MEM.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_RemLog.h Dimension.h FileIO.h FileName.h FileTypes.h Frame.h Hungarian.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NC_Cmatrix.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h SymmetricRmsdCalc.h TextFormat.h Timer.h Topology.h TrajectoryFile.h TypeNameHolder.h Unit.h Vec3.h @@ -194,7 +195,7 @@ DataIO_VecTraj.o : DataIO_VecTraj.cpp ActionFrameCounter.h ArgList.h ArrayIterat DataIO_XVG.o : DataIO_XVG.cpp ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h BufferedLine.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataIO.h DataIO_XVG.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_double.h Dimension.h FileIO.h FileName.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h DataIO_Xplor.o : DataIO_Xplor.cpp ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h BufferedLine.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataIO.h DataIO_Xplor.h DataSet.h DataSetList.h DataSet_3D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_GridFlt.h Dimension.h FileIO.h FileName.h Frame.h Grid.h GridBin.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h DataSet.o : DataSet.cpp AssociatedData.h CpptrajFile.h CpptrajStdio.h DataSet.h Dimension.h FileIO.h FileName.h MetaData.h Parallel.h Range.h TextFormat.h -DataSetList.o : DataSetList.cpp ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h Box.h ClusterDist.h ClusterSieve.h ComplexArray.h Constants.h CoordinateInfo.h Cph.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_3D.h DataSet_Cmatrix.h DataSet_Cmatrix_DISK.h DataSet_Cmatrix_MEM.h DataSet_Cmatrix_NOMEM.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_Coords_TRJ.h DataSet_GridDbl.h DataSet_GridFlt.h DataSet_Mat3x3.h DataSet_MatrixDbl.h DataSet_MatrixFlt.h DataSet_Mesh.h DataSet_Modes.h DataSet_PHREMD.h DataSet_PHREMD_Explicit.h DataSet_PHREMD_Implicit.h DataSet_Parameters.h DataSet_RemLog.h DataSet_StringVar.h DataSet_Tensor.h DataSet_Topology.h DataSet_Vector.h DataSet_Vector_Scalar.h DataSet_double.h DataSet_float.h DataSet_integer.h DataSet_integer_disk.h DataSet_integer_mem.h DataSet_pH.h DataSet_string.h Dimension.h FileIO.h FileName.h Frame.h Grid.h GridBin.h Hungarian.h InputTrajCommon.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NC_Cmatrix.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h Spline.h StringRoutines.h SymbolExporting.h SymmetricRmsdCalc.h SymmetricTensor.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajFrameIndex.h Trajin.h TypeNameHolder.h Unit.h Vec3.h +DataSetList.o : DataSetList.cpp ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h Box.h ClusterDist.h ClusterSieve.h CompactFrameArray.h ComplexArray.h Constants.h CoordinateInfo.h Cph.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_3D.h DataSet_Cmatrix.h DataSet_Cmatrix_DISK.h DataSet_Cmatrix_MEM.h DataSet_Cmatrix_NOMEM.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_Coords_TRJ.h DataSet_GridDbl.h DataSet_GridFlt.h DataSet_Mat3x3.h DataSet_MatrixDbl.h DataSet_MatrixFlt.h DataSet_Mesh.h DataSet_Modes.h DataSet_PHREMD.h DataSet_PHREMD_Explicit.h DataSet_PHREMD_Implicit.h DataSet_Parameters.h DataSet_RemLog.h DataSet_StringVar.h DataSet_Tensor.h DataSet_Topology.h DataSet_Vector.h DataSet_Vector_Scalar.h DataSet_double.h DataSet_float.h DataSet_integer.h DataSet_integer_disk.h DataSet_integer_mem.h DataSet_pH.h DataSet_string.h Dimension.h FileIO.h FileName.h Frame.h Grid.h GridBin.h Hungarian.h InputTrajCommon.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NC_Cmatrix.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h Spline.h StringRoutines.h SymbolExporting.h SymmetricRmsdCalc.h SymmetricTensor.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajFrameIndex.h Trajin.h TypeNameHolder.h Unit.h Vec3.h DataSet_1D.o : DataSet_1D.cpp ArrayIterator.h AssociatedData.h ComplexArray.h Constants.h Corr.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_1D.h Dimension.h FileIO.h FileName.h MetaData.h Parallel.h PubFFT.h Range.h TextFormat.h DataSet_3D.o : DataSet_3D.cpp AssociatedData.h Box.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_3D.h Dimension.h FileIO.h FileName.h GridBin.h Matrix_3x3.h MetaData.h Parallel.h Range.h TextFormat.h Vec3.h DataSet_Cmatrix.o : DataSet_Cmatrix.cpp ArrayIterator.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h Box.h ClusterDist.h ClusterSieve.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_1D.h DataSet_Cmatrix.h DataSet_Coords.h Dimension.h FileIO.h FileName.h Frame.h Hungarian.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h SymmetricRmsdCalc.h TextFormat.h Topology.h TypeNameHolder.h Unit.h Vec3.h @@ -202,7 +203,7 @@ DataSet_Cmatrix_DISK.o : DataSet_Cmatrix_DISK.cpp ArrayIterator.h AssociatedData DataSet_Cmatrix_MEM.o : DataSet_Cmatrix_MEM.cpp ArrayIterator.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h Box.h ClusterDist.h ClusterSieve.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_1D.h DataSet_Cmatrix.h DataSet_Cmatrix_MEM.h DataSet_Coords.h Dimension.h FileIO.h FileName.h Frame.h Hungarian.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h SymmetricRmsdCalc.h TextFormat.h Topology.h TypeNameHolder.h Unit.h Vec3.h DataSet_Cmatrix_NOMEM.o : DataSet_Cmatrix_NOMEM.cpp ArrayIterator.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h Box.h ClusterDist.h ClusterSieve.h Constants.h CoordinateInfo.h CpptrajFile.h DataSet.h DataSet_1D.h DataSet_Cmatrix.h DataSet_Cmatrix_NOMEM.h DataSet_Coords.h Dimension.h FileIO.h FileName.h Frame.h Hungarian.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h SymmetricRmsdCalc.h TextFormat.h Topology.h TypeNameHolder.h Unit.h Vec3.h DataSet_Coords.o : DataSet_Coords.cpp AssociatedData.h Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_Coords.h Dimension.h FileIO.h FileName.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Topology.h TypeNameHolder.h Unit.h Vec3.h -DataSet_Coords_CRD.o : DataSet_Coords_CRD.cpp AssociatedData.h Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_Coords.h DataSet_Coords_CRD.h Dimension.h FileIO.h FileName.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Topology.h TypeNameHolder.h Unit.h Vec3.h +DataSet_Coords_CRD.o : DataSet_Coords_CRD.cpp AssociatedData.h Atom.h AtomMask.h AtomType.h Box.h CompactFrameArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_Coords.h DataSet_Coords_CRD.h Dimension.h FileIO.h FileName.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Topology.h TypeNameHolder.h Unit.h Vec3.h DataSet_Coords_REF.o : DataSet_Coords_REF.cpp ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h FileIO.h FileName.h Frame.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Topology.h TrajFrameCounter.h Trajin.h Trajin_Single.h TypeNameHolder.h Unit.h Vec3.h DataSet_Coords_TRJ.o : DataSet_Coords_TRJ.cpp AssociatedData.h Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_Coords.h DataSet_Coords_TRJ.h Dimension.h FileIO.h FileName.h Frame.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Topology.h TrajFrameCounter.h TrajFrameIndex.h Trajin.h Trajin_Single.h TypeNameHolder.h Unit.h Vec3.h DataSet_GridDbl.o : DataSet_GridDbl.cpp ArrayIterator.h AssociatedData.h Box.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_3D.h DataSet_GridDbl.h Dimension.h FileIO.h FileName.h Grid.h GridBin.h Matrix_3x3.h MetaData.h Parallel.h Range.h StringRoutines.h TextFormat.h Vec3.h @@ -229,8 +230,8 @@ DataSet_pH.o : DataSet_pH.cpp AssociatedData.h Cph.h CpptrajFile.h CpptrajStdio. DataSet_string.o : DataSet_string.cpp 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 Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h DihedralSearch.h FileName.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Topology.h TypeNameHolder.h Unit.h Vec3.h -DistRoutines.o : DistRoutines.cpp Box.h DistRoutines.h Matrix_3x3.h Parallel.h Vec3.h -Energy.o : Energy.cpp Atom.h AtomMask.h AtomType.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h Energy.h ExclusionArray.h FileName.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h +DistRoutines.o : DistRoutines.cpp Box.h DistRoutines.h ImageOption.h Matrix_3x3.h Parallel.h Vec3.h +Energy.o : Energy.cpp Atom.h AtomMask.h AtomType.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h Energy.h ExclusionArray.h FileName.h Frame.h ImageOption.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h EnergyArray.o : EnergyArray.cpp CpptrajFile.h CpptrajStdio.h EnergyArray.h FileIO.h FileName.h Parallel.h Energy_Sander.o : Energy_Sander.cpp ArgList.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h Energy_Sander.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ParmFile.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h TypeNameHolder.h Unit.h Vec3.h EnsembleIn.o : EnsembleIn.cpp Atom.h AtomMask.h Box.h CoordinateInfo.h CpptrajStdio.h EnsembleIn.h FileName.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h Timer.h TrajFrameCounter.h Unit.h Vec3.h @@ -245,7 +246,7 @@ Ewald.o : Ewald.cpp Atom.h AtomMask.h AtomType.h Box.h CharMask.h Constants.h Co Ewald_ParticleMesh.o : Ewald_ParticleMesh.cpp Atom.h AtomMask.h Box.h CoordinateInfo.h CpptrajStdio.h Ewald.h Ewald_ParticleMesh.h ExclusionArray.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h PairList.h Parallel.h ReplicaDimArray.h Residue.h Segment.h SplineFxnTable.h SymbolExporting.h Timer.h Unit.h Vec3.h helpme_standalone.h Ewald_Regular.o : Ewald_Regular.cpp Atom.h AtomMask.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h Ewald.h Ewald_Regular.h ExclusionArray.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h PairList.h Parallel.h ReplicaDimArray.h Residue.h Segment.h SplineFxnTable.h StringRoutines.h SymbolExporting.h Timer.h Unit.h Vec3.h ExclusionArray.o : ExclusionArray.cpp Atom.h AtomMask.h CharMask.h CpptrajStdio.h ExclusionArray.h MaskToken.h Molecule.h NameType.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Unit.h -Exec_AddMissingRes.o : Exec_AddMissingRes.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h BufferedLine.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnergyArray.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_AddMissingRes.h Exec_AddMissingRes_Pres.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Minimize_SteepestDescent.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ParmFile.h PotentialFunction.h PotentialTerm.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h Trajin_Single.h TrajoutList.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h +Exec_AddMissingRes.o : Exec_AddMissingRes.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h BufferedLine.h CharMask.h CompactFrameArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnergyArray.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_AddMissingRes.h Exec_AddMissingRes_Pres.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Minimize_SteepestDescent.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ParmFile.h PotentialFunction.h PotentialTerm.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h Trajin_Single.h TrajoutList.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h Exec_Analyze.o : Exec_Analyze.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Cmd.h CmdList.h Command.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Analyze.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_Calc.o : Exec_Calc.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Calc.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 ParameterHolders.h ParameterSet.h ParameterTypes.h RPNcalc.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_CatCrd.o : Exec_CatCrd.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_CatCrd.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h @@ -254,26 +255,26 @@ Exec_ClusterMap.o : Exec_ClusterMap.cpp Action.h ActionList.h ActionState.h Anal Exec_CombineCoords.o : Exec_CombineCoords.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_CombineCoords.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_Commands.o : Exec_Commands.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Commands.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_CompareTop.o : Exec_CompareTop.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_CompareTop.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h -Exec_CrdAction.o : Exec_CrdAction.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Cmd.h CmdList.h Command.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_CrdAction.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 ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h +Exec_CrdAction.o : Exec_CrdAction.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Cmd.h CmdList.h Command.h CompactFrameArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_CrdAction.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 ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_CrdOut.o : Exec_CrdOut.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_CrdOut.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h Exec_CreateSet.o : Exec_CreateSet.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_CreateSet.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 ParameterHolders.h ParameterSet.h ParameterTypes.h RPNcalc.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_DataFile.o : Exec_DataFile.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_DataFile.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_DataFilter.o : Exec_DataFilter.cpp Action.h ActionList.h ActionState.h Action_FilterByData.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h Array1D.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_double.h DataSet_integer.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_DataFilter.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 ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_DataSetCmd.o : Exec_DataSetCmd.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h ComplexArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixDbl.h DataSet_Mesh.h DataSet_Vector.h DataSet_string.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_DataSetCmd.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h Spline.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_Emin.o : Exec_Emin.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnergyArray.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Emin.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Minimize_SteepestDescent.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h PotentialFunction.h PotentialTerm.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h -Exec_GenerateAmberRst.o : Exec_GenerateAmberRst.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h DistRoutines.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_GenerateAmberRst.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h +Exec_GenerateAmberRst.o : Exec_GenerateAmberRst.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h DistRoutines.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_GenerateAmberRst.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h ImageOption.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_Graft.o : Exec_Graft.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Graft.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_Help.o : Exec_Help.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Cmd.h CmdList.h Command.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Help.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 ParameterHolders.h ParameterSet.h ParameterTypes.h ParmFile.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_LoadCrd.o : Exec_LoadCrd.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_LoadCrd.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h Trajin_Single.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_LoadTraj.o : Exec_LoadTraj.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Coords_TRJ.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_LoadTraj.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajFrameIndex.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_ParallelAnalysis.o : Exec_ParallelAnalysis.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_ParallelAnalysis.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h -Exec_ParmBox.o : Exec_ParmBox.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_ParmBox.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h +Exec_ParmBox.o : Exec_ParmBox.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h BoxArgs.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_ParmBox.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_ParmSolvent.o : Exec_ParmSolvent.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_ParmSolvent.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_ParmStrip.o : Exec_ParmStrip.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_ParmStrip.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_ParmWrite.o : Exec_ParmWrite.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_ParmWrite.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 ParameterHolders.h ParameterSet.h ParameterTypes.h ParmFile.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h -Exec_PermuteDihedrals.o : Exec_PermuteDihedrals.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DihedralSearch.h Dimension.h DispatchObject.h DistRoutines.h EnsembleIn.h EnsembleOutList.h ExclusionArray.h Exec.h Exec_PermuteDihedrals.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h ImagedAction.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Random.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h StructureCheck.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h +Exec_PermuteDihedrals.o : Exec_PermuteDihedrals.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h CompactFrameArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DihedralSearch.h Dimension.h DispatchObject.h DistRoutines.h EnsembleIn.h EnsembleOutList.h ExclusionArray.h Exec.h Exec_PermuteDihedrals.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h ImageOption.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Random.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h StructureCheck.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h Exec_Precision.o : Exec_Precision.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Precision.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h -Exec_PrepareForLeap.o : Exec_PrepareForLeap.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h DistRoutines.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_PrepareForLeap.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h +Exec_PrepareForLeap.o : Exec_PrepareForLeap.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h DistRoutines.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_PrepareForLeap.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h ImageOption.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_PrintData.o : Exec_PrintData.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_PrintData.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_ReadData.o : Exec_ReadData.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_ReadData.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_ReadEnsembleData.o : Exec_ReadEnsembleData.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_ReadEnsembleData.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h @@ -285,7 +286,7 @@ Exec_SequenceAlign.o : Exec_SequenceAlign.cpp Action.h ActionFrameCounter.h Acti Exec_Set.o : Exec_Set.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_StringVar.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Set.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_Show.o : Exec_Show.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_StringVar.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Show.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_SortEnsembleData.o : Exec_SortEnsembleData.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h Cph.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_PHREMD.h DataSet_PHREMD_Explicit.h DataSet_PHREMD_Implicit.h DataSet_pH.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_SortEnsembleData.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h -Exec_SplitCoords.o : Exec_SplitCoords.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_SplitCoords.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 ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h +Exec_SplitCoords.o : Exec_SplitCoords.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CompactFrameArray.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_SplitCoords.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 ParameterHolders.h ParameterSet.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_System.o : Exec_System.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_System.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_Top.o : Exec_Top.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Top.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 ParameterHolders.h ParameterSet.h ParameterTypes.h ParmFile.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h TopInfo.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h Exec_Traj.o : Exec_Traj.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Traj.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 ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Unit.h Vec3.h @@ -310,7 +311,7 @@ Frame.o : Frame.cpp Atom.h AtomMask.h Box.h Constants.h CoordinateInfo.h Cpptraj GridAction.o : GridAction.cpp ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSetList.h DataSet_3D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_GridFlt.h Dimension.h FileIO.h FileName.h Frame.h Grid.h GridAction.h GridBin.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h HistBin.o : HistBin.cpp Constants.h CpptrajStdio.h Dimension.h HistBin.h Hungarian.o : Hungarian.cpp ArrayIterator.h Constants.h CpptrajStdio.h Hungarian.h Matrix.h -ImageRoutines.o : ImageRoutines.cpp Atom.h AtomMask.h Box.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h Frame.h ImageRoutines.h ImageTypes.h Image_List.h Image_List_Mask.h Image_List_Pair.h Image_List_Pair_CoM.h Image_List_Pair_First.h Image_List_Pair_Geom.h Image_List_Unit.h Image_List_Unit_CoM.h Image_List_Unit_First.h Image_List_Unit_Geom.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Unit.h Vec3.h +ImageRoutines.o : ImageRoutines.cpp Atom.h AtomMask.h Box.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h Frame.h ImageOption.h ImageRoutines.h ImageTypes.h Image_List.h Image_List_Mask.h Image_List_Pair.h Image_List_Pair_CoM.h Image_List_Pair_First.h Image_List_Pair_Geom.h Image_List_Unit.h Image_List_Unit_CoM.h Image_List_Unit_First.h Image_List_Unit_Geom.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Unit.h Vec3.h Image_List_Mask.o : Image_List_Mask.cpp Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h Image_List.h Image_List_Mask.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Topology.h TypeNameHolder.h Unit.h Vec3.h Image_List_Pair.o : Image_List_Pair.cpp Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h Image_List.h Image_List_Pair.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h TypeNameHolder.h Unit.h Vec3.h Image_List_Unit.o : Image_List_Unit.cpp Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h Image_List.h Image_List_Unit.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h TypeNameHolder.h Unit.h Vec3.h @@ -318,8 +319,8 @@ InputTrajCommon.o : InputTrajCommon.cpp CpptrajStdio.h FileName.h InputTrajCommo KDE.o : KDE.cpp AssociatedData.h Constants.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_1D.h DataSet_double.h Dimension.h FileIO.h FileName.h HistBin.h KDE.h MetaData.h Parallel.h Range.h TextFormat.h MapAtom.o : MapAtom.cpp Atom.h MapAtom.h NameType.h SymbolExporting.h MaskArray.o : MaskArray.cpp Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h MaskArray.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h TypeNameHolder.h Unit.h Vec3.h -MaskToken.o : MaskToken.cpp ArgList.h Atom.h Box.h CpptrajStdio.h DistRoutines.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Unit.h Vec3.h -Matrix_3x3.o : Matrix_3x3.cpp Constants.h CpptrajStdio.h Matrix_3x3.h Vec3.h +MaskToken.o : MaskToken.cpp ArgList.h Atom.h CpptrajStdio.h DistRoutines.h ImageOption.h MaskToken.h Molecule.h NameType.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Unit.h +Matrix_3x3.o : Matrix_3x3.cpp Constants.h CpptrajStdio.h Matrix_3x3.h Parallel.h Vec3.h MetaData.o : MetaData.cpp CpptrajStdio.h FileName.h MetaData.h Range.h StringRoutines.h Minimize_SteepestDescent.o : Minimize_SteepestDescent.cpp ActionFrameCounter.h ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h EnergyArray.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Minimize_SteepestDescent.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h PotentialFunction.h PotentialTerm.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajectoryFile.h Trajout_Single.h TypeNameHolder.h Unit.h Vec3.h Mol.o : Mol.cpp Atom.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h MaskToken.h Matrix_3x3.h Mol.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h TypeNameHolder.h Unit.h Vec3.h @@ -358,17 +359,17 @@ RemdReservoirNC.o : RemdReservoirNC.cpp Atom.h AtomMask.h Box.h CoordinateInfo.h Residue.o : Residue.cpp NameType.h Residue.h SDFfile.o : SDFfile.cpp Atom.h CpptrajFile.h FileIO.h FileName.h NameType.h Parallel.h SDFfile.h StringRoutines.h SymbolExporting.h SimplexMin.o : SimplexMin.cpp AssociatedData.h CpptrajFile.h CpptrajStdio.h DataSet.h Dimension.h FileIO.h FileName.h MetaData.h Parallel.h Random.h Range.h SimplexMin.h TextFormat.h -SpaceGroup.o : SpaceGroup.cpp Matrix_3x3.h SpaceGroup.h Vec3.h +SpaceGroup.o : SpaceGroup.cpp Matrix_3x3.h Parallel.h SpaceGroup.h Vec3.h Spline.o : Spline.cpp CpptrajStdio.h Spline.h SplineFxnTable.o : SplineFxnTable.cpp Constants.h CpptrajStdio.h Spline.h SplineFxnTable.h StringRoutines.h StringRoutines.o : StringRoutines.cpp CpptrajStdio.h StringRoutines.h -StructureCheck.o : StructureCheck.cpp Atom.h AtomMask.h AtomType.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h ExclusionArray.h FileName.h Frame.h ImagedAction.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StructureCheck.h SymbolExporting.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h +StructureCheck.o : StructureCheck.cpp Atom.h AtomMask.h AtomType.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h ExclusionArray.h FileName.h Frame.h ImageOption.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StructureCheck.h SymbolExporting.h Timer.h Topology.h TypeNameHolder.h Unit.h Vec3.h StructureMapper.o : StructureMapper.cpp AssociatedData.h Atom.h AtomMap.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h FileIO.h FileName.h Frame.h MapAtom.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StructureMapper.h SymbolExporting.h TextFormat.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h -SymmetricRmsdCalc.o : SymmetricRmsdCalc.cpp ArrayIterator.h Atom.h AtomMap.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h FileName.h Frame.h Hungarian.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h SymmetricRmsdCalc.h Topology.h TypeNameHolder.h Unit.h Vec3.h +SymmetricRmsdCalc.o : SymmetricRmsdCalc.cpp ArrayIterator.h Atom.h AtomMap.h AtomMask.h AtomType.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h FileName.h Frame.h Hungarian.h ImageOption.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h SymmetricRmsdCalc.h Topology.h TypeNameHolder.h Unit.h Vec3.h TextFormat.o : TextFormat.cpp StringRoutines.h TextFormat.h Timer.o : Timer.cpp CpptrajStdio.h Timer.h TinkerFile.o : TinkerFile.cpp ArgList.h Atom.h AtomMask.h Box.h BufferedLine.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TinkerFile.h Unit.h Vec3.h -TopInfo.o : TopInfo.cpp AssociatedData.h Atom.h AtomMask.h AtomType.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_Coords.h Dimension.h DistRoutines.h FileIO.h FileName.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Mol.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h TopInfo.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h +TopInfo.o : TopInfo.cpp AssociatedData.h Atom.h AtomMask.h AtomType.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSet_Coords.h Dimension.h DistRoutines.h FileIO.h FileName.h Frame.h ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Mol.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h TextFormat.h TopInfo.h Topology.h TorsionRoutines.h TypeNameHolder.h Unit.h Vec3.h Topology.o : Topology.cpp Atom.h AtomMask.h AtomType.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Topology.h TypeNameHolder.h Unit.h UpdateParameters.h Vec3.h TorsionRoutines.o : TorsionRoutines.cpp Constants.h TorsionRoutines.h Vec3.h TrajFrameCounter.o : TrajFrameCounter.cpp ArgList.h CpptrajStdio.h TrajFrameCounter.h @@ -391,7 +392,7 @@ Traj_GmxXtc.o : Traj_GmxXtc.cpp ArgList.h Atom.h AtomMask.h AtomType.h BaseIOtyp Traj_Gro.o : Traj_Gro.cpp Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h BufferedLine.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h Frame.h FramePtrArray.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Topology.h Traj_Gro.h TrajectoryIO.h TypeNameHolder.h Unit.h Vec3.h Traj_Mol2File.o : Traj_Mol2File.cpp ArgList.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h Frame.h FramePtrArray.h MaskToken.h Matrix_3x3.h Mol2File.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h Traj_Mol2File.h TrajectoryIO.h TypeNameHolder.h Unit.h Vec3.h Traj_NcEnsemble.o : Traj_NcEnsemble.cpp ArgList.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h Frame.h FrameArray.h FramePtrArray.h MaskToken.h Matrix_3x3.h Molecule.h NC_Routines.h NameType.h NetcdfFile.h Parallel.h ParallelNetcdf.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h Traj_NcEnsemble.h TrajectoryIO.h TypeNameHolder.h Unit.h Vec3.h -Traj_PDBfile.o : Traj_PDBfile.cpp ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Tensor.h Dimension.h DistRoutines.h FileIO.h FileName.h Frame.h FramePtrArray.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PDBfile.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h SymmetricTensor.h TextFormat.h Timer.h Topology.h Traj_PDBfile.h TrajectoryIO.h TypeNameHolder.h Unit.h Vec3.h +Traj_PDBfile.o : Traj_PDBfile.cpp ArgList.h AssociatedData.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Tensor.h Dimension.h DistRoutines.h FileIO.h FileName.h Frame.h FramePtrArray.h ImageOption.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h PDBfile.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h SymmetricTensor.h TextFormat.h Timer.h Topology.h Traj_PDBfile.h TrajectoryIO.h TypeNameHolder.h Unit.h Vec3.h Traj_SDF.o : Traj_SDF.cpp Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h Frame.h FramePtrArray.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h SDFfile.h Segment.h SymbolExporting.h Topology.h Traj_SDF.h TrajectoryIO.h TypeNameHolder.h Unit.h Vec3.h Traj_SQM.o : Traj_SQM.cpp ArgList.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h Frame.h FramePtrArray.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Topology.h Traj_SQM.h TrajectoryIO.h TypeNameHolder.h Unit.h Vec3.h Traj_Tinker.o : Traj_Tinker.cpp Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h BufferedLine.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h Frame.h FramePtrArray.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h TinkerFile.h Topology.h Traj_Tinker.h TrajectoryIO.h TypeNameHolder.h Unit.h Vec3.h diff --git a/src/cpptrajfiles b/src/cpptrajfiles index 290bb34b1e..d69fb355dd 100644 --- a/src/cpptrajfiles +++ b/src/cpptrajfiles @@ -2,7 +2,6 @@ # differently for each will go into SOURCES/LIBCPPTRAJ_OBJECTS respectively. COMMON_SOURCES= \ SpaceGroup.cpp \ - Action.cpp \ ActionFrameCounter.cpp \ ActionList.cpp \ ActionTopWriter.cpp \ @@ -142,6 +141,7 @@ COMMON_SOURCES= \ AxisType.cpp \ BondSearch.cpp \ Box.cpp \ + BoxArgs.cpp \ BufferedFrame.cpp \ BufferedLine.cpp \ ByteRoutines.cpp \ @@ -162,6 +162,7 @@ COMMON_SOURCES= \ Cmd.cpp \ CmdInput.cpp \ CmdList.cpp \ + CompactFrameArray.cpp \ ComplexArray.cpp \ Constraints.cpp \ ControlBlock_For.cpp \ diff --git a/src/cuda_kernels/kernel_wrappers.cu b/src/cuda_kernels/kernel_wrappers.cu index 7e2a9fc156..9c827fd481 100644 --- a/src/cuda_kernels/kernel_wrappers.cu +++ b/src/cuda_kernels/kernel_wrappers.cu @@ -1,7 +1,7 @@ #ifdef DEBUG_CUDA #include #endif -#include "../DistRoutines.h" +#include "../ImageOption.h" #define BLOCKDIM 512 @@ -31,7 +31,7 @@ __global__ void kClosestDistsToAtoms_Nonortho(double*,const double*,const double * \param recip Fractional cell matrix. */ void Action_Closest_Center(const double *SolventMols_, double *D_, const double* maskCenter, - double maxD, int NMols, int NAtoms, ImagingType type, + double maxD, int NMols, int NAtoms, ImageOption::Type type, const double* box, const double* ucell, const double* recip) { #ifdef DEBUG_CUDA @@ -52,12 +52,12 @@ void Action_Closest_Center(const double *SolventMols_, double *D_, const double* cudaMalloc(((void **)(&devI2Ptr)),NMols * NAtoms * 3 * sizeof(double )); cudaMemcpy(devI2Ptr,SolventMols_,NMols * NAtoms * 3 * sizeof(double ),cudaMemcpyHostToDevice); - if (type == ORTHO) + if (type == ImageOption::ORTHO) { cudaMalloc(((void**)(&boxDev)), 3 * sizeof(double)); cudaMemcpy(boxDev,box, 3 * sizeof(double), cudaMemcpyHostToDevice); } - if (type == NONORTHO) + if (type == ImageOption::NONORTHO) { cudaMalloc(((void**)(&ucellDev)), 9 * sizeof(double)); cudaMalloc(((void**)(&recipDev)), 9 * sizeof(double)); @@ -84,13 +84,13 @@ void Action_Closest_Center(const double *SolventMols_, double *D_, const double* #endif switch (type) { - case NOIMAGE: + case ImageOption::NO_IMAGE: kClosestDistsToPt_NoImage<<>>(devO1Ptr,devI1Ptr, devI2Ptr, maxD, NMols, NAtoms,active_size); break; - case ORTHO: + case ImageOption::ORTHO: kClosestDistsToPt_Ortho<<>>(devO1Ptr,devI1Ptr, devI2Ptr, maxD,boxDev, NMols, NAtoms,active_size); break; - case NONORTHO: + case ImageOption::NONORTHO: kClosestDistsToPt_Nonortho<<>>(devO1Ptr,devI1Ptr, devI2Ptr, maxD,ucellDev, recipDev, NMols, NAtoms,active_size); } @@ -108,9 +108,9 @@ void Action_Closest_Center(const double *SolventMols_, double *D_, const double* cudaFree(devO1Ptr); cudaFree(devI1Ptr); cudaFree(devI2Ptr); - if (type == ORTHO) + if (type == ImageOption::ORTHO) cudaFree(boxDev); - if (type == NONORTHO) + if (type == ImageOption::NONORTHO) { cudaFree(ucellDev); cudaFree(recipDev); @@ -132,7 +132,7 @@ void Action_Closest_Center(const double *SolventMols_, double *D_, const double* * \param recip Fractional cell matrix. */ void Action_Closest_NoCenter(const double *SolventMols_, double *D_, const double *Solute_atoms, - double maxD, int NMols, int NAtoms, int NSAtoms, ImagingType type, + double maxD, int NMols, int NAtoms, int NSAtoms, ImageOption::Type type, const double* box, const double* ucell, const double* recip) { #ifdef DEBUG_CUDA @@ -153,12 +153,12 @@ void Action_Closest_NoCenter(const double *SolventMols_, double *D_, const doubl cudaMalloc(((void **)(&devI3Ptr)), NSAtoms * 3 * sizeof(double )); cudaMemcpy(devI3Ptr,Solute_atoms,NSAtoms * 3 * sizeof(double ),cudaMemcpyHostToDevice); - if (type == ORTHO) + if (type == ImageOption::ORTHO) { cudaMalloc(((void**)(&boxDev)), 3 * sizeof(double)); cudaMemcpy(boxDev,box, 3 * sizeof(double), cudaMemcpyHostToDevice); } - if (type == NONORTHO) + if (type == ImageOption::NONORTHO) { cudaMalloc(((void**)(&ucellDev)), 9 * sizeof(double)); cudaMalloc(((void**)(&recipDev)), 9 * sizeof(double)); @@ -185,13 +185,13 @@ void Action_Closest_NoCenter(const double *SolventMols_, double *D_, const doubl #endif switch (type) { - case NOIMAGE: + case ImageOption::NO_IMAGE: kClosestDistsToAtoms_NoImage<<>>(devO1Ptr, devI2Ptr,devI3Ptr, maxD, NMols, NAtoms,NSAtoms,active_size); break; - case ORTHO: + case ImageOption::ORTHO: kClosestDistsToAtoms_Ortho<<>>(devO1Ptr, devI2Ptr,devI3Ptr, maxD, boxDev, NMols, NAtoms,NSAtoms,active_size); break; - case NONORTHO: + case ImageOption::NONORTHO: kClosestDistsToAtoms_Nonortho<<>>(devO1Ptr, devI2Ptr,devI3Ptr, maxD, ucellDev, recipDev, NMols, NAtoms,NSAtoms,active_size); break; } @@ -210,9 +210,9 @@ void Action_Closest_NoCenter(const double *SolventMols_, double *D_, const doubl cudaFree(devO1Ptr); cudaFree(devI2Ptr); cudaFree(devI3Ptr); - if (type == ORTHO) + if (type == ImageOption::ORTHO) cudaFree(boxDev); - if (type == NONORTHO) + if (type == ImageOption::NONORTHO) { cudaFree(ucellDev); cudaFree(recipDev); diff --git a/test/MasterTest.sh b/test/MasterTest.sh index 79d6d8e56f..77290a766e 100644 --- a/test/MasterTest.sh +++ b/test/MasterTest.sh @@ -75,6 +75,8 @@ CHECKERR=0 # Total errors this test from CheckEnv routine. TESTNAME='' # Current test name for Requires routine. UNITNAME='' # Current unit name for CheckFor routine. DESCRIP='' # Current test/unit name for CheckEnv routine. +FNC1='' # First file to NcTest(); for output in DoTest() +FNC2='' # Second file to NcTest(); for output in DoTest() # ============================================================================== # TestHeader() @@ -155,6 +157,14 @@ DoTest() { # First two arguments are files to compare. F1=$1 ; shift F2=$1 ; shift + # Names for output + if [ "$F1" = 'nc0.save' -a "$F2" = 'nc0' ] ; then + FNAME1=$FNC1 + FNAME2=$FNC2 + else + FNAME1=$F1 + FNAME2=$F2 + fi # Process remaining arguments. USE_NDIFF=0 while [ ! -z "$1" ] ; do @@ -171,7 +181,7 @@ DoTest() { else if [ ! -z "$CPPTRAJ_DACDIF" ] ; then # Print AT test header. - echo "diffing $F1 with $F2" + echo "diffing $FNAME1 with $FNAME2" fi if [ $USE_NDIFF -eq 0 ] ; then $CPPTRAJ_DIFF $DIFFARGS $DIFFOPTS $F1 $F2 > temp.diff 2>&1 @@ -180,21 +190,21 @@ DoTest() { fi if [ -s 'temp.diff' ] ; then if [ -z "$CPPTRAJ_DACDIF" ] ; then - OutBoth " $F1 $F2 are different." + OutBoth " $FNAME1 $FNAME2 are different." cat temp.diff >> $CPPTRAJ_TEST_ERROR else - mv temp.diff $F2.dif - echo "possible FAILURE: check $F2.dif" - echo "possible FAILURE: check $F2.dif" >> $CPPTRAJ_TEST_ERROR + mv temp.diff $FNAME2.dif + echo "possible FAILURE: check $FNAME2.dif" + echo "possible FAILURE: check $FNAME2.dif" >> $CPPTRAJ_TEST_ERROR echo "$TEST_WORKDIR" >> $CPPTRAJ_TEST_ERROR - cat $F2.dif >> $CPPTRAJ_TEST_ERROR + cat $FNAME2.dif >> $CPPTRAJ_TEST_ERROR echo "---------------------------------------" >> $CPPTRAJ_TEST_ERROR fi ((ERRCOUNT++)) else if [ -z "$CPPTRAJ_DACDIF" ] ; then # Standalone pass. - OUT " $F2 OK." + OUT " $FNAME2 OK." else # AmberTools pass. echo "PASSED" @@ -219,8 +229,8 @@ NcTest() { exit 1 fi # Save remaining args for DoTest - F1=$1 - F2=$2 + FNC1=$1 + FNC2=$2 shift shift DIFFARGS="nc0.save nc0" @@ -232,7 +242,7 @@ NcTest() { DIFFARGS=$DIFFARGS" $1" shift done - CheckTestFiles $F1 $F2 + CheckTestFiles $FNC1 $FNC2 if [ $? -ne 0 ] ; then ((NUMCOMPARISONS++)) ((ERRCOUNT++)) @@ -243,11 +253,11 @@ NcTest() { # the regular expression to ndiff.awk FS without the interpreter giving # this error for FS='[ \t,()]': # awk: fatal: Invalid regular expression: /'[/ - $CPPTRAJ_NCDUMP -n nctest $F1 | grep -v "==>\|:program" | sed 's/,/ /g' > nc0.save - $CPPTRAJ_NCDUMP -n nctest $F2 | grep -v "==>\|:program" | sed 's/,/ /g' > nc0 + $CPPTRAJ_NCDUMP -n nctest $FNC1 | grep -v "==>\|:program" | sed 's/,/ /g' > nc0.save + $CPPTRAJ_NCDUMP -n nctest $FNC2 | grep -v "==>\|:program" | sed 's/,/ /g' > nc0 else - $CPPTRAJ_NCDUMP -n nctest $F1 | grep -v "==>\|:program" > nc0.save - $CPPTRAJ_NCDUMP -n nctest $F2 | grep -v "==>\|:program" > nc0 + $CPPTRAJ_NCDUMP -n nctest $FNC1 | grep -v "==>\|:program" > nc0.save + $CPPTRAJ_NCDUMP -n nctest $FNC2 | grep -v "==>\|:program" > nc0 fi DoTest $DIFFARGS $CPPTRAJ_RM nc0.save nc0 diff --git a/test/Test_Align/RunTest.sh b/test/Test_Align/RunTest.sh index 68ce1636b4..141c545a98 100755 --- a/test/Test_Align/RunTest.sh +++ b/test/Test_Align/RunTest.sh @@ -3,7 +3,7 @@ . ../MasterTest.sh # Clean -CleanFiles rms.in rmsd.dat rmsd.mass.dat rmsd.reftraj.dat +CleanFiles rms.in rmsd.dat rmsd.mass.dat rmsd.reftraj.dat report.?.dat TESTNAME='Align tests' Requires netcdf maxthreads 10 @@ -28,6 +28,18 @@ DoTest ../Test_RMSD/rmsd.dat.save rmsd.dat DoTest ../Test_RMSD/rmsd.mass.dat.save rmsd.mass.dat DoTest ../Test_RMSD/rmsd.reftraj.dat.save rmsd.reftraj.dat +# Check before and after alignment should be the same +cat > rms.in < check.in < check.in < create.in < create.in < create.in < create.in < dist.in < dist.in < gist.in < gist.in < gist.in < hbond.in < nc.in < $in < $in < $in < rms.in < radial.in < radial.in < :5@CD" +@target G0.S0 +@type xy + 0.250 0.000000 + 0.750 0.000000 + 1.250 0.000000 + 1.750 0.000000 + 2.250 0.000000 + 2.750 0.000000 + 3.250 0.809089 + 3.750 1.148470 + 4.250 0.368295 + 4.750 0.568751 + 5.250 0.569132 + 5.750 0.920273 + 6.250 0.535559 + 6.750 0.490499 + 7.250 0.768983 + 7.750 0.728417 + 8.250 0.859430 + 8.750 0.739195 + 9.250 0.767072 + 9.750 0.805504 + 10.250 0.742431 + 10.750 0.810806 + 11.250 0.849333 + 11.750 0.899177 + 12.250 0.786077 + 12.750 0.948015 + 13.250 0.972652 + 13.750 0.968620 + 14.250 0.972120 + 14.750 1.051636 + 15.250 0.957224 + 15.750 0.977955 + 16.250 0.952930 + 16.750 0.929105 + 17.250 0.994324 + 17.750 1.022138 + 18.250 0.948334 + 18.750 0.925495 + 19.250 0.783051 + 19.750 0.803663 diff --git a/test/Test_Radial/WatO-Trp.volume.agr.save b/test/Test_Radial/WatO-Trp.volume.agr.save new file mode 100644 index 0000000000..cd11507fad --- /dev/null +++ b/test/Test_Radial/WatO-Trp.volume.agr.save @@ -0,0 +1,28 @@ +@with g0 +@ xaxis label "Distance (Ang)" +@ yaxis label "" +@ legend 0.2, 0.995 +@ legend char size 0.60 +@ s0 legend ":WAT@O => :TRP" +@target G0.S0 +@type xy + 0.250 0.000000 + 0.750 0.000000 + 1.250 0.000000 + 1.750 0.032149 + 2.250 0.057474 + 2.750 0.242166 + 3.250 0.366266 + 3.750 0.496398 + 4.250 0.507767 + 4.750 0.514473 + 5.250 0.533186 + 5.750 0.577641 + 6.250 0.613773 + 6.750 0.665082 + 7.250 0.707213 + 7.750 0.725302 + 8.250 0.778697 + 8.750 0.810055 + 9.250 0.851482 + 9.750 0.884541 diff --git a/test/Test_Radial/noimage.WatO-Glu5CD.agr.save b/test/Test_Radial/noimage.WatO-Glu5CD.agr.save new file mode 100644 index 0000000000..02335e86f3 --- /dev/null +++ b/test/Test_Radial/noimage.WatO-Glu5CD.agr.save @@ -0,0 +1,48 @@ +@with g0 +@ xaxis label "Distance (Ang)" +@ yaxis label "" +@ legend 0.2, 0.995 +@ legend char size 0.60 +@ s0 legend ":WAT@O => :5@CD" +@target G0.S0 +@type xy + 0.250 0.000000 + 0.750 0.000000 + 1.250 0.000000 + 1.750 0.000000 + 2.250 0.000000 + 2.750 0.000000 + 3.250 0.809089 + 3.750 1.148470 + 4.250 0.368295 + 4.750 0.568751 + 5.250 0.569132 + 5.750 0.920273 + 6.250 0.535559 + 6.750 0.490499 + 7.250 0.768983 + 7.750 0.728417 + 8.250 0.859430 + 8.750 0.739195 + 9.250 0.767072 + 9.750 0.805504 + 10.250 0.742431 + 10.750 0.810806 + 11.250 0.849333 + 11.750 0.899177 + 12.250 0.786077 + 12.750 0.948015 + 13.250 0.972652 + 13.750 0.968620 + 14.250 0.967435 + 14.750 1.034145 + 15.250 0.904044 + 15.750 0.920428 + 16.250 0.870066 + 16.750 0.864678 + 17.250 0.890415 + 17.750 0.883236 + 18.250 0.832649 + 18.750 0.813191 + 19.250 0.659817 + 19.750 0.702443