OMCompiler/SimulationRuntime/cpp/Solver/Kinsol/KinsolSettings.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 | #include <Core/ModelicaDefine.h> | ||
| 29 | #include <Core/Modelica.h> | ||
| 30 | /** @addtogroup solverKinsol | ||
| 31 | * | ||
| 32 | * @{ | ||
| 33 | */ | ||
| 34 | |||
| 35 | #include <Solver/Kinsol/KinsolSettings.h> | ||
| 36 | |||
| 37 | ✗ | KinsolSettings::KinsolSettings() | |
| 38 | ✗ | : _iNewt_max (700) | |
| 39 | ✗ | , _dRtol (1e-12) | |
| 40 | ✗ | , _dAtol (1.0) | |
| 41 | ✗ | , _dDelta (0.9) | |
| 42 | ✗ | , _continueOnError(false) | |
| 43 | { | ||
| 44 | ✗ | }; | |
| 45 | /*max. Anzahl an Newtonititerationen pro Schritt (default: 25)*/ | ||
| 46 | ✗ | long int KinsolSettings::getNewtMax() | |
| 47 | { | ||
| 48 | ✗ | return _iNewt_max; | |
| 49 | } | ||
| 50 | ✗ | void KinsolSettings::setNewtMax(long int max) | |
| 51 | { | ||
| 52 | ✗ | _iNewt_max =max; | |
| 53 | ✗ | } | |
| 54 | /* Relative Toleranz für die Newtoniteration (default: 1e-6)*/ | ||
| 55 | ✗ | double KinsolSettings::getRtol() | |
| 56 | { | ||
| 57 | ✗ | return _dRtol; | |
| 58 | } | ||
| 59 | ✗ | void KinsolSettings::setRtol(double t) | |
| 60 | { | ||
| 61 | ✗ | _dRtol=t; | |
| 62 | ✗ | } | |
| 63 | /*Absolute Toleranz für die Newtoniteration (default: 1e-6)*/ | ||
| 64 | ✗ | double KinsolSettings::getAtol() | |
| 65 | { | ||
| 66 | ✗ | return _dAtol; | |
| 67 | } | ||
| 68 | ✗ | void KinsolSettings::setAtol(double t) | |
| 69 | { | ||
| 70 | ✗ | _dAtol =t; | |
| 71 | ✗ | } | |
| 72 | /*Dämpfungsfaktor (default: 0.9)*/ | ||
| 73 | ✗ | double KinsolSettings::getDelta() | |
| 74 | { | ||
| 75 | ✗ | return _dDelta; | |
| 76 | } | ||
| 77 | ✗ | void KinsolSettings::setDelta(double t) | |
| 78 | { | ||
| 79 | ✗ | _dDelta = t; | |
| 80 | ✗ | } | |
| 81 | |||
| 82 | ✗ | void KinsolSettings::load(string) | |
| 83 | { | ||
| 84 | ✗ | } | |
| 85 | |||
| 86 | ✗ | void KinsolSettings::setContinueOnError(bool value) | |
| 87 | { | ||
| 88 | ✗ | _continueOnError = value; | |
| 89 | ✗ | } | |
| 90 | |||
| 91 | ✗ | bool KinsolSettings::getContinueOnError() | |
| 92 | { | ||
| 93 | ✗ | return _continueOnError; | |
| 94 | } | ||
| 95 | /** @} */ // end of solverKinsol | ||
| 96 |