Changeset 0c3a76e in OpenModelica
- Timestamp:
- 2016-04-11T10:08:25+02:00 (8 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 390188e2
- Parents:
- 3a64133c
- git-author:
- Lennart Ochel <lennart.ochel@…> (04/11/16 10:08:25)
- git-committer:
- hudson <openmodelica@…> (04/11/16 10:08:25)
- Location:
- SimulationRuntime/c
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
SimulationRuntime/c/simulation/simulation_runtime.cpp
r7d8f15f2 r0c3a76e 77 77 #include "simulation_info_json.h" 78 78 #include "modelinfo.h" 79 #include "simulation/solver/events.h" 79 80 #include "simulation/solver/model_help.h" 80 81 #include "simulation/solver/mixedSystem.h" … … 525 526 init_lambda_steps_string = omc_flagValue[FLAG_ILS]; 526 527 init_lambda_steps = atoi(init_lambda_steps_string.c_str()); 528 } 529 if(omc_flag[FLAG_MAX_BISECTION_ITERATIONS]) { 530 maxBisectionIterations = atoi(omc_flagValue[FLAG_MAX_BISECTION_ITERATIONS]); 531 infoStreamPrint(LOG_STDOUT, 0, "Maximum number of bisection iterations changed to %d", maxBisectionIterations); 527 532 } 528 533 if(omc_flag[FLAG_MAX_EVENT_ITERATIONS]) { -
SimulationRuntime/c/simulation/solver/events.c
r34e4a4c r0c3a76e 51 51 #endif 52 52 53 int maxBisectionIterations = 0; 53 54 double bisection(DATA* data, threadData_t *threadData, double*, double*, double*, double*, LIST*, LIST*); 54 55 int checkZeroCrossings(DATA *data, LIST *list, LIST*); … … 417 418 long i=0; 418 419 /* n >= log(2)/log(2) + log(|b-a|/TOL)/log(2)*/ 419 unsigned int n = 1 + ceil(log(fabs(*b - *a)/TTOL)/log(2));420 unsigned int n = maxBisectionIterations > 0 ? maxBisectionIterations : 1 + ceil(log(fabs(*b - *a)/TTOL)/log(2)); 420 421 421 422 memcpy(data->simulationInfo->zeroCrossingsBackup, data->simulationInfo->zeroCrossings, data->modelData->nZeroCrossings * sizeof(modelica_real)); -
SimulationRuntime/c/simulation/solver/events.h
r34e4a4c r0c3a76e 43 43 #endif 44 44 45 extern int maxBisectionIterations; 45 46 void checkForSampleEvent(DATA *data, SOLVER_INFO* solverInfo); 46 47 int checkEvents(DATA* data, threadData_t *threadData, LIST* eventLst, modelica_boolean useRootFinding, double *eventTime); -
SimulationRuntime/c/util/simulation_options.c
r96898a5d r0c3a76e 69 69 /* FLAG_LSS_MIN_SIZE */ "lssMinSize", 70 70 /* FLAG_LV */ "lv", 71 /* FLAG_MAX_BISECTION_ITERATIONS */ "mbi", 71 72 /* FLAG_MAX_EVENT_ITERATIONS */ "mei", 72 73 /* FLAG_MAX_ORDER */ "maxIntegrationOrder", … … 135 136 /* FLAG_LSS_MIN_SIZE */ "[int (default 4001)] value specifies the minimum system size for using a linear sparse solver", 136 137 /* FLAG_LV */ "[string list] value specifies the logging level", 138 /* FLAG_MAX_BISECTION_ITERATIONS */ "[int (default 0)] value specifies the maximum number of bisection iterations for state event detection or zero for default behavior", 137 139 /* FLAG_MAX_EVENT_ITERATIONS */ "[int (default 20)] value specifies the maximum number of event iterations", 138 140 /* FLAG_MAX_ORDER */ "value specifies maximum integration order, used by dassl solver", … … 255 257 " Value (a comma-separated String list) specifies which logging levels to\n" 256 258 " enable. Multiple options can be enabled at the same time.", 259 /* FLAG_MAX_BISECTION_ITERATIONS */ 260 " value specifies the maximum number of bisection iterations for state event\n" 261 " detection or zero for default behavior", 257 262 /* FLAG_MAX_EVENT_ITERATIONS */ 258 263 " Value specifies the maximum number of event iterations.\n" … … 369 374 /* FLAG_LSS_MIN_SIZE */ FLAG_TYPE_OPTION, 370 375 /* FLAG_LV */ FLAG_TYPE_OPTION, 376 /* FLAG_MAX_BISECTION_ITERATIONS */ FLAG_TYPE_OPTION, 371 377 /* FLAG_MAX_EVENT_ITERATIONS */ FLAG_TYPE_OPTION, 372 378 /* FLAG_MAX_ORDER */ FLAG_TYPE_OPTION, -
SimulationRuntime/c/util/simulation_options.h
r96898a5d r0c3a76e 77 77 FLAG_LSS_MIN_SIZE, 78 78 FLAG_LV, 79 FLAG_MAX_BISECTION_ITERATIONS, 79 80 FLAG_MAX_EVENT_ITERATIONS, 80 81 FLAG_MAX_ORDER,
Note: See TracChangeset
for help on using the changeset viewer.