From 0806edb7d661b26f657e6603219003813f5a8b2b Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Mon, 24 Jan 2011 09:25:33 +0100 Subject: [PATCH] ProcessFields: new fix for dynamic memory hdf5 dumps --- Common/processfields.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/Common/processfields.cpp b/Common/processfields.cpp index 1c6c295..cf147d4 100644 --- a/Common/processfields.cpp +++ b/Common/processfields.cpp @@ -449,21 +449,23 @@ bool ProcessFields::DumpVectorArray2HDF5(string filename, string groupName, stri // I have not the slightest idea why this array-copy action is necessary... but it's the only way hdf5 does what it is supposed to do anyway!! // at least it is save in case FDTD_FLOAT was defined as double... // why does hdf5 write the dimensions backwards??? or matlab??? - float hdf5array[3][numLines[2]][numLines[1]][numLines[0]]; + unsigned long pos = 0; + float *hdf5array = new float[3*numLines[0]*numLines[1]*numLines[2]]; for (int n=0; n<3; ++n) { - for (unsigned int i=0; i