Sinusoidal excitation
parent
c4c2222d26
commit
9e86a96436
|
@ -141,6 +141,22 @@ void Operator::CalcGaussianPulsExcitation(double f0, double fc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Operator::CalcSinusExcitation(double f0, int nTS)
|
||||||
|
{
|
||||||
|
if (dT==0) return;
|
||||||
|
if (nTS<=0) return;
|
||||||
|
|
||||||
|
ExciteLength = (unsigned int)(nTS);
|
||||||
|
delete[] ExciteSignal;
|
||||||
|
ExciteSignal = new FDTD_FLOAT[ExciteLength+1];
|
||||||
|
ExciteSignal[0]=0.0;
|
||||||
|
for (unsigned int n=1;n<ExciteLength+1;++n)
|
||||||
|
{
|
||||||
|
ExciteSignal[n] = sin(2.0*PI*f0*n*dT);
|
||||||
|
// cerr << ExciteSignal[n] << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Operator::DumpOperator2File(string filename)
|
void Operator::DumpOperator2File(string filename)
|
||||||
{
|
{
|
||||||
ofstream file(filename.c_str(),ios_base::out);
|
ofstream file(filename.c_str(),ios_base::out);
|
||||||
|
|
|
@ -21,7 +21,10 @@ public:
|
||||||
|
|
||||||
virtual int CalcECOperator();
|
virtual int CalcECOperator();
|
||||||
|
|
||||||
|
//! Calculate an excitation with center of f0 and the half bandwidth fc
|
||||||
virtual void CalcGaussianPulsExcitation(double f0, double fc);
|
virtual void CalcGaussianPulsExcitation(double f0, double fc);
|
||||||
|
//! Calculate a sinusoidal excitation with frequency f0 and a duration of nTS number of timesteps
|
||||||
|
virtual void CalcSinusExcitation(double f0, int nTS);
|
||||||
|
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue