command line option for disabling dumps

pull/1/head
Thorsten Liebig 2010-03-11 15:48:55 +01:00
parent b76eac70e8
commit f7c5d27f60
3 changed files with 18 additions and 5 deletions

View File

@ -6,19 +6,30 @@
#include "examples/FDTD_examples.h"
//#define STANDALONE
#define STANDALONE
using namespace std;
int main(int argc, char *argv[])
{
openEMS FDTD;
#ifdef STANDALONE
if (argc<=1)
{
cerr << " argc= " << argc << endl;
cerr << " usage: openEMS FDTD_XML_FILE [--disable-dumps]" << endl;
exit(-1);
}
if (argc>=3)
{
for (int n=2;n<argc;++n)
{
if (strcmp(argv[n],"--disable-dumps")==0)
FDTD.SetEnableDumps(false);
}
}
char* file = argv[1];
#else
//*************** setup/read geometry ************//
@ -39,7 +50,6 @@ int main(int argc, char *argv[])
// cerr << CSX.ReadFromXML("examples/PlaneWave.xml") << endl;
#endif
openEMS FDTD;
int EC = FDTD.SetupFDTD(file);
if (EC) return EC;

View File

@ -15,6 +15,7 @@ openEMS::openEMS()
FDTD_Op=NULL;
FDTD_Eng=NULL;
PA=NULL;
Enable_Dumps = true;
}
openEMS::~openEMS()
@ -45,7 +46,6 @@ int openEMS::SetupFDTD(const char* file)
double f0=0;
double fc=0;
int Excit_Type=0;
bool EnableDump = true;
int bounds[6];
time_t startTime=time(NULL);
@ -181,7 +181,7 @@ int openEMS::SetupFDTD(const char* file)
for (size_t i=0;i<DumpProps.size();++i)
{
ProcessFieldsTD* ProcTD = new ProcessFieldsTD(FDTD_Op,FDTD_Eng);
ProcTD->SetEnable(EnableDump);
ProcTD->SetEnable(Enable_Dumps);
ProcTD->SetProcessInterval(Nyquist/2); //twice as often as nyquist dictates
//only looking for one prim atm

View File

@ -17,9 +17,12 @@ public:
void Reset();
void SetEnableDumps(bool val) {Enable_Dumps=val;}
protected:
//! Number of Timesteps
int NrTS;
bool Enable_Dumps;
Operator* FDTD_Op;
Engine* FDTD_Eng;
ProcessingArray* PA;