Skip to content

Commit

Permalink
- Updated the default outputFormat of simulations to be .mat
Browse files Browse the repository at this point in the history
  - Only mosfiles-dassl/Sample2.mos changed its output; this seems to be because we have an event at the last time-step. I'll see if we can change the interpolation to always find the right limit


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7997 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Feb 24, 2011
1 parent ab52ae8 commit 7a39a8e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Compiler/Script/CevalScript.mo
Expand Up @@ -170,7 +170,7 @@ public constant DAE.Exp defaultFileNamePrefix = DAE.SCONST("") "default
public constant DAE.Exp defaultStoreInTemp = DAE.BCONST(false) "default storeInTemp";
public constant DAE.Exp defaultNoClean = DAE.BCONST(false) "default noClean";
public constant DAE.Exp defaultOptions = DAE.SCONST("") "default options";
public constant DAE.Exp defaultOutputFormat = DAE.SCONST("plt") "default outputFormat";
public constant DAE.Exp defaultOutputFormat = DAE.SCONST("mat") "default outputFormat";
public constant DAE.Exp defaultVariableFilter = DAE.SCONST(".*") "default variableFilter; does whole string matching, i.e. it becomes ^.*$ in the runtime";

public constant SimulationOptions defaultSimulationOptions =
Expand Down
4 changes: 2 additions & 2 deletions c_runtime/simulation_result_csv.cpp
Expand Up @@ -86,9 +86,9 @@ simulation_result_csv::simulation_result_csv(const char* filename, long numpoint
for (int i = 0; i < globalData->nAlgebraic; i++) if (!globalData->algebraicsFilterOutput[i])
fprintf(fout, format, globalData->algebraicsNames[i].name);
for (int i = 0; i < globalData->intVariables.nAlgebraic; i++) if (!globalData->intVariables.algebraicsFilterOutput[i])
fprintf(fout, format, globalData->int_alg_names[i]);
fprintf(fout, format, globalData->int_alg_names[i].name);
for (int i = 0; i < globalData->boolVariables.nAlgebraic; i++) if (!globalData->boolVariables.algebraicsFilterOutput[i])
fprintf(fout, format, globalData->bool_alg_names[i]);
fprintf(fout, format, globalData->bool_alg_names[i].name);

fprintf(fout,"\n");
}
Expand Down
3 changes: 2 additions & 1 deletion c_runtime/simulation_result_mat.cpp
Expand Up @@ -203,12 +203,13 @@ long simulation_result_mat::flattenStrBuf(int rank, const int *dims,

// allocate memory
dest = new char[longest*nstrings+1];
memset(dest,longest*nstrings+1,sizeof(char));
if (!dest) throw SimulationResultMallocException();
// copy data
char *ptr = dest;
for (i = 0; i < rank; ++i)
for (j = 0; j < dims[i]; ++j) {
strncpy(ptr,useComment ? src[i][j].comment : src[i][j].name,longest);
strncpy(ptr,useComment ? src[i][j].comment : src[i][j].name,longest+1 /* ensures that we get \0 after the longest string*/);
if (fixNames) fixDerInName(ptr,strlen(useComment ? src[i][j].comment : src[i][j].name));
ptr += longest;
}
Expand Down

0 comments on commit 7a39a8e

Please sign in to comment.