Initial matlab interface
parent
4de33663ad
commit
962fe5ee94
|
@ -0,0 +1,7 @@
|
|||
function FDTD = InitFDTD(NrTS, endCrit)
|
||||
|
||||
FDTD.ATTRIBUTE.NumberOfTimesteps=NrTS;
|
||||
FDTD.ATTRIBUTE.endCriteria=endCrit;
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
function FDTD = SetBoundaryCond(FDTD,BC)
|
||||
|
||||
FDTD.BoundaryCond.ATTRIBUTE.xmin=BC(1);
|
||||
FDTD.BoundaryCond.ATTRIBUTE.xmax=BC(2);
|
||||
FDTD.BoundaryCond.ATTRIBUTE.ymin=BC(3);
|
||||
FDTD.BoundaryCond.ATTRIBUTE.ymax=BC(4);
|
||||
FDTD.BoundaryCond.ATTRIBUTE.zmin=BC(5);
|
||||
FDTD.BoundaryCond.ATTRIBUTE.zmax=BC(6);
|
|
@ -0,0 +1,5 @@
|
|||
function FDTD = SetGaussExcite(FDTD,f0,fc);
|
||||
|
||||
FDTD.Excitation.ATTRIBUTE.Type=0;
|
||||
FDTD.Excitation.ATTRIBUTE.f0=f0;
|
||||
FDTD.Excitation.ATTRIBUTE.fc=fc;
|
|
@ -0,0 +1,6 @@
|
|||
function WriteOpenEMS(filename, FDTD, CSX)
|
||||
|
||||
openEMS.FDTD=FDTD;
|
||||
openEMS.ContinuousStructure=CSX;
|
||||
|
||||
xml_write(filename,openEMS);
|
|
@ -0,0 +1,34 @@
|
|||
close all;
|
||||
clear all;
|
||||
clc
|
||||
|
||||
openEMS_Path = [pwd() '/../../']
|
||||
openEMS_opts = '';
|
||||
openEMS_opts = [openEMS_opts ' --disable-dumps'];
|
||||
openEMS_opts = [openEMS_opts ' --debug-material'];
|
||||
|
||||
Sim_Path = 'tmp';
|
||||
Sim_CSX = 'helix.xml';
|
||||
|
||||
mkdir(Sim_Path);
|
||||
|
||||
%setup FDTD parameter
|
||||
FDTD = InitFDTD(1000,1e-6);
|
||||
FDTD = SetGaussExcite(FDTD,0.5e9,0.5e9);
|
||||
BC = [1 1 1 1 1 1];
|
||||
FDTD = SetBoundaryCond(FDTD,BC);
|
||||
|
||||
%setup CSXCAD geometry
|
||||
CSX = [];
|
||||
|
||||
%Write openEMS compatoble xml-file
|
||||
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 ' openEMS_opts];
|
||||
disp(command);
|
||||
system(command)
|
||||
cd(savePath);
|
||||
|
Loading…
Reference in New Issue