  FDTD vs geometrical optics and how to create a source at not-too large distance

Recently I got a few support cases that is related to interoperability with tools from geometrical optics. When I reviewed the actual devices, I found that the dimension to be simulated is on the micron meter scale at the optical wavelength. In such cases the geometrical optics may not accurately predict the results. However users will have difficulty to simulate it since the distance is in 100um scale, too large for FDTD simulation.

Alternatively, one can create a customer source using monitor data by use of farfieldexact. Examples and related script files can be found from
https://kb.lumerical.com/ref_sim_obj_sources_custom_field_import.html
https://apps.lumerical.com/sp_bullseye_aperture.html
https://apps.lumerical.com/sp_focusing_with_subwavelength_aperture.html

To facilitate this, I write this brief summary on how to do it using farfieldexact3d: https://kb.lumerical.com/ref_scripts_farfieldexact3d.html

1: specify xyz to be projected
2: get farfieldexact3D, and extract Ex,Ey and Ez;
3: create the dataset for source import and import it
4: then you are ready to do next simulation, either using FDTD or other tools.

nx=50;# use larger number to get accurate result later
ny=50;
x=linspace(0.2e-6,150e-6,nx);#this is the dimension for the import source
y=linspace(-20e-6,20e-6,ny);
z=100e-6;# this is the z coordinate of the plane to be projected

f=getdata(“R”,“f”); # the monitor name is R

do far field projection

E2 = farfieldexact3d(‘R’,x,y,z); #suppose it is single wavelength, if not, a loop will be needed

extract Ex,Ey and Ez
Ex=Efar(:,:,:,1);

Ey=Efar(:,:,:,2);

Ez=Efar(:,:,:,3);

then create a dataset:

EM = rectilineardataset(“EM fields”,x,y,z);
EM.addparameter(“lambda”,c/f,“f”,f); # Note: Import source can only load datasets with one frequency point of data.
matlabsave(“EM_data.mat”,EM);

If it is used for another FDTD simulation, then open the 2nd fsp file to be simulated: