GithubHelp home page GithubHelp logo

danielkotik / optical-beams-meep Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 13.0 21.51 MB

Simulation of reflection and refraction of polarized opticial beams at plane and curved dielectric interfaces.

Home Page: https://danielkotik.github.io/Optical-beams-MEEP/

License: MIT License

Scheme 37.10% Python 57.59% Cython 5.30%
optics meep numerical-codes fdtd simulation gaussian-beams laguerre-gaussian airy-beams python cython

optical-beams-meep's People

Contributors

danielkotik avatar jbgoette avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

optical-beams-meep's Issues

Refactor code base and make an installable package named `optbeam`

Two step process:

  1. Refactor the multiple optbeam.py files to a pure Python installable (via pip install -e .) package optbeam:

    optbeam
    ├── 2d/
    ├── 3d/
    └── __init__.py
    
  2. Enable package build process for Cython using:

    python setup.py build_ext
    python setup.py install --user

    with

    optbeam
    ├── 2d/
    ├── 3d/
    ├── __init__.pxd
    └── __init__.py
    

    see:

Update `README.md`

  • add repo folder structure
  • introduce package optbeam and mention scripts folder
  • explain necessity of Cython
  • update citation section with link to correct DOI
  • add link to GitHub Pages docs

Improve performance of calculating the initial field distribution

There is a huge Python bottleneck due to the high number of necessary function calls of the integrand function in psi_spherical. We use Cython to tackle this problem. According to a527d2d we start our journey from an average execution time of roughly one second:

In [1]: import beamprofile                                                        

In [2]: psi = beamprofile.main()                                                  
Using MPI version 3.1, 1 processes

In [3]: %timeit psi()                                                             
Calculating inital field configuration. This will take some time...
1 s ± 58.4 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

Add Airy beam in 3d

Add support for incomplete Airy beams in 3d. This new class may inherit from Beam3dCartesian:

class IncAiry3d(Beam3dCartesian):
   ...

Add docstrings

Add NumPy style docstrings to optbeam library functions and classes.

Laguerre-Gaussian beam doesn't work with meep 1.9.0

Here is the output information

mpiexec -n 8 meep e_z=0 e_y=1 freq=5 LaguerreGauss3d.ctl

Using MPI version 3.1, 8 processes
command-line param: e_z=0
command-line param: e_y=1
command-line param: freq=5

start time: Fri May 10 09:57:04 2019
Gauss spectrum (cartesian): 0.6347225159862774
Gauss spectrum (spherical): 2.3981973818259543e-8

L-G spectrum (cartesian): 0.016907581994799106-0.006752644114666309i
L-G spectrum (spherical): 1.61036015580364e-24+2.6299177149278234e-8i

integrand (cartesian): 0.01237493696893364+0.0022382324370958263i
integrand (spherical): -8.908123979652118e-7+1.1204027172148073e-5i

psi (cartesian): 0.6060939710665376-1.7435922978423426i
psi (spherical): 0.5341009898668722-1.7119280296995554i

Specified variables and derived values:
n1: 1.0
n2: 1.54
chi: 45.0 [degree]
incl.: 45.0 [degree]
kw_0: 8
kr_w: 0
k_vac: 31.41592653589793
vortex charge: 2
Jones vector components: (e_z=0, e_y=1) ---> p-polarisation
degree of linear polarisation at pi/4: 0
degree of circular polarisation: 0

Initializing structure...
Working in 3D dimensions.
Computational cell is 5 x 5 x 4 with resolution 77
block, center = (2.5,-2.5,0)
size (1e+20,7.07107,1e+20)
axes (0.707107,0.707107,0), (-0.707107,0.707107,0), (0,0,1)
dielectric constant epsilon diagonal = (2.3716,2.3716,2.3716)
subpixel-averaging is 35.9121% done, 7.14225 s remaining
subpixel-averaging is 72.6905% done, 1.50484 s remaining
subpixel-averaging is 34.3034% done, 7.66376 s remaining
subpixel-averaging is 67.5178% done, 1.93616 s remaining
subpixel-averaging is 36.3081% done, 7.01777 s remaining
subpixel-averaging is 71.5025% done, 1.59486 s remaining
time for set_epsilon = 48.3139 s

Meep: using complex fields.

Meep is running but seems to stick here.

Upload to PyPI

First complete the following tasks:

  • API documentation (NumPy style docstrings)
  • adding tests using the pytest framework
  • #23

Static methods

Declare spectrum amplitude functions (_f_Gauss, _f_Airy, _f_Gauss_cartesian, _f_Laguerre_Gauss_cartesian, _f_Gauss_spherical and _f_Laguerre_Gauss_spherical) as static methods.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.