Paul,
If you want to check the ATR reflection dip against simple thin-film
theory,
you probably want infinite boundary conditions and a plane wave source
at an angle with a CW simulation run until convergence. Otherwise the
depth of the plasmon dip will depend on the length of film you are
simulating
(because the coupling from incident beam to plasmon builds up along the
film). In my experience (using my own code, not with meep yet), you need
a lot of
air (5um +) between the gold and the back PMLs but the simulation can be
very
narrow in the orthogonal dimension.
Using meep as it stands, you should be able to do this with 2
simulations
per angle, with a current source with a linear phase ramp that is
self-consistent
with the Bloch boundary conditions. One sim is empty (and unfortunately it
doesn't seem like this can be any smaller, even along the propagation
direction,
according to the Meep reference) and then one with your gold film (with the
fluxes loaded "minus" as mentioned in the tutorials/reference). Another
way one
might potentially do this with 1 simulation per angle in meep would be to
initialize
and step two sets of fields, one in 1-D and one in 2-D, where you use the
1-D fields to build
a total-field scattered-field source (see Taflove/Hagness text, Ch. 5, for
instance) for
the 2-D fields using the custom-src functionality. (The full TFSF is a
plane wave that
lives only in a box - here you really only need one of the faces of this
box, to get
a plane wave that starts from one plane and only goes "left to right")
This way you could be
sure the fields you see behind your source are the reflection, and then
building up the
reflectivity vs. angle curve is pretty straightforward. But I haven't had
the chance to try to
insert this TFSF functionality into meep yet, so it may not be possible to
kludge this into
meep in this manner...
Hope this helps...
Geoff
==================================
Geoffrey W. Burr, Ph.D.
-----------------------------------------------------------
IBM Almaden Research Center, D2/K13E
650 Harry Road
San Jose, California 95120
(408) 927-1512
FAX (408) 927-2100
[email protected]
-----------------------------------------------------------
paul
<sciencefo...@soh
u.com> To
Sent by: [email protected]
meep-discuss-boun cc
[email protected]
.edu Subject
[Meep-discuss] Re: how to define a
beam source, new reuslts
05/09/2006 05:13
PM
Steven G. Johnson wrote:
> On Tue, 9 May 2006, paul wrote:
>
>> Could you give a breif corresponsding part to c++ interface if
>> possible? How can I use self defiend source amplitude function in c++
>> interface?
>>
>> I want to compute a ATR prism with Gaussian beam in 2D.
>
>
> In C++ you would use:
>
> void fields::add_volume_source(component c, const src_time &src,
> const geometric_volume &,
> complex<double> A(const vec &),
> complex<double> amp = 1.0);
>
> and pass the function you want for the A parameter in order to specify
> the amplitude function.
Hi Steven:
Thanks for your hints,
I just tried to construct, it seems to work.
Could you just give me some comments? The animation is not very smooth?
Can I use similar things to compute a ATR prism with thin gold layer
with Drude model?
I think I also need to write a code for exploration the near field to
far field to check the reflection dip.
Please have a review,
Regards,
#include <meep.hpp>
using namespace meep;
double eps(const vec &p) {
if (p.x() < 10 && p.y() < 5)
return 1.1;
return 1.0;
}
complex<double> one(const vec &p) {
//return 1;
return (0.0,exp(-2*pi*p.x()*(0.3,0.4)));
}
int main(int argc, char **argv) {
initialize mpi(argc, argv); // do this even for non-MPI Meep
double resolution = 10; // pixels per distance 20
volume v = vol2d(10,10, resolution); // 5x10 2d cell
structure s(v, eps, pml(1.0));
fields f(&s);
f.output_hdf5(Dielectric, v.surroundings());
double freq = 0.5, fwidth = 0.1;
//gaussian_src_time src(freq, fwidth);
continuous_src_time src(freq, fwidth);
geometric_volume src_plane(vec(4,0),vec(0,0));
f.add_volume_source(Hz,src,src_plane,one,1.0);
//f.add_point_source(Ey, src, vec(5, 2)); //1.1 2.3
master_printf("volume sources added...\n");
//f.add_point_source(Ey, src, vec(4, 6)); //1.1 2.3
f.solve_cw(1e-14,100000,2);
master_printf("cw solved...\n");
for(int i=0; i<50;i++){
f.step();
}
for(int i=0; i<60;i++){
f.step();
//f.output_hdf5(Hx, v.surroundings());
//f.output_hdf5(Hy, v.surroundings());
f.output_hdf5(Hz, v.surroundings());
f.output_hdf5(Ey, v.surroundings());
f.output_hdf5(Ex, v.surroundings());
}
return 0;
}
CC = g++
CFLAGS = -O2 -I/usr/local/include
CPPFLAGS = -I/usr/local/lib/hdf5-1.6.5/hdf5/include/
CXXFLAGS = -O2 -malign-double -march=pentium3
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = grep -E
EXEEXT =
F77 = g77
FFLAGS = -g -O2
GEN_CTL_IO = gen-ctl-io
HARMINV_CFLAGS = -I/usr/local/include
HARMINV_LIBS = -L/usr/local/lib -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2
-L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../.. -lharminv -llapack
-lblas -lfrtbegin -lg2c -lm -lgcc_s
HAVE_GUILE_CONFIG = yes
LDFLAGS = -L/usr/local/lib/hdf5-1.6.5/hdf5/lib/
MEEPLIBS = -L/usr/local/lib/hdf5-1.6.5/hdf5/lib/
-L/usr/local/lib/libmeep.la -lhdf5 -lz -L/usr/local/lib
-L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2
-L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../.. -lharminv -llapack
-lblas -lfrtbegin -lg2c -lm -lgcc_s -lfftw3 -lm -lmeep
Test1.o : Test.cpp meep.hpp
${CC} ${CFLAGS} ${CPPFLAGS} ${CXXFLAGS} ${DEFS} -c Test.cpp
all : Test.o
${CC} ${CFLAGS} Test.o ${LDFLAGS} ${MEEPLIBS} ${HARMINV_LIBS}
-o test2
clean :
rm -rf *.o test2 *.h5
(See attached file: hz-000005.50.png)(See attached file: hz-000005.30.png)
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss<<attachment: hz-000005.50.png>>
<<attachment: hz-000005.30.png>>
_______________________________________________ meep-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

