cylinder extensions: two critical bug fixes

pull/1/head
Thorsten Liebig 2010-05-17 15:44:03 +02:00
parent f98314d55c
commit 25777f7f27
2 changed files with 7 additions and 5 deletions

View File

@ -21,11 +21,13 @@
Engine_Ext_Cylinder::Engine_Ext_Cylinder(Operator_Ext_Cylinder* op_ext) : Engine_Extension(op_ext)
{
cyl_Op = op_ext;
CC_closedAlpha = op_ext->CC_closedAlpha;
CC_R0_included = op_ext->CC_R0_included;
for (int n=0;n<3;++n)
numLines[n] = op_ext->m_Op->GetNumberOfLines(n);
numLines[n] = op_ext->m_Op->GetOriginalNumLines(n);
}
void Engine_Ext_Cylinder::Apply2Voltages()

View File

@ -29,18 +29,18 @@ bool Operator_Ext_Cylinder::BuildExtension()
if ((CC_R0_included==false) || (CC_closedAlpha==false))
return true;
vv_R0 = new FDTD_FLOAT[m_Op->GetNumberOfLines(2)];
vi_R0 = new FDTD_FLOAT[m_Op->GetNumberOfLines(2)];
vv_R0 = new FDTD_FLOAT[m_Op->GetOriginalNumLines(2)];
vi_R0 = new FDTD_FLOAT[m_Op->GetOriginalNumLines(2)];
unsigned int pos[3];
double inEC[4];
double dT = m_Op->GetTimestep();
pos[0]=0;
for (pos[2]=0;pos[2]<m_Op->GetNumberOfLines(2);++pos[2])
for (pos[2]=0;pos[2]<m_Op->GetOriginalNumLines(2);++pos[2])
{
double C=0;
double G=0;
for (pos[1]=0;pos[1]<m_Op->GetNumberOfLines(1)-1;++pos[1])
for (pos[1]=0;pos[1]<m_Op->GetOriginalNumLines(1)-1;++pos[1])
{
m_Op_Cyl->Calc_ECPos(2,pos,inEC);
C+=inEC[0]*0.5;