Finite-Difference Time-Domain Electromagnetic Simulation: Angora: A Free Software Package For
Finite-Difference Time-Domain Electromagnetic Simulation: Angora: A Free Software Package For
Finite-Difference Time-Domain
Electromagnetic Simulation
İlker R. Çapoğlu1, Allen Taflove2, and Vadim Backman1
2
Electrical Engineering and Computer Science Department of Northwestern University
2145 Sheridan Road, Evanston, IL 60208 USA
E-mail: tafl[email protected]
Abstract
Angora is a free, open-source software package implementing the Finite-Difference Time-Domain (FDTD) Method. This
article explains how to access and use Angora, and introduces its features. Examples of its configuration and use are
given. These include treatment of planar stratified and random materials, the creation of current sources and incident
beams, near-field-to-far-field transformation, optical imaging and nano-optics, and the recording of fields.
Keywords: Open source software; finite difference methods; time domain analysis; parallel algorithms; optical imaging;
FDTD
There are many proprietary software tools on the market Angora is currently available only for the GNU/Linux
for FDTD simulation, and a few free software implementa- operating system. Angora can be downloaded from the Angora
tions. Examples of these can be found in [3]. In this article, we Web site [4] in source-code format, as well as in binary format
introduce a new, free FDTD software package named Angora. for x86_64 GNU/Linux systems. On the Web site, you can also
This software package is now available for download at http:// find information on how to receive updates on Angora.
www.angorafdtd.org [4]. A comprehensive user’s manual can
be found on this Web site. In the following sections, we will Some important features of Angora, such as focused
summarize the important features of Angora, and give some laser-beam illumination and numerical optical-image synthe-
examples. sis, are geared toward optics applications. Others, such as ran-
80 ISSN 1045-9243/2012/$26 ©2013 IEEE IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013
• Support for HDF5, a portable file storage format. The next three lines set the dimensions of the simulation space
in the x, y, and z directions. The pml_thickness line deter-
• Field-value recording (two-dimensional, one-dimen- mines the thickness of the perfectly-matched layer (PML)
sional, single point) and movie generation. absorbing boundary, which is based on the convolution per-
fectly-matched layer formulation [9]. With the extra perfectly-
• Generating random constitutive parameter distribu- matched layer thickness, the total simulation space has dimen-
tions. sions of 10.5 cm × 10.5 cm × 10.5 cm. Finally, the number
of time steps in the simulation is specified using the num_of_
• Reading constitutive-parameter distributions from time_steps variable.
files.
Other properties of the simulation are configured simi-
• Synthesizing the optical image of the simulated sam- larly, by assigning values to various variables. Examples of
ple. these are given in the following sections.
IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013 81
Materials:
(
{
material_tag = “mat1”;
rel_permittivity = 2.1;
},
{
material_tag = “mat2”;
rel_permittivity = 2.0;
}
);
2
Lists in Angora are collections of values (integers, groups,
even other lists) delineated by parentheses () . In the Angora
context, lists almost invariably consist of groups. For more Figure 1. The yz cross section of the permittivity distribu-
information on the Angora configuration syntax, see the user’s tion in the FDTD grid at x = 0 after the placement of two
manual. simple shapes.
82 IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013
A highly-inhomogeneous material region can be placed • n y : An integer (four bytes) specifying the extent of
into the simulation grid by reading a file that stores the con- the three-dimensional array (in grid cells) in the y
stitutive-parameter distribution of the region in a simple dimension
binary format. The MaterialsFromFiles list is used for this
purpose: • nz : An integer (four bytes) specifying the extent of
SimulationSpace: the three-dimensional array (in grid cells) in the z
{ dimension
MaterialsFromFiles:
( • A three-dimensional floating-point array of size
{
file_name = “materialfile”;
( )
nx × n y × nz , with each element of type double
constitutive_param_type = (eight bytes) or float (four bytes), depending on the
“rel_permittivity”; datatype variable above. The array should be laid
anchor = “center”; out in column-major order, i.e., x dimension first.
coord_x = 0;
coord_y = 0; With the above assignment to the constitutive_
coord_z = 0;
param_type variable, the array read from the file will set the
datatype = “double”;
} relative permittivity of the region. The positioning is determined
); by the coordinates of the anchor point in the three-dimensional
}; region. In the above example, the anchor is set to the center of
the region, which is then placed at ( 0, 0, 0 ) with respect to the
The input file “materialfile” should be a binary file with the center of the grid.
following data, in the order specified:
The placement of the material region can be customized
• nx : An integer (four bytes) specifying the extent of much further. Different constitutive parameters can also be
the three-dimensional region (in grid cells) in the x superimposed using multiple definitions. For more details,
dimension please consult the user’s manual.
IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013 83
m −3/2
25/2− m ( r lc )
B (r ) = σ 2
K m −3/2 ( r lc ) . (1)
Γ ( m − 3 2)
84 IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013
2
=f ( t ) sin ( 2π f 0t ) exp − ( t τ ) 2 ,
and given the name “my_wf”. The variables tau and f_0
correspond to τ and f 0 , respectively. All time and frequency
units are in seconds and Hz, respectively. We can now define
the infinitesimal dipole. The PointSources list is used for this
purpose:
PointSources:
(
{
coord_x = 0;
coord_y = 0;
coord_z = 0;
source_orientation = “x_directed”;
waveform_tag = “my_wf”;
j_0 = 1.0;
}
);
Figure 5. An electricfield snapshot of an x-polarized plane
In the above assignment, the coordinates and the orientation wave. The direction of propagation is indicated by the
of the dipole are determined by the first four lines. The arrow.
waveform that represents the current moment of the dipole (in
Ampere × m) is set by the string tag “my_wf”. The variable
j_0 adds an extra prefactor to the current-moment waveform.
section of the FDTD grid at x = 0 , t = 850 ps. The brightness
As an example, we placed this dipole inside the grid with of a pixel is proportional to the x component of the electric field
the two basic shapes shown in Figure 1 (Section 4). In Figure 4, at that pixel. The permittivity distribution is shown in red where
the field and permittivity distributions are shown on a yz cross it is different from one.
TFSF:
{
PlaneWaves:
(
{
theta = 40;
phi = 90;
psi = 0;
waveform_tag = “waveform1”;
}
Figure 4. The field distribution created by an x-directed );
infinitesimal (Hertzian) electric current source at the origin. };
IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013 85
86 IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013
PhasorDomainNFFFT:
(
{
num_of_lambdas = 50;
lambda_min = 3e-2;
lambda_max = 6e-2;
lambda_spacing_type = “k-linear”;
direction_spec = “theta-phi”;
num_of_dirs_1 = 1;
dir1_min=0.0;
dir1_max=0.0;
num_of_dirs_2 = 1;
dir2_min=0.0;
dir2_max=0.0;
far_field_dir = “my_path”;
},
{
num_of_lambdas = 1;
lambda_min = 4e-2;
direction_spec = “theta-phi”;
num_of_dirs_1 = 360;
Figure 7. An electricfield snapshot of an x-polarized focused
dir1_min=0.0;
Gaussian beam. The direction of propagation is indicated dir1_max=360.0;
by the arrow. num_of_dirs_2 = 1;
dir2_min=0.0;
dir2_max=0.0;
far_field_dir = “my_path”;
types of near-field-to-far-field transformations. In the first, }
the frequency (or phasor) components of the temporal Fourier );
spectrum of the far field are calculated at specific frequencies.
In the second, the far field is obtained directly in the time In this example, two near-field-to-far-field transformations are
domain. In the first type, there is a significant memory penalty defined in two consecutive groups. In the first group, the far
per frequency, but a small additional computational burden per field is calculated at a range of frequencies in a single direction.
observation direction. In the second type of near-field-to-far- In the second group, the far field is calculated at a single
field transformation, the additional computational burden per frequency over a range of observation directions. In the first
observation direction is much larger; however, the memory near-field-to-far-field transformation, the first four lines
usage is much lower. The first type (phasor-domain near-field- determine the frequencies (or free-space wavelengths) at which
to-far-field transformation) is therefore desirable if very few the far field will be calculated. Here, the far-field is calculated
frequencies are needed. The second (time-domain near-field- at 50 free-space wavelengths, spaced linearly in frequency
to-far-field transformation) is desirable if very few observation (equivalently, in wavenumber, k) between 3 cm and 6 cm. In the
directions are needed. Angora can calculate both types of near- second near-field-to-far-field transformation, lines three to nine
field-to-far-field transformations. The phasor-domain near- define the directions at which the far field is to be calculated.
field-to-far-field transformation is supported for an arbitrary The assignment direction_spec=“theta-phi” says that
number of layers with any permittivity, permeability, and the directions are given in terms of the spherical-coordinate
electric-conductivity values (see Section 5), whereas the time- angles θ and φ , where the z axis corresponds to θ = 0 , and the
domain near-field-to-far-field transformation is supported for up
xz plane corresponds to φ = 0 . The lines that follow this
to three lossless planar layers. The phasor-domain near-field-to-
far-field transformation for arbitrary layering was described (as assignment specify that the far field will be calculated at 360 θ
an extension and generalization of the results in [13]) in [14], values between 0° and 360°, and a single φ value ( φ = 0° ).
and the time-domain near-field-to-far-field transformation for a This corresponds to the far-field pattern on the xz plane. The last
three-layered medium was described in [15]. line in each group determines the directory in which the output
file is placed. The output is in the standard HDF5 format, which
can be inspected and modified using free software [16], or built-
in MATLAB functions. For more information on the output of
10.1 Phasor-Domain NFFFT the phasor-domain near-field-to-far-field transformation, please
consult the Angora user’s manual. The far-field amplitudes are
Angora supports phasor-domain near-field-to-far-field all normalized by the asymptotic r dependence exp ( − jkr ) r .
transformations for arbitrary planar stratification with permit-
tivity, permeability, and electric conductivity variations along As an example, the frequency spectrum and the far-field
the axis of symmetry. pattern are shown in Figures 8a and 8b for the arrangement in
IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013 87
TimeDomainNFFFT:
(
{
theta = 36;
phi = 57;
far_field_dir = “my_path”;
}
Figure 8b. The farfield amplitudes created by the Hertzian );
source in Figure 4: The phasor-amplitude pattern in the xz
plane at λ = 4 cm. The absolute value of Eθ is shown. All The theta and phi variables specify the spherical-coordinate
amplitudes were normalized by the distance, r, and the free- θ and φ angles at which the far-field waveforms are to be
space amplitude created by the dipole in the θ = 0° calculated. The far_field_dir variable determines the
direction. directory in which the output file is placed. The output is in the
88 IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013
OpticalImages:
(
{
output_data = [“intensity_tot”,
“intensity_inc”];
num_of_lambdas = 10;
lambda_min = 400e-9;
lambda_max = 700e-9;
lambda_spacing_type = “k-linear”;
ap_half_angle = 36.87;
magnification = 40.0;
coll_half_space = “upper”;
image_dir = “my_path”;
} Figure 9a. The xy cross section of the geometry of the opti-
); cally-imaged sample in the shape of the AP-S logo ( n = 1.6 ),
embossed on a glass substrate ( n = 1.5 ).The embossing
The output_data array lists the desired field or intensity material is shown in red.
information in the output file. In the above example, only the
total intensity and the incident intensity (the intensity created
by the incident beam without any scatterers) are recorded. The
next four lines specify the wavelengths at which the optical
image will be synthesized. The assignments have the same
meaning as those in the near-field-to-far-field transformation
(NFFFT) specification (see Section 10.1). The half-angle of the
collection aperture as seen from the focal point of the objective
(which is by default the origin of the grid) is determined by the
ap_half_angle variable. The magnification variable sets Figure 9b. The xz cross section of the sample in Figure 9a.
the magnification of the imaging system. The coll_half_ The glass substrate is shown in green. The substrate extends
space=“upper” setting implies that the objective is placed to infinity in the − z direction.
IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013 89
90 IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013
Figure 10c. Optical images of the structure shown in Fig- Figure 10d. Optical images of the structure shown in Figure
ure 9: A darkfield image. The spectrum was processed as 9: A phase-contrast image. The spectrum was processed as
in Figure 10b. in Figure 10b.
IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013 91
1. K. S. Yee, “Numerical Solution of Initial Boundary Value 14. I. R. Capoglu, A. Taflove, and V. Backman, “A Frequency-
Problems Involving Maxwell’s Equations in Isotropic Media,” Domain Near-Field-to-Far-Field Transform for Planar Layered
IEEE Transactions on Antennas and Propagation, AP-14, 3, Media,” IEEE Transactions on Antennas and Propagation, AP-
May 1966, pp. 302-307. 60, 4, April 2012, pp. 1878-1885.
2. A. Taflove and S. C. Hagness, Computational Electrody- 15. I. R. Capoglu, Techniques for Handling Multilayered
namics: The Finite-Difference Time-Domain Method, Third Media in the FDTD Method, PhD dissertation, Georgia Insti-
Edition, Norwood, MA, Artech House, 2005. tute of Technology, Atlanta, GA, 2007; available at http://goo.
gl/7gGN7.
3. Wikipedia, “Finite-Difference Time-Domain Method,” 2012,
accessed April 2012, available at http://en.wikipedia.org/wiki/ 16. HDF5 Group, “HDF5 Tools,” accessed April 2012, avail-
Finite-difference_time-domain_method. able at http://www.hdfgroup.org/products/hdf5_tools.
4. I. R. Capoglu, “Angora: A Free Software Package for 17. I. R. Capoglu, J. D. Rogers, A. Taflove, and V. Backman,
Finite-Difference Time-Domain (FDTD) Electromagnetic “The Microscope in a Computer: Image Synthesis from Three-
Simulation,” 2012, accessed April 2012, available at http:// Dimensional Full-Vector Solutions of Maxwell’s Equations
www.angorafdtd.org. at the Nanometer Scale,” Progress in Optics, April 2012 (to
appear in 57).
5. I. R. Capoglu, “Configuration Files for the APS Magazine
Article,” 2012, accessed April 2012, available at http://www. 18. M. D. Fairchild, Color Appearance Models, New York,
angorafdtd.org/aps_mag. Wiley, 2005.
92 IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013
IEEE Antennas and Propagation Magazine, Vol. 55, No. 4, August 2013 93