25#include <boost/program_options.hpp>
26#include <boost/tokenizer.hpp>
45 out <<
"!! EXPERIMENTAL !! Calculate spherical order parameter.\n"
46 " Needs non-spherical beads in mapping.\n\n";
53 boost::program_options::value<string>(&
filter_)->default_value(
"*"),
54 "filter molecule names")(
58 "radial cutoff: distance from center where bead is considered")(
60 boost::program_options::value<double>(&
minrad_)->default_value(0.0),
61 "minimal distance a parcle has to be apart from center to be "
64 boost::program_options::value<string>(&
refmol_)->default_value(
""),
65 "Reference molecule")(
67 boost::program_options::value<double>(&
rbinw_)->default_value(0),
68 "Do multiple r_bins multiple histograms");
94 throw runtime_error(
" radialcut_ > 0 has to be specified");
101 throw runtime_error(
"cannot open hist_u.xvg for output");
105 throw runtime_error(
"cannot open hist_v.xvg for output");
109 throw runtime_error(
"cannot open hist_w.xvg for output");
114 Eigen::Matrix3d box = top->
getBox();
115 Eigen::Vector3d a = box.col(0);
119 ref_ = box.rowwise().sum() / 2;
121 cout <<
"Refernce is center of box " <<
ref_ << endl;
127 cout <<
"radial bins " <<
rbins_ << endl;
130 cout <<
"considering atoms between " <<
minrad_ <<
" and "
143 cout <<
"Average number of molecules within cutoff " << endl;
145 cout << (double)i *
rbinw_ <<
" " << (
double)
nmol_[i] / (double)
n_
149 double exp_value = 1.0 / (double)
nbin_;
150 double orderparam = 0;
165 orderparam += (
hist_u_(0, n) - exp_value) * (
hist_u_(0, n) - exp_value);
168 orderparam = sqrt(orderparam / (
double)
nbin_);
170 cout <<
"Orderparam " <<
radialcutoff_ <<
" " << orderparam << endl;
181 Eigen::Vector3d u, v, w;
184 for (
const auto &bead : conf->
Beads()) {
186 ref_ = bead.getPos();
191 for (
const auto &bead : conf->
Beads()) {
199 eR = bead.getPos() -
ref_;
259int main(
int argc,
char **argv) {
261 return app.
Exec(argc, argv);
string ProgramName() override
program name
bool EvaluateOptions() override
Process command line options.
bool DoMapping() override
overload and return true to enable mapping command line options
void EndEvaluate() override
called after the last frame
bool DoTrajectory() override
overload and return true to enable trajectory command line options
void Initialize() override
Initialize application data.
void setOut(const string &filename)
void BeginEvaluate(Topology *top, Topology *) override
called before the first frame
void EvalConfiguration(Topology *conf, Topology *=nullptr) override
void HelpText(ostream &out) override
help text of application without version information
void setFilter(const string &filter)
bool EvaluateOptions() override
Process command line options.
void Initialize() override
Initialize application data.
topology of the whole system
const Eigen::Matrix3d & getBox() const
int main(int argc, char **argv)