39 out <<
"Calculates the orientational correlation function\n"
40 "<3/2*u(0)*u(r) - 1/2>\n"
41 "for a polymer melt, where u is the vector pointing along a bond "
43 "r the distance between bond segments (centered on middle of "
45 "The output is correlation.dat (with intra-molecular contributions) "
47 "correlation_excl.dat, where inter-molecular contributions are "
65 std::unique_ptr<CsgApplication::Worker>
ForkWorker(
void)
override;
108int main(
int argc,
char **argv) {
110 return app.
Exec(argc, argv);
120 boost::program_options::value<double>(&
cut_off_)->default_value(1.0),
121 "cutoff for the neighbor search")(
123 boost::program_options::value<votca::Index>(&
nbins_)->default_value(40),
124 "number of bins for the grid")(
126 boost::program_options::value<string>(&
nbmethod_)->default_value(
"grid"),
127 "neighbor search algorithm (simple or "
133 return std::make_unique<NBList>();
136 return std::make_unique<NBListGrid>();
139 throw std::runtime_error(
140 "unknown neighbor search method, use simple or grid");
154 auto worker = std::make_unique<MyWorker>();
156 worker->cor_.Initialize(0, worker->cut_off_,
nbins_);
157 worker->count_.Initialize(0, worker->cut_off_,
nbins_);
158 worker->cor_excl_.Initialize(0, worker->cut_off_,
nbins_);
159 worker->count_excl_.Initialize(0, worker->cut_off_,
nbins_);
170 cout <<
"generating mapped topology...";
176 for (
const auto &mol_src : top->
Molecules()) {
180 for (
votca::Index i = 0; i < mol_src.BeadCount() - 1; ++i) {
182 string bead_type =
"A";
188 Eigen::Vector3d p1 = mol_src.getBead(i)->
getPos();
189 Eigen::Vector3d p2 = mol_src.getBead(i + 1)->getPos();
191 Eigen::Vector3d pos = 0.5 * (p1 + p2);
193 Eigen::Vector3d v = p2 - p1;
225 double tmp = b1->
getV().dot(b2->
getV());
226 double P2 = 3. / 2. * tmp * tmp - 0.5;
void EvalConfiguration(Topology *top, Topology *top_ref) override
overload with the actual computation
votca::tools::HistogramNew count_excl_
bool FoundPair(Bead *b1, Bead *b2, const Eigen::Vector3d &r, const double dist)
~MyWorker() override=default
votca::tools::HistogramNew cor_excl_
votca::tools::HistogramNew count_
votca::tools::HistogramNew cor_
string ProgramName() override
program name
void Initialize() override
Initialize application data.
bool SynchronizeThreads() override
void MergeWorker(Worker *worker) override
void HelpText(ostream &out) override
help text of application without version information
bool DoThreaded() override
void BeginEvaluate(Topology *top, Topology *top_ref) override
called before the first frame
bool DoTrajectory() override
overload and return true to enable trajectory command line options
static std::unique_ptr< NBList > CreateNBSearch()
votca::tools::HistogramNew cor_excl_
std::unique_ptr< CsgApplication::Worker > ForkWorker(void) override
void EndEvaluate() override
called after the last frame
votca::tools::HistogramNew cor_
votca::tools::HistogramNew count_
votca::tools::HistogramNew count_excl_
virtual const Eigen::Vector3d & getPos() const
virtual void setPos(const Eigen::Vector3d &bead_position)
Index getMoleculeId() const noexcept
Get the id of the molecule the bead is a part of, if the molecule id has not been set return topology...
Index Generate(Topology &top, const std::string &select)
Select all beads of type "select".
const Eigen::Vector3d & getV() const
get second orientation vector of bead
void setV(const Eigen::Vector3d &v)
set second orientation vector of bead
Worker, derived from Thread, does the work.
void Initialize() override
Initialize application data.
information about molecules
void AddBead(Bead *bead, const std::string &name)
Add a bead to the molecule.
topology of the whole system
void setBox(const Eigen::Matrix3d &box, BoundaryCondition::eBoxtype boxtype=BoundaryCondition::typeAuto)
bool BeadTypeExist(std::string type) const
Determine if a bead type exists.
const Eigen::Matrix3d & getBox() const
Bead * CreateBead(Bead::Symmetry symmetry, std::string name, std::string type, Index resnr, double m, double q)
Creates a new Bead.
void RegisterBeadType(std::string type)
Register the bead type with the topology object.
Molecule * CreateMolecule(std::string name)
Creates a new molecule.
MoleculeContainer & Molecules()
int main(int argc, char **argv)