OMCompiler/SimulationRuntime/cpp/Core/Solver/SolverSettings.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * This file belongs to the OpenModelica Run-Time System | ||
| 3 | * | ||
| 4 | * Copyright (c) 1998-2026, Open Source Modelica Consortium (OSMC), c/o Linköpings | ||
| 5 | * universitet, Department of Computer and Information Science, SE-58183 Linköping, Sweden. All rights | ||
| 6 | * reserved. | ||
| 7 | * | ||
| 8 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE | ||
| 9 | * AGPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.8. ANY | ||
| 10 | * USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S | ||
| 11 | * ACCEPTANCE OF THE BSD NEW LICENSE OR THE OSMC PUBLIC LICENSE OR THE AGPL | ||
| 12 | * VERSION 3, ACCORDING TO RECIPIENTS CHOICE. | ||
| 13 | * | ||
| 14 | * The OpenModelica software and the OSMC (Open Source Modelica Consortium) Public License | ||
| 15 | * (OSMC-PL) are obtained from OSMC, either from the above address, from the URLs: | ||
| 16 | * http://www.openmodelica.org or https://github.com/OpenModelica/ or | ||
| 17 | * http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica distribution. GNU | ||
| 18 | * AGPL version 3 is obtained from: https://www.gnu.org/licenses/licenses.html#GPL. The BSD NEW | ||
| 19 | * License is obtained from: http://www.opensource.org/licenses/BSD-3-Clause. | ||
| 20 | * | ||
| 21 | * This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY | ||
| 23 | * SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF | ||
| 24 | * OSMC-PL. | ||
| 25 | * | ||
| 26 | */ | ||
| 27 | |||
| 28 | /** @addtogroup coreSolver | ||
| 29 | * | ||
| 30 | * @{ | ||
| 31 | */ | ||
| 32 | #include <Core/ModelicaDefine.h> | ||
| 33 | #include <Core/Modelica.h> | ||
| 34 | #include <Core/Solver/FactoryExport.h> | ||
| 35 | #include <Core/Solver/SolverSettings.h> | ||
| 36 | #include <Core/SimulationSettings/IGlobalSettings.h> | ||
| 37 | //#include "../Interfaces/API.h" | ||
| 38 | #include <Core/Math/Constants.h> | ||
| 39 | |||
| 40 | 40 | SolverSettings::SolverSettings(IGlobalSettings* globalSettings) | |
| 41 | 40 | : _hInit (1e-3) | |
| 42 | 40 | , _hUpperLimit (1e-3) | |
| 43 | 40 | , _hLowerLimit (10*UROUND) | |
| 44 | 40 | , _endTimeTol (1e-7) | |
| 45 | 40 | , _dRtol (1e-6) | |
| 46 | 40 | , _dAtol (1e-6) | |
| 47 | 40 | , _denseOutput (false) | |
| 48 | { | ||
| 49 | 40 | _globalSettings = globalSettings ; | |
| 50 | 40 | } | |
| 51 | |||
| 52 | 40 | SolverSettings::~SolverSettings() | |
| 53 | { | ||
| 54 | 40 | } | |
| 55 | |||
| 56 | 39 | double SolverSettings::gethInit() | |
| 57 | { | ||
| 58 | 39 | return _hInit; | |
| 59 | } | ||
| 60 | |||
| 61 | 40 | void SolverSettings::sethInit(double h) | |
| 62 | { | ||
| 63 | 40 | _hInit = h; | |
| 64 | 40 | } | |
| 65 | |||
| 66 | 168 | double SolverSettings::getATol() | |
| 67 | { | ||
| 68 | 168 | return _dAtol; | |
| 69 | } | ||
| 70 | |||
| 71 | 40 | void SolverSettings::setATol(double atol) | |
| 72 | { | ||
| 73 | 40 | _dAtol = atol; | |
| 74 | 40 | } | |
| 75 | |||
| 76 | 160 | double SolverSettings::getRTol() | |
| 77 | { | ||
| 78 | 160 | return _dRtol; | |
| 79 | } | ||
| 80 | |||
| 81 | 40 | void SolverSettings::setRTol(double rtol) | |
| 82 | { | ||
| 83 | 40 | _dRtol = rtol; | |
| 84 | 40 | } | |
| 85 | |||
| 86 | ✗ | double SolverSettings::getLowerLimit() | |
| 87 | { | ||
| 88 | ✗ | return _hLowerLimit; | |
| 89 | } | ||
| 90 | |||
| 91 | 40 | void SolverSettings::setLowerLimit(double h) | |
| 92 | { | ||
| 93 | 40 | _hLowerLimit = h; | |
| 94 | 40 | } | |
| 95 | |||
| 96 | ✗ | double SolverSettings::getUpperLimit() | |
| 97 | { | ||
| 98 | ✗ | return _hUpperLimit; | |
| 99 | } | ||
| 100 | |||
| 101 | 40 | void SolverSettings::setUpperLimit(double h) | |
| 102 | { | ||
| 103 | 40 | _hUpperLimit = h; | |
| 104 | 40 | } | |
| 105 | |||
| 106 | 311677 | double SolverSettings::getEndTimeTol() | |
| 107 | { | ||
| 108 | 311677 | return _endTimeTol; | |
| 109 | } | ||
| 110 | |||
| 111 | 39 | void SolverSettings::setEndTimeTol(double tol) | |
| 112 | { | ||
| 113 | 39 | _endTimeTol = tol; | |
| 114 | 39 | } | |
| 115 | |||
| 116 | ✗ | bool SolverSettings::getDenseOutput() | |
| 117 | { | ||
| 118 | ✗ | return _denseOutput; | |
| 119 | } | ||
| 120 | |||
| 121 | ✗ | void SolverSettings::setDenseOutput(bool dense) | |
| 122 | { | ||
| 123 | ✗ | _denseOutput = dense; | |
| 124 | ✗ | } | |
| 125 | |||
| 126 | 415195 | IGlobalSettings* SolverSettings::getGlobalSettings() | |
| 127 | { | ||
| 128 | 415195 | return _globalSettings; | |
| 129 | } | ||
| 130 | |||
| 131 | ✗ | void SolverSettings::load(string) | |
| 132 | { | ||
| 133 | ✗ | } | |
| 134 | /** @} */ // end of coreSolver | ||
| 135 | |||
| 136 | |||
| 137 |