[Meep-discuss] 3-D waveguide not guiding wave

2011-12-19 Thread John Bordelon
Hey All,

I am John Bordelon from Louisiana State University Electrical Engineering 
department.  I am working on scaling my simulation of a microring resonator up 
to 3-D and am running into problems.  The first is that for some reason the 
waves are not being confined inside the waveguide.  In the video created from 
the code below, the wave as it just sort of dissipates into free space (and 
eventually the PML).  I have also tried with just a single 3-D waveguide but 
still am having the same non-confined waves problem.

Perhaps it has to do with my source?  For propagation in the x direction, I 
assumed I would still use (component Ez), as with the 2-D.  But maybe I am 
wrong.

Here is the code.  Any help is greatly appreciated.

(define-param n 3.4) ;index ofwaveguide   
(define-param fcen .6452) ; frequency of source 
(define-param L 20.94)  ; holds distance
(define-param gap .0415) ; gap is 41.5nm
(define-param fspread .02) ; spread in gaussian freq range
(define-param nfreq 1000) ; number of frequencies at which to compute flux 
(define-param rho 3.3346) ; radius of circles in track
(define-param gap_wg .17) ; this is the gap between ring and waveguide
(define-param gap_index .035) ; this is the gap bw index modulator and ring
(define-param guide_z .2)
(define-param guide_r .2)    ;this is the radial thickness of ring
(define-param size_z 2)
(define-param size_x 10)
(define-param size_y 10)
(define-param pml_thickness 2)
 
; remember that to create the index modulator I can use the top two
; cylinders inserted to create a quarter circle a distance above the ring
; with the same z projection

(set! geometry-lattice (make lattice (size (+ pml_thickness size_x) (+ 
pml_thickness size_y) (+ pml_thickness size_z

(set! geometry 
  (list
        (make cylinder (center 0 0 0) (height guide_z)
  (radius rho) (material (make dielectric (epsilon 11.7

        (make cylinder (center 0 0 0) (height guide_z)
  (radius (- rho guide_r)) (material air))
; possibly insert modulator in here, omit now for testing

        (make block (center 0 (+ rho guide_r gap_wg) 0) (size infinity guide_r 
guide_z)  ; size is given as (size x y z)
  (material (make dielectric (epsilon 11.7

        (make block (center 0 (- (+ rho guide_r gap_wg)) 0) (size infinity 
guide_r guide_z)  ; size is given as (size x y z)
  (material (make dielectric (epsilon 11.7

            ))
 
(set! sources (list
   (make source
 (src (make gaussian-src (frequency fcen) (fwidth fspread)))
 (component Ez)
 (center -4 (+ rho guide_r gap_wg) 0 ) (size 0 .05 .05) (cutoff 
15

(set! pml-layers (list (make pml (thickness 1
(set! resolution 20) 
(use-output-directory)
(run-until 400
   (at-beginning output-epsilon)
   (to-appended ez (at-every 10 output-efield-z)))





Thanks all,

John

___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] Meep, MPB, Harminv on Cygwin

2011-12-19 Thread Pavel Ivanov
Recently, Wesley Wand has drawn my attention to issues with compiling 
MPB and Meep on cygwin of latest version. He noticed that the above 
recipe does not longer work.


The latest Setup.exe version is 2.761 and the latest Cygwin version is 
1.7.9-1.


To make things simpler, you can install the following cygwin packages as 
shown below:

Accessibility: Default
Admin: Default
Archive: Install hdf5: HDF5 Hierarchal Data Format /version 1.8.8-1/, 
libhfd5-devel: HDF5 Hierarchal Data Format (development) /version 
1.8.8-1/, libhfd5_7: HDF5 Hierarchal Data Format (runtime) /version 1.8.8-1/

Audio: Default
Base: Default
Database: Default
Devel: Install all
Doc: Default
Editors: Default
Games: Default
Gnome: Default
Graphics: Default
Interpreters: Install guile: the GNU extension language and Scheme 
interpreter -- executables /version 1.8.7-2/

KDE: Default
Libs: Install all
Mail: Default
Math: Install: lapack: Comprehensive FORTRAN library for linear algebra 
operations /version 3.2.2-2/, liblapack-devel: Development libs for 
LAPACK /version 3.2.2-2/, liblapack0: Comprehensive FORTRAN library for 
linear algebra operations /version 3.2.2-2/

Net: Default
Perl: Default
Publishing: Default
Python: Default
Security: Default
Shells: Default
System: Default
Text: Default
Utils: Default
Web: Default
X11: Default




I. If you want to compile Meep, MPB and Harminv.
The actual Cygwin version includes GNU compiler versions 3.4.4 and 
4.5.3. To compile MEEP, MPB and Harminv, we need to use the GCC version 
3.4.4. Add the following lines at the end of you .bash_profile file to 
choose GCC version 3.4.4 and fortan compiler version 3.4.4.


LDFLAGS=-L/usr/local/lib export LDFLAGS
CPPFLAGS=-I/usr/local/include export CPPFLAGS
PATH=/usr/local/bin:$PATH export PATH
LD_LIBRARY_PATH=/usr/local/lib export LD_LIBRARY_PATH
CC=gcc-3 export CC
F77=g77 export F77
CXX=c++-3 export CXX

1. Build and install FFTW
1.1 download http://www.fftw.org/fftw-2.1.5.tar.gz
1.2 gzip -d fftw-2.1.5.tar.gz
1.3 tar -xvf fftw-2.1.5.tar
1.4 cd fftw-2.1.5
1.5 ./configure --prefix=/usr/local
1.6 make
1.7 make install

2. libctl
2.1 Download it from http://ab-initio.mit.edu/libctl/libctl-3.1.tar.gz
2.2 gzip -d libctl-3.1.tar.gz
2.3 tar -xvf libctl-3.1.tar
2.4 cd libctl-3.1
2.5 ./configure --prefix=/usr/local
2.6 make
2.7 make install

3. MPB
3.1 download it from http://ab-initio.mit.edu/mpb/mpb-1.4.2.tar.gz
3.2 gzip -d mpb-1.4.2.tar.gz
3.3 tar -xvf mpb-1.4.2.tar
3.4 cd mpb-1.4.2
3.5 ./configure --prefix=/usr/local CPPFLAGS=-DH5_USE_16_API=1
3.6 make
3.7 make install

4. Harminv
4.1 download it from http://ab-initio.mit.edu/harminv/harminv-1.3.1.tar.gz
4.2 gzip -d harminv-1.3.1.tar.gz
4.3 tar -xvf harminv-1.3.1.tar
4.4 cd harminv-1.3.1
4.5 ./configure --prefix=/usr/local
4.6 make
4.7 make install

Run following commands in the cygwin terminal

ln -s /usr/lib/gcc/i686-pc-cygwin/3.4.4/libg2c.la 
/usr/lib/gcc/i686-pc-cygwin/libg2c.la
ln -s /usr/lib/gcc/i686-pc-cygwin/3.4.4/libg2c.a 
/usr/lib/gcc/i686-pc-cygwin/libg2c.a


5. MEEP
5.1 download it from http://ab-initio.mit.edu/meep/meep-1.1.1.tar.gz
5.2 gzip -d meep-1.1.1.tar.gz
5.3 tar -xvf meep-1.1.1.tar
5.4 cd meep-1.1.1
5.5 ./configure --prefix=/usr/local F77=gfortran
5.6 make
5.7 make install

6. Build and install h5utils (optional, you need them if you want to 
convert .h5 files created with Meep and MPB)

6.1 Download http://ab-initio.mit.edu/h5utils/h5utils-1.12.1.tar.gz
6.2 gzip -d h5utils-1.12.1.tar.gz
6.3 tar -xvf h5utils-1.12.1.tar
6.4 cd h5utils-1.12.1
6.5 ./configure --prefix=/usr/local
6.6 make
6.7 make install

II. If you want to install MPB only
You can add the following lines at the end of your .bash_profile file to 
choose GCC version 4.5.3 and fortran compiler version 4.5.3.

LDFLAGS=-L/usr/local/lib export LDFLAGS
CPPFLAGS=-I/usr/local/include export CPPFLAGS
PATH=/usr/local/bin:$PATH export PATH
LD_LIBRARY_PATH=/usr/local/lib export LD_LIBRARY_PATH
CC=gcc-4 export CC
F77=gfortran export F77
CXX=c++-4 export CXX

Then build and install all packages as described above.



P.S.
Moreover, if you need MPB only, then you can add the following lines 
into your bash_profile file

LDFLAGS=-L/usr/local/lib export LDFLAGS
CPPFLAGS=-I/usr/local/include export CPPFLAGS
PATH=/usr/local/bin:$PATH export PATH
LD_LIBRARY_PATH=/usr/local/lib export LD_LIBRARY_PATH

Configure Harminv as
./configure --prefix=/usr/local F77=gfortran

Configure MPB as
./configure --prefix=/usr/local CPPFLAGS=-DH5_USE_16_API=1 F77=gfortran

Best regards
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss