Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DAEmode] Avoid IDA for models without states
- when the model has no states and no residual equations the general simulation algorithm with event handling is used. - This fixes models like Modelica.Blocks.Examples.RealNetwork1 for the daeMode=new. Belonging to [master]: - OpenModelica/OMCompiler#2295
- Loading branch information
1 parent
1769e70
commit 77407e8
Showing
7 changed files
with
124 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* This file is part of OpenModelica. | ||
* | ||
* Copyright (c) 1998-2018, Open Source Modelica Consortium (OSMC), | ||
* c/o Linköpings universitet, Department of Computer and Information Science, | ||
* SE-58183 Linköping, Sweden. | ||
* | ||
* All rights reserved. | ||
* | ||
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE | ||
* GPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. | ||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES | ||
* RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, | ||
* ACCORDING TO RECIPIENTS CHOICE. | ||
* | ||
* The OpenModelica software and the OSMC (Open Source Modelica Consortium) | ||
* Public License (OSMC-PL) are obtained from OSMC, either from the above | ||
* address, from the URLs: http://www.openmodelica.org or | ||
* http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica | ||
* distribution. GNU version 3 is obtained from: | ||
* http://www.gnu.org/copyleft/gpl.html. The New BSD License is obtained from: | ||
* http://www.opensource.org/licenses/BSD-3-Clause. | ||
* | ||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS | ||
* EXPRESSLY SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE | ||
* CONDITIONS OF OSMC-PL. | ||
* | ||
*/ | ||
|
||
#include "dae_mode.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/*! \fn void evaluateDAEResiduals_wrapperEventUpdate | ||
* | ||
* wrapper function of the main evaluation function for DAE mode | ||
*/ | ||
int evaluateDAEResiduals_wrapperEventUpdate(DATA* data, threadData_t* threadData) | ||
{ | ||
int retVal; | ||
|
||
data->simulationInfo->discreteCall = 1; | ||
retVal = data->simulationInfo->daeModeData->evaluateDAEResiduals(data, threadData); | ||
data->simulationInfo->discreteCall = 0; | ||
|
||
return retVal; | ||
} | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* This file is part of OpenModelica. | ||
* | ||
* Copyright (c) 1998-2018, Open Source Modelica Consortium (OSMC), | ||
* c/o Linköpings universitet, Department of Computer and Information Science, | ||
* SE-58183 Linköping, Sweden. | ||
* | ||
* All rights reserved. | ||
* | ||
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE | ||
* GPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. | ||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES | ||
* RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, | ||
* ACCORDING TO RECIPIENTS CHOICE. | ||
* | ||
* The OpenModelica software and the OSMC (Open Source Modelica Consortium) | ||
* Public License (OSMC-PL) are obtained from OSMC, either from the above | ||
* address, from the URLs: http://www.openmodelica.org or | ||
* http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica | ||
* distribution. GNU version 3 is obtained from: | ||
* http://www.gnu.org/copyleft/gpl.html. The New BSD License is obtained from: | ||
* http://www.opensource.org/licenses/BSD-3-Clause. | ||
* | ||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS | ||
* EXPRESSLY SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE | ||
* CONDITIONS OF OSMC-PL. | ||
* | ||
*/ | ||
|
||
#ifndef DAE_MODE_H | ||
#define DAE_MODE_H | ||
|
||
#include "simulation_data.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
int evaluateDAEResiduals_wrapperEventUpdate(DATA* data, threadData_t* threadData); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters