votca 2024.2-dev
Loading...
Searching...
No Matches
jobcalculator.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 */
21
22#pragma once
23#ifndef VOTCA_XTP_JOBCALCULATOR_H
24#define VOTCA_XTP_JOBCALCULATOR_H
25
26// VOTCA includes
28
29// Local VOTCA includes
30#include "job.h"
31#include "progressobserver.h"
32#include "topology.h"
33
34namespace votca {
35namespace xtp {
36
37class Topology;
38
40 public:
41 JobCalculator() = default;
42 ~JobCalculator() override = default;
43
44 std::string Identify() const override = 0;
45 std::string Package() const final { return "xtp"; }
46 bool EvaluateFrame(const Topology &top) { return Evaluate(top); }
47
48 void Initialize(const tools::Property &opt) final { ParseOptions(opt); }
49 virtual void WriteJobFile(const Topology &top) = 0;
50 virtual void ReadJobFile(Topology &top) = 0;
51
52 void setOpenMPThreads(Index ompthreads) { openmp_threads_ = ompthreads; }
53 void setProgObserver(ProgObserver<std::vector<Job> > *obs) { progObs_ = obs; }
54
55 protected:
56 virtual void ParseOptions(const tools::Property &opt) = 0;
57 virtual bool Evaluate(const Topology &top) = 0;
58
61};
62
63} // namespace xtp
64} // namespace votca
65
66#endif // VOTCA_XTP_JOBCALCULATOR_H
Base class for all calculators.
Definition calculator.h:40
class to manage program options with xml serialization functionality
Definition property.h:55
virtual void WriteJobFile(const Topology &top)=0
virtual void ParseOptions(const tools::Property &opt)=0
bool EvaluateFrame(const Topology &top)
std::string Package() const final
Package name.
ProgObserver< std::vector< Job > > * progObs_
std::string Identify() const override=0
Calculator name.
void setProgObserver(ProgObserver< std::vector< Job > > *obs)
~JobCalculator() override=default
void Initialize(const tools::Property &opt) final
Initializes a calculator from an XML file with options.
virtual void ReadJobFile(Topology &top)=0
void setOpenMPThreads(Index ompthreads)
virtual bool Evaluate(const Topology &top)=0
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