operator BC handling changed
parent
138624d2d8
commit
d5c4747118
|
@ -69,6 +69,9 @@ void Operator::Init()
|
||||||
EC_L[n]=NULL;
|
EC_L[n]=NULL;
|
||||||
EC_R[n]=NULL;
|
EC_R[n]=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int n=0;n<6;++n)
|
||||||
|
m_BC[n]=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Operator::Reset()
|
void Operator::Reset()
|
||||||
|
@ -577,6 +580,11 @@ int Operator::CalcECOperator()
|
||||||
if (CalcEFieldExcitation()==false) return -1;
|
if (CalcEFieldExcitation()==false) return -1;
|
||||||
CalcPEC();
|
CalcPEC();
|
||||||
|
|
||||||
|
bool PMC[6];
|
||||||
|
for (int n=0;n<6;++n)
|
||||||
|
PMC[n] = m_BC[n]==1;
|
||||||
|
ApplyMagneticBC(PMC);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ public:
|
||||||
//! Get the excitation timestep with the (first) max amplitude
|
//! Get the excitation timestep with the (first) max amplitude
|
||||||
virtual unsigned int GetMaxExcitationTimestep() const;
|
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 ApplyElectricBC(bool* dirs); //applied by default to all boundaries
|
||||||
virtual void ApplyMagneticBC(bool* dirs);
|
virtual void ApplyMagneticBC(bool* dirs);
|
||||||
|
|
||||||
|
@ -104,6 +105,8 @@ protected:
|
||||||
|
|
||||||
ContinuousStructure* CSX;
|
ContinuousStructure* CSX;
|
||||||
|
|
||||||
|
int m_BC[6];
|
||||||
|
|
||||||
//E-Field Excitation
|
//E-Field Excitation
|
||||||
//! Calc the electric field excitation.
|
//! Calc the electric field excitation.
|
||||||
virtual bool CalcEFieldExcitation();
|
virtual bool CalcEFieldExcitation();
|
||||||
|
|
10
openems.cpp
10
openems.cpp
|
@ -237,10 +237,6 @@ int openEMS::SetupFDTD(const char* file)
|
||||||
return(-2);
|
return(-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PMC[6];
|
|
||||||
for (int n=0;n<6;++n)
|
|
||||||
PMC[n]=(bounds[n]==1);
|
|
||||||
|
|
||||||
//*************** setup operator ************//
|
//*************** setup operator ************//
|
||||||
cout << "Create Operator..." << endl;
|
cout << "Create Operator..." << endl;
|
||||||
if (CylinderCoords)
|
if (CylinderCoords)
|
||||||
|
@ -255,8 +251,10 @@ int openEMS::SetupFDTD(const char* file)
|
||||||
|
|
||||||
if (FDTD_Op->SetGeometryCSX(&CSX)==false) return(2);
|
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 !!!! **********************************/
|
/**************************** create all operator/engine extensions here !!!! **********************************/
|
||||||
//Mur-ABC
|
//Mur-ABC, defined as extension to the operator
|
||||||
for (int n=0;n<6;++n)
|
for (int n=0;n<6;++n)
|
||||||
{
|
{
|
||||||
if (bounds[n]==2)
|
if (bounds[n]==2)
|
||||||
|
@ -284,8 +282,6 @@ int openEMS::SetupFDTD(const char* file)
|
||||||
|
|
||||||
FDTD_Op->ShowStat();
|
FDTD_Op->ShowStat();
|
||||||
|
|
||||||
FDTD_Op->ApplyMagneticBC(PMC);
|
|
||||||
|
|
||||||
cout << "Creation time for operator: " << difftime(OpDoneTime,startTime) << " s" << endl;
|
cout << "Creation time for operator: " << difftime(OpDoneTime,startTime) << " s" << endl;
|
||||||
|
|
||||||
//create FDTD engine
|
//create FDTD engine
|
||||||
|
|
Loading…
Reference in New Issue