Dear meep users, finally I managed to read my MATLAB results into an array using the C++ interface and I also implemented a function doing a bilinear interpolation. This allows me to calculate the amplitude of the source at any point in a given plane. However, I was not able to define a planar source. volume src_plane(vec(),vec()); makes a nice line source, but I would like to have something similar to (set! sources ... (center 0 0 lz) (size lx ly no-size)))) in Scheme. Please, can anyone help me? I am at my wit's end.
Best regards, Laura Von: uodgl Gesendet: Montag, 24. Februar 2014 13:25 An: 'meep-discuss@ab-initio.mit.edu' Betreff: Read data to define source Dear meep users, it turned out that the simulation of a tightly focused laser beam with an obstacle in proximity to the focal spot is way more challenging than I thought it would be. I use MATLAB in order to compute the unperturbed electric field distribution in a plane at a certain distance from the focus. Fitting these results seems to be a hopeless task, so I would like to import them into meep in order to define the amplitude function of my source. http://article.gmane.org/gmane.comp.science.electromagnetism.meep.general/2286/match=read+data This article says that reading data into an array is possible using the C++ interface. Subsequently a function is needed that interpolates the points in the array. My question is: Can you please give me some lines of C++ code that show how to read a .mat file (or any other clever file format, for that matter) and, most important, how to implement the interpolating function. Any help would be greatly appreciated! Best regards, Laura
_______________________________________________ meep-discuss mailing list meep-discuss@ab-initio.mit.edu http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss