bug fix handling field dumps for cylindrical coordinates & closed alpha mesh
parent
3660da8a8d
commit
a748b6416f
|
@ -33,34 +33,18 @@ Engine_Interface_Cylindrical_FDTD::~Engine_Interface_Cylindrical_FDTD()
|
||||||
|
|
||||||
double* Engine_Interface_Cylindrical_FDTD::GetHField(const unsigned int* pos, double* out) const
|
double* Engine_Interface_Cylindrical_FDTD::GetHField(const unsigned int* pos, double* out) const
|
||||||
{
|
{
|
||||||
if ((m_Op_Cyl->GetClosedAlpha()==false) || (m_InterpolType!=NODE_INTERPOLATE))
|
if (m_Op_Cyl->GetClosedAlpha()==false)
|
||||||
return Engine_Interface_FDTD::GetHField(pos, out);
|
return Engine_Interface_FDTD::GetHField(pos, out);
|
||||||
|
|
||||||
unsigned int iPos[] = {pos[0],pos[1],pos[2]};
|
unsigned int iPos[] = {pos[0],pos[1],pos[2]};
|
||||||
if (iPos[1]==0)
|
|
||||||
iPos[1]=m_Op->GetNumberOfLines(1)-1;
|
|
||||||
|
|
||||||
int nP,nPP;
|
if ((m_InterpolType==CELL_INTERPOLATE) && (pos[1]==m_Op->GetNumberOfLines(1)))
|
||||||
for (int n=0; n<3; ++n)
|
iPos[1]=0;
|
||||||
{
|
|
||||||
nP = (n+1)%3;
|
if ((m_InterpolType==NODE_INTERPOLATE) && (iPos[1]==0))
|
||||||
nPP = (n+2)%3;
|
iPos[1]=m_Op->GetNumberOfLines(1);
|
||||||
if ((iPos[0]==m_Op->GetNumberOfLines(0)-1) || (iPos[2]==m_Op->GetNumberOfLines(2)-1) || (iPos[nP]==0) || (iPos[nPP]==0))
|
|
||||||
{
|
return Engine_Interface_FDTD::GetHField(iPos, out);
|
||||||
out[n] = 0;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
out[n]=m_Eng->GetCurr(n,iPos)/m_Op->GetEdgeLength(n,iPos,true);
|
|
||||||
--iPos[nP];
|
|
||||||
out[n]+=m_Eng->GetCurr(n,iPos)/m_Op->GetEdgeLength(n,iPos,true);
|
|
||||||
--iPos[nPP];
|
|
||||||
out[n]+=m_Eng->GetCurr(n,iPos)/m_Op->GetEdgeLength(n,iPos,true);
|
|
||||||
++iPos[nP];
|
|
||||||
out[n]+=m_Eng->GetCurr(n,iPos)/m_Op->GetEdgeLength(n,iPos,true);
|
|
||||||
++iPos[nPP];
|
|
||||||
out[n]/=4;
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double* Engine_Interface_Cylindrical_FDTD::GetRawInterpolatedField(const unsigned int* pos, double* out, int type) const
|
double* Engine_Interface_Cylindrical_FDTD::GetRawInterpolatedField(const unsigned int* pos, double* out, int type) const
|
||||||
|
@ -70,30 +54,11 @@ double* Engine_Interface_Cylindrical_FDTD::GetRawInterpolatedField(const unsigne
|
||||||
|
|
||||||
unsigned int iPos[] = {pos[0],pos[1],pos[2]};
|
unsigned int iPos[] = {pos[0],pos[1],pos[2]};
|
||||||
|
|
||||||
switch (m_InterpolType)
|
if ((m_InterpolType==NODE_INTERPOLATE) && (pos[1]==0))
|
||||||
{
|
iPos[1]=m_Op->GetNumberOfLines(1);
|
||||||
default:
|
|
||||||
case NO_INTERPOLATION:
|
|
||||||
return Engine_Interface_FDTD::GetRawInterpolatedField(pos,out,type);
|
|
||||||
break;
|
|
||||||
case NODE_INTERPOLATE:
|
|
||||||
for (int n=0; n<3; ++n)
|
|
||||||
{
|
|
||||||
if (pos[1]==0)
|
|
||||||
iPos[1]=m_Op->GetNumberOfLines(1)-1;
|
|
||||||
return Engine_Interface_FDTD::GetRawInterpolatedField(iPos,out,type);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CELL_INTERPOLATE:
|
|
||||||
for (int n=0; n<3; ++n)
|
|
||||||
{
|
|
||||||
if (pos[1]==m_Op->GetNumberOfLines(1)-1)
|
|
||||||
iPos[1]=0;
|
|
||||||
return Engine_Interface_FDTD::GetRawInterpolatedField(iPos,out,type);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! this should not happen
|
if ((m_InterpolType==CELL_INTERPOLATE) && (pos[1]==m_Op->GetNumberOfLines(1)))
|
||||||
return Engine_Interface_FDTD::GetRawInterpolatedField(pos,out,type);
|
iPos[1]=0;
|
||||||
|
|
||||||
|
return Engine_Interface_FDTD::GetRawInterpolatedField(iPos,out,type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ double* Engine_Interface_FDTD::GetRawInterpolatedField(const unsigned int* pos,
|
||||||
{
|
{
|
||||||
nP = (n+1)%3;
|
nP = (n+1)%3;
|
||||||
nPP = (n+2)%3;
|
nPP = (n+2)%3;
|
||||||
if ((pos[0]==m_Op->GetNumberOfLines(0)-1) || (pos[1]==m_Op->GetNumberOfLines(1)-1) || (pos[2]==m_Op->GetNumberOfLines(2)-1))
|
if ((pos[0]==m_Op->GetOriginalNumLines(0)-1) || (pos[1]==m_Op->GetOriginalNumLines(1)-1) || (pos[2]==m_Op->GetOriginalNumLines(2)-1))
|
||||||
{
|
{
|
||||||
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;
|
||||||
|
@ -119,7 +119,7 @@ double* Engine_Interface_FDTD::GetHField(const unsigned int* pos, double* out) c
|
||||||
{
|
{
|
||||||
nP = (n+1)%3;
|
nP = (n+1)%3;
|
||||||
nPP = (n+2)%3;
|
nPP = (n+2)%3;
|
||||||
if ((pos[0]==m_Op->GetNumberOfLines(0)-1) || (pos[1]==m_Op->GetNumberOfLines(1)-1) || (pos[2]==m_Op->GetNumberOfLines(2)-1) || (pos[nP]==0) || (pos[nPP]==0))
|
if ((pos[0]==m_Op->GetOriginalNumLines(0)-1) || (pos[1]==m_Op->GetOriginalNumLines(1)-1) || (pos[2]==m_Op->GetOriginalNumLines(2)-1) || (pos[nP]==0) || (pos[nPP]==0))
|
||||||
{
|
{
|
||||||
out[n] = 0;
|
out[n] = 0;
|
||||||
continue;
|
continue;
|
||||||
|
@ -140,7 +140,7 @@ double* Engine_Interface_FDTD::GetHField(const unsigned int* pos, double* out) c
|
||||||
{
|
{
|
||||||
delta = m_Op->GetEdgeLength(n,iPos,true);
|
delta = m_Op->GetEdgeLength(n,iPos,true);
|
||||||
out[n] = m_Eng->GetCurr(n,iPos);
|
out[n] = m_Eng->GetCurr(n,iPos);
|
||||||
if ((pos[n]>=m_Op->GetNumberOfLines(n)-1))
|
if ((pos[n]>=m_Op->GetOriginalNumLines(n)-1))
|
||||||
{
|
{
|
||||||
out[n] = 0; //magnetic field on the outer boundaries is always zero
|
out[n] = 0; //magnetic field on the outer boundaries is always zero
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue