From 2d325d316dfd76507ad0bc4e8f9b1e5b04263e09 Mon Sep 17 00:00:00 2001 From: Sebastian Held Date: Tue, 30 Mar 2010 13:10:42 +0200 Subject: [PATCH] bugfix: length of excitation --- FDTD/engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FDTD/engine.cpp b/FDTD/engine.cpp index 277234f..5b25ba2 100644 --- a/FDTD/engine.cpp +++ b/FDTD/engine.cpp @@ -82,7 +82,7 @@ bool Engine::IterateTS(unsigned int iterTS) for (unsigned int n=0;nE_Exc_Count;++n) { exc_pos = (int)numTS - (int)Op->E_Exc_delay[n]; - exc_pos*= (exc_pos>0 && exc_pos<(int)Op->ExciteLength); + exc_pos *= (exc_pos>0 && exc_pos<=(int)Op->ExciteLength); // if (n==0) cerr << numTS << " => " << Op->ExciteSignal[exc_pos] << endl; volt[Op->E_Exc_dir[n]][Op->E_Exc_index[0][n]][Op->E_Exc_index[1][n]][Op->E_Exc_index[2][n]] += Op->E_Exc_amp[n]*Op->ExciteSignal[exc_pos]; }