21#include <boost/lexical_cast.hpp>
84 std::cout <<
"Removing periodic box. Creating new... " << std::endl;
104 const Eigen::Matrix3d &box) {
110 if (box.isApproxToConstant(0)) {
111 std::cout <<
"WARNING: No box vectors specified in trajectory."
112 "Using open-box boundary conditions. "
117 else if ((box - Eigen::Matrix3d(box.diagonal().asDiagonal()))
118 .isApproxToConstant(0)) {
130 const Eigen::Vector3d &r2)
const {
131 return bc_->BCShortestConnection(r1, r2);
136 double R2 = std::numeric_limits<double>::max();
137 for (
const Atom &atom1 : seg1) {
138 for (
const Atom &atom2 : seg2) {
146 return std::sqrt(R2);
153 std::vector<Index> common_elements;
154 std::set_intersection(ids1.begin(), ids1.end(), ids2.begin(), ids2.end(),
155 std::back_inserter(common_elements));
156 std::vector<const Segment *> results;
157 if (common_elements.empty() || common_elements.size() > 1) {
160 Index molid = common_elements[0];
163 if (std::find(seg.getMoleculeIds().begin(), seg.getMoleculeIds().end(),
164 molid) != seg.getMoleculeIds().end()) {
165 results.push_back(&seg);
174 writer.
Open(filename,
false);
208 for (
Index i = 0; i < count; i++) {
void WriteHeader(std::string header)
void WriteBox(const Eigen::Matrix3d &box)
void WriteContainer(T &container)
void Open(std::string file, bool bAppend=false) override
Index getNumDataSets() const
CheckpointReader openChild(const std::string &childName) const
CheckpointWriter openChild(const std::string &childName) const
void ReadFromCpt(CheckpointReader &r, const std::vector< Segment > &segments)
void WriteToCpt(CheckpointWriter &w) const
QMPair & Add(const Segment &seg1, const Segment &seg2, const Eigen::Vector3d &r)
const std::vector< Index > & getMoleculeIds() const
Container for segments and box and atoms.
void WriteToCpt(CheckpointWriter &w) const
std::unique_ptr< csg::BoundaryCondition > bc_
Segment & AddSegment(std::string segment_name)
std::vector< Segment > segments_
Eigen::Vector3d PbShortestConnect(const Eigen::Vector3d &r1, const Eigen::Vector3d &r2) const
void setBox(const Eigen::Matrix3d &box, csg::BoundaryCondition::eBoxtype boxtype=csg::BoundaryCondition::typeAuto)
std::vector< const Segment * > FindAllSegmentsOnMolecule(const Segment &seg1, const Segment &seg2) const
csg::BoundaryCondition::eBoxtype AutoDetectBoxType(const Eigen::Matrix3d &box)
const Eigen::Matrix3d & getBox() const
void ReadFromCpt(CheckpointReader &r)
void WriteToPdb(std::string filename) const
Topology & operator=(const Topology &top)
double GetShortestDist(const Segment &seg1, const Segment &seg2) const
static constexpr int topology_version()
base class for all analysis tools