OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
AbstractTimeDependence.h
Go to the documentation of this file.
1//
2// Copyright (c) 2026, Paul Scherrer Institute, Villigen PSI, Switzerland
3// All rights reserved
4//
5// This file is part of OPAL.
6//
7// OPAL is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// You should have received a copy of the GNU General License
13// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
14//
15
16#ifndef ALGORITHMS_ABSTRACTTIMEDEPENDENCE_H_
17#define ALGORITHMS_ABSTRACTTIMEDEPENDENCE_H_
18
19#include <map>
20#include <memory>
21#include <string>
22
34 // Unit tests for this class are in with PolynomialTimeDependence
35public:
37 virtual ~AbstractTimeDependence() = default;
38
45
51 virtual double getValue(double time) = 0;
52
56 virtual double getIntegral(double time) = 0;
57
65 static std::shared_ptr<AbstractTimeDependence> getTimeDependence(const std::string& name);
66
73 static void setTimeDependence(
74 const std::string& name, std::shared_ptr<AbstractTimeDependence> time_dep);
75
84 static std::string getName(const std::shared_ptr<AbstractTimeDependence>& time_dep);
85
86private:
87 static std::map<std::string, std::shared_ptr<AbstractTimeDependence> > td_map;
88};
89
90#endif
static std::map< std::string, std::shared_ptr< AbstractTimeDependence > > td_map
virtual AbstractTimeDependence * clone()=0
static void setTimeDependence(const std::string &name, std::shared_ptr< AbstractTimeDependence > time_dep)
virtual ~AbstractTimeDependence()=default
static std::string getName(const std::shared_ptr< AbstractTimeDependence > &time_dep)
static std::shared_ptr< AbstractTimeDependence > getTimeDependence(const std::string &name)
virtual double getValue(double time)=0
virtual double getIntegral(double time)=0