votca 2024.2-dev
Loading...
Searching...
No Matches
jobtopology.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_JOBTOPOLOGY_H
22#define VOTCA_XTP_JOBTOPOLOGY_H
23
24// Local VOTCA includes
25#include "job.h"
26#include "logger.h"
27#include "region.h"
28#include "topology.h"
29
44namespace votca {
45namespace xtp {
46class SegId;
48 public:
49 JobTopology(Job& job, Logger& log, std::string workdir)
50 : job_(job), log_(log), workdir_(workdir) {};
51 void BuildRegions(const Topology& top,
52 std::pair<std::string, tools::Property> options);
53
54 void WriteToHdf5(std::string filename) const;
55
56 void ReadFromHdf5(std::string filename);
57
58 void WriteToPdb(std::string filename) const;
59
60 std::vector<std::unique_ptr<Region> >::iterator begin() {
61 return regions_.begin();
62 }
63 std::vector<std::unique_ptr<Region> >::iterator end() {
64 return regions_.end();
65 }
66
67 const std::vector<std::unique_ptr<Region> >& Regions() const {
68 return regions_;
69 }
70
71 std::vector<std::unique_ptr<Region> >& Regions() { return regions_; }
72
73 Index size() const { return Index(regions_.size()); }
74
75 std::vector<std::unique_ptr<Region> >::const_iterator begin() const {
76 return regions_.begin();
77 }
78 std::vector<std::unique_ptr<Region> >::const_iterator end() const {
79 return regions_.end();
80 }
81
82 private:
83 std::vector<std::vector<SegId> > PartitionRegions(
84 const tools::Property& regions_def, const Topology& top) const;
85
86 void CreateRegions(const std::pair<std::string, tools::Property>& options,
87 const Topology& top,
88 const std::vector<std::vector<SegId> >& region_seg_ids);
89
90 void ModifyOptionsByJobFile(tools::Property& regions_def) const;
91
92 template <class T>
93 void ShiftPBC(const Topology& top, const Eigen::Vector3d& center,
94 T& mol) const;
95
96 void CheckEnumerationOfRegions(const tools::Property& regions_def) const;
97 std::vector<const tools::Property*> SortRegionsDefbyId(
98 const tools::Property& regions_def) const;
99
102 std::vector<std::unique_ptr<Region> > regions_;
103 std::string workdir_ = "";
104
105 static constexpr int jobtopology_version() { return 1; }
106};
107} // namespace xtp
108} // namespace votca
109
110#endif // VOTCA_XTP_JOBTOPOLOGY_H
class to manage program options with xml serialization functionality
Definition property.h:55
std::vector< std::unique_ptr< Region > > regions_
void ShiftPBC(const Topology &top, const Eigen::Vector3d &center, T &mol) const
std::vector< std::unique_ptr< Region > >::const_iterator begin() const
Definition jobtopology.h:75
std::vector< std::unique_ptr< Region > >::iterator end()
Definition jobtopology.h:63
std::vector< const tools::Property * > SortRegionsDefbyId(const tools::Property &regions_def) const
void ReadFromHdf5(std::string filename)
static constexpr int jobtopology_version()
std::vector< std::unique_ptr< Region > > & Regions()
Definition jobtopology.h:71
const std::vector< std::unique_ptr< Region > > & Regions() const
Definition jobtopology.h:67
void CreateRegions(const std::pair< std::string, tools::Property > &options, const Topology &top, const std::vector< std::vector< SegId > > &region_seg_ids)
std::vector< std::vector< SegId > > PartitionRegions(const tools::Property &regions_def, const Topology &top) const
void WriteToPdb(std::string filename) const
void CheckEnumerationOfRegions(const tools::Property &regions_def) const
void BuildRegions(const Topology &top, std::pair< std::string, tools::Property > options)
void WriteToHdf5(std::string filename) const
std::vector< std::unique_ptr< Region > >::iterator begin()
Definition jobtopology.h:60
std::vector< std::unique_ptr< Region > >::const_iterator end() const
Definition jobtopology.h:78
JobTopology(Job &job, Logger &log, std::string workdir)
Definition jobtopology.h:49
void ModifyOptionsByJobFile(tools::Property &regions_def) const
Logger is used for thread-safe output of messages.
Definition logger.h:164
Container for segments and box and atoms.
Definition topology.h:41
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26