diff --git a/Common/engine_interface_base.h b/Common/engine_interface_base.h index 846b608..0435ab8 100644 --- a/Common/engine_interface_base.h +++ b/Common/engine_interface_base.h @@ -44,9 +44,18 @@ public: //! Get the (interpolated) magnetic field at \p pos. \sa SetInterpolationType virtual double* GetHField(const unsigned int* pos, double* out) const {UNUSED(pos);return out;} + //! Calculate the electric field integral along a given line + virtual double CalcVoltageIntegral(const unsigned int* start, const unsigned int* stop) const {UNUSED(start);UNUSED(stop);return 0.0;} + //! Convert the interpolation type into a string. static std::string GetInterpolationNameByType(InterpolationType mode); + //! Get the current simulation time + virtual double GetTime(bool dualTime=false) const {UNUSED(dualTime);return 0.0;} + + //! Get the current number of timesteps + virtual unsigned int GetNumberOfTimesteps() const {return 0;} + protected: Engine_Interface_Base(); diff --git a/FDTD/engine_interface_fdtd.cpp b/FDTD/engine_interface_fdtd.cpp index e138e1f..19169e0 100644 --- a/FDTD/engine_interface_fdtd.cpp +++ b/FDTD/engine_interface_fdtd.cpp @@ -161,3 +161,24 @@ double* Engine_Interface_FDTD::GetHField(const unsigned int* pos, double* out) c return out; } + +double Engine_Interface_FDTD::CalcVoltageIntegral(const unsigned int* start, const unsigned int* stop) const +{ + double result=0; + for (int n=0;n<3;++n) + { + if (start[n]GetVolt(n,pos[0],pos[1],pos[2]); + } + else + { + unsigned int pos[3]={stop[0],stop[1],stop[2]}; + for (;pos[n]GetVolt(n,pos[0],pos[1],pos[2]); + } + } + return result; +} diff --git a/FDTD/engine_interface_fdtd.h b/FDTD/engine_interface_fdtd.h index c4e0ad1..f5118ca 100644 --- a/FDTD/engine_interface_fdtd.h +++ b/FDTD/engine_interface_fdtd.h @@ -44,6 +44,11 @@ public: virtual double* GetEField(const unsigned int* pos, double* out) const; virtual double* GetHField(const unsigned int* pos, double* out) const; + virtual double CalcVoltageIntegral(const unsigned int* start, const unsigned int* stop) const; + + virtual double GetTime(bool dualTime=false) const {return ((double)m_Eng->GetNumberOfTimesteps() + (double)dualTime*0.5)*m_Op->GetTimestep();}; + virtual unsigned int GetNumberOfTimesteps() const {return m_Eng->GetNumberOfTimesteps();} + protected: Operator* m_Op; Engine* m_Eng; diff --git a/FDTD/process_efield.cpp b/FDTD/process_efield.cpp index b1c189c..dc91a54 100644 --- a/FDTD/process_efield.cpp +++ b/FDTD/process_efield.cpp @@ -19,8 +19,9 @@ #include "time.h" #include "process_efield.h" -ProcessEField::ProcessEField(Operator* op, Engine* eng) : Processing(op, eng) +ProcessEField::ProcessEField(Operator* op, Engine* eng) : Processing(op) { + Eng = eng; } ProcessEField::~ProcessEField() diff --git a/FDTD/process_efield.h b/FDTD/process_efield.h index 6189a49..9f01315 100644 --- a/FDTD/process_efield.h +++ b/FDTD/process_efield.h @@ -37,6 +37,7 @@ public: virtual int Process(); protected: + Engine* Eng; vector FD_Values[3]; }; diff --git a/FDTD/processcurrent.cpp b/FDTD/processcurrent.cpp index 6663acc..864b6a1 100644 --- a/FDTD/processcurrent.cpp +++ b/FDTD/processcurrent.cpp @@ -17,9 +17,10 @@ #include "tools/global.h" #include "processcurrent.h" +#include "engine_interface_fdtd.h" #include -ProcessCurrent::ProcessCurrent(Operator* op, Engine* eng) : ProcessIntegral(op, eng) +ProcessCurrent::ProcessCurrent(Operator* op) : ProcessIntegral(op) { m_TimeShift = op->GetTimestep()/2.0; m_dualMesh = true; @@ -33,96 +34,103 @@ double ProcessCurrent::CalcIntegral() { FDTD_FLOAT current=0; - int Dump_Dim = 0; - int NormDir = 0; + Engine_Interface_FDTD* EI_FDTD = dynamic_cast(m_Eng_Interface); - for (int n=0;n<3;++n) + if (EI_FDTD) { - if (start[n]>stop[n]) + const Engine* Eng = EI_FDTD->GetFDTDEngine(); + + int Dump_Dim = 0; + int NormDir = 0; + + for (int n=0;n<3;++n) { - unsigned int help=start[n]; - start[n]=stop[n]; - stop[n]=help; - bool b_help=m_start_inside[n]; - m_start_inside[n] = m_stop_inside[n]; - m_stop_inside[n] = b_help; + if (start[n]>stop[n]) + { + unsigned int help=start[n]; + start[n]=stop[n]; + stop[n]=help; + bool b_help=m_start_inside[n]; + m_start_inside[n] = m_stop_inside[n]; + m_stop_inside[n] = b_help; + } + if (m_stop_inside[n]==false) // integrate up to the wall, Operator::SnapToMesh would give numLines[n]-2 + stop[n]=Op->GetNumberOfLines(n)-1; + + if (stop[n]>start[n]) + ++Dump_Dim; + if (stop[n] == start[n]) + NormDir = n; } - if (m_stop_inside[n]==false) // integrate up to the wall, Operator::SnapToMesh would give numLines[n]-2 - stop[n]=Op->GetNumberOfLines(n)-1; - if (stop[n]>start[n]) - ++Dump_Dim; - if (stop[n] == start[n]) - NormDir = n; - } + if (Dump_Dim!=2) + { + cerr << "ProcessCurrent::Process(): Warning Current Integration Box \"" << m_filename << "\" is not a surface (found dimension: " << Dump_Dim << ") --> i = 0" << endl; + current = 0; + return 0.0; + } - if (Dump_Dim!=2) - { - cerr << "ProcessCurrent::Process(): Warning Current Integration Box \"" << m_filename << "\" is not a surface (found dimension: " << Dump_Dim << ") --> i = 0" << endl; - current = 0; - return 0.0; - } - - switch (NormDir) - { - case 0: - //y-current - if (m_stop_inside[0] && m_start_inside[2]) - for (unsigned int i=start[1]+1;i<=stop[1];++i) - current+=Eng->GetCurr(1,stop[0],i,start[2]); - //z-current - if (m_stop_inside[0] && m_stop_inside[1]) - for (unsigned int i=start[2]+1;i<=stop[2];++i) - current+=Eng->GetCurr(2,stop[0],stop[1],i); - //y-current - if (m_start_inside[0] && m_stop_inside[2]) - for (unsigned int i=start[1]+1;i<=stop[1];++i) - current-=Eng->GetCurr(1,start[0],i,stop[2]); - //z-current - if (m_start_inside[0] && m_start_inside[1]) - for (unsigned int i=start[2]+1;i<=stop[2];++i) - current-=Eng->GetCurr(2,start[0],start[1],i); - break; - case 1: - //z-current - if (m_start_inside[0] && m_start_inside[1]) - for (unsigned int i=start[2]+1;i<=stop[2];++i) - current+=Eng->GetCurr(2,start[0],start[1],i); - //x-current - if (m_stop_inside[1] && m_stop_inside[2]) - for (unsigned int i=start[0]+1;i<=stop[0];++i) - current+=Eng->GetCurr(0,i,stop[1],stop[2]); - //z-current - if (m_stop_inside[0] && m_stop_inside[1]) - for (unsigned int i=start[2]+1;i<=stop[2];++i) - current-=Eng->GetCurr(2,stop[0],stop[1],i); - //x-current - if (m_start_inside[1] && m_start_inside[2]) - for (unsigned int i=start[0]+1;i<=stop[0];++i) - current-=Eng->GetCurr(0,i,start[1],start[2]); - break; - case 2: - //x-current - if (m_start_inside[1] && m_start_inside[2]) - for (unsigned int i=start[0]+1;i<=stop[0];++i) - current+=Eng->GetCurr(0,i,start[1],start[2]); - //y-current - if (m_stop_inside[0] && m_start_inside[2]) - for (unsigned int i=start[1]+1;i<=stop[1];++i) - current+=Eng->GetCurr(1,stop[0],i,start[2]); - //x-current - if (m_stop_inside[1] && m_stop_inside[2]) - for (unsigned int i=start[0]+1;i<=stop[0];++i) - current-=Eng->GetCurr(0,i,stop[1],stop[2]); - //y-current - if (m_start_inside[0] && m_stop_inside[2]) - for (unsigned int i=start[1]+1;i<=stop[1];++i) - current-=Eng->GetCurr(1,start[0],i,stop[2]); - break; - default: - //this cannot happen... - return 0.0; - break; + switch (NormDir) + { + case 0: + //y-current + if (m_stop_inside[0] && m_start_inside[2]) + for (unsigned int i=start[1]+1;i<=stop[1];++i) + current+=Eng->GetCurr(1,stop[0],i,start[2]); + //z-current + if (m_stop_inside[0] && m_stop_inside[1]) + for (unsigned int i=start[2]+1;i<=stop[2];++i) + current+=Eng->GetCurr(2,stop[0],stop[1],i); + //y-current + if (m_start_inside[0] && m_stop_inside[2]) + for (unsigned int i=start[1]+1;i<=stop[1];++i) + current-=Eng->GetCurr(1,start[0],i,stop[2]); + //z-current + if (m_start_inside[0] && m_start_inside[1]) + for (unsigned int i=start[2]+1;i<=stop[2];++i) + current-=Eng->GetCurr(2,start[0],start[1],i); + break; + case 1: + //z-current + if (m_start_inside[0] && m_start_inside[1]) + for (unsigned int i=start[2]+1;i<=stop[2];++i) + current+=Eng->GetCurr(2,start[0],start[1],i); + //x-current + if (m_stop_inside[1] && m_stop_inside[2]) + for (unsigned int i=start[0]+1;i<=stop[0];++i) + current+=Eng->GetCurr(0,i,stop[1],stop[2]); + //z-current + if (m_stop_inside[0] && m_stop_inside[1]) + for (unsigned int i=start[2]+1;i<=stop[2];++i) + current-=Eng->GetCurr(2,stop[0],stop[1],i); + //x-current + if (m_start_inside[1] && m_start_inside[2]) + for (unsigned int i=start[0]+1;i<=stop[0];++i) + current-=Eng->GetCurr(0,i,start[1],start[2]); + break; + case 2: + //x-current + if (m_start_inside[1] && m_start_inside[2]) + for (unsigned int i=start[0]+1;i<=stop[0];++i) + current+=Eng->GetCurr(0,i,start[1],start[2]); + //y-current + if (m_stop_inside[0] && m_start_inside[2]) + for (unsigned int i=start[1]+1;i<=stop[1];++i) + current+=Eng->GetCurr(1,stop[0],i,start[2]); + //x-current + if (m_stop_inside[1] && m_stop_inside[2]) + for (unsigned int i=start[0]+1;i<=stop[0];++i) + current-=Eng->GetCurr(0,i,stop[1],stop[2]); + //y-current + if (m_start_inside[0] && m_stop_inside[2]) + for (unsigned int i=start[1]+1;i<=stop[1];++i) + current-=Eng->GetCurr(1,start[0],i,stop[2]); + break; + default: + //this cannot happen... + return 0.0; + break; + } } return current; diff --git a/FDTD/processcurrent.h b/FDTD/processcurrent.h index 7eaff5c..e0ce15e 100644 --- a/FDTD/processcurrent.h +++ b/FDTD/processcurrent.h @@ -23,7 +23,7 @@ class ProcessCurrent : public ProcessIntegral { public: - ProcessCurrent(Operator* op, Engine* eng); + ProcessCurrent(Operator* op); virtual ~ProcessCurrent(); //! Integrate currents flowing through an area diff --git a/FDTD/processfields.cpp b/FDTD/processfields.cpp index 5a3c790..dc39a37 100644 --- a/FDTD/processfields.cpp +++ b/FDTD/processfields.cpp @@ -19,8 +19,9 @@ #include #include "tools/global.h" #include "processfields.h" +#include "engine_interface_fdtd.h" -ProcessFields::ProcessFields(Operator* op, Engine* eng) : Processing(op, eng) +ProcessFields::ProcessFields(Operator* op) : Processing(op) { m_DumpType = E_FIELD_DUMP; // vtk-file is default @@ -212,30 +213,35 @@ void ProcessFields::DefineStartStopCoord(double* dstart, double* dstop) double ProcessFields::CalcTotalEnergy() const { - if (!Eng) - return 0; + double energy=0.0; - double energy=0; - unsigned int pos[3]; - for (pos[0]=0;pos[0]GetNumberOfLines(0);++pos[0]) + Engine_Interface_FDTD* EI_FDTD = dynamic_cast(m_Eng_Interface); + + if (EI_FDTD) { - for (pos[1]=0;pos[1]GetNumberOfLines(1);++pos[1]) + const Engine* Eng = EI_FDTD->GetFDTDEngine(); + + unsigned int pos[3]; + for (pos[0]=0;pos[0]GetNumberOfLines(0);++pos[0]) { - for (pos[2]=0;pos[2]GetNumberOfLines(2);++pos[2]) + for (pos[1]=0;pos[1]GetNumberOfLines(1);++pos[1]) { - energy+=fabs(Eng->GetVolt(0,pos[0],pos[1],pos[2]) * Eng->GetCurr(1,pos[0],pos[1],pos[2])); - energy+=fabs(Eng->GetVolt(0,pos[0],pos[1],pos[2]) * Eng->GetCurr(2,pos[0],pos[1],pos[2])); - energy+=fabs(Eng->GetVolt(1,pos[0],pos[1],pos[2]) * Eng->GetCurr(0,pos[0],pos[1],pos[2])); - energy+=fabs(Eng->GetVolt(1,pos[0],pos[1],pos[2]) * Eng->GetCurr(2,pos[0],pos[1],pos[2])); - energy+=fabs(Eng->GetVolt(2,pos[0],pos[1],pos[2]) * Eng->GetCurr(0,pos[0],pos[1],pos[2])); - energy+=fabs(Eng->GetVolt(2,pos[0],pos[1],pos[2]) * Eng->GetCurr(1,pos[0],pos[1],pos[2])); + for (pos[2]=0;pos[2]GetNumberOfLines(2);++pos[2]) + { + energy+=fabs(Eng->GetVolt(0,pos[0],pos[1],pos[2]) * Eng->GetCurr(1,pos[0],pos[1],pos[2])); + energy+=fabs(Eng->GetVolt(0,pos[0],pos[1],pos[2]) * Eng->GetCurr(2,pos[0],pos[1],pos[2])); + energy+=fabs(Eng->GetVolt(1,pos[0],pos[1],pos[2]) * Eng->GetCurr(0,pos[0],pos[1],pos[2])); + energy+=fabs(Eng->GetVolt(1,pos[0],pos[1],pos[2]) * Eng->GetCurr(2,pos[0],pos[1],pos[2])); + energy+=fabs(Eng->GetVolt(2,pos[0],pos[1],pos[2]) * Eng->GetCurr(0,pos[0],pos[1],pos[2])); + energy+=fabs(Eng->GetVolt(2,pos[0],pos[1],pos[2]) * Eng->GetCurr(1,pos[0],pos[1],pos[2])); + } } } } return energy*0.5; } -void ProcessFields::SetSubSampling(unsigned int subSampleRate, int dir) +void ProcessFields::SetSubSampling(unsigned int subSampleRate, int dir) { if (dir>2) return; if (dir<0) diff --git a/FDTD/processfields.h b/FDTD/processfields.h index 4fc186c..83ae51d 100644 --- a/FDTD/processfields.h +++ b/FDTD/processfields.h @@ -26,7 +26,7 @@ class ProcessFields : public Processing { public: - ProcessFields(Operator* op, Engine* eng); + ProcessFields(Operator* op); virtual ~ProcessFields(); enum FileType { VTK_FILETYPE, HDF5_FILETYPE}; diff --git a/FDTD/processfields_td.cpp b/FDTD/processfields_td.cpp index 95968be..42edd7c 100644 --- a/FDTD/processfields_td.cpp +++ b/FDTD/processfields_td.cpp @@ -20,7 +20,7 @@ #include #include -ProcessFieldsTD::ProcessFieldsTD(Operator* op, Engine* eng) : ProcessFields(op, eng) +ProcessFieldsTD::ProcessFieldsTD(Operator* op) : ProcessFields(op) { pad_length = 8; } @@ -40,7 +40,7 @@ int ProcessFieldsTD::Process() if (m_fileType==VTK_FILETYPE) { stringstream ss; - ss << filePattern << std::setw( pad_length ) << std::setfill( '0' ) << Eng->GetNumberOfTimesteps() << ".vtk"; + ss << filePattern << std::setw( pad_length ) << std::setfill( '0' ) << m_Eng_Interface->GetNumberOfTimesteps() << ".vtk"; filename = ss.str(); } else @@ -107,8 +107,8 @@ int ProcessFieldsTD::Process() else if (m_fileType==HDF5_FILETYPE) { stringstream ss; - ss << std::setw( pad_length ) << std::setfill( '0' ) << Eng->GetNumberOfTimesteps(); - DumpVectorArray2HDF5(filename.c_str(),string( ss.str() ),field,numLines,(0.5+Eng->GetNumberOfTimesteps())*Op->GetTimestep()); + ss << std::setw( pad_length ) << std::setfill( '0' ) << m_Eng_Interface->GetNumberOfTimesteps(); + DumpVectorArray2HDF5(filename.c_str(),string( ss.str() ),field,numLines,(0.5+m_Eng_Interface->GetNumberOfTimesteps())*Op->GetTimestep()); } else cerr << "ProcessFieldsTD::Process: unknown File-Type" << endl; diff --git a/FDTD/processfields_td.h b/FDTD/processfields_td.h index 99f4616..36e86ef 100644 --- a/FDTD/processfields_td.h +++ b/FDTD/processfields_td.h @@ -23,7 +23,7 @@ class ProcessFieldsTD : public ProcessFields { public: - ProcessFieldsTD(Operator* op, Engine* eng); + ProcessFieldsTD(Operator* op); virtual ~ProcessFieldsTD(); virtual int Process(); diff --git a/FDTD/processing.cpp b/FDTD/processing.cpp index 95e6033..e952f83 100644 --- a/FDTD/processing.cpp +++ b/FDTD/processing.cpp @@ -21,10 +21,9 @@ #include "time.h" #include -Processing::Processing(Operator* op, Engine* eng) +Processing::Processing(Operator* op) { Op=op; - Eng=eng; Enabled = true; m_PS_pos = 0; SetPrecision(12); @@ -59,7 +58,7 @@ bool Processing::CheckTimestep() { if (m_ProcessSteps.size()>m_PS_pos) { - if (m_ProcessSteps.at(m_PS_pos)==Eng->GetNumberOfTimesteps()) + if (m_ProcessSteps.at(m_PS_pos)==m_Eng_Interface->GetNumberOfTimesteps()) { ++m_PS_pos; return true; @@ -67,12 +66,12 @@ bool Processing::CheckTimestep() } if (ProcessInterval) { - if (Eng->GetNumberOfTimesteps()%ProcessInterval==0) return true; + if (m_Eng_Interface->GetNumberOfTimesteps()%ProcessInterval==0) return true; } if (m_FD_Interval) { - if (Eng->GetNumberOfTimesteps()%m_FD_Interval==0) return true; + if (m_Eng_Interface->GetNumberOfTimesteps()%m_FD_Interval==0) return true; } return false; } @@ -83,11 +82,11 @@ int Processing::GetNextInterval() const int next=INT_MAX; if (m_ProcessSteps.size()>m_PS_pos) { - next = (int)m_ProcessSteps.at(m_PS_pos)-(int)Eng->GetNumberOfTimesteps(); + next = (int)m_ProcessSteps.at(m_PS_pos)-(int)m_Eng_Interface->GetNumberOfTimesteps(); } if (ProcessInterval!=0) { - int next_Interval = (int)ProcessInterval - (int)Eng->GetNumberOfTimesteps()%ProcessInterval; + int next_Interval = (int)ProcessInterval - (int)m_Eng_Interface->GetNumberOfTimesteps()%ProcessInterval; if (next_IntervalGetNumberOfTimesteps()%m_FD_Interval; + int next_Interval = (int)m_FD_Interval - (int)m_Eng_Interface->GetNumberOfTimesteps()%m_FD_Interval; if (next_IntervalGetCurr(n,pos[0],pos[1],pos[2]); - } - else - { - unsigned int pos[3]={stop[0],stop[1],stop[2]}; - for (;pos[n]GetCurr(n,pos[0],pos[1],pos[2]); - } - } - return result; -} -double Processing::CalcLineIntegral_V(unsigned int* start, unsigned int* stop) const -{ - double result=0; - for (int n=0;n<3;++n) - { - if (start[n]GetVolt(n,pos[0],pos[1],pos[2]); - } - else - { - unsigned int pos[3]={stop[0],stop[1],stop[2]}; - for (;pos[n]GetVolt(n,pos[0],pos[1],pos[2]); - } - } - return result; -} - void Processing::OpenFile( string outfile ) { if (file.is_open()) diff --git a/FDTD/processing.h b/FDTD/processing.h index cee5c25..bd74c99 100644 --- a/FDTD/processing.h +++ b/FDTD/processing.h @@ -33,7 +33,7 @@ typedef std::complex double_complex; class Processing { public: - Processing(Operator* op, Engine* eng); + Processing(Operator* op); virtual ~Processing(); //! Set the interface to the engine. Each processing needs its own engine interface. This class will take ownership and cleanup the interface on deletion! @@ -85,7 +85,6 @@ public: protected: Engine_Interface_Base* m_Eng_Interface; Operator* Op; - Engine* Eng; MeshType m_Mesh_Type; unsigned int m_precision; @@ -128,10 +127,6 @@ protected: string m_filename; virtual void OpenFile(string outfile); - - double CalcLineIntegral(unsigned int* start, unsigned int* stop, int field) const; - double CalcLineIntegral_I(unsigned int* start, unsigned int* stop) const; - double CalcLineIntegral_V(unsigned int* start, unsigned int* stop) const; }; class ProcessingArray diff --git a/FDTD/processintegral.cpp b/FDTD/processintegral.cpp index cc2321a..1944166 100644 --- a/FDTD/processintegral.cpp +++ b/FDTD/processintegral.cpp @@ -18,7 +18,7 @@ #include "processintegral.h" #include -ProcessIntegral::ProcessIntegral(Operator* op, Engine* eng) : Processing(op, eng) +ProcessIntegral::ProcessIntegral(Operator* op) : Processing(op) { m_TimeShift = 0.0; m_Results=NULL; @@ -56,11 +56,11 @@ int ProcessIntegral::Process() int NrInt = GetNumberOfIntegrals(); double integral = m_Results[0] * m_weight; - double time = (double)Eng->GetNumberOfTimesteps()*Op->GetTimestep() + m_TimeShift; + double time = m_Eng_Interface->GetTime(false) + m_TimeShift; if (ProcessInterval) { - if (Eng->GetNumberOfTimesteps()%ProcessInterval==0) + if (m_Eng_Interface->GetNumberOfTimesteps()%ProcessInterval==0) { TD_Values.push_back(integral); file << setprecision(m_precision) << time; @@ -72,7 +72,7 @@ int ProcessIntegral::Process() if (m_FD_Interval) { - if (Eng->GetNumberOfTimesteps()%m_FD_Interval==0) + if (m_Eng_Interface->GetNumberOfTimesteps()%m_FD_Interval==0) { double T = time; for (size_t n=0;n -ProcessVoltage::ProcessVoltage(Operator* op, Engine* eng) : ProcessIntegral(op, eng) +ProcessVoltage::ProcessVoltage(Operator* op) : ProcessIntegral(op) { } @@ -29,5 +29,5 @@ ProcessVoltage::~ProcessVoltage() double ProcessVoltage::CalcIntegral() { //integrate voltages from start to stop on a line - return CalcLineIntegral(start,stop,0); + return m_Eng_Interface->CalcVoltageIntegral(start,stop); } diff --git a/FDTD/processvoltage.h b/FDTD/processvoltage.h index 59ac48e..4bec349 100644 --- a/FDTD/processvoltage.h +++ b/FDTD/processvoltage.h @@ -24,7 +24,7 @@ class ProcessVoltage : public ProcessIntegral { public: - ProcessVoltage(Operator* op, Engine* eng); + ProcessVoltage(Operator* op); virtual ~ProcessVoltage(); virtual double CalcIntegral(); diff --git a/openems.cpp b/openems.cpp index c3fed9a..642578c 100644 --- a/openems.cpp +++ b/openems.cpp @@ -447,12 +447,12 @@ int openEMS::SetupFDTD(const char* file) { if (pb->GetProbeType()==0) { - ProcessVoltage* procVolt = new ProcessVoltage(FDTD_Op,FDTD_Eng); + ProcessVoltage* procVolt = new ProcessVoltage(FDTD_Op); proc=procVolt; } else if (pb->GetProbeType()==1) { - ProcessCurrent* procCurr = new ProcessCurrent(FDTD_Op,FDTD_Eng); + ProcessCurrent* procCurr = new ProcessCurrent(FDTD_Op); proc=procCurr; } else if (pb->GetProbeType()==2) @@ -461,7 +461,7 @@ int openEMS::SetupFDTD(const char* file) proc = new ProcessHField(FDTD_Op,FDTD_Eng); else if ((pb->GetProbeType()==10) || (pb->GetProbeType()==11)) { - ProcessModeMatch* pmm = new ProcessModeMatch(FDTD_Op,FDTD_Eng); + ProcessModeMatch* pmm = new ProcessModeMatch(FDTD_Op); pmm->SetFieldType(pb->GetProbeType()-10); pmm->SetModeFunction(0,pb->GetAttributeValue("ModeFunctionX")); pmm->SetModeFunction(1,pb->GetAttributeValue("ModeFunctionY")); @@ -493,7 +493,7 @@ int openEMS::SetupFDTD(const char* file) vector DumpProps = CSX.GetPropertyByType(CSProperties::DUMPBOX); for (size_t i=0;iSetEnable(Enable_Dumps); ProcTD->SetProcessInterval(Nyquist/m_OverSampling); @@ -581,7 +581,8 @@ void openEMS::RunFDTD() cout << "Running FDTD engine... this may take a while... grab a cup of coffee?!?" << endl; //special handling of a field processing, needed to realize the end criteria... - ProcessFields* ProcField = new ProcessFields(FDTD_Op,FDTD_Eng); + ProcessFields* ProcField = new ProcessFields(FDTD_Op); + ProcField->SetEngineInterface(new Engine_Interface_FDTD(FDTD_Op,FDTD_Eng)); PA->AddProcessing(ProcField); double maxE=0,currE=0;