Saturday, November 28, 2015

Example


Let's start with a diamond lattice of spheres as an example. Here we will show, how one can compute DOS or LDOS in a perfect diamond lattice from scratch. We assume that you have already  installed FPS in your home folder and you have also  installed MPB (see Quick tutorial and Appendix - A beginner's guide to calculating photonic band diagrams: Getting setup). We need to carry out three steps to compute DOS in our structure. We use MPB to generate epsilon function called "epsilon.h5". There is, however, no limit on the generating epsilon function. Epsilon functions that are generated by MEEP cannot be used with FPS (see the reason here: why not MEEP?).

1) Finding center of each sphere in diamond lattice and writing them in a text file with the following format and giving the size of box that contains these spheres:
For example here we want to compute DOS in a 5a*5a*5a block made of air and contains all the spheres with diamond lattice arrangement:

Block: size_x size_y size_z dielectric_constant resolution/unit_cell
      5      5      5      1.0    32
Sph: center_x center_y center_z radius dielectric_constant
    0.0        0.0        0.0        0.35   11.56
    0.0        0.25       0.0        0.35   11.56

These parameters for all the spheres should be presented in the file (here we just showed two of them).

Once the file is ready we should make a folder that we want to save our results. Here we assume that name of folder is "diamond" and is in "Desktop". Open a terminal window and enter the directory of the folder:
cd ~/Desktop/diamond

Run the following command:
~/FPS/text2ctl
text2ctl will read the text file and based on the information that you provided it will write a ctl file for MPB and then it will use MPB itself to generate "epsilon.h5" file that we need for the next step. This will take a few seconds (see Tutorial - Making a dielectric function with MPB and Tutorial - Visualizing dielectric functions for visualization).
Dielectric function of diamond lattice of spheres in air


2) Modifying controller file of FPS:

Now here we provide all the modifications that are required to be done in the controller file


CPU -> 10
DOS_x -> 1
DOS_y -> 1
LDOS_resolution -> 5
DOS_z ->
center_wavelength -> 2.0
PML_dist -> 0
delta_x -> 0.04 //(1/25.0)
lattice_constant -> 1.0
resolution -> 32
size -> 160 160 160 // (5*32) (5*32) (5*32)
time_step -> 8000
unit_cell_end -> 80 80 80
unit_cell_Start -> 80 80 80 


All these parameters should be entered in the "controller.h5" file. the file should be saved in "diamond" folder.
Now every thing is ready to compute DOS or LDOS. run the follwing command:
~/FPS/FPC

It will take less than 15 minutes to compute one LDOS in this structure. FPC also estimates required time for calculation and reports in terminal.

3) Once the calculation is done the user can use the reported data for post processing. FPS creates a folder called "results" in the folder that is used for calculation. It then creates two text files with the name of  "reduced_frequency.txt" and "DOS.txt". The first file contains frequency in reduced format and the second file contains DOS for those frequency.
Here we compared the results of LDOS in z direction calculated by FPS with band diagram of infinitely extended crystal:
Band diagram of infinitely extended diamond lattice (right) of spheres and LDOS in Z direction (left)



No comments:

Post a Comment