votca 2024-dev
Loading...
Searching...
No Matches
partial_rdf.cc
Go to the documentation of this file.
1/*
2 * Copyright 2009 The VOTCA Development Team (http://www.votca.org)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18// Standard includes
19#include <fstream>
20#include <iostream>
21
22// Third party includes
23#include <boost/program_options.hpp>
24
25// Local VOTCA includes
26#include <votca/csg/cgengine.h>
27#include <votca/csg/version.h>
28
29// Local internal includes
30#include "rdf_calculator.h"
31
32using namespace std;
33using namespace votca::csg;
34using namespace votca::tools;
35
36#include <cstdlib>
38
39// using namespace votca::tools;
40using namespace std;
41using namespace votca::csg;
42
44 public:
46
47 string ProgramName() override { return "csg_partial_rdf"; }
48 void HelpText(ostream &out) override;
49
50 bool DoTrajectory() override { return true; }
51 bool DoMapping() override { return true; }
52 bool DoMappingDefault(void) override { return false; }
53 bool DoThreaded() override { return true; }
54 bool SynchronizeThreads() override { return true; }
55 void Initialize() override;
56 bool EvaluateOptions() override;
57
58 void BeginEvaluate(Topology *top, Topology *top_ref) override;
59 void EndEvaluate() override;
60
61 std::unique_ptr<CsgApplication::Worker> ForkWorker() override {
63 }
64
65 void MergeWorker(CsgApplication::Worker *worker) override {
67 }
68
69 public:
72};
73
74void CsgPartialRdfApp::HelpText(ostream &out) {
75 out << "Calculate spatially confined rdfs";
76}
77
80 AddProgramOptions("Specific options")("options",
81 boost::program_options::value<string>(),
82 " options file defining the rdfs")(
83 "subvolume_radius", boost::program_options::value<double>(),
84 "Rdf calc. in spherical subvolume of this radius (from center of box)")(
85 "do-vol-corr", "Correct for subvolume truncation in rdf")(
86 "write-every", boost::program_options::value<votca::Index>(&write_every_),
87 " (UNIMPLEMENTED) write after every block of this length, "
88 "if --blocking is set, the averages are cleared after every output")(
89 "do-blocks", " write output for blocking analysis");
90}
91
94 CheckRequired("options");
95 CheckRequired("subvolume_radius");
96 CheckRequired("trj", "no trajectory file specified");
97
98 rdf_calculator_.LoadOptions(OptionsMap()["options"].as<string>());
99
101 OptionsMap()["subvolume_radius"].as<double>());
102
104 if (OptionsMap().count("do-blocks")) {
106 }
107
108 if (OptionsMap().count("do-vol-corr")) {
110 }
111
113 return true;
114}
115
117 rdf_calculator_.BeginEvaluate(top, top_ref);
118}
119
121
122int main(int argc, char **argv) {
124 app.Exec(argc, argv);
125}
bool DoThreaded() override
bool EvaluateOptions() override
Process command line options.
std::unique_ptr< CsgApplication::Worker > ForkWorker() override
void MergeWorker(CsgApplication::Worker *worker) override
RDFCalculator rdf_calculator_
void EndEvaluate() override
called after the last frame
void Initialize() override
Initialize application data.
string ProgramName() override
program name
void BeginEvaluate(Topology *top, Topology *top_ref) override
called before the first frame
bool DoMapping() override
overload and return true to enable mapping command line options
bool DoMappingDefault(void) override
if DoMapping is true, will by default require mapping or not
votca::Index write_every_
bool DoTrajectory() override
overload and return true to enable trajectory command line options
bool SynchronizeThreads() override
void HelpText(ostream &out) override
help text of application without version information
Worker, derived from Thread, does the work.
bool EvaluateOptions() override
Process command line options.
void Initialize() override
Initialize application data.
class to calculate distribution functions and cross correlations for inverse monte carlo
std::unique_ptr< CsgApplication::Worker > ForkWorker()
void SetSubvolRadius(double r)
void DoVolumeCorrection(bool do_vol_corr)
void DoBlocks(bool do_blocks)
void BeginEvaluate(Topology *top, Topology *top_atom)
begin coarse graining a trajectory
void EndEvaluate()
end coarse graining a trajectory
void WriteEvery(Index write_every)
void LoadOptions(const std::string &file)
load cg definitions file
void MergeWorker(CsgApplication::Worker *worker_)
topology of the whole system
Definition topology.h:81
int Exec(int argc, char **argv)
executes the program
boost::program_options::variables_map & OptionsMap()
get available program options & descriptions
boost::program_options::options_description_easy_init AddProgramOptions(const std::string &group="")
add option for command line
void CheckRequired(const std::string &option_name, const std::string &error_msg="")
Check weather required option is set.
STL namespace.
Eigen::Index Index
Definition types.h:26
int main(int argc, char **argv)