Skip to content

Commit

Permalink
added a warning in dyn. optimization
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22130 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Vitalij Ruge committed Sep 4, 2014
1 parent 3fa198c commit 1dc9639
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions SimulationRuntime/c/optimization/DataManagement/MoveData.c
Expand Up @@ -708,6 +708,7 @@ static inline void pickUpStates(OptData* optData){
warningStreamPrint(LOG_STDOUT, 0, "OMC can't find the file %s.",cflags);
}else{
int c, n = 0;
modelica_boolean b;
while(1){
c = fgetc(pFile);
if (c==EOF) break;
Expand All @@ -731,18 +732,23 @@ static inline void pickUpStates(OptData* optData){
fscanf(pFile, "%s", buffer);
fscanf(pFile, "%lf", &start_value);

printf("\nset %s.start %g", buffer,start_value);
printf("\n[%i]set %s.start %g", i, buffer,start_value);

for(j = 0; j < optData->dim.nx; ++j){
for(j = 0, b = 0; j < optData->dim.nx; ++j){
if(!strcmp(optData->data->modelData.realVarsData[j].info.name, buffer)){
optData->data->localData[0]->realVars[i] = start_value;
optData->data->localData[1]->realVars[i] = start_value;
optData->data->localData[2]->realVars[i] = start_value;
optData->v0[i] = start_value;
b = 1;
continue;
}
}
if(!b)
warningStreamPrint(LOG_STDOUT, 0, "it was impossible to set %s.start %g", buffer,start_value);

}
printf("\n");
/*update system*/
optData->data->callback->input_function(optData->data);
optData->data->callback->functionDAE(optData->data);
Expand Down

0 comments on commit 1dc9639

Please sign in to comment.