Define a max FDTD simulated time, maybe useful for e.g. sinusoidal excitations
matlab example: simulate 1us in the time domain: FDTD = InitFDTD(5e5,1e-5,'MaxTime',1e-6)pull/1/head
parent
f290fd6db4
commit
1b52834e89
|
@ -188,6 +188,10 @@ int openEMS::SetupFDTD(const char* file)
|
||||||
if (m_OverSampling<2)
|
if (m_OverSampling<2)
|
||||||
m_OverSampling=2;
|
m_OverSampling=2;
|
||||||
|
|
||||||
|
double maxTime=0;
|
||||||
|
FDTD_Opts->QueryDoubleAttribute("MaxTime",&maxTime);
|
||||||
|
|
||||||
|
|
||||||
TiXmlElement* BC = FDTD_Opts->FirstChildElement("BoundaryCond");
|
TiXmlElement* BC = FDTD_Opts->FirstChildElement("BoundaryCond");
|
||||||
if (BC==NULL)
|
if (BC==NULL)
|
||||||
{
|
{
|
||||||
|
@ -250,6 +254,10 @@ int openEMS::SetupFDTD(const char* file)
|
||||||
}
|
}
|
||||||
|
|
||||||
FDTD_Op->CalcECOperator();
|
FDTD_Op->CalcECOperator();
|
||||||
|
|
||||||
|
unsigned int maxTime_TS = (unsigned int)(maxTime/FDTD_Op->GetTimestep());
|
||||||
|
if ((maxTime_TS>0) && (maxTime_TS<NrTS))
|
||||||
|
NrTS = maxTime_TS;
|
||||||
|
|
||||||
if (!FDTD_Op->Exc->setupExcitation( FDTD_Opts->FirstChildElement("Excitation"), NrTS ))
|
if (!FDTD_Op->Exc->setupExcitation( FDTD_Opts->FirstChildElement("Excitation"), NrTS ))
|
||||||
exit(2);
|
exit(2);
|
||||||
|
|
Loading…
Reference in New Issue