eisgenerator 1.0.x
componant.h
1//SPDX-License-Identifier: LGPL-3.0-or-later
2/* * eisgenerator - a shared libary and application to generate EIS spectra
3 * Copyright (C) 2022-2024 Carl Philipp Klemm <carl@uvos.xyz>
4 *
5 * This file is part of eisgenerator.
6 *
7 * eisgenerator is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser 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 * eisgenerator is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with eisgenerator. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22#include <complex>
23#include <iostream>
24#include <vector>
25#include <string>
26
27#include "../eistype.h"
28
29namespace eis
30{
31
33{
34 protected:
35 std::vector<eis::Range> ranges;
36 std::string uniqueName;
37
38 public:
39 virtual std::complex<fvalue> execute(fvalue omega)
40 {
41 (void)omega;
42 std::cout<<"warning incompleat model\n";
43 return std::complex<fvalue> (1,0);
44 }
45
46 virtual void setParamRanges(const std::vector<eis::Range>& ranges);
47 virtual std::vector<eis::Range>& getParamRanges();
48 virtual std::vector<eis::Range> getParamRanges() const;
49 virtual std::vector<eis::Range> getDefaultParameters(bool range = true) const;
50 virtual size_t paramCount() const {return 0;};
51 virtual ~Componant() = default;
52 virtual char getComponantChar() const = 0;
53 virtual std::string getComponantString(bool currentValue = true) const;
54 virtual std::string componantName() const = 0;
55 virtual std::string getCode(std::vector<std::string>& parameters);
56 virtual std::string getTorchScript(std::vector<std::string>& parameters);
57 virtual bool compileable();
58
59 std::string getUniqueName();
60
61 static Componant* copy(Componant* componant);
62 static Componant* createNewComponant(char componant, std::string paramStr = "", size_t count = 1, bool defaultToRange = false);
63 static bool isValidComponantChar(char componant);
64};
65
66}
Definition componant.h:33
eisgenerator Copyright (C) 2021 Carl Klemm
Definition basicmath.h:26