diff --git a/main.cpp b/main.cpp index 2c278db..3e235a7 100644 --- a/main.cpp +++ b/main.cpp @@ -76,12 +76,11 @@ int main(int argc, char *argv[]) const char* fileHelix="../examples/Helix.xml"; BuildHelix(fileHelix); - const char* file=fileMSL; + const char* file=fileHelix; -// cerr << CSX.ReadFromXML("examples/PlaneWave.xml") << endl; + FDTD.DebugMaterial(); #endif -// FDTD.DebugMaterial(); int EC = FDTD.SetupFDTD(file); if (EC) return EC; FDTD.RunFDTD(); diff --git a/openems.cpp b/openems.cpp index ec30157..499dcf6 100644 --- a/openems.cpp +++ b/openems.cpp @@ -16,6 +16,7 @@ */ #include "openems.h" +#include #include "tools/array_ops.h" #include "FDTD/operator.h" #include "FDTD/engine.h" @@ -91,6 +92,9 @@ int openEMS::SetupFDTD(const char* file) exit(-1); } FDTD_Opts->QueryIntAttribute("NumberOfTimesteps",&NrTS); + FDTD_Opts->QueryDoubleAttribute("endCriteria",&endCrit); + if (endCrit==0) + endCrit=1e-6; TiXmlElement* Excite = FDTD_Opts->FirstChildElement("Excitation"); if (Excite==NULL) @@ -272,9 +276,9 @@ void openEMS::RunFDTD() currE = ProcField.CalcTotalEnergy(); if ((currE>0) && (currE>maxE)) maxE=currE; - cout << "Timestep:\t" << currTS << " of " << NrTS << " (" << (double)currTS/(double)NrTS*100.0 << "%)" ; - cout << "\t with currently " << speed*(double)(currTS-prevTS)/t_diff << " MCells/s" ; - cout << "\t current Energy estimate: " << currE << " (decrement: " << -10.0*log10(currE/maxE) << "dB)" << endl; + cout << "Timestep: " << setw(12) << currTS << " (" << setw(6) << setprecision(2) << std::fixed << (double)currTS/(double)NrTS*100.0 << "%)" ; + cout << " with currently " << setw(6) << setprecision(1) << std::fixed << speed*(double)(currTS-prevTS)/t_diff << " MCells/s" ; + cout << " --- Energy: ~" << setw(6) << setprecision(2) << std::scientific << currE << " (decrement: " << setw(6) << setprecision(2) << std::fixed << fabs(10.0*log10(currE/maxE)) << "dB)" << endl; prevTime=currTime; prevTS=currTS; }