Changeset 7605dee0 in OpenModelica


Ignore:
Timestamp:
2020-10-21T18:53:49+02:00 (3 years ago)
Author:
Adrian Pop <adrian.pop@…>
Branches:
maintenance/v1.16
Children:
7a6667d1
Parents:
82316a99
git-author:
AnHeuermann <andreas.heuermann@…> (10/08/20 12:42:39)
git-committer:
Adrian Pop <adrian.pop@…> (10/21/20 18:53:49)
Message:

Add output path to CSV file for homotopy logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/SimulationRuntime/c/simulation/solver/initialization/initialization.c

    r82316a99 r7605dee0  
    284284    if(ACTIVE_STREAM(LOG_INIT_HOMOTOPY))
    285285    {
    286       sprintf(buffer, "%s_equidistant_global_homotopy.csv", mData->modelFilePrefix);
     286      if (omc_flag[FLAG_OUTPUT_PATH]) { /* Add output path to file name */
     287        sprintf(buffer, "%s/%s_equidistant_global_homotopy.csv", omc_flagValue[FLAG_OUTPUT_PATH], mData->modelFilePrefix);
     288      }
     289      else
     290      {
     291        sprintf(buffer, "%s_equidistant_global_homotopy.csv", mData->modelFilePrefix);
     292      }
    287293      infoStreamPrint(LOG_INIT_HOMOTOPY, 0, "The homotopy path will be exported to %s.", buffer);
    288294      pFile = omc_fopen(buffer, "wt");
     295      if (pFile == NULL)
     296      {
     297        throwStreamPrint(threadData, "Could not write to `%s`.", buffer);
     298      }
    289299      fprintf(pFile, "\"lambda\"");
    290300      for(i=0; i<mData->nVariablesReal; ++i) {
Note: See TracChangeset for help on using the changeset viewer.