24#include <boost/lexical_cast.hpp> 
   55  std::cout << 
"begin to calculate distribution functions\n";
 
   56  std::cout << 
"# of bonded interactions: " << 
bonded_.size() << std::endl;
 
   57  std::cout << 
"# of non-bonded interactions: " << 
nonbonded_.size()
 
   61    throw std::runtime_error(
 
   62        "No interactions defined in options xml-file - nothing to be done");
 
 
   73  Eigen::Matrix3d box = top->
getBox();
 
   74  boxc_ = box.rowwise().sum() / 2.0;
 
   76  std::cout << 
"Using center of box: " << 
boxc_ << std::endl;
 
   84    std::string name = prop->get(
"name").value();
 
   91    allbeads1.
Generate(*top, prop->get(
"type1").value());
 
   92    allbeads2.
Generate(*top, prop->get(
"type2").value());
 
   94    if (allbeads1.
size() == 0) {
 
   95      throw std::runtime_error(
"Topology does not have beads of type \"" +
 
   96                               prop->get(
"type1").value() +
 
   98                               "This was specified in type1 of interaction \"" +
 
  101    if (allbeads2.
size() == 0) {
 
  102      throw std::runtime_error(
"Topology does not have beads of type \"" +
 
  103                               prop->get(
"type2").value() +
 
  105                               "This was specified in type2 of interaction \"" +
 
  111      std::cout << 
"Volume correction on" << std::endl;
 
  114      std::cout << 
"Volume correction off" << std::endl;
 
 
  121  std::string name = p->
get(
"name").
value();
 
  126  auto inter = std::make_unique<interaction_t>();
 
 
  157    throw std::runtime_error(
 
  158        "no frames were processed. Please check your input");
 
 
  183    interaction_.second->average_.Clear();
 
  187    group_.second->corr_.setZero();
 
 
  194                     Eigen::Vector3d boxc, 
bool do_vol_corr)
 
 
  208      double dr = (b1->
Pos() - 
boxc_).norm();
 
  213        hist_->Process(dist);
 
  217      hist_->Process(dist);
 
 
 
  233    std::string name = prop->
get(
"name").
value();
 
  256    std::unique_ptr<NBList> nb;
 
  258    bool gridsearch = 
true;
 
  261      if (
rdfcalculator_->options_.get(
"cg.nbsearch").as<std::string>() ==
 
  265                     .as<std::string>() == 
"simple") {
 
  268        throw std::runtime_error(
"cg.nbsearch invalid, can be grid or simple");
 
  272      nb = std::make_unique<NBListGrid>();
 
  274      nb = std::make_unique<NBList>();
 
  289      nb->Generate(beads1);
 
  291      nb->Generate(beads1, beads2);
 
 
  303    std::string name = prop->
get(
"name").
value();
 
  313    for (
auto ic : vec) {
 
  314      double v = ic->EvaluateVar(*top);
 
 
  322  std::map<std::string, std::unique_ptr<group_t>>::iterator iter;
 
  325    return (
groups_[name] = std::make_unique<group_t>()).get();
 
  327  return (*iter).second.get();
 
 
  336    Table &t = interaction_.second->average_.data();
 
  339    interaction_.second->norm_ /=
 
  340        (interaction_.second->avg_beadlist_1_count_.getAvg() *
 
  341         interaction_.second->avg_beadlist_2_count_.getAvg());
 
  342    dist.
y() = 
avg_vol_.getAvg() * interaction_.second->norm_ *
 
  343               dist.
y().cwiseQuotient(dist.
x().cwiseAbs2());
 
  345    dist.
Save((interaction_.first) + suffix + 
".dist.new");
 
  346    std::cout << 
"written " << (interaction_.first) + suffix + 
".dist.new\n";
 
  348    std::cout << 
"Avg. number of particles in subvol for " 
  349              << (interaction_.first) << std::endl;
 
  350    std::cout << 
"beadlist 1: " 
  351              << interaction_.second->avg_beadlist_1_count_.getAvg()
 
  353    std::cout << 
"beadlist 2: " 
  354              << interaction_.second->avg_beadlist_2_count_.getAvg()
 
  358  std::cout << 
"Volume used for normalization: " << 
avg_vol_.getAvg()
 
 
  363  auto worker = std::make_unique<RDFCalculator::Worker>();
 
  366  worker->rdfcalculator_ = 
this;
 
  370    worker->current_hists_[i->
index_].Initialize(
 
 
  398          std::string(
"_") + boost::lexical_cast<std::string>(
nblock_);
 
 
virtual Eigen::Vector3d & Pos()
Index Generate(Topology &top, const std::string &select)
Select all beads of type "select".
Index GenerateInSphericalSubvolume(Topology &top, const std::string &select, Eigen::Vector3d ref, double radius)
Select all beads of type "select" withn a radius "radius" of reference vector "ref".
Worker, derived from Thread, does the work.
bool FoundPair(Bead *b1, Bead *, const Eigen::Vector3d &, const double dist)
double SurfaceRatio(double dist, double r)
IMCNBSearchHandler(HistogramNew *hist, double subvol_rad, Eigen::Vector3d boxc, bool do_vol_corr)
double cur_beadlist_2_count_
void DoNonbonded(Topology *top)
process non-bonded interactions for given frame
void DoBonded(Topology *top)
process bonded interactions for given frame
void EvalConfiguration(Topology *top, Topology *top_atom) override
evaluate current conformation
double cur_beadlist_1_count_
RDFCalculator * rdfcalculator_
std::vector< HistogramNew > current_hists_
std::unique_ptr< CsgApplication::Worker > ForkWorker()
std::vector< Property * > nonbonded_
list of non-bonded interactions
Average< double > avg_vol_
interaction_t * AddInteraction(Property *p)
create a new interaction entry based on given options
std::vector< Property * > bonded_
list of bonded interactions
void BeginEvaluate(Topology *top, Topology *top_atom)
begin coarse graining a trajectory
void EndEvaluate()
end coarse graining a trajectory
std::map< std::string, std::unique_ptr< interaction_t > > interactions_
std::map ineteractionm-name to interaction
void WriteDist(const std::string &suffix="")
Property options_
the options parsed from cg definition file
std::map< std::string, std::unique_ptr< group_t > > groups_
std::map group-name to group
bool processed_some_frames_
void LoadOptions(const std::string &file)
load cg definitions file
void MergeWorker(CsgApplication::Worker *worker_)
group_t * getGroup(const std::string &name)
get group by name, creates one if it doesn't exist
topology of the whole system
std::vector< Interaction * > InteractionsInGroup(const std::string &group)
const Eigen::Matrix3d & getBox() const
Provides a means for comparing floating point numbers.
struct to store collected information for groups (e.g. crosscorrelations)
std::list< interaction_t * > interactions_
struct to store collected information for interactions
Average< double > avg_beadlist_2_count_
Average< double > avg_beadlist_1_count_