From c4b7ecb88e5e967f2f59a763391334a229bee44c Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Tue, 13 Sep 2011 10:51:11 +0200 Subject: [PATCH] critical fix in GetYeeCoords this was affecting the correct snapping/weighting of current excitations --- FDTD/operator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FDTD/operator.cpp b/FDTD/operator.cpp index 3a464f5..42e61f9 100644 --- a/FDTD/operator.cpp +++ b/FDTD/operator.cpp @@ -148,10 +148,10 @@ bool Operator::GetYeeCoords(int ny, unsigned int pos[3], double* coords, bool du } else //dual grid { + coords[ny]-=0.5*fabs(GetRawDiscDelta(ny, pos[ny]-1)); + int nP = (ny+1)%3; int nPP = (ny+2)%3; - coords[nP] +=0.5*fabs(GetRawDiscDelta(nP ,pos[nP] )); - coords[nPP]+=0.5*fabs(GetRawDiscDelta(nPP,pos[nPP])); if ((pos[nP]>=numLines[nP]-1) || (pos[nPP]>=numLines[nPP]-1)) return false; }