operator BC handling changed

pull/1/head
Thorsten Liebig 2010-04-28 22:01:03 +02:00
parent 138624d2d8
commit d5c4747118
3 changed files with 14 additions and 7 deletions

View File

@ -69,6 +69,9 @@ void Operator::Init()
EC_L[n]=NULL;
EC_R[n]=NULL;
}
for (int n=0;n<6;++n)
m_BC[n]=0;
}
void Operator::Reset()
@ -577,6 +580,11 @@ int Operator::CalcECOperator()
if (CalcEFieldExcitation()==false) return -1;
CalcPEC();
bool PMC[6];
for (int n=0;n<6;++n)
PMC[n] = m_BC[n]==1;
ApplyMagneticBC(PMC);
return 0;
}

View File

@ -53,6 +53,7 @@ public:
//! Get the excitation timestep with the (first) max amplitude
virtual unsigned int GetMaxExcitationTimestep() const;
virtual void SetBoundaryCondition(int* BCs) {for (int n=0;n<6;++n) m_BC[n]=BCs[n];}
virtual void ApplyElectricBC(bool* dirs); //applied by default to all boundaries
virtual void ApplyMagneticBC(bool* dirs);
@ -104,6 +105,8 @@ protected:
ContinuousStructure* CSX;
int m_BC[6];
//E-Field Excitation
//! Calc the electric field excitation.
virtual bool CalcEFieldExcitation();

View File

@ -237,10 +237,6 @@ int openEMS::SetupFDTD(const char* file)
return(-2);
}
bool PMC[6];
for (int n=0;n<6;++n)
PMC[n]=(bounds[n]==1);
//*************** setup operator ************//
cout << "Create Operator..." << endl;
if (CylinderCoords)
@ -255,8 +251,10 @@ int openEMS::SetupFDTD(const char* file)
if (FDTD_Op->SetGeometryCSX(&CSX)==false) return(2);
FDTD_Op->SetBoundaryCondition(bounds); //operator only knows about PEC and PMC, everything else is defined by extensions (see below)
/**************************** create all operator/engine extensions here !!!! **********************************/
//Mur-ABC
//Mur-ABC, defined as extension to the operator
for (int n=0;n<6;++n)
{
if (bounds[n]==2)
@ -284,8 +282,6 @@ int openEMS::SetupFDTD(const char* file)
FDTD_Op->ShowStat();
FDTD_Op->ApplyMagneticBC(PMC);
cout << "Creation time for operator: " << difftime(OpDoneTime,startTime) << " s" << endl;
//create FDTD engine