init processings at a later time

pull/1/head
Thorsten Liebig 2011-02-16 10:11:39 +01:00
parent 9619df7ec0
commit 277b746462
4 changed files with 20 additions and 2 deletions

View File

@ -53,9 +53,11 @@ public:
//! Used file pattern e.g. pattern="tmp/efield_" --> "tmp/efield_000045.vtk" for timestep 45 or "tmp/efield_2.40000e9.vtk" for 2.4GHz E-field dump. (VTK FileType only) \sa SetFileType() //! Used file pattern e.g. pattern="tmp/efield_" --> "tmp/efield_000045.vtk" for timestep 45 or "tmp/efield_2.40000e9.vtk" for 2.4GHz E-field dump. (VTK FileType only) \sa SetFileType()
void SetFilePattern(string fp) {m_filename=filePattern=fp;} void SetFilePattern(string fp) {m_filename=filePattern=fp;}
string GetFilePattern() const {return filePattern;}
//! Set the filename for a hdf5 data group file (HDF5 FileType only) \sa SetFileType() //! Set the filename for a hdf5 data group file (HDF5 FileType only) \sa SetFileType()
void SetFileName(string fn) {m_filename=fn;} void SetFileName(string fn) {m_filename=fn;}
string SetFileName() const {return m_filename;}
//! Define the Dump-Mode //! Define the Dump-Mode
void SetDumpMode(Engine_Interface_Base::InterpolationType mode); void SetDumpMode(Engine_Interface_Base::InterpolationType mode);

View File

@ -273,6 +273,14 @@ void ProcessingArray::AddProcessing(Processing* proc)
ProcessArray.push_back(proc); ProcessArray.push_back(proc);
} }
void ProcessingArray::InitAll()
{
for (size_t i=0; i<ProcessArray.size(); ++i)
{
ProcessArray.at(i)->InitProcess();
}
}
void ProcessingArray::FlushNext() void ProcessingArray::FlushNext()
{ {
for (size_t i=0; i<ProcessArray.size(); ++i) for (size_t i=0; i<ProcessArray.size(); ++i)

View File

@ -48,6 +48,7 @@ public:
void SetEngineInterface(Engine_Interface_Base* eng_if); void SetEngineInterface(Engine_Interface_Base* eng_if);
virtual void SetName(string val) {m_Name=val;} virtual void SetName(string val) {m_Name=val;}
virtual string GetName() const {return m_Name;}
//! Get the name for this processing, will be used in file description. //! Get the name for this processing, will be used in file description.
virtual string GetProcessingName() const = 0; virtual string GetProcessingName() const = 0;
@ -159,6 +160,8 @@ public:
void AddProcessing(Processing* proc); void AddProcessing(Processing* proc);
void InitAll();
//! Invoke this flag to flush all stored data to disk for all processings on next Process() //! Invoke this flag to flush all stored data to disk for all processings on next Process()
void FlushNext(); void FlushNext();
@ -178,6 +181,10 @@ public:
void DumpBoxes2File( string vtkfilenameprefix ) const; void DumpBoxes2File( string vtkfilenameprefix ) const;
size_t GetNumberOfProcessings() const {return ProcessArray.size();}
Processing* GetProcessing(size_t number) {return ProcessArray.at(number);}
protected: protected:
unsigned int maxInterval; unsigned int maxInterval;
vector<Processing*> ProcessArray; vector<Processing*> ProcessArray;

View File

@ -345,7 +345,6 @@ bool openEMS::SetupProcessing()
proc->SetName(pb->GetName()); proc->SetName(pb->GetName());
proc->DefineStartStopCoord(start,stop); proc->DefineStartStopCoord(start,stop);
proc->SetWeight(pb->GetWeighting()); proc->SetWeight(pb->GetWeighting());
proc->InitProcess();
PA->AddProcessing(proc); PA->AddProcessing(proc);
prim->SetPrimitiveUsed(true); prim->SetPrimitiveUsed(true);
} }
@ -424,7 +423,6 @@ bool openEMS::SetupProcessing()
ProcField->SetFilePattern(db->GetName()); ProcField->SetFilePattern(db->GetName());
ProcField->SetFileName(db->GetName()); ProcField->SetFileName(db->GetName());
ProcField->DefineStartStopCoord(start,stop); ProcField->DefineStartStopCoord(start,stop);
ProcField->InitProcess();
PA->AddProcessing(ProcField); PA->AddProcessing(ProcField);
prim->SetPrimitiveUsed(true); prim->SetPrimitiveUsed(true);
} }
@ -686,6 +684,9 @@ void openEMS::RunFDTD()
PA->AddProcessing(ProcField); PA->AddProcessing(ProcField);
double maxE=0,currE=0; double maxE=0,currE=0;
//init processings
PA->InitAll();
//add all timesteps to end-crit field processing with max excite amplitude //add all timesteps to end-crit field processing with max excite amplitude
unsigned int maxExcite = FDTD_Op->Exc->GetMaxExcitationTimestep(); unsigned int maxExcite = FDTD_Op->Exc->GetMaxExcitationTimestep();
for (unsigned int n=0; n<FDTD_Op->Exc->Volt_Count; ++n) for (unsigned int n=0; n<FDTD_Op->Exc->Volt_Count; ++n)