This section describes settings for import sources.
Import sources offer users more flexible options, and here are some settings related to Import sources.
Select Import in the solver tab and create an Import source in Composite viewer, then set further parameters in the Edit properties interface that automatically pops up.
General source tab can be used to set incident axis, amplitude, and other parameters related to a source.
Name | Description |
---|---|
Incident axis | Select desired incident axis for an import source from the drop-down list. |
Direction | Incident direction of an import source, specifically selected as Forward (forward propagation) or Backward (backward propagation). |
For settings related to the amplitude, phase shift, and rotation of import sources, see general settings in Source.
Import data tab can be used to set parameters related to importing data.
Name | Description |
---|---|
Spatial position | Spatial position for importing data can be selected as either center of the mesh boundary (Yee-cell) or intersection point of the mesh (Nearest mesh cell). |
Finite-difference type | Optional types include Central finite difference and Yee-cell-based finite difference. |
Imported data from path | This is a read-only parameter. |
Visualize data | Open the Visualizer window. |
Import source | Enter interface for selecting files to be imported. |
Geometry tab can be used to set geometric dimensions of a source. See geometry settings in Source.
Wavelength/Frequency tab can be used to set the wavelength/frequency of a source. See wavelength/frequency settings in Source.
Construction of field data is one of the main concerns when importing sources. Software requires field data to be transferred to import sources in the fixed form.
We will demonstrate how to use import source. In this case, we first construct a Gaussian source dataset with z-axis incidence. The script is as follows:
# Define parameters;incident axis is Z
points = 201;
x = linspace(-5e-6, 5e-6, points);
y = linspace(-4e-6, 4e-6, points);
z = -4e-6;
lambda = 0.5e-6;
f = c/lambda;
index = 1;
# Calculate field components using Gaussian formula
[x0,y0] = meshgrid(x,y);
w0 = 1e-6;
f_a = exp(-((x0/w0).^2 + (y0/w0).^2));
f_a = f_a.';
Ex = f_a;
Ey = zeros(points, points);
Ez = zeros(points, points);
Hx = zeros(points, points);
Hy = f_a*sqrt(eps0/mu0);
Hz = zeros(points, points);
# Create EH dataset
Gaussian_fields = matrixdataset('fields');
Gaussian_fields.addparameter('x', x);
Gaussian_fields.addparameter('y', y);
Gaussian_fields.addparameter('z', z);
Gaussian_fields.addparameter('lambda', lambda, 'f', f);
Gaussian_fields.addattribute('E', Ex, Ey, Ez);
Gaussian_fields.addattribute('H', Hx, Hy, Hz);
Gaussian_fields.setparameterunit('x','length');
Gaussian_fields.setparameterunit('y','length');
Gaussian_fields.setparameterunit('z','length');
Gaussian_fields.setparameterunit('lambda','length');
Gaussian_fields.setparameterunit('f', 'frequency');
# Save the dataset as a .mat file
savematlabmatfile('Gaussian_fields.mat', Gaussian_fields);
Import data Gaussian_fields.mat
to an Import source, run FDTD simulation, and view transmission field on the monitor, the results are as follows:
Import-E magnitude | Transmission field-E magnitude |
---|---|
![]() |
![]() |
Users can import any field data according to the above-mentioned data format, thereby forming a customized imported light source.