fix in Excitation length comparison

This commit is contained in:
Thorsten Liebig 2011-03-18 10:06:28 +01:00
parent caacbb9d9d
commit be7e543232

View File

@ -134,12 +134,11 @@ void Excitation::CalcGaussianPulsExcitation(double f0, double fc, int nTS)
if (dT==0) return;
Length = (unsigned int)(2.0 * 9.0/(2.0*PI*fc) / dT);
if ((int)Length>nTS)
if (Length>(unsigned int)nTS)
{
cerr << "Operator::CalcGaussianPulsExcitation: Requested excitation pusle would be " << Length << " timesteps or " << Length * dT << " s long. Cutting to max number of timesteps!" << endl;
Length=(unsigned int)nTS;
}
// cerr << "Operator::CalcGaussianPulsExcitation: Length of the excite signal: " << ExciteLength << " timesteps" << endl;
delete[] Signal_volt;
delete[] Signal_curr;
Signal_volt = new FDTD_FLOAT[Length+1];