Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

harminv not showing any frequencies #2864

Open
csohom opened this issue Jul 9, 2024 · 5 comments
Open

harminv not showing any frequencies #2864

csohom opened this issue Jul 9, 2024 · 5 comments

Comments

@csohom
Copy link

csohom commented Jul 9, 2024

Hey, This is Sohom Chakraborty, i am using MEEP for making a simulation of a 2D ring resonator. The code has been exactly copied from MEEP documentation website but still the output that is expected to come is not coming. Harminv doesn't show any frequencies or shows contradictory results after each run. I am providing the code and output for your reference. Please help.
Code:

(define-param n 3.4)                     ; index of waveguide

(define-param w 1)                       ; width of waveguide

(define-param r 1)                       ; inner radius of ring

(define-param pad 4)                     ; padding between waveguide and edge of PML

(define-param dpml 2)                    ; thickness of PML

(define sxy (* 2 (+ r w pad dpml)))      ; cell size

(set! geometry-lattice (make lattice (size sxy sxy no-size)))

(set! geometry (list

                (make cylinder (center 0 0) (height infinity)
                
                      (radius (+ r w)) (material (make medium (index n))))
                      
                (make cylinder (center 0 0) (height infinity)
                
                      (radius r) (material air))))
                      
(set! pml-layers (list (make pml (thickness dpml))))

(set-param! resolution 10)

(define-param fcen 0.15)   ; pulse center frequency

(define-param df 0.1)      ; pulse frequency width

(set! sources (list

               (make source
               
                 (src (make gaussian-src (frequency fcen) (fwidth df)))
                 
                 (component Ez) (center (+ r 0.1) 0))))
                 
(run-sources+ 300

              (at-beginning output-epsilon)
              
              (after-sources (harminv Ez (vector3 (+ r 0.1)) fcen df)))

Output:

-----------
Initializing structure...
Working in 2D dimensions.
Computational cell is 16 x 16 x 0 with resolution 10
     cylinder, center = (0,0,0)
          radius 2, height 1e+20, axis (0, 0, 1)
          dielectric constant epsilon diagonal = (11.56,11.56,11.56)
     cylinder, center = (0,0,0)
          radius 1, height 1e+20, axis (0, 0, 1)
          dielectric constant epsilon diagonal = (1,1,1)
time for choose_chunkdivision = 0.000806093 s
time for set_epsilon = 0.100648 s
-----------
creating output file "./ringresonator2-eps-000000.00.h5"...
harminv0:, frequency, imag. freq., Q, |amp|, amplitude, error
run 0 finished at t = 400.0 (8000 timesteps)

Elapsed run time = 3.03279 s

@stevengj
Copy link
Collaborator

stevengj commented Jul 9, 2024

This is exactly the example from the tutorial, correct? Have you changed any of the parameters?

When you compiled Meep, did you link it with Harminv? Check that the config.h file ha

#define HAVE_HARMINV 1

@csohom
Copy link
Author

csohom commented Jul 9, 2024 via email

@csohom
Copy link
Author

csohom commented Jul 9, 2024 via email

@stevengj
Copy link
Collaborator

stevengj commented Jul 10, 2024

Is harminv compiled and installed? How did you install Meep? (The easiest is to use the Anaconda packages rather than compiling yourself.)

@csohom
Copy link
Author

csohom commented Jul 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants