Skip to content

Commit

Permalink
- move initialization of stateSelection properly
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23987 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Jan 9, 2015
1 parent dc6377d commit 484c891
Showing 1 changed file with 12 additions and 12 deletions.
Expand Up @@ -662,7 +662,8 @@ static int symbolic_initialization(DATA *data, long numLambdaSteps)
storePreValues(data);
overwriteOldSimulationData(data);

if (data->callback->useHomotopy && numLambdaSteps > 1) {
if (data->callback->useHomotopy && numLambdaSteps > 1)
{
long i;
char buffer[4096];
FILE *pFile = NULL;
Expand Down Expand Up @@ -754,17 +755,6 @@ static int symbolic_initialization(DATA *data, long numLambdaSteps)
}
storeRelations(data);

/* do pivoting for dynamic state selection if selection changed try again an */
if(stateSelection(data, 0, 1) == 1)
{
data->callback->functionInitialEquations(data);
storeRelations(data);

/* report a warning about strange start values */
if(stateSelection(data, 0, 1) == 1)
warningStreamPrint(LOG_STDOUT, 0, "Cannot initialize the dynamic state selection in an unique way. Use -lv LOG_DSS to see the switching state set.");
}

/* check for over-determined systems */
retVal = data->callback->functionRemovedInitialEquations(data);

Expand Down Expand Up @@ -1138,6 +1128,16 @@ int initialization(DATA *data, const char* pInitMethod, const char* pOptiMethod,
{
throwStreamPrint(data->threadData, "unsupported option -iim");
}

/* do pivoting for dynamic state selection if selection changed try again */
if(stateSelection(data, 0, 1) == 1)
{
if(stateSelection(data, 1, 1) == 1)
{
/* report a warning about strange start values */
warningStreamPrint(LOG_STDOUT, 0, "Cannot initialize the dynamic state selection in an unique way. Use -lv LOG_DSS to see the switching state set.");
}
}

/* check for unsolved (nonlinear|linear|mixed) systems
* This is a workaround and should be removed as soon as possible.
Expand Down

0 comments on commit 484c891

Please sign in to comment.