2010-02-28 21:48:03 +00:00
|
|
|
#include <iostream>
|
2010-03-01 18:35:28 +00:00
|
|
|
#include <fstream>
|
|
|
|
#include <sstream>
|
2010-03-01 13:56:27 +00:00
|
|
|
|
2010-03-11 09:56:19 +00:00
|
|
|
#include "openems.h"
|
2010-02-28 21:48:03 +00:00
|
|
|
|
2010-03-07 11:49:38 +00:00
|
|
|
#include "examples/FDTD_examples.h"
|
2010-02-28 21:48:03 +00:00
|
|
|
|
2010-03-11 14:48:55 +00:00
|
|
|
#define STANDALONE
|
2010-03-11 09:56:19 +00:00
|
|
|
|
2010-03-07 11:49:38 +00:00
|
|
|
using namespace std;
|
2010-02-28 22:42:10 +00:00
|
|
|
|
2010-02-28 21:48:03 +00:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2010-03-11 14:48:55 +00:00
|
|
|
openEMS FDTD;
|
|
|
|
|
2010-03-11 09:56:19 +00:00
|
|
|
#ifdef STANDALONE
|
|
|
|
if (argc<=1)
|
|
|
|
{
|
2010-03-11 14:48:55 +00:00
|
|
|
cerr << " usage: openEMS FDTD_XML_FILE [--disable-dumps]" << endl;
|
2010-03-11 09:56:19 +00:00
|
|
|
exit(-1);
|
|
|
|
}
|
2010-02-28 21:48:03 +00:00
|
|
|
|
2010-03-11 14:48:55 +00:00
|
|
|
if (argc>=3)
|
|
|
|
{
|
|
|
|
for (int n=2;n<argc;++n)
|
|
|
|
{
|
|
|
|
if (strcmp(argv[n],"--disable-dumps")==0)
|
|
|
|
FDTD.SetEnableDumps(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-03-11 09:56:19 +00:00
|
|
|
char* file = argv[1];
|
|
|
|
#else
|
2010-03-01 18:35:28 +00:00
|
|
|
//*************** setup/read geometry ************//
|
2010-03-01 13:56:27 +00:00
|
|
|
|
2010-03-11 09:56:19 +00:00
|
|
|
const char* fileDP="examples/Dipol.xml";
|
|
|
|
BuildDipol(fileDP);
|
2010-03-01 13:56:27 +00:00
|
|
|
|
2010-03-11 09:56:19 +00:00
|
|
|
const char* filePW="examples/PlaneWave.xml";
|
|
|
|
BuildPlaneWave(filePW);
|
2010-03-01 18:35:28 +00:00
|
|
|
|
2010-03-11 09:56:19 +00:00
|
|
|
const char* fileMSL="examples/MSL.xml";
|
|
|
|
BuildMSL(fileMSL);
|
2010-03-01 13:56:27 +00:00
|
|
|
|
2010-03-11 14:35:12 +00:00
|
|
|
const char* fileCoax="examples/Coax_Cart.xml";
|
|
|
|
BuildCoaxial_Cartesian(fileCoax);
|
|
|
|
|
|
|
|
const char* file=fileCoax;
|
2010-03-01 13:56:27 +00:00
|
|
|
|
2010-03-11 09:56:19 +00:00
|
|
|
// cerr << CSX.ReadFromXML("examples/PlaneWave.xml") << endl;
|
|
|
|
#endif
|
2010-03-10 11:15:14 +00:00
|
|
|
|
2010-03-11 09:56:19 +00:00
|
|
|
int EC = FDTD.SetupFDTD(file);
|
|
|
|
if (EC) return EC;
|
|
|
|
FDTD.RunFDTD();
|
2010-03-10 11:15:14 +00:00
|
|
|
|
2010-03-11 09:56:19 +00:00
|
|
|
return 0;
|
2010-02-28 21:48:03 +00:00
|
|
|
}
|