added Oversampling for processing

pull/1/head
Thorsten Liebig 2010-04-04 19:48:36 +02:00
parent 8cc42b911c
commit 6288ebca91
3 changed files with 12 additions and 4 deletions

View File

@ -1,7 +1,9 @@
function FDTD = InitFDTD(NrTS, endCrit) function FDTD = InitFDTD(NrTS, endCrit, varargin)
FDTD.ATTRIBUTE.NumberOfTimesteps=NrTS; FDTD.ATTRIBUTE.NumberOfTimesteps=NrTS;
FDTD.ATTRIBUTE.endCriteria=endCrit; FDTD.ATTRIBUTE.endCriteria=endCrit;
for n=1:(nargin-2)/2
FDTD.ATTRIBUTE.(varargin{2*n-1})=varargin{2*n};
end

View File

@ -47,6 +47,7 @@ openEMS::openEMS()
DebugMat = false; DebugMat = false;
DebugOp = false; DebugOp = false;
endCrit = 1e-6; endCrit = 1e-6;
m_OverSampling = 4;
m_engine = EngineType_Standard; m_engine = EngineType_Standard;
m_engine_numThreads = 0; m_engine_numThreads = 0;
@ -149,6 +150,10 @@ int openEMS::SetupFDTD(const char* file)
if (endCrit==0) if (endCrit==0)
endCrit=1e-6; endCrit=1e-6;
FDTD_Opts->QueryIntAttribute("OverSampling",&m_OverSampling);
if (m_OverSampling<2)
m_OverSampling=2;
TiXmlElement* Excite = FDTD_Opts->FirstChildElement("Excitation"); TiXmlElement* Excite = FDTD_Opts->FirstChildElement("Excitation");
if (Excite==NULL) if (Excite==NULL)
{ {
@ -312,7 +317,7 @@ int openEMS::SetupFDTD(const char* file)
procCurr->OpenFile(pb->GetName()); procCurr->OpenFile(pb->GetName());
proc=procCurr; proc=procCurr;
} }
proc->SetProcessInterval(Nyquist/3); //three times as often as nyquist dictates proc->SetProcessInterval(Nyquist/m_OverSampling);
proc->DefineStartStopCoord(start,stop); proc->DefineStartStopCoord(start,stop);
PA->AddProcessing(proc); PA->AddProcessing(proc);
} }
@ -326,7 +331,7 @@ int openEMS::SetupFDTD(const char* file)
{ {
ProcessFieldsTD* ProcTD = new ProcessFieldsTD(FDTD_Op,FDTD_Eng); ProcessFieldsTD* ProcTD = new ProcessFieldsTD(FDTD_Op,FDTD_Eng);
ProcTD->SetEnable(Enable_Dumps); ProcTD->SetEnable(Enable_Dumps);
ProcTD->SetProcessInterval(Nyquist/2); //twice as often as nyquist dictates ProcTD->SetProcessInterval(Nyquist/m_OverSampling);
//only looking for one prim atm //only looking for one prim atm
CSPrimitives* prim = DumpProps.at(i)->GetPrimitive(0); CSPrimitives* prim = DumpProps.at(i)->GetPrimitive(0);

View File

@ -49,6 +49,7 @@ protected:
bool DebugMat; bool DebugMat;
bool DebugOp; bool DebugOp;
double endCrit; double endCrit;
int m_OverSampling;
Operator* FDTD_Op; Operator* FDTD_Op;
Engine* FDTD_Eng; Engine* FDTD_Eng;
ProcessingArray* PA; ProcessingArray* PA;