Skip to content

Commit 8fd278b

Browse files
committed
Add c run-time flag –ignoreHideResult
1 parent 386cb98 commit 8fd278b

File tree

3 files changed

+44
-38
lines changed

3 files changed

+44
-38
lines changed

SimulationRuntime/c/simulation/simulation_input_xml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ void read_input_xml(MODEL_DATA* modelData,
603603
infoStreamPrint(LOG_DEBUG, 0, "filtering protected variable %s", info->name); \
604604
out[j].filterOutput = 1; \
605605
} \
606-
else if (0 == strcmp(findHashStringString(v, "hideResult"), "true")) \
606+
else if (!omc_flag[FLAG_IGNORE_HIDERESULT] && 0 == strcmp(findHashStringString(v, "hideResult"), "true")) \
607607
{ \
608608
infoStreamPrint(LOG_DEBUG, 0, "filtering variable %s due to HideResult annotation", info->name); \
609609
out[j].filterOutput = 1; \

SimulationRuntime/c/util/simulation_options.c

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ const char *FLAG_NAME[FLAG_MAX+1] = {
3838
/* FLAG_CLOCK */ "clock",
3939
/* FLAG_CPU */ "cpu",
4040
/* FLAG_DASSL_JACOBIAN */ "dasslJacobian",
41-
/* FLAG_DASSL_NO_ROOTFINDING */ "dasslnoRootFinding",
4241
/* FLAG_DASSL_NO_RESTART */ "dasslnoRestart",
42+
/* FLAG_DASSL_NO_ROOTFINDING */ "dasslnoRootFinding",
4343
/* FLAG_EMIT_PROTECTED */ "emit_protected",
4444
/* FLAG_F */ "f",
4545
/* FLAG_HELP */ "help",
46+
/* FLAG_IGNORE_HIDERESULT */ "ignoreHideResult",
4647
/* FLAG_IIF */ "iif",
4748
/* FLAG_IIM */ "iim",
4849
/* FLAG_IIT */ "iit",
@@ -51,17 +52,17 @@ const char *FLAG_NAME[FLAG_MAX+1] = {
5152
/* FLAG_INPUT_FILE */ "exInputFile",
5253
/* FLAG_INPUT_FILE_STATES */ "stateFile",
5354
/* FLAG_IPOPT_HESSE*/ "ipopt_hesse",
54-
/* FLAG_IPOPT_JAC*/ "ipopt_jac",
5555
/* FLAG_IPOPT_INIT*/ "ipopt_init",
56+
/* FLAG_IPOPT_JAC*/ "ipopt_jac",
5657
/* FLAG_IPOPT_MAX_ITER */ "ipopt_max_iter",
5758
/* FLAG_IPOPT_WARM_START */ "ipopt_warm_start",
5859
/* FLAG_L */ "l",
5960
/* FLAG_LOG_FORMAT */ "logFormat",
6061
/* FLAG_LS */ "ls",
6162
/* FLAG_LS_IPOPT */ "ls_ipopt",
6263
/* FLAG_LV */ "lv",
63-
/* FLAG_MAX_STEP_SIZE */ "maxStepSize",
6464
/* FLAG_MAX_ORDER */ "maxIntegrationOrder",
65+
/* FLAG_MAX_STEP_SIZE */ "maxStepSize",
6566
/* FLAG_MEASURETIMEPLOTFORMAT */ "measureTimePlotFormat",
6667
/* FLAG_NEWTON_STRATEGY */ "newton",
6768
/* FLAG_NLS */ "nls",
@@ -72,15 +73,15 @@ const char *FLAG_NAME[FLAG_MAX+1] = {
7273
/* FLAG_NOEQUIDISTANT_OUT_TIME*/ "noEquidistantOutputTime",
7374
/* FLAG_NOEVENTEMIT */ "noEventEmit",
7475
/* FLAG_OPTDEBUGEJAC */ "optDebugeJac",
76+
/* FLAG_OPTIMIZER_NP */ "optimizerNP",
77+
/* FLAG_OPTIMIZER_TGRID */ "optimizerTimeGrid",
7578
/* FLAG_OUTPUT */ "output",
7679
/* FLAG_OVERRIDE */ "override",
7780
/* FLAG_OVERRIDE_FILE */ "overrideFile",
78-
/* FLAG_OPTIMIZER_NP */ "optimizerNP",
79-
/* FLAG_OPTIMIZER_TGRID */ "optimizerTimeGrid",
80-
/* FLAG_UP_HESSIAN */ "keepHessian",
8181
/* FLAG_PORT */ "port",
8282
/* FLAG_R */ "r",
8383
/* FLAG_S */ "s",
84+
/* FLAG_UP_HESSIAN */ "keepHessian",
8485
/* FLAG_W */ "w",
8586

8687
"FLAG_MAX"
@@ -94,11 +95,12 @@ const char *FLAG_DESC[FLAG_MAX+1] = {
9495
/* FLAG_CLOCK */ "selects the type of clock to use -clock=RT, -clock=CYC or -clock=CPU",
9596
/* FLAG_CPU */ "dumps the cpu-time into the results-file",
9697
/* FLAG_DASSL_JACOBIAN */ "selects the type of the jacobians that is used for the dassl solver.\n dasslJacobian=[coloredNumerical (default) |numerical|internalNumerical|coloredSymbolical|symbolical].",
97-
/* FLAG_DASSL_NO_ROOTFINDING */ "flag deactivates the internal root finding procedure of dassl.",
9898
/* FLAG_DASSL_NO_RESTART */ "flag deactivates the restart of dassl after an event is performed.",
99+
/* FLAG_DASSL_NO_ROOTFINDING */ "flag deactivates the internal root finding procedure of dassl.",
99100
/* FLAG_EMIT_PROTECTED */ "emits protected variables to the result-file",
100101
/* FLAG_F */ "value specifies a new setup XML file to the generated simulation code",
101102
/* FLAG_HELP */ "get detailed information that specifies the command-line flag",
103+
/* FLAG_IGNORE_HIDERESULT */ "ignore HideResult=true annotation",
102104
/* FLAG_IIF */ "value specifies an external file for the initialization of the model",
103105
/* FLAG_IIM */ "value specifies the initialization method",
104106
/* FLAG_IIT */ "[double] value specifies a time for the initialization of the model",
@@ -107,17 +109,17 @@ const char *FLAG_DESC[FLAG_MAX+1] = {
107109
/* FLAG_INPUT_FILE */ "value specifies an external file with inputs for the simulation/optimization of the model",
108110
/* FLAG_INPUT_FILE_STATES */ "value specifies an file with states start values for the optimization of the model",
109111
/* FLAG_IPOPT_HESSE */ "value specifies the hessian for Ipopt",
110-
/* FLAG_IPOPT_JAC */ "value specifies the jacobian for Ipopt",
111112
/* FLAG_IPOPT_INIT */ "value specifies the initial guess for optimization",
113+
/* FLAG_IPOPT_JAC */ "value specifies the jacobian for Ipopt",
112114
/* FLAG_IPOPT_MAX_ITER */ "value specifies the max number of iteration for ipopt",
113115
/* FLAG_IPOPT_WARM_START */ "value specifies lvl for a warm start in ipopt: 1,2,3,...",
114116
/* FLAG_L */ "value specifies a time where the linearization of the model should be performed",
115117
/* FLAG_LOG_FORMAT */ "value specifies the log format of the executable. -logFormat=text (default) or -logFormat=xml",
116118
/* FLAG_LS */ "value specifies the linear solver method",
117119
/* FLAG_LS_IPOPT */ "value specifies the linear solver method for ipopt",
118120
/* FLAG_LV */ "[string list] value specifies the logging level",
119-
/* FLAG_MAX_STEP_SIZE */ "value specifies maximum absolute step size, used by dassl solver",
120121
/* FLAG_MAX_ORDER */ "value specifies maximum integration order, used by dassl solver",
122+
/* FLAG_MAX_STEP_SIZE */ "value specifies maximum absolute step size, used by dassl solver",
121123
/* FLAG_MEASURETIMEPLOTFORMAT */ "value specifies the output format of the measure time functionality",
122124
/* FLAG_NEWTON_STRATEGY */ "value specifies the damping strategy for the newton solver",
123125
/* FLAG_NLS */ "value specifies the nonlinear solver",
@@ -128,15 +130,15 @@ const char *FLAG_DESC[FLAG_MAX+1] = {
128130
/* FLAG_NOEQUIDISTANT_OUT_TIME*/ "value controls the output time point in noEquidistantOutputTime mode",
129131
/* FLAG_NOEVENTEMIT */ "do not emit event points to the result file",
130132
/* FLAG_OPTDEBUGEJAC */ "value specifies the number of iter from the dyn. optimization, which will be debuge, creating *csv and *py file",
133+
/* FLAG_OPTIMIZER_NP */ "value specifies the number of points in a subinterval",
134+
/* FLAG_OPTIMIZER_TGRID */ "value specifies external file with time points.",
131135
/* FLAG_OUTPUT */ "output the variables a, b and c at the end of the simulation to the standard output",
132136
/* FLAG_OVERRIDE */ "override the variables or the simulation settings in the XML setup file",
133137
/* FLAG_OVERRIDE_FILE */ "will override the variables or the simulation settings in the XML setup file with the values from the file",
134-
/* FLAG_OPTIMIZER_NP */ "value specifies the number of points in a subinterval",
135-
/* FLAG_OPTIMIZER_TGRID */ "value specifies external file with time points.",
136-
/* FLAG_UP_HESSIAN */ "value specifies the number of steps, which keep hessian matrix constant",
137138
/* FLAG_PORT */ "value specifies the port for simulation status (default disabled)",
138139
/* FLAG_R */ "value specifies a new result file than the default Model_res.mat",
139140
/* FLAG_S */ "value specifies the solver",
141+
/* FLAG_UP_HESSIAN */ "value specifies the number of steps, which keep hessian matrix constant",
140142
/* FLAG_W */ "shows all warnings even if a related log-stream is inactive",
141143

142144
"FLAG_MAX"
@@ -162,17 +164,19 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
162164
" * coloredSymbolical (colored symbolical Jacobian. Only usable if the simulation is compiled with --generateSymbolicJacobian or --generateSymbolicLinearization.\n"
163165
" * numerical - numerical Jacobian.\n\n"
164166
" * symbolical - symbolical Jacobian. Only usable if the simulation is compiled with --generateSymbolicJacobian or --generateSymbolicLinearization.",
165-
/* FLAG_DASSL_NO_ROOTFINDING */
166-
" Deactivates the internal root finding procedure of dassl.",
167167
/* FLAG_DASSL_NO_RESTART */
168168
" Deactivates the restart of dassl after an event is performed.",
169+
/* FLAG_DASSL_NO_ROOTFINDING */
170+
" Deactivates the internal root finding procedure of dassl.",
169171
/* FLAG_EMIT_PROTECTED */
170172
" Emits protected variables to the result-file.",
171173
/* FLAG_F */
172174
" Value specifies a new setup XML file to the generated simulation code.\n",
173175
/* FLAG_HELP */
174176
" Get detailed information that specifies the command-line flag\n"
175177
" For example, -help=f prints detailed information for command-line flag f.",
178+
/* FLAG_IGNORE_HIDERESULT */
179+
" Emits also variables with HideResult=true annotation.",
176180
/* FLAG_IIF */
177181
" Value specifies an external file for the initialization of the model.",
178182
/* FLAG_IIM */
@@ -190,10 +194,10 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
190194
" Value specifies an file with states start values for the optimization of the model.",
191195
/* FLAG_IPOPT_HESSE */
192196
" Value specifies the hessematrix for Ipopt(OMC, BFGS, const).",
193-
/* FLAG_IPOPT_JAC */
194-
" Value specifies the jacobian for Ipopt(SYM, NUM, NUMDENSE).",
195197
/* FLAG_IPOPT_INIT */
196198
" Value specifies the initial guess for optimization (sim, const).",
199+
/* FLAG_IPOPT_JAC */
200+
" Value specifies the jacobian for Ipopt(SYM, NUM, NUMDENSE).",
197201
/* FLAG_IPOPT_MAX_ITER */
198202
" Value specifies the max number of iteration for ipopt.",
199203
/* FLAG_IPOPT_WARM_START */
@@ -212,10 +216,10 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
212216
/* FLAG_LV */
213217
" Value (a comma-separated String list) specifies which logging levels to\n"
214218
" enable. Multiple options can be enabled at the same time.",
215-
/* FLAG_MAX_STEP_SIZE */
216-
" Value specifies maximum absolute step size, used by dassl solver.",
217219
/* FLAG_MAX_ORDER */
218220
" Value specifies maximum integration order, used by dassl solver.",
221+
/* FLAG_MAX_STEP_SIZE */
222+
" Value specifies maximum absolute step size, used by dassl solver.",
219223
/* FLAG_MEASURETIMEPLOTFORMAT */
220224
" Value specifies the output format of the measure time functionality\n\n"
221225
" * svg\n"
@@ -249,6 +253,11 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
249253
/* FLAG_OPTDEBUGEJAC */
250254
" Value specifies the number of itereations from the dynamic optimization, which\n"
251255
" will be debugged, creating .csv and .py files.",
256+
/* FLAG_OPTIMIZER_NP */
257+
" Value specifies the number of points in a subinterval.\n"
258+
" Currently supports numbers 1 and 3.",
259+
/* FLAG_OPTIMIZER_TGRID */
260+
" Value specifies external file with time points.",
252261
/* FLAG_OUTPUT */
253262
" Output the variables a, b and c at the end of the simulation to the standard\n"
254263
" output: time = value, a = value, b = value, c = value",
@@ -261,13 +270,6 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
261270
" Note that: -overrideFile CANNOT be used with -override.\n"
262271
" Use when variables for -override are too many.\n"
263272
" overrideFileName contains lines of the form: var1=start1",
264-
/* FLAG_OPTIMIZER_NP */
265-
" Value specifies the number of points in a subinterval.\n"
266-
" Currently supports numbers 1 and 3.",
267-
/* FLAG_OPTIMIZER_TGRID */
268-
" Value specifies external file with time points.",
269-
/* FLAG_UP_HESSIAN */
270-
" Value specifies the number of steps, which keep hessian matrix constant.",
271273
/* FLAG_PORT */
272274
" Value specifies the port for simulation status (default disabled).",
273275
/* FLAG_R */
@@ -276,6 +278,8 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
276278
" For example: Model_res.mat.",
277279
/* FLAG_S */
278280
" Value specifies the solver (integration method).",
281+
/* FLAG_UP_HESSIAN */
282+
" Value specifies the number of steps, which keep hessian matrix constant.",
279283
/* FLAG_W */
280284
" Shows all warnings even if a related log-stream is inactive.",
281285

@@ -290,11 +294,12 @@ const int FLAG_TYPE[FLAG_MAX] = {
290294
/* FLAG_CLOCK */ FLAG_TYPE_OPTION,
291295
/* FLAG_CPU */ FLAG_TYPE_FLAG,
292296
/* FLAG_DASSL_JACOBIAN */ FLAG_TYPE_OPTION,
293-
/* FLAG_DASSL_NO_ROOTFINDING */ FLAG_TYPE_FLAG,
294297
/* FLAG_DASSL_NO_RESTART */ FLAG_TYPE_FLAG,
298+
/* FLAG_DASSL_NO_ROOTFINDING */ FLAG_TYPE_FLAG,
295299
/* FLAG_EMIT_PROTECTED */ FLAG_TYPE_FLAG,
296300
/* FLAG_F */ FLAG_TYPE_OPTION,
297301
/* FLAG_HELP */ FLAG_TYPE_OPTION,
302+
/* FLAG_IGNORE_HIDERESULT */ FLAG_TYPE_FLAG,
298303
/* FLAG_IIF */ FLAG_TYPE_OPTION,
299304
/* FLAG_IIM */ FLAG_TYPE_OPTION,
300305
/* FLAG_IIT */ FLAG_TYPE_OPTION,
@@ -303,17 +308,17 @@ const int FLAG_TYPE[FLAG_MAX] = {
303308
/* FLAG_INPUT_FILE */ FLAG_TYPE_OPTION,
304309
/* FLAG_INPUT_FILE_STATES */ FLAG_TYPE_OPTION,
305310
/* FLAG_IPOPT_HESSE */ FLAG_TYPE_OPTION,
306-
/* FLAG_IPOPT_JAC */ FLAG_TYPE_OPTION,
307311
/* FLAG_IPOPT_INIT */ FLAG_TYPE_OPTION,
312+
/* FLAG_IPOPT_JAC */ FLAG_TYPE_OPTION,
308313
/* FLAG_IPOPT_MAX_ITER */ FLAG_TYPE_OPTION,
309314
/* FLAG_IPOPT_WARM_START */ FLAG_TYPE_OPTION,
310315
/* FLAG_L */ FLAG_TYPE_OPTION,
311316
/* FLAG_LOG_FORMAT */ FLAG_TYPE_OPTION,
312317
/* FLAG_LS */ FLAG_TYPE_OPTION,
313318
/* FLAG_LS_IPOPT */ FLAG_TYPE_OPTION,
314319
/* FLAG_LV */ FLAG_TYPE_OPTION,
315-
/* FLAG_MAX_STEP_SIZE */ FLAG_TYPE_OPTION,
316320
/* FLAG_MAX_ORDER */ FLAG_TYPE_OPTION,
321+
/* FLAG_MAX_STEP_SIZE */ FLAG_TYPE_OPTION,
317322
/* FLAG_MEASURETIMEPLOTFORMAT */ FLAG_TYPE_OPTION,
318323
/* FLAG_NEWTON_STRATEGY */ FLAG_TYPE_OPTION,
319324
/* FLAG_NLS */ FLAG_TYPE_OPTION,
@@ -324,15 +329,15 @@ const int FLAG_TYPE[FLAG_MAX] = {
324329
/* FLAG_NOEQUIDISTANT_OUT_TIME*/ FLAG_TYPE_OPTION,
325330
/* FLAG_NOEVENTEMIT */ FLAG_TYPE_FLAG,
326331
/* FLAG_OPTDEBUGEJAC */ FLAG_TYPE_OPTION,
332+
/* FLAG_OPTIZER_NP */ FLAG_TYPE_OPTION,
333+
/* FLAG_OPTIZER_TGRID */ FLAG_TYPE_OPTION,
327334
/* FLAG_OUTPUT */ FLAG_TYPE_OPTION,
328335
/* FLAG_OVERRIDE */ FLAG_TYPE_OPTION,
329336
/* FLAG_OVERRIDE_FILE */ FLAG_TYPE_OPTION,
330-
/* FLAG_OPTIZER_NP */ FLAG_TYPE_OPTION,
331-
/* FLAG_OPTIZER_TGRID */ FLAG_TYPE_OPTION,
332-
/* FLAG_UP_HESSIAN */ FLAG_TYPE_OPTION,
333337
/* FLAG_PORT */ FLAG_TYPE_OPTION,
334338
/* FLAG_R */ FLAG_TYPE_OPTION,
335339
/* FLAG_S */ FLAG_TYPE_OPTION,
340+
/* FLAG_UP_HESSIAN */ FLAG_TYPE_OPTION,
336341
/* FLAG_W */ FLAG_TYPE_FLAG
337342
};
338343

SimulationRuntime/c/util/simulation_options.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ enum _FLAG
4646
FLAG_CLOCK,
4747
FLAG_CPU,
4848
FLAG_DASSL_JACOBIAN,
49-
FLAG_DASSL_NO_ROOTFINDING,
5049
FLAG_DASSL_NO_RESTART,
50+
FLAG_DASSL_NO_ROOTFINDING,
5151
FLAG_EMIT_PROTECTED,
5252
FLAG_F,
5353
FLAG_HELP,
54+
FLAG_IGNORE_HIDERESULT,
5455
FLAG_IIF,
5556
FLAG_IIM,
5657
FLAG_IIT,
@@ -59,17 +60,17 @@ enum _FLAG
5960
FLAG_INPUT_FILE,
6061
FLAG_INPUT_FILE_STATES,
6162
FLAG_IPOPT_HESSE,
62-
FLAG_IPOPT_JAC,
6363
FLAG_IPOPT_INIT,
64+
FLAG_IPOPT_JAC,
6465
FLAG_IPOPT_MAX_ITER,
6566
FLAG_IPOPT_WARM_START,
6667
FLAG_L,
6768
FLAG_LOG_FORMAT,
6869
FLAG_LS,
6970
FLAG_LS_IPOPT,
7071
FLAG_LV,
71-
FLAG_MAX_STEP_SIZE,
7272
FLAG_MAX_ORDER,
73+
FLAG_MAX_STEP_SIZE,
7374
FLAG_MEASURETIMEPLOTFORMAT,
7475
FLAG_NEWTON_STRATEGY,
7576
FLAG_NLS,
@@ -80,15 +81,15 @@ enum _FLAG
8081
FLAG_NOEQUIDISTANT_OUT_TIME,
8182
FLAG_NOEVENTEMIT,
8283
FLAG_OPTDEBUGEJAC,
84+
FLAG_OPTIMIZER_NP,
85+
FLAG_OPTIMIZER_TGRID,
8386
FLAG_OUTPUT,
8487
FLAG_OVERRIDE,
8588
FLAG_OVERRIDE_FILE,
86-
FLAG_OPTIMIZER_NP,
87-
FLAG_OPTIMIZER_TGRID,
88-
FLAG_UP_HESSIAN,
8989
FLAG_PORT,
9090
FLAG_R,
9191
FLAG_S,
92+
FLAG_UP_HESSIAN,
9293
FLAG_W,
9394

9495
FLAG_MAX

0 commit comments

Comments
 (0)