Difference between revisions of "Simulation/CAMFR"

From OptoelectronicsWiki
Jump to: navigation, search
Line 89: Line 89:
  
 
==UCSB Includes and Scripts==
 
==UCSB Includes and Scripts==
A number of useful python functions have been written for
+
* A number of useful python functions have been written for CAMFR. You can download the UCSB-specific include file "camfr_UCSB.py" here. To use the function from this file in your own script, type "from camfr_UCSB import *" at the beginning of your script.
 +
 
 +
* Scripts that calculate bend loss, coupling loss, and scattering loss can be downloaded here. The scripts use functions included in camfr_UCSB.py

Revision as of 00:00, 2 March 2010

The first four sections contain information obtained from camfr.sourceforge.net. For installation files and instructions, skip to section 5.

Introduction

CAMFR (CAvity Modelling FRamework) is a fast, flexible, friendly full-vectorial Maxwell solver. Its main focus is on applications in the field of nanophotonics, like

   * wavelength-scale microstructures (like photonic crystal devices)
   * lasers (like vertical-cavity surface-emitting lasers)
   * light-emitting diodes (like resonant-cavity LEDs)

It is based on a combination of eigenmode expansion and advanced boundary conditions like perfectly matched layers (PML).

Features

CAMFR is an ongoing active research project, started at the photonics group of the Department of Information Technology (INTEC) at Ghent University in Belgium. This means that it contains many attractive features and algorithms currently not yet found in commercial modelling tools. CAMFR can be used to calculate

   * the scattering matrix of a structure
   * the field inside a structure, for any given excitation
   * band diagrams of an infinite periodic structure
   * threshold material gain and resonance wavelength of laser modes
   * the response to a current source in an arbitrary cavity
   * structures terminated by a semi-infinite repetition of another structure

This functionality is currently available for two types of geometries:

   * 2D Cartesian structures
   * 3D cylindrical symmetric structures

Additionally, there is code to model the extraction from light emitting diodes, either planar devices, or 3D devices which incorporate 2D periodic structures. Defining structures is quite straightforward, either layer-by-layer, or using geometric primitive shapes. There are also integrated plotting routines for rapid simulation feedback.

Framework character

CAMFR is conceived as a C++ framework, with all the algorithms implemented in terms of abstract waveguides and scatterers. This makes it extremely easy to extend CAMFR to new geometries. The end user does not deal with this C++ code directly, but rather through bindings to the Python scripting language. This makes the code very clear and flexible, and allows e.g. to seamlessly integrate CAMFR with Python-aware visualistion tools.

License and support

CAMFR is being distributed under a dual license scheme. All the code is released under the GPL, but we also provide a closed proprietary license scheme. Contact us for more information, including on support contracts.

Installation

OS X

The CAMFR installation for OS X is a bit easier as the .dmg includes all necessary Python modules:

   * Download and install Python 2.5 from http://www.python.org/download/releases/2.5.5/
   * Download and install the CAMFR 20070717 py2.5 .dmg from http://sourceforge.net/projects/camfr/files/

Notes on Running Python from OS X Terminal

   * OS X includes python, so you can immediately enter a python session by typing "python" in the terminal window
   * Ctrl+D exits a python session
   * To execute a python script, type "python scriptName.py"
   * To execute a python script and leave the python session open afterward, type "python -i scriptName.py" 
     (useful for troubleshooting and performing additional calculations)

Additional Notes

   * Python modules are installed in ///Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages
   * CAMFR example files can be run from ///Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/
     ...camfr/examples/tutorial
   * 45 CAMFR test files can be run by executing ///Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/
     ...camfr/testsuite/camfr_test.py

Windows 32-bit

The CAMFR intstallation for windows is in pieces. It is important that you download and install the correct version number of each python module as listed below:

   * Download and install Python 2.5 from http://www.python.org/download/releases/2.5.5/
   * Download and install CAMFR 20070717 py2.5 from http://sourceforge.net/projects/camfr/files/
   * Download and install Numpy 1.0.4 from http://sourceforge.net/projects/numpy/files/
   * Download and install MatPlotLib 0.91.1 from http://sourceforge.net/projects/matplotlib/files/
   * Download and install Scipy 0.6.0* from http://sourceforge.net/projects/scipy/files/
       * Use the .msi installer file as this prevents a small bug
   * Download and install PIL 1.1.6 from http://www.pythonware.com/products/pil/
   * Download and install python-dateutil-1.1 from http://labix.org/python-dateutil
   * Download and install pytz-2006g from http://sourceforge.net/projects/pytz/

Notes on Running Python from Windows Command Line

   * Right Click "My Computer"
   * Select "Properties"
   * Select the "Advanced" tab
   * Select the "Environment Variables" button
   * In the "System variables" box, select "Path" from the "Variable" column
   * Add ";C:\Python25" to the end of the "Variable value" text field
   * Open the command line and type "python" to start a python session
   * Type "quit()" to exit a python session
   * To execute a python script, type "python scriptName.py"
   * To execute a python script and leave the python session open afterward, type "python -i scriptName.py"
     (useful for troubleshooting and performing additional calculations)

Additional Notes

   * Python modules are installed in C:\Python25\Lib\site-packages
   * CAMFR example files can be run from C:\Python25\Lib\site-packages\camfr\examples\tutorial
   * 45 CAMFR test files can be run by executing C:\Python25\Lib\site-packages\camfr\testsuite\camfr_test.py

UCSB Includes and Scripts

  • A number of useful python functions have been written for CAMFR. You can download the UCSB-specific include file "camfr_UCSB.py" here. To use the function from this file in your own script, type "from camfr_UCSB import *" at the beginning of your script.
  • Scripts that calculate bend loss, coupling loss, and scattering loss can be downloaded here. The scripts use functions included in camfr_UCSB.py