diff --git a/matlab/SetSinusExcite.m b/matlab/SetSinusExcite.m new file mode 100644 index 0000000..08c1b18 --- /dev/null +++ b/matlab/SetSinusExcite.m @@ -0,0 +1,4 @@ +function FDTD = SetGaussExcite(FDTD,f0); + +FDTD.Excitation.ATTRIBUTE.Type=1; +FDTD.Excitation.ATTRIBUTE.f0=f0; \ No newline at end of file diff --git a/matlab/examples/Helix.m b/matlab/examples/Helix.m index 7469449..c9d1ec6 100644 --- a/matlab/examples/Helix.m +++ b/matlab/examples/Helix.m @@ -92,7 +92,7 @@ WriteOpenEMS([Sim_Path '/' Sim_CSX],FDTD,CSX); %cd to working dir and run openEMS savePath = pwd(); cd(Sim_Path); %cd to working dir -command = [openEMS_Path 'openEMS ' Sim_CSX ' ' openEMS_opts]; +command = [openEMS_Path 'openEMS.sh ' Sim_CSX ' ' openEMS_opts]; disp(command); system(command) cd(savePath); diff --git a/openems.cpp b/openems.cpp index dba1765..ed3da8c 100644 --- a/openems.cpp +++ b/openems.cpp @@ -109,6 +109,10 @@ int openEMS::SetupFDTD(const char* file) Excite->QueryDoubleAttribute("f0",&f0); Excite->QueryDoubleAttribute("fc",&fc); } + else if (Excit_Type==1) + { + Excite->QueryDoubleAttribute("f0",&f0); + } TiXmlElement* BC = FDTD_Opts->FirstChildElement("BoundaryCond"); if (BC==NULL) @@ -151,8 +155,11 @@ int openEMS::SetupFDTD(const char* file) FDTD_Op->DumpOperator2File("operator_dump.vtk"); } + fc = 0; if (Excit_Type==0) FDTD_Op->CalcGaussianPulsExcitation(f0,fc); + else if (Excit_Type==1) + FDTD_Op->CalcSinusExcitation(f0,NrTS); else { cerr << "openEMS: Excitation type is unknown" << endl;