always show the optimal timestep

pull/1/head
Thorsten Liebig 2010-09-02 22:12:03 +02:00
parent cabdf4a84a
commit 12c26f834a
2 changed files with 7 additions and 1 deletions

View File

@ -304,7 +304,10 @@ void Operator::ShowStat() const
cout << "in " << GetDirName(1) << " direction\t\t: " << m_Nr_PEC[1] << endl; cout << "in " << GetDirName(1) << " direction\t\t: " << m_Nr_PEC[1] << endl;
cout << "in " << GetDirName(2) << " direction\t\t: " << m_Nr_PEC[2] << endl; cout << "in " << GetDirName(2) << " direction\t\t: " << m_Nr_PEC[2] << endl;
cout << "-----------------------------------" << endl; cout << "-----------------------------------" << endl;
cout << "Timestep (s)\t\t: " << dT << endl; cout << "Timestep (s)\t\t: " << dT ;
if (opt_dT)
cout <<"\t(" << opt_dT << ")";
cout << endl;
cout << "Timestep method name\t: " << m_Used_TS_Name << endl; cout << "Timestep method name\t: " << m_Used_TS_Name << endl;
cout << "Nyquist criteria (TS)\t: " << Exc->GetNyquistNum() << endl; cout << "Nyquist criteria (TS)\t: " << Exc->GetNyquistNum() << endl;
cout << "Nyquist criteria (s)\t: " << Exc->GetNyquistNum()*dT << endl; cout << "Nyquist criteria (s)\t: " << Exc->GetNyquistNum()*dT << endl;
@ -533,10 +536,12 @@ int Operator::CalcECOperator()
if (Calc_EC()==0) if (Calc_EC()==0)
return -1; return -1;
opt_dT = 0;
if (dT>0) if (dT>0)
{ {
double save_dT = dT; double save_dT = dT;
CalcTimestep(); CalcTimestep();
opt_dT = dT;
if (dT<save_dT) if (dT<save_dT)
cerr << "Operator::CalcECOperator: Warning, forced timestep: " << save_dT << "s is larger than calculated timestep: " << dT << "s! It is not recommended using this timestep!! " << endl; cerr << "Operator::CalcECOperator: Warning, forced timestep: " << save_dT << "s is larger than calculated timestep: " << dT << "s! It is not recommended using this timestep!! " << endl;
dT = save_dT; dT = save_dT;

View File

@ -130,6 +130,7 @@ protected:
//Calc timestep only internal use //Calc timestep only internal use
virtual double CalcTimestep(); virtual double CalcTimestep();
double dT; //FDTD timestep! double dT; //FDTD timestep!
double opt_dT;
string m_Used_TS_Name; string m_Used_TS_Name;
double CalcTimestep_Var1(); double CalcTimestep_Var1();