5454#include <string.h>
5555
5656#include "external_input.h"
57- #include "jacobianSymbolical.h"
5857#include "kinsolSolver.h"
59- #include "model_help.h"
6058#include "newtonIteration.h"
6159#include "nonlinearSystem.h"
6260#include "omc_math.h"
63- #include "simulation/options.h"
64- #include "simulation/results/simulation_result.h"
65- #include "simulation/jacobian_util.h"
66- #include "util/omc_error.h"
67- #include "util/omc_file.h"
68- #include "util/simulation_options.h"
69- #include "util/varinfo.h"
61+ #include "../options.h"
62+ #include "../results/simulation_result.h"
63+ #include "../jacobian_util.h"
64+ #include "../../util/omc_error.h"
65+ #include "../../util/omc_file.h"
66+ #include "../../util/simulation_options.h"
7067#include "epsilon.h"
7168
7269extern void communicateStatus (const char * phase , double completionPercent , double currentTime , double currentStepSize );
@@ -87,8 +84,6 @@ void gbode_fODE(DATA *data, threadData_t *threadData, unsigned int* counter)
8784 externalInputUpdate (data );
8885 data -> callback -> input_function (data , threadData );
8986 data -> callback -> functionODE (data , threadData );
90-
91- return ;
9287}
9388
9489/**
@@ -271,7 +266,7 @@ int gbodef_allocateData(DATA *data, threadData_t *threadData, SOLVER_INFO *solve
271266 snprintf (filename , bufSize , "%s_ActiveStates.txt" , data -> modelData -> modelFilePrefix );
272267 gbfData -> fastStatesDebugFile = omc_fopen (filename , "w" );
273268 warningStreamPrint (OMC_LOG_STDOUT , 0 , "LOG_GBODE_STATES sets -noEquidistantTimeGrid for emitting results!" );
274- solverInfo -> integratorSteps = TRUE;
269+ solverInfo -> solverNoEquidistantGrid = TRUE;
275270 } else {
276271 gbfData -> fastStatesDebugFile = NULL ;
277272 }
@@ -1027,8 +1022,8 @@ int gbodef_main(DATA *data, threadData_t *threadData, SOLVER_INFO *solverInfo, d
10271022 dumpFastStates_gbf (gbData , gbfData -> time , 0 );
10281023 }
10291024
1030- /* emit step, if integratorSteps is selected */
1031- if (solverInfo -> integratorSteps ) {
1025+ /* emit step, if solverNoEquidistantGrid is selected */
1026+ if (solverInfo -> solverNoEquidistantGrid ) {
10321027 sData -> timeValue = gbfData -> time ;
10331028 solverInfo -> currentTime = sData -> timeValue ;
10341029 memcpy (sData -> realVars , gbfData -> y , nStates * sizeof (double ));
@@ -1055,7 +1050,7 @@ int gbodef_main(DATA *data, threadData_t *threadData, SOLVER_INFO *solverInfo, d
10551050 // copy error and values of the fast states to the outer integrator routine if outer integration time is reached
10561051 //gbData->err_fast = gbfData->errValues[0];
10571052
1058- if (!solverInfo -> integratorSteps && gbfData -> time >= targetTime ) {
1053+ if (!solverInfo -> solverNoEquidistantGrid && gbfData -> time >= targetTime ) {
10591054 /* Integrator does large steps and needs to interpolate results with respect to the output grid */
10601055 /* Here, only the fast states get updated */
10611056 sData -> timeValue = solverInfo -> currentTime + solverInfo -> currentStepSize ;
@@ -1115,7 +1110,7 @@ int gbode_birate(DATA *data, threadData_t *threadData, SOLVER_INFO *solverInfo)
11151110
11161111 /* Calculate steps until targetTime is reached */
11171112 // 1 => emit result at integrator step points; 0 => equidistant grid
1118- if (solverInfo -> integratorSteps ) {
1113+ if (solverInfo -> solverNoEquidistantGrid ) {
11191114 if (data -> simulationInfo -> nextSampleEvent < data -> simulationInfo -> stopTime ) {
11201115 targetTime = data -> simulationInfo -> nextSampleEvent ;
11211116 } else {
@@ -1360,7 +1355,7 @@ int gbode_birate(DATA *data, threadData_t *threadData, SOLVER_INFO *solverInfo)
13601355 messageClose (OMC_LOG_GBODE_V );
13611356 }
13621357 if (gbData -> ctrl_method != GB_CTRL_CNST && ((gbData -> interpolation == GB_INTERPOL_HERMITE_ERRCTRL ) || (gbData -> interpolation == GB_DENSE_OUTPUT_ERRCTRL ))) {
1363- if (gbData -> err_int > err ) {
1358+ if (gbData -> err_int > err ) {
13641359 gbData -> errValues [0 ] = gbData -> err_int ;
13651360 gbData -> stepSize = gbData -> lastStepSize * gbData -> stepSize_control (gbData -> errValues , gbData -> stepSizeValues , gbData -> tableau -> error_order );
13661361 if (gbData -> maxStepSize > 0 && gbData -> maxStepSize < gbData -> stepSize )
@@ -1517,8 +1512,8 @@ int gbode_birate(DATA *data, threadData_t *threadData, SOLVER_INFO *solverInfo)
15171512 dumpFastStates_gb (gbData , FALSE, gbData -> time , 0 );
15181513 }
15191514
1520- /* emit step, if integratorSteps is selected */
1521- if (solverInfo -> integratorSteps && gbData -> gbfData -> time < gbData -> time ) {
1515+ /* emit step, if solverNoEquidistantGrid is selected */
1516+ if (solverInfo -> solverNoEquidistantGrid && gbData -> gbfData -> time < gbData -> time ) {
15221517 sData -> timeValue = gbData -> time ;
15231518 solverInfo -> currentTime = sData -> timeValue ;
15241519 memcpy (sData -> realVars , gbData -> y , nStates * sizeof (double ));
@@ -1546,7 +1541,7 @@ int gbode_birate(DATA *data, threadData_t *threadData, SOLVER_INFO *solverInfo)
15461541 }
15471542 // end of while-loop (gbData->time < targetTime)
15481543
1549- if (!solverInfo -> integratorSteps ) {
1544+ if (!solverInfo -> solverNoEquidistantGrid ) {
15501545 /* Integrator does large steps and needs to interpolate results with respect to the output grid */
15511546 sData -> timeValue = solverInfo -> currentTime + solverInfo -> currentStepSize ;
15521547 solverInfo -> currentTime = sData -> timeValue ;
@@ -1634,7 +1629,7 @@ int gbode_singlerate(DATA *data, threadData_t *threadData, SOLVER_INFO *solverIn
16341629
16351630 /* Calculate steps until targetTime is reached */
16361631 // 1 => emit result at integrator step points; 0 => equidistant grid
1637- if (solverInfo -> integratorSteps ) {
1632+ if (solverInfo -> solverNoEquidistantGrid ) {
16381633 if (data -> simulationInfo -> nextSampleEvent < data -> simulationInfo -> stopTime ) {
16391634 targetTime = data -> simulationInfo -> nextSampleEvent ;
16401635 } else {
@@ -1912,8 +1907,8 @@ int gbode_singlerate(DATA *data, threadData_t *threadData, SOLVER_INFO *solverIn
19121907 infoStreamPrint (OMC_LOG_SOLVER , 0 , "Accept step from %10g to %10g, error %10g interpolation error %10g, new stepsize %10g" ,
19131908 gbData -> timeLeft , gbData -> timeRight , err , gbData -> err_int , gbData -> stepSize );
19141909
1915- /* emit step, if integratorSteps is selected */
1916- if (solverInfo -> integratorSteps ) {
1910+ /* emit step, if solverNoEquidistantGrid is selected */
1911+ if (solverInfo -> solverNoEquidistantGrid ) {
19171912 solverInfo -> currentTime = sData -> timeValue ;
19181913 /*
19191914 * to emit consistent value we need to update the whole
@@ -1938,7 +1933,7 @@ int gbode_singlerate(DATA *data, threadData_t *threadData, SOLVER_INFO *solverIn
19381933 // reduce step size with respect to the simulation stop time, if necessary
19391934 gbData -> stepSize = fmin (gbData -> stepSize , stopTime - gbData -> time );
19401935
1941- if (omc_flag [FLAG_PORT ] && solverInfo -> integratorSteps ) {
1936+ if (omc_flag [FLAG_PORT ] && solverInfo -> solverNoEquidistantGrid ) {
19421937 if (0 != strcmp ("ia" , data -> simulationInfo -> outputFormat )) {
19431938 communicateStatus ("Running" , (solverInfo -> currentTime - data -> simulationInfo -> startTime )/(data -> simulationInfo -> stopTime - data -> simulationInfo -> startTime ), solverInfo -> currentTime , solverInfo -> currentStepSize );
19441939 }
@@ -1947,7 +1942,7 @@ int gbode_singlerate(DATA *data, threadData_t *threadData, SOLVER_INFO *solverIn
19471942 }
19481943 // end of while-loop (gbData->time < targetTime)
19491944
1950- if (!solverInfo -> integratorSteps ) {
1945+ if (!solverInfo -> solverNoEquidistantGrid ) {
19511946 /* Integrator does large steps and needs to interpolate results with respect to the output grid */
19521947 sData -> timeValue = solverInfo -> currentTime + solverInfo -> currentStepSize ;
19531948 solverInfo -> currentTime = sData -> timeValue ;
0 commit comments