diff --git a/Common/processing.cpp b/Common/processing.cpp index 9697990..3460b4f 100644 --- a/Common/processing.cpp +++ b/Common/processing.cpp @@ -185,6 +185,11 @@ void Processing::OpenFile( string outfile ) m_filename = outfile; } +void Processing::PostProcess() +{ + FlushData(); +} + void Processing::DumpBox2File( string vtkfilenameprefix, bool dualMesh ) const { string vtkfilename = vtkfilenameprefix + m_filename + ".vtk"; @@ -252,30 +257,6 @@ void Processing::DumpBox2File( string vtkfilenameprefix, bool dualMesh ) const file.close(); } -void Processing::Dump_FD_Data(vector value, double factor, string filename) -{ - if (value.size()==0) - return; - if (value.size()!=m_FD_Samples.size()) - { - cerr << "Processing::Dump_FD_Data: Error: Complex value and frequency vector have different size! This should never happend!!!" << endl; - return; - } - ofstream file; - file.open( filename.c_str() ); - if (!file.is_open()) - cerr << "Can't open file: " << filename << endl; - - time_t rawTime; - time(&rawTime); - file << "%dump by openEMS @" << ctime(&rawTime) << "%frequency\treal\timag\n"; - for (size_t n=0; n value, double factor, string filename); - //! define if given coords are on main or dualMesh (default is false) bool m_dualMesh; diff --git a/Common/processintegral.cpp b/Common/processintegral.cpp index 52c4510..4fb0a8b 100644 --- a/Common/processintegral.cpp +++ b/Common/processintegral.cpp @@ -21,29 +21,68 @@ ProcessIntegral::ProcessIntegral(Engine_Interface_Base* eng_if) : Processing(eng_if) { m_Results=NULL; + m_FD_Results=NULL; } ProcessIntegral::~ProcessIntegral() { delete[] m_Results; + delete[] m_FD_Results; m_Results = NULL; - ProcessIntegral::FlushData(); + m_FD_Results = NULL; } void ProcessIntegral::InitProcess() { + delete[] m_Results; + delete[] m_FD_Results; + m_Results = new double[GetNumberOfIntegrals()]; + m_FD_Results = new vector[GetNumberOfIntegrals()]; + m_filename = m_Name; OpenFile(m_filename); - FD_Values.clear(); - for (size_t n=0; nGetTime(m_dualTime); if (ProcessInterval) { if (m_Eng_Interface->GetNumberOfTimesteps()%ProcessInterval==0) { - TD_Values.push_back(integral); file << setprecision(m_precision) << time; for (int n=0; nGetNumberOfTimesteps()%m_FD_Interval==0) { - double T = time; for (size_t n=0; n TD_Values; - vector FD_Values; + void Dump_FD_Data(double factor, string filename); + vector *m_FD_Results; double *m_Results; };