Re: [Meep-discuss] Large Computational Cell

2017-12-02 Thread Ardavan Oskooi

Just a couple points of clarification from my previous post:

    1) In order to use 2 mirror symmetry planes in your ring structure, 
you can use a minimum of 2 point/line sources (4 sources will also work).


    2) The time average of the energy (or flux) can only be obtained if 
you have time-harmonic complex fields which requires a CW source and not 
a Gaussian as you are using.



On 12/02/2017 10:12 PM, Ardavan Oskooi wrote:

On 11/30/2017 02:21 PM, Da Silva, Jaime wrote:
I'm designing a large ring resonator (200µm diameter) in the visible 
spectrum (640nm). My 2D simulations have been running for nearly 20h 
(meep time 11,000) on HPC, using 12 nodes (36 cores/node). I believe 


There are three things you can try to speed your computation.

1) Since the index contrast of your ring resonator is relatively 
small, the Q of the resonant mode will likely also be small. Also, 
regardless of whether the Q is small or not, harminv is still able to 
resolve Qs of 1e6 given only a few periods of the field data (see 
Section 5.2 and Fig. 9 of the Meep paper). This means that you don't 
need to run your simulation for too long after the sources have turned 
off for harminv to obtain an accurate result. You can facilitate 
harminv's performance by using a narrow-band source as has been 
discussed previously on this list.


2) Your ring structure has no sharp corners/edges (in 2d, at 
least) and is a lossless dielectric (i.e., refractive index is purely 
real). In this case, Meep's subpixel smoothing enables you to reduce 
the resolution while still ensuring good accuracy.


3) Due to the four-fold symmetry of the ring structure, you can 
use two mirror symmetry planes to reduce the size of the computation 
by a factor of 4. To use this feature, you will need to use 4 separate 
point/line sources. Note that both the structure and the 
sources/fields must respect the symmetries that are defined. It might 
be worthwhile to review this topic in the documentation 
(http://meep.readthedocs.io/en/latest/Exploiting_Symmetry/).


Finally, if this may be relevant, you should be setting (set-param! 
force-complex-fields? true) in order to obtain time-average values, 
rather than snapshots, for the energy. This is because Meep uses real 
fields by default.



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

Re: [Meep-discuss] Large Computational Cell

2017-12-02 Thread Ardavan Oskooi

On 11/30/2017 02:21 PM, Da Silva, Jaime wrote:
I'm designing a large ring resonator (200µm diameter) in the visible 
spectrum (640nm). My 2D simulations have been running for nearly 20h 
(meep time 11,000) on HPC, using 12 nodes (36 cores/node). I believe 


There are three things you can try to speed your computation.

	1) Since the index contrast of your ring resonator is relatively small, 
the Q of the resonant mode will likely also be small. Also, regardless 
of whether the Q is small or not, harminv is still able to resolve Qs of 
1e6 given only a few periods of the field data (see Section 5.2 and Fig. 
9 of the Meep paper). This means that you don't need to run your 
simulation for too long after the sources have turned off for harminv to 
obtain an accurate result. You can facilitate harminv's performance by 
using a narrow-band source as has been discussed previously on this list.


	2) Your ring structure has no sharp corners/edges (in 2d, at least) and 
is a lossless dielectric (i.e., refractive index is purely real). In 
this case, Meep's subpixel smoothing enables you to reduce the 
resolution while still ensuring good accuracy.


	3) Due to the four-fold symmetry of the ring structure, you can use two 
mirror symmetry planes to reduce the size of the computation by a factor 
of 4. To use this feature, you will need to use 4 separate point/line 
sources. Note that both the structure and the sources/fields must 
respect the symmetries that are defined. It might be worthwhile to 
review this topic in the documentation 
(http://meep.readthedocs.io/en/latest/Exploiting_Symmetry/).


Finally, if this may be relevant, you should be setting (set-param! 
force-complex-fields? true) in order to obtain time-average values, 
rather than snapshots, for the energy. This is because Meep uses real 
fields by default.


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

[Meep-discuss] Large Computational Cell

2017-11-30 Thread Da Silva, Jaime
Hello,


I'm designing a large ring resonator (200µm diameter) in the visible spectrum 
(640nm). My 2D simulations have been running for nearly 20h (meep time 11,000) 
on HPC, using 12 nodes (36 cores/node). I believe this is a very high 
computational time, especially given the capabilities of the HPC but I could be 
wrong in that assumption.


I need to perform 3D simulations but it will last even longer than 2D for the 
required height, maybe weeks.


I tried to use symmetry without much success. The transmission spectrum was not 
the same because of the additional source.


I thought of reducing my dimensions by 10, making a = 10µm (instead of 1µm), 
but the resolution will have to be much higher (200 instead of 20) since the 
wavelength will be 10 times smaller and we need around 8pixels/wavelength in 
the highest dielectric.


Could you please give me some insight on how to go about this.


According to the output file:

"Computational cell is 240 x 320 x 0 with resolution 20"


Here's my code in case you can't see the attachment:


(use-output-directory "Output")
(define-param pad 4) ; padding between cell edge and wvg
(define-param w 50) ; waveguide width 0.25 micrometers
(define-param n 1.4) ; index of refraction
(define-param r 100) ; outer radius of ring micrometers
(define-param top-gap 0.15) ; top-gap between wvg and ring
(define top-wvg-ycen (+ r (/ w 2) top-gap)) ; y center of horiz. wvg
(define-param n-ring 1.4) ; index of refraction of the semi circle
(define-param ring-thickness 3)
(define ring-or r)
(define ring-ir (- r ring-thickness))
(define-param bottom-gap 0.1)
(define bottom-wvg-ycen (* -1 (+ r bottom-gap (/ ring-thickness 2
(define-param dpml 2) ; thickness of pml
(define-param has-ring? true) ; if false, we have a straight wvg w/o a ring
(define-param has-symmetry? false)
;(define-param sym-phase 1)
(define-param duration 1)

(define-param sx (* 2 (+ r 20))) ; size of cell X dir
(define-param sy (* 2 (+ r w pad))) ; size of cell Y dir
(define x-source (+ (* -0.5 sx) pad))
(set! geometry-lattice (make lattice (size sx sy no-size)))
(set! pml-layers (list (make pml (thickness dpml
(set-param! resolution 20)

(set! geometry
  (if has-ring?
(list
(make block (center 0 top-wvg-ycen) (size infinity w infinity) ; top wvg
(material (make dielectric (index n
(make cylinder (center 0 0) (height infinity)
(radius ring-or) (material (make dielectric (index n
(make cylinder (center 0 0) (height infinity)
(radius ring-ir) (material air))
(make block (center 0 bottom-wvg-ycen)
(size infinity ring-thickness infinity) ; bottom wvg
(material (make dielectric (index n
)
(list
(make block (center 0 top-wvg-ycen) (size infinity w infinity)
(material (make dielectric (index n
)
  ))


(define-param fcen (/ 1 0.640)) ; pulse center frequency
(define-param df 0.01) ; pulse width (in frequency)
(set! sources (list
(make source
  (src (make gaussian-src (frequency fcen) (fwidth df)))
  (component Ez)
  (center x-source top-wvg-ycen)
  (size 0 w

;(if has-symmetry? (set! symmetries (list (make mirror-sym (direction X) (phase 
sym-phase)

(define-param dfe 0.005) ; pulse width (in frequency)
(define nfreq 3)

(define trans1 ; transmitted flux just after the source
(add-flux fcen dfe nfreq
(make flux-region
(center (+ x-source 10) top-wvg-ycen) (size 0 (* 2 w)

(define trans2 ; transmitted flux end of top wvg
(add-flux fcen dfe nfreq
(make flux-region
(center (* -1 (+ x-source 10)) top-wvg-ycen) (size 0 (* 2 w)

(define trans3 ; transmitted flux at the bottom waveguide
(add-flux fcen dfe nfreq
(make flux-region
(center x-source bottom-wvg-ycen) (size 0 (* 2 ring-thickness)

(define trans-ring ; ring flux
(add-flux fcen dfe nfreq
(make flux-region
(center (/ (+ ring-or ring-ir) 2) 0) (size (* 2 ring-thickness) 
0


(define (myoutputfeb)
(print "fieldenergybwvg:, " (meep-time) ", "
 (field-energy-in-box (volume (size 1 (* 2 ring-thickness) 0)
 (center x-source bottom-wvg-ycen))) "\n"))

(define (myoutputfer)
   (print "fieldenergyring:, " (meep-time) ", "
(field-energy-in-box (volume (size (* 2 ring-thickness) (* 2 
ring-thickness))
(center (/ (+ ring-ir ring-or) 2) 0))) "\n"))

(run-sources+ duration
(after-sources (harminv Ez (vector3 x-source bottom-wvg-ycen 0) fcen dfe))
(at-every 0.5 myoutputfeb myoutputfer)
)


(if has-ring? (display-fluxes trans1 trans2 trans3 trans-ring) (display-fluxes 
trans2))

Thank you,

Jaime Silva


wvg-ring.ctl
Description: wvg-ring.ctl
___
meep-discuss mailing list