fixed GetRawField handling

This commit is contained in:
Thorsten Liebig 2011-01-10 11:14:23 +01:00
parent 51fb31dec1
commit c5a689b67c
2 changed files with 8 additions and 8 deletions

View File

@ -53,7 +53,7 @@ double* Engine_Interface_FDTD::GetRawInterpolatedField(const unsigned int* pos,
for (int n=0; n<3; ++n) for (int n=0; n<3; ++n)
{ {
delta = m_Op->GetEdgeLength(n,iPos); delta = m_Op->GetEdgeLength(n,iPos);
out[n] = GetRawField(n,iPos); out[n] = GetRawField(n,iPos,type);
if (delta==0) if (delta==0)
{ {
out[n]=0; out[n]=0;
@ -67,7 +67,7 @@ double* Engine_Interface_FDTD::GetRawInterpolatedField(const unsigned int* pos,
--iPos[n]; --iPos[n];
double deltaDown = m_Op->GetEdgeLength(n,iPos); double deltaDown = m_Op->GetEdgeLength(n,iPos);
double deltaRel = delta / (delta+deltaDown); double deltaRel = delta / (delta+deltaDown);
out[n] = out[n]*(1.0-deltaRel) + (double)GetRawField(n,iPos)*deltaRel; out[n] = out[n]*(1.0-deltaRel) + (double)GetRawField(n,iPos,type)*deltaRel;
++iPos[n]; ++iPos[n];
} }
break; break;
@ -81,13 +81,13 @@ double* Engine_Interface_FDTD::GetRawInterpolatedField(const unsigned int* pos,
out[n] = 0; //electric field outside the field domain is always zero out[n] = 0; //electric field outside the field domain is always zero
continue; continue;
} }
out[n]=GetRawField(n,iPos); out[n]=GetRawField(n,iPos,type);
++iPos[nP]; ++iPos[nP];
out[n]+=GetRawField(n,iPos); out[n]+=GetRawField(n,iPos,type);
++iPos[nPP]; ++iPos[nPP];
out[n]+=GetRawField(n,iPos); out[n]+=GetRawField(n,iPos,type);
--iPos[nP]; --iPos[nP];
out[n]+=GetRawField(n,iPos); out[n]+=GetRawField(n,iPos,type);
--iPos[nPP]; --iPos[nPP];
out[n]/=4; out[n]/=4;
} }

View File

@ -53,8 +53,8 @@ protected:
Operator* m_Op; Operator* m_Op;
Engine* m_Eng; Engine* m_Eng;
double* GetRawInterpolatedField(const unsigned int* pos, double* out, int type = 0) const; double* GetRawInterpolatedField(const unsigned int* pos, double* out, int type) const;
double GetRawField(unsigned int n, const unsigned int* pos, int type = 0) const; double GetRawField(unsigned int n, const unsigned int* pos, int type) const;
}; };
#endif // ENGINE_INTERFACE_FDTD_H #endif // ENGINE_INTERFACE_FDTD_H