Re: mpb + output to a file-> strange behaviour (comment)
stephane chatigny <[email protected]>
| Newsgroups | gmane.comp.science.photonic-bands |
|---|---|
| Message-ID | <[email protected]> |
hello all,
I have work extensively on this problem, and finally it is not related
to the fact that I output my results into a file.
I suppose that it is related to my loop and some memory management that
I should do.
Here is a copy of my code, I have reduced the tolerance, mesh-size,
resolution and interpolate parameters in order to generate the bug quicker.
With these new settings the simulation stops after 4616 iterations (on
my computer Athlon 2Gb memory). Some how, the bug seems to be related to
these parameters (presumably via the memory usage).
If anybody has a trick for solving this problem that will be highly
appreciated.
thanks
Stef
===========================================================================================================
===========================================================================================================
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Based on an Example of Martin Lokke Nielson Thesis p143
;TRIANGULAR Lattice of Air holes in silica
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define bands 32);Number of bands calculated
(define kzstart 0);z-component of the k vector
(define kzstep 0.01);z-component step
(define kzend 5);z-component of the k vector
(set! tolerance 1e-4);Defines tolerance for convergence
(set! mesh-size 3)
(set-param! resolution 8)
(define-param k-interp 0)
(define rstart 0.2);start value of rod radius, r
(define rstep 0.025);increase r of step size rstep
(define rend 0.5);limit for non-overlapping cylinders
(define nstart 1) ;start band
(define nstep 1)
(define nend (- bands 1)) ;end band
(define estart (* 1.44402 1.44402)) ;start epsilon Silica @ 1550nm
(define estep 1) ;epsilon steps
(define eend (* 1.44402 1.44402)) ;end epsilon
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Defining Super-cell parameters\\
;Corresponds to translational invariant lattice
(define S 1) ;Supercell definition
(define points 32)
(set! num-bands bands) ;Number of calculated bands
(set! grid-size (vector3 points points 1))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Define lattice, the unit cell\\
(set! geometry-lattice (make lattice (size S S no-size)
(basis1 (/ (sqrt 3) 2) 0.5)
(basis2 (/ (sqrt 3) 2) -0.5) ))
(define (LatticeAndkz kz)
(set! k-points (list (vector3 0 0 kz) ; Gamma
(vector3 0 0.5 kz) ; M
(vector3 (/ -3) (/ 3) kz) ; K
(vector3 0 0 kz))) ; Gamma
(set! k-points (interpolate k-interp k-points))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Create periodic structure\\
;Defining the function structure\\
;In defined unit cell
;Create cylinder of radius r
;Invariant in z-direction
;Air has n=epsilon=1
;Calculates the bands
(define (structure r)
(set! geometry
(geometric-objects-lattice-duplicates
(list (make cylinder (center 0 0 0) (radius r) (height infinity)
(material air)))))
(run)
)
;Calculates gap between band n and n+1
(define (retrieve n)
(retrieve-gap n)
)
;Background medium is set
(define (background-material e)
(define medium (make dielectric (epsilon e)))
(set! default-material medium)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Loops which outputs epsilon, rod-radius and kz
(do ((e estart ( + e estep))) ((> e eend))
(background-material e)
(do ((r rstart ( + r rstep))) ((> r rend))
(do ((kz kzstart ( + kz kzstep))) ((> kz kzend))
(LatticeAndkz kz)
(structure r)
)
)
)
Stephane Chatigny a écrit :
> Sorry I made a mistake in my last post.
>
>
>
> I just figure out that I write a line for each band in my file and I
> compute 32 bands per call of the run function.
>
> So the file as 102528 lines, but I call (run) 3204 times instead of
> 102528 times as stated in my earlier post.
>
>
>
> Thanks
>
> stef
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> mpb-discuss mailing list
> [email protected]
> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/mpb-discuss