diff --git a/Common/processing.cpp b/Common/processing.cpp index c3db8ec..9d18349 100644 --- a/Common/processing.cpp +++ b/Common/processing.cpp @@ -305,6 +305,11 @@ void ProcessingArray::DeleteAll() ProcessArray.clear(); } +void ProcessingArray::PreProcess() +{ + for (size_t i=0; iPreProcess(); +} + int ProcessingArray::Process() { int nextProcess=maxInterval; @@ -318,6 +323,11 @@ int ProcessingArray::Process() return nextProcess; } +void ProcessingArray::PostProcess() +{ + for (size_t i=0; iPostProcess(); +} + void ProcessingArray::DumpBoxes2File( string vtkfilenameprefix ) const { for (size_t i=0; i *freqs); bool CheckTimestep(); + + //! Process data prior to the simulation run. + virtual void PreProcess() {}; + + //! Process data during simulation run. virtual int Process() {return GetNextInterval();} + //! Process data after simulation has finished. + virtual void PostProcess() {}; + //! If disabled, Process() will do nothing... virtual void SetEnable(bool val) {Enabled=val;} //! If disabled, Process() will do nothing... @@ -152,8 +160,15 @@ public: //! Deletes all given processing's, can be helpful, but use carefull!!! void DeleteAll(); + //! Invoke PreProcess() on all Processings. + void PreProcess(); + + //! Invoke Process() on all Processings. Will return the smallest next iteration interval. int Process(); + //! Invoke PostProcess() on all Processings. + void PostProcess(); + void DumpBoxes2File( string vtkfilenameprefix ) const; protected: diff --git a/openems.cpp b/openems.cpp index 9d44726..b57565d 100644 --- a/openems.cpp +++ b/openems.cpp @@ -617,6 +617,7 @@ void openEMS::RunFDTD() //*************** simulate ************// + PA->PreProcess(); int step=PA->Process(); if ((step<0) || (step>(int)NrTS)) step=NrTS; while ((FDTD_Eng->GetNumberOfTimesteps()endCrit) && !CheckAbortCond()) @@ -654,6 +655,7 @@ void openEMS::RunFDTD() PA->FlushNext(); } } + PA->PostProcess(); //*************** postproc ************// prevTime = currTime;