Maybe I didn't make my point clearly. This is a problem with the 3D modeling, I don't make any claims one way or another regarding the behavior of the 2D model.
I did run the modified code in both 2D and 3D, on two different machines. The results were identical, machine to machine. They were very different 2-D to 3-D model. The 2-D run results were much as you described. The 3-D model results never even approach zero. The values of the scaler electric field after nearly 2300 cycles are: field:, 995.9000244140625, -20.707737734274147+0.0i field:, 998.2000122070312, -20.707742564817224+0.0i The magnitude of the scaler electric field of 20.7 after 2300 cycles is very little different from its value after cut-off. The following data was extracted to show the behavior of the field values around cut-off which occurs at cycle 40. Different output intervals makes no fundamental difference in the result. I'm inclined to think that this is a bug in the meep code. field:, 13.800000190734863, 118.46786614619795+0.0i field:, 16.100000381469727, -67.59604610145057+0.0i field:, 18.399999618530273, -49.24438737994264+0.0i field:, 20.700000762939453, 125.47630938094056+0.0i field:, 23.0, -0.8539819960813517+0.0i field:, 25.299999237060547, -97.49759773787325+0.0i field:, 27.600000381469727, 88.55815749919773+0.0i field:, 29.899999618530273, 70.22101722170089+0.0i field:, 32.20000076293945, -104.51037341834984+0.0i field:, 34.5, 21.813834934105188+0.0i field:, 36.79999923706055, 118.47415684002891+0.0i field:, 39.099998474121094, -67.59675801838053+0.0i field:, 41.400001525878906, -20.43251327118803+0.0i field:, 43.70000076293945, -20.819578010434448+0.0i field:, 46.0, -20.735123917586336+0.0i field:, 48.29999923706055, -20.68665239025745+0.0i field:, 50.599998474121094, -20.729085985876495+0.0i field:, 52.900001525878906, -20.712054936251683+0.0i On Sat, 2017-07-08 at 10:31 -0700, Ardavan Oskooi wrote: > Abruptly turning off the source will introduce high-frequency > artifacts > into the simulation as mentioned previously. High frequencies near > the > Nyquist frequency of the grid have slow group velocities and are > poorly > absorbed by PML. This is why the fields do not go to zero after the > sources have turned off. Unfortunately, there is no workaround. > > Here's another way to see this. We make a slight modification to the > previous script to print the value of the scalar electric field at > the > source location instead of outputting the field over the entire > computational cell. You can then plot the intensity of the field as > a > function of time on a semilog plot. The field intensity drops by > several > orders of magnitude after the source has turned off and reaches a > floor > of ~1e-5 for the remainder of the simulation. Doubling the thickness > of > the PML or the resolution has practically no effect on the results. > > modified Scheme/libctl control script: > > (set-param! resolution 20) > > (set! geometry-lattice (make lattice (size 10 10 no-size))) > > (set! pml-layers (list (make pml (thickness 2)))) > > (set! symmetries (list (make mirror-sym (direction X)) > (make mirror-sym (direction Y)))) > > (set! sources (list (make source (src (make continuous-src > (frequency > 1.0))) (component Ez) (center 0 0 0)))) > > (define src-on? true) > > (define print-field (lambda () (print "field:, " (meep-round-time) ", > " > (get-field-point Ez (vector3 0 0 0)) "\n"))) > > (run-until 1000 > (lambda () > (if (and (> (meep-round-time) 40) src-on?) > (begin (change-sources! '()) (set! src-on? > false)))) > (at-every 2.3 print-field)) > > _______________________________________________ > meep-discuss mailing list > meep-discuss@ab-initio.mit.edu > http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss _______________________________________________ meep-discuss mailing list meep-discuss@ab-initio.mit.edu http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss