Linux GNU 11.4.0 Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 4 / 0 / 4
Functions: 100.0% 1 / 0 / 1
Branches: 100.0% 2 / 0 / 2

OMCompiler/SimulationRuntime/cpp/Solver/IDA/FactoryExport.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
29 #include <Core/ModelicaDefine.h>
30 #include <Core/Modelica.h>
31 #if defined(__vxworks)
32
33
34 #elif defined(SIMSTER_BUILD)
35
36 #include <Solver/IDA/IDA.h>
37
38
39 /*Simster factory*/
40 extern "C" void BOOST_EXTENSION_EXPORT_DECL extension_export_ida(boost::extensions::factory_map & fm)
41 {
42 fm.get<ISolver,int,IMixedSystem*, ISolverSettings*>()[1].set<Ida>();
43 //fm.get<ISolverSettings,int, IGlobalSettings* >()[2].set<IDASettings>();
44 }
45
46 #elif defined(OMC_BUILD) && !defined(RUNTIME_STATIC_LINKING)
47
48 #include <Solver/IDA/IDA.h>
49 #include <Solver/IDA/IDASettings.h>
50
51 /* OMC factory */
52 using boost::extensions::factory;
53
54 2 BOOST_EXTENSION_TYPE_MAP_FUNCTION {
55 types.get<std::map<std::string, factory<ISolver,IMixedSystem*, ISolverSettings*> > >()
56
1/1
✓ Branch 2 taken 2 times.
4 ["idaSolver"].set<Ida>();
57 types.get<std::map<std::string, factory<ISolverSettings, IGlobalSettings* > > >()
58
1/1
✓ Branch 2 taken 2 times.
2 ["idaSettings"].set<IDASettings>();
59 2 }
60 #elif defined(OMC_BUILD) && defined(RUNTIME_STATIC_LINKING)
61 #include <Solver/IDA/IDA.h>
62 #include <Solver/IDA/IDASettings.h>
63
64 #ifdef ENABLE_SUNDIALS_STATIC
65 shared_ptr<ISolver> createIda(IMixedSystem* system, shared_ptr<ISolverSettings> solver_settings)
66 {
67 shared_ptr<ISolver> ida = shared_ptr<ISolver>(new Ida(system,solver_settings.get()));
68 return ida;
69 }
70 shared_ptr<ISolverSettings> createIdaSettings(shared_ptr<IGlobalSettings> globalSettings)
71 {
72 shared_ptr<ISolverSettings> ida_settings = shared_ptr<ISolverSettings>(new IDASettings(globalSettings.get()));
73 return ida_settings;
74 }
75 #else
76 shared_ptr<ISolver> createIda(IMixedSystem* system, shared_ptr<ISolverSettings> solver_settings)
77 {
78 throw ModelicaSimulationError(SOLVER,"IDA was disabled during build");
79 }
80 shared_ptr<ISolverSettings> createIdaSettings(shared_ptr<IGlobalSettings> globalSettings)
81 {
82 throw ModelicaSimulationError(SOLVER,"IDA was disabled during build");
83 }
84 #endif //ENABLE_SUNDIALS_STATIC
85
86
87 #else
88 error "operating system not supported"
89 #endif
90
91
92
93