NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
odesolver.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2015 Erik Haenel et al.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17******************************************************************************/
18
19
20#ifndef ODESOLVER_HPP
21#define ODESOLVER_HPP
22#include <iostream>
23#include <string>
24#include <vector>
25#include <gsl/gsl_matrix.h>
26#include <gsl/gsl_errno.h>
27#include <gsl/gsl_odeiv.h>
28
29#include "../ParserLib/muParser.h"
30#include "../utils/tools.hpp"
31#include "../datamanagement/memorymanager.hpp"
32#include "define.hpp"
33#include "parser_functions.hpp"
34#include "../settings.hpp"
35#include "../ui/error.hpp"
36
38{
39 private:
43 const gsl_odeiv_step_type* odeStepType;
44 gsl_odeiv_step* odeStep;
45 gsl_odeiv_control* odeControl;
46 gsl_odeiv_evolve* odeEvolve;
47
48 static int odeFunction(double x, const double y[], double dydx[], void* params);
49 inline static int jacobian(double x, const double y[], double dydx[], double dfdt[], void* params)
50 {return GSL_SUCCESS;}
51
52 public:
54 static int nDimensions;
56
57 Odesolver();
58 Odesolver(mu::Parser* _parser, MemoryManager* _data, FunctionDefinitionManager* _functions, Settings* _option);
59 ~Odesolver();
60
61 inline void setObjects(mu::Parser* _parser, MemoryManager* _data, FunctionDefinitionManager* _functions, Settings* _option)
62 {
63 _odeParser = _parser;
64 _odeData = _data;
65 _odeFunctions = _functions;
66 _odeSettings = _option;
67 return;
68 }
69 bool solve(const std::string& sCmd);
70};
71
72typedef int (Odesolver::*odeFunction)(double, const double*, double*, void*);
73
74#endif // ODESOLVER_HPP
75
This class implements the function definition managing instance.
Definition: define.hpp:74
This class represents the central memory managing instance. It will handle all tables and clusters,...
MemoryManager * _odeData
Definition: odesolver.hpp:40
static int nDimensions
Definition: odesolver.hpp:54
static mu::Parser * _odeParser
Definition: odesolver.hpp:53
Settings * _odeSettings
Definition: odesolver.hpp:42
static int odeFunction(double x, const double y[], double dydx[], void *params)
Definition: odesolver.cpp:73
bool solve(const std::string &sCmd)
Definition: odesolver.cpp:94
FunctionDefinitionManager * _odeFunctions
Definition: odesolver.hpp:41
const gsl_odeiv_step_type * odeStepType
Definition: odesolver.hpp:43
gsl_odeiv_step * odeStep
Definition: odesolver.hpp:44
gsl_odeiv_control * odeControl
Definition: odesolver.hpp:45
static mu::varmap_type mVars
Definition: odesolver.hpp:55
gsl_odeiv_evolve * odeEvolve
Definition: odesolver.hpp:46
void setObjects(mu::Parser *_parser, MemoryManager *_data, FunctionDefinitionManager *_functions, Settings *_option)
Definition: odesolver.hpp:61
static int jacobian(double x, const double y[], double dydx[], double dfdt[], void *params)
Definition: odesolver.hpp:49
This class manages the setting values of the internal (kernel) settings of this application.
Definition: settings.hpp:663
Mathematical expressions parser.
Definition: muParser.h:51
std::map< string_type, value_type * > varmap_type
Type used for storing variables.
Definition: muParserDef.h:273
int(Odesolver::* odeFunction)(double, const double *, double *, void *)
Definition: odesolver.hpp:72