23#include <boost/format.hpp>
35 out_.open(file, std::ios_base::app);
42 if (header.size() < 10 || header.substr(0, 10) !=
"HEADER ") {
46 if (header.back() !=
'\n') {
55 out_ << boost::format(
"MODEL %1$4d\n") % (conf->
getStep() + 1)
59 out_ <<
"ENDMDL" << std::endl;
63 boost::format boxfrmt(
"CRYST1%1$9.3f%2$9.3f%3$9.3f%4$7.2f%5$7.2f%6$7.2f\n");
64 double a = box.col(0).norm();
65 double b = box.col(1).norm();
66 double c = box.col(2).norm();
68 180 /
tools::conv::Pi * std::acos(box.col(1).dot(box.col(2)) / (b * c));
70 180 /
tools::conv::Pi * std::acos(box.col(0).dot(box.col(2)) / (a * c));
72 180 /
tools::conv::Pi * std::acos(box.col(0).dot(box.col(1)) / (a * b));
73 out_ << boxfrmt % a % b % c % alpha % beta % gamma;
78 Eigen::Vector3d r = 10 * bead.
getPos();
79 boost::format beadfrmt(
80 "HETATM%1$5d %2$4s %3$3s %4$1s%5$4d %6$8.3f%7$8.3f%8$8.3f\n");
81 Eigen::Vector3d ru = 0.1 * bead.
getU() + r;
83 out_ << beadfrmt % (bead.
getId() + 1) % 100000
88 % ru.x() % ru.y() % ru.z();
91 Eigen::Vector3d rv = 0.1 * bead.
getV() + r;
92 out_ << beadfrmt % (bead.
getId() + 1) % 100000
97 % rv.x() % rv.y() % rv.z();
virtual const Eigen::Vector3d & getPos() const
std::string getName() const
Gets the name of the bead.
Index getId() const noexcept
Gets the id of the bead.
const Eigen::Vector3d & getU() const
get first orientation (normal vector) vector of bead
const Index & getResnr() const
const Eigen::Vector3d & getV() const
get second orientation vector of bead
Symmetry getSymmetry() const
std::string getResname(T &container, Atom &)
void writeSymmetry(Atom &)
void WriteHeader(std::string header)
void WriteBox(const Eigen::Matrix3d &box)
void Write(Topology *conf) override
void WriteContainer(T &container)
void Open(std::string file, bool bAppend=false) override
const std::string & getName() const
get the name of the residue
topology of the whole system
Index ResidueCount() const
Residue & getResidue(const Index i)
base class for all analysis tools