cylinder engine extension changed handling and priority
parent
0cf527d74c
commit
11fed5f506
|
@ -41,7 +41,7 @@ void Engine_Ext_Cylinder::SetEngine(Engine* eng)
|
||||||
m_Eng_SSE = dynamic_cast<Engine_sse*>(m_Eng);
|
m_Eng_SSE = dynamic_cast<Engine_sse*>(m_Eng);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine_Ext_Cylinder::Apply2Voltages()
|
void Engine_Ext_Cylinder::DoPostVoltageUpdates()
|
||||||
{
|
{
|
||||||
if (CC_closedAlpha==false) return;
|
if (CC_closedAlpha==false) return;
|
||||||
|
|
||||||
|
@ -49,14 +49,15 @@ void Engine_Ext_Cylinder::Apply2Voltages()
|
||||||
{
|
{
|
||||||
unsigned int pos[3];
|
unsigned int pos[3];
|
||||||
pos[0] = 0;
|
pos[0] = 0;
|
||||||
|
FDTD_FLOAT volt=0;
|
||||||
for (pos[2]=0; pos[2]<numLines[2]; ++pos[2])
|
for (pos[2]=0; pos[2]<numLines[2]; ++pos[2])
|
||||||
{
|
{
|
||||||
m_Eng_SSE->Engine_sse::SetVolt(2,0,0,pos[2], m_Eng_SSE->Engine_sse::GetVolt(2,0,0,pos[2])*cyl_Op->vv_R0[pos[2]]);
|
volt =m_Eng_SSE->Engine_sse::GetVolt(2,0,0,pos[2])*cyl_Op->vv_R0[pos[2]];
|
||||||
for (pos[1]=0; pos[1]<numLines[1]-1; ++pos[1])
|
for (pos[1]=0; pos[1]<numLines[1]-1; ++pos[1])
|
||||||
{
|
volt +=cyl_Op->vi_R0[pos[2]] * m_Eng_SSE->Engine_sse::GetCurr(1,0,pos[1],pos[2]);
|
||||||
m_Eng_SSE->Engine_sse::SetVolt(2,0,0,pos[2], m_Eng_SSE->Engine_sse::GetVolt(2,0,0,pos[2]) + cyl_Op->vi_R0[pos[2]] * m_Eng_SSE->Engine_sse::GetCurr(1,0,pos[1],pos[2]) );
|
m_Eng_SSE->Engine_sse::SetVolt(2,0,0,pos[2], volt);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (pos[1]=0; pos[1]<numLines[1]; ++pos[1])
|
for (pos[1]=0; pos[1]<numLines[1]; ++pos[1])
|
||||||
{
|
{
|
||||||
for (pos[2]=0; pos[2]<numLines[2]; ++pos[2])
|
for (pos[2]=0; pos[2]<numLines[2]; ++pos[2])
|
||||||
|
@ -81,7 +82,7 @@ void Engine_Ext_Cylinder::Apply2Voltages()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine_Ext_Cylinder::Apply2Current()
|
void Engine_Ext_Cylinder::DoPostCurrentUpdates()
|
||||||
{
|
{
|
||||||
if (CC_closedAlpha==false) return;
|
if (CC_closedAlpha==false) return;
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,9 @@ class Engine_Ext_Cylinder : public Engine_Extension
|
||||||
public:
|
public:
|
||||||
Engine_Ext_Cylinder(Operator_Ext_Cylinder* op_ext);
|
Engine_Ext_Cylinder(Operator_Ext_Cylinder* op_ext);
|
||||||
|
|
||||||
virtual void Apply2Voltages();
|
virtual void DoPostVoltageUpdates();
|
||||||
|
|
||||||
virtual void Apply2Current();
|
virtual void DoPostCurrentUpdates();
|
||||||
|
|
||||||
virtual void SetEngine(Engine* eng);
|
virtual void SetEngine(Engine* eng);
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
|
|
||||||
// priority definitions for some important extensions
|
// priority definitions for some important extensions
|
||||||
#define ENG_EXT_PRIO_UPML +1e6 //unaxial pml extension priority
|
#define ENG_EXT_PRIO_UPML +1e6 //unaxial pml extension priority
|
||||||
|
#define ENG_EXT_PRIO_CYLINDER +1e5 //cylindrial extension priority
|
||||||
#define ENG_EXT_PRIO_EXCITATION -1000 //excitation priority
|
#define ENG_EXT_PRIO_EXCITATION -1000 //excitation priority
|
||||||
#define ENG_EXT_PRIO_CYLINDER -2000 //cylindrial extension priority
|
|
||||||
#define ENG_EXT_PRIO_CYLINDERMULTIGRID -3000 //cylindrial multi-grid extension priority
|
#define ENG_EXT_PRIO_CYLINDERMULTIGRID -3000 //cylindrial multi-grid extension priority
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
@ -82,7 +82,14 @@ bool Operator_Ext_Excitation::BuildExtension()
|
||||||
//electric field excite
|
//electric field excite
|
||||||
for (int n=0; n<3; ++n)
|
for (int n=0; n<3; ++n)
|
||||||
{
|
{
|
||||||
m_Op->GetYeeCoords(n,pos,volt_coord,false);
|
if (m_Op->GetYeeCoords(n,pos,volt_coord,false)==false)
|
||||||
|
continue;
|
||||||
|
if (m_CC_R0_included && (n==2) && (pos[0]==0))
|
||||||
|
volt_coord[1] = m_Op->GetDiscLine(1,0);
|
||||||
|
|
||||||
|
if (m_CC_R0_included && (n==1) && (pos[0]==0))
|
||||||
|
continue;
|
||||||
|
|
||||||
for (size_t p=0; p<vec_prop.size(); ++p)
|
for (size_t p=0; p<vec_prop.size(); ++p)
|
||||||
{
|
{
|
||||||
prop = vec_prop.at(p);
|
prop = vec_prop.at(p);
|
||||||
|
@ -118,7 +125,8 @@ bool Operator_Ext_Excitation::BuildExtension()
|
||||||
{
|
{
|
||||||
if ((pos[0]>=numLines[0]-1) || (pos[1]>=numLines[1]-1) || (pos[2]>=numLines[2]-1))
|
if ((pos[0]>=numLines[0]-1) || (pos[1]>=numLines[1]-1) || (pos[2]>=numLines[2]-1))
|
||||||
continue; //skip the last H-Line which is outside the FDTD-domain
|
continue; //skip the last H-Line which is outside the FDTD-domain
|
||||||
m_Op->GetYeeCoords(n,pos,curr_coord,true);
|
if (m_Op->GetYeeCoords(n,pos,curr_coord,true)==false)
|
||||||
|
continue;
|
||||||
for (size_t p=0; p<vec_prop.size(); ++p)
|
for (size_t p=0; p<vec_prop.size(); ++p)
|
||||||
{
|
{
|
||||||
prop = vec_prop.at(p);
|
prop = vec_prop.at(p);
|
||||||
|
|
Loading…
Reference in New Issue