NanoComp / meep

free finite-difference time-domain (FDTD) software for electromagnetic simulations
GNU General Public License v2.0
1.26k stars 629 forks source link

harminv not showing any frequencies #2864

Open csohom opened 4 months ago

csohom commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

Yes, this is exactly the example from the tutorial. I have changed the parameters, sometimes harming shows some frequencies, sometimes it doesn't. I have increased the simulation time but I am not getting the modes shown in the tutorial as output.

On Tue, 9 Jul, 2024, 18:33 Steven G. Johnson, @.***> wrote:

This is exactly the example from the tutorial https://meep.readthedocs.io/en/master/Scheme_Tutorials/Basics/#modes-of-a-ring-resonator, 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

— Reply to this email directly, view it on GitHub https://github.com/NanoComp/meep/issues/2864#issuecomment-2217687245, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJVMRNZKD4HAVV4XYJXI2A3ZLPNR7AVCNFSM6AAAAABKSEFWRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJXGY4DOMRUGU . You are receiving this because you authored the thread.Message ID: @.***>

csohom commented 4 months ago

I did not check though, but can you please tell me sir how to link harminv while compiling meep? I am stuck in this issue for quite some time.

On Tue, 9 Jul, 2024, 18:33 Steven G. Johnson, @.***> wrote:

This is exactly the example from the tutorial https://meep.readthedocs.io/en/master/Scheme_Tutorials/Basics/#modes-of-a-ring-resonator, 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

— Reply to this email directly, view it on GitHub https://github.com/NanoComp/meep/issues/2864#issuecomment-2217687245, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJVMRNZKD4HAVV4XYJXI2A3ZLPNR7AVCNFSM6AAAAABKSEFWRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJXGY4DOMRUGU . You are receiving this because you authored the thread.Message ID: @.***>

stevengj commented 4 months ago

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

csohom commented 4 months ago

Yes, it's done but still encountering the problem. Can't understand what is wrong.

On Thu, 11 Jul 2024 at 03:07, Steven G. Johnson @.***> wrote:

Is harminv compiled and installed?

— Reply to this email directly, view it on GitHub https://github.com/NanoComp/meep/issues/2864#issuecomment-2221557882, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJVMRNYIBWXCYDSCXIJ654TZLWSSLAVCNFSM6AAAAABKSEFWRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRRGU2TOOBYGI . You are receiving this because you authored the thread.Message ID: @.***>

-- Sohom Chakraborty Assistant Professor University of Engineering and Management Kolkata- 700160