# FDTD port " setglobalmonitor("frequency points") " script command inconsistent with manual input

#1

Hi Lumerical,

I am having issues using the script command in FDTD to get a spectrum across some wavelengths in my transmission “T” output data in my “ports” settings.

I set up, through scripts, such that in FDTD>ports>“edit port group” settings > "monitor frequency points(override global) > is set to 500 (I visually inspect and see this is the case.

in the FDTD>ports>port 1 (and port 2) > Modal Properties > frequency points > is set to 1 (visually inspect).

When I do this through scripts I DONT get a spectrum(viewing T), but only get 1 single data point. When I do this manually, by band, I do get a spectrum (viewing T)

Here is the script command I use

# BEGINNING OF CODE snippet:
#############################
#EXTRANEOUS INFO BUT JUST SHOWING WHAT ALL I DID TO PUT THE FDTD SIMULATION REGION IN
#############################
set("x min", minvxWAFER+.5e-6-sdelta);
set("x max", maxvxWAFER-.5e-6);
set("y min", minvyWAFER-1e-6);
set("y max", maxvyWAFER+1e-6);
set("z min", -FDTD_below); set("z max", maxvzWAFER+FDTD_above);
set("simulation time",sim_time);

set("mesh accuracy",meshaccuracynum);

set("name","source");
set("injection axis","x-axis");
set("direction","forward");
set("y",0); set("y span", 1.5e-6);
set("x",0+.5e-6+.25e-6-sdelta);  # the FDTD simulation region is 0.5e-6 meters from the origin (0,0), then the
#source is 0.25 microns to the right of the FDTD simulation(i.e. putting the source inside the FDTD sim region
set("z min",-FDTD_below); set("z max", maxvzWAFER+FDTD_above);
set("mode selection","fundamental mode");

set("name","through");
set("injection axis","x");
set("direction","forward");
#set("monitor type","2D X-normal");
set("x", 0+.5e-6+.25e-6-sdelta);
set("z min", -FDTD_below); set("z max", maxvzWAFER+FDTD_above);

##############################################
# END OF EXTRANEOUS STUFF JUST FYI
#############################################

################################
# HERE IS WHERE I THINK I HAVE SETUP THE FREQUENCY MONITOR POINTS AND GET A SPECTRUM CORRECTLY:
################################

select("FDTD::ports::source");
set("frequency points",1);

select("FDTD::ports::through");
set("frequency points",1);

setglobalsource("wavelength start",1200e-9);
setglobalsource("wavelength stop",1400e-9);
setglobalmonitor("use source limits",0);

setglobalmonitor("frequency points",500);
setglobalmonitor("minimum wavelength",1305e-9);
setglobalmonitor("maximum wavelength",1315e-9);

##################################### END OF CODE snippet


Now, I run, and get back only ONE data point, so I go to ports, and check the global freq points and the freq points inside each port, and they are displayed exactly as I described in the first of this post.

Then, I only manually edit “ports” under FDTD object, and manually delete the "500 " number I wrote in for the frequency points and manually type it back in and hit ok, then hit run. Then I get magically get data across the full spectrum as I wanted!

Is this a bug or is there some other script command that I’m missing? Just dont want to manually wade thru each iteration of code…

Many thanks!!
XW

#2

Dear @xw27

Unfortunately its a bug and thanks for reporting it.

It looks like the monitor frequency points in PortGroup does not get updated once you set it. This problem occurs even if you define ports objects through GUI.

In the mean time that we are working to fix the bug, you can add these commands to set it to the value of interest:

select("FDTD::ports"); # select the port group
set("monitor frequency points",100);


Sorry for any inconvenience.

#3

@bkhanaliloo thanks very much for the tip!!