Skip to content

Commit ef9e327

Browse files
committed
- fix inconsistent flags iim and iom
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16639 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent ef81fa6 commit ef9e327

File tree

4 files changed

+72
-58
lines changed

4 files changed

+72
-58
lines changed

SimulationRuntime/c/simulation/simulation_runtime.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
#include "nonlinearSystem.h"
7373
#include "rtclock.h"
7474
#include "../../../Compiler/runtime/config.h"
75+
#include "initialization.h"
7576

7677
#ifdef _OMC_QSS_LIB
7778
#include "solver_qss/solver_qss.h"
@@ -772,10 +773,24 @@ int initRuntimeAndSimulation(int argc, char**argv, DATA *data)
772773

773774
/* detailed information for some flags */
774775
INDENT(LOG_STDOUT);
775-
if(i == FLAG_LV)
776+
if(FLAG_LV == i)
776777
{
777778
for(j=firstOMCErrorStream; j<LOG_MAX; ++j)
778-
INFO2(LOG_STDOUT, " %-18s [%s]", LOG_STREAM_NAME[j], LOG_STREAM_DESC[j]);
779+
INFO2(LOG_STDOUT, "%-18s [%s]", LOG_STREAM_NAME[j], LOG_STREAM_DESC[j]);
780+
}
781+
else if(FLAG_IIM == i)
782+
{
783+
for(j=1; j<IIM_MAX; ++j)
784+
INFO2(LOG_STDOUT, "%-18s [%s]", initMethodStr[j], initMethodDescStr[j]);
785+
}
786+
else if(FLAG_IOM == i)
787+
{
788+
for(j=1; j<IOM_MAX; ++j)
789+
INFO2(LOG_STDOUT, "%-18s [%s]", optiMethodStr[j], optiMethodDescStr[j]);
790+
}
791+
else if(FLAG_S == i)
792+
{
793+
/* TODO */
779794
}
780795
RELEASE(LOG_STDOUT);
781796

SimulationRuntime/c/simulation/solver/initialization/initialization.c

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -55,59 +55,6 @@
5555
#include <math.h>
5656
#include <string.h>
5757

58-
enum INIT_INIT_METHOD
59-
{
60-
IIM_UNKNOWN = 0,
61-
IIM_NONE,
62-
IIM_NUMERIC,
63-
IIM_SYMBOLIC,
64-
IIM_MAX
65-
};
66-
67-
static const char *initMethodStr[IIM_MAX] = {
68-
"unknown",
69-
"none",
70-
"numeric",
71-
"symbolic"
72-
};
73-
static const char *initMethodDescStr[IIM_MAX] = {
74-
"unknown",
75-
"no initialization method",
76-
"solves the initialization problem numerically",
77-
"solves the initialization problem symbolically - default"
78-
};
79-
80-
enum INIT_OPTI_METHOD
81-
{
82-
IOM_UNKNOWN = 0,
83-
IOM_SIMPLEX,
84-
IOM_NEWUOA,
85-
IOM_NELDER_MEAD_EX,
86-
IOM_KINSOL,
87-
IOM_KINSOL_SCALED,
88-
IOM_IPOPT,
89-
IOM_MAX
90-
};
91-
92-
static const char *optiMethodStr[IOM_MAX] = {
93-
"unknown",
94-
"simplex",
95-
"newuoa",
96-
"nelder_mead_ex",
97-
"kinsol",
98-
"kinsol_scaled",
99-
"ipopt"
100-
};
101-
static const char *optiMethodDescStr[IOM_MAX] = {
102-
"unknown",
103-
"Nelder-Mead method",
104-
"Brent's method",
105-
"Nelder-Mead method with global homotopy (see -ils for global homotopy) - default",
106-
"sundials/kinsol",
107-
"sundials/kinsol with scaling",
108-
"Interior Point OPTimizer"
109-
};
110-
11158
/*! \fn int reportResidualValue(INIT_DATA *initData)
11259
*
11360
* return 1: if funcValue > 1e-5

SimulationRuntime/c/simulation/solver/initialization/initialization.h

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,58 @@
4343
extern "C"
4444
{
4545
#endif
46+
enum INIT_INIT_METHOD
47+
{
48+
IIM_UNKNOWN = 0,
49+
IIM_NONE,
50+
IIM_NUMERIC,
51+
IIM_SYMBOLIC,
52+
IIM_MAX
53+
};
54+
55+
static const char *initMethodStr[IIM_MAX] = {
56+
"unknown",
57+
"none",
58+
"numeric",
59+
"symbolic"
60+
};
61+
static const char *initMethodDescStr[IIM_MAX] = {
62+
"unknown",
63+
"no initialization method",
64+
"solves the initialization problem numerically",
65+
"solves the initialization problem symbolically - default"
66+
};
67+
68+
enum INIT_OPTI_METHOD
69+
{
70+
IOM_UNKNOWN = 0,
71+
IOM_SIMPLEX,
72+
IOM_NEWUOA,
73+
IOM_NELDER_MEAD_EX,
74+
IOM_KINSOL,
75+
IOM_KINSOL_SCALED,
76+
IOM_IPOPT,
77+
IOM_MAX
78+
};
79+
80+
static const char *optiMethodStr[IOM_MAX] = {
81+
"unknown",
82+
"simplex",
83+
"newuoa",
84+
"nelder_mead_ex",
85+
"kinsol",
86+
"kinsol_scaled",
87+
"ipopt"
88+
};
89+
static const char *optiMethodDescStr[IOM_MAX] = {
90+
"unknown",
91+
"Nelder-Mead method",
92+
"Brent's method",
93+
"Nelder-Mead method with global homotopy (see -ils for global homotopy) - default",
94+
"sundials/kinsol",
95+
"sundials/kinsol with scaling",
96+
"Interior Point OPTimizer"
97+
};
4698

4799
extern void dumpInitialization(INIT_DATA *initData);
48100
extern int reportResidualValue(INIT_DATA *initData);

SimulationRuntime/c/util/simulation_options.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
9898
/* FLAG_F */ "value specifies a new setup XML file to the generated simulation code",
9999
/* FLAG_HELP */ "get detailed information that specifies the command-line flag\n e.g. -help=f prints detailed information for command-line flag f",
100100
/* FLAG_IIF */ "value specifies an external file for the initialization of the model",
101-
/* FLAG_IIM */ "value specifies the initialization method\n none\n numeric\n symbolic",
101+
/* FLAG_IIM */ "value specifies the initialization method",
102102
/* FLAG_IIT */ "value specifies a time for the initialization of the model",
103103
/* FLAG_ILS */ "value specifies the number of steps for homotopy method (required: -iim=symbolic) or\n'start value homotopy' method (required: -iim=numeric -iom=nelder_mead_ex)",
104104
/* FLAG_INTERACTIVE */ "specify interactive simulation",
105-
/* FLAG_IOM */ "value specifies the initialization optimization method\n nelder_mead_ex\n simplex\n newuoa",
105+
/* FLAG_IOM */ "value specifies the initialization optimization method",
106106
/* FLAG_L */ "value specifies a time where the linearization of the model should be performed",
107107
/* FLAG_LS */ "value specifies the linear solver method\n lapack",
108108
/* FLAG_LV */ "value specifies the logging level",
@@ -114,7 +114,7 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
114114
/* FLAG_OVERRIDE_FILE */ "will override the variables or the simulation settings in the XML setup file with the values from the file\n note that: -overrideFile CANNOT be used with -override\n use when variables for -override are too many and do not fit in command line size\n overrideFileName contains lines of the form: var1=start1",
115115
/* FLAG_PORT */ "value specifies interactive simulation port",
116116
/* FLAG_R */ "value specifies a new result file than the default Model_res.mat",
117-
/* FLAG_S */ "value specifies the solver\n dassl\n euler\n rungekutta\n inline-euler\n inline-rungekutta\n dasslwort\n dasslSymJac\n dasslNumJac\n dasslColorSymJac\n dasslInternalNumJac\n qss",
117+
/* FLAG_S */ "value specifies the solver",
118118
/* FLAG_W */ "shows all warnings even if a related log-stream is inactive",
119119

120120
"FLAG_MAX"

0 commit comments

Comments
 (0)