27.12.2012 Views

Wave Propagation in Linear Media | re-examined

Wave Propagation in Linear Media | re-examined

Wave Propagation in Linear Media | re-examined

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8.2 Outl<strong>in</strong>e of the program structu<strong>re</strong><br />

8.2 Outl<strong>in</strong>e of the program structu<strong>re</strong><br />

S<strong>in</strong>ce we have to cope with a large variety of similar functions, we must adopt a modular<br />

approach for the <strong>in</strong>dividual subrout<strong>in</strong>es. This means that the <strong>in</strong>tegrands a<strong>re</strong> comb<strong>in</strong>ed from<br />

several function modules follow<strong>in</strong>g the afo<strong>re</strong>mentioned structu<strong>re</strong>, which is the only possibility<br />

to ensu<strong>re</strong> consistency with<strong>in</strong> the package and to provide comparatively easy extendability. A<br />

<strong>re</strong>asonable implementation strategy <strong>in</strong>volves th<strong>re</strong>e dist<strong>in</strong>ct hierarchical levels.<br />

Driver modules provide the basic <strong>in</strong>terface to the user. The most user-friendly of<br />

them expects noth<strong>in</strong>g mo<strong>re</strong> than the parameters <strong>re</strong>qui<strong>re</strong>d to compute the wave function<br />

and an option de n<strong>in</strong>g the shape of the <strong>in</strong>itial waveform. Depend<strong>in</strong>g on the spatial<br />

coord<strong>in</strong>ate it then <strong>re</strong>turns either the wave function <strong>in</strong>side the tunnel or the sum of the<br />

<strong>in</strong>cident and <strong>re</strong> ected parts on the outside. These partial solutions a<strong>re</strong> computed <strong>in</strong><br />

turn by other driver modules that can also be accessed di<strong>re</strong>ctly. All modules must take<br />

<strong>in</strong>to account that di e<strong>re</strong>nt waveforms may need di e<strong>re</strong>nt numbers of parameters (such<br />

as the Gaussian wave packet, which <strong>re</strong>qui<strong>re</strong>s an additional geometry parameter for the<br />

variance of the distribution).<br />

Quadratu<strong>re</strong> modules a<strong>re</strong> dist<strong>in</strong>ct for all waveforms. The <strong>re</strong>ason for this is that the<br />

number of exponential functions <strong>in</strong> the sum of equation (8.15) as well as the <strong>re</strong>spective<br />

coe cients as;i a<strong>re</strong> di e<strong>re</strong>nt for each possible waveform. Furthermo<strong>re</strong>, some of<br />

the <strong>in</strong> nite <strong>in</strong>tegrals can be computed <strong>in</strong> di e<strong>re</strong>nt ways. So these modules a<strong>re</strong> typically<br />

implemented as waveform-dependent templates that need the mo<strong>re</strong> general part<br />

ss( ) cr( ) of the <strong>in</strong>tegrand as <strong>in</strong>put parameter. The they add the speci c functions<br />

P m<br />

i=1 as;i e j(gs;i( )+pr( )) and call the actual quadratu<strong>re</strong> rout<strong>in</strong>e with the appropriate<br />

options.<br />

The only exception to this scheme is the computation of the evanescent part of the<br />

<strong>in</strong>tegrals. As this <strong>in</strong>volves only a s<strong>in</strong>gle de nite <strong>in</strong>tegral, the<strong>re</strong> is no po<strong>in</strong>t <strong>in</strong> divid<strong>in</strong>g the<br />

<strong>in</strong>tegrands like we do for the <strong>in</strong> nite <strong>in</strong>tegrals <strong>in</strong> order to meet the formal <strong>re</strong>qui<strong>re</strong>ments<br />

of our quadratu<strong>re</strong> strategy. Hence the<strong>re</strong> is only one template for this task, and the<br />

whole <strong>in</strong>tegrand function is passed to this rout<strong>in</strong>e from the call<strong>in</strong>g module. Because all<br />

these rout<strong>in</strong>es a<strong>re</strong> highly specialised, they a<strong>re</strong> not made available to the user.<br />

Function modules a<strong>re</strong> the actual build<strong>in</strong>g blocks of the <strong>in</strong>tegrands. The<strong>re</strong> a<strong>re</strong> atomic<br />

functions describ<strong>in</strong>g the shape- and <strong>re</strong>gion-dependent coe cients ss( ), cr( )aswell as<br />

the constants Cs. These elements a<strong>re</strong> then comb<strong>in</strong>ed to form the <strong>in</strong>tegrands for the two<br />

<strong>in</strong>de nite transmissive parts and the evanescent section of the <strong>in</strong>tegration range. These<br />

functions, too, a<strong>re</strong> <strong>in</strong>ternal to the package and cannot be accessed by the user.<br />

For the triangular and Gaussian wave packet, the gradient of the wave function <strong>in</strong>side the<br />

tunnel is also of <strong>in</strong>te<strong>re</strong>st for the computation of the energy density and nally the energy<br />

velocity. These functions have not been <strong>in</strong>cluded <strong>in</strong> the general framework, <strong>in</strong> that they<br />

cannot be accessed from the same driver rout<strong>in</strong>e as the wave functions themselves. Although<br />

the gradient functions sha<strong>re</strong> the quadratu<strong>re</strong> modules of the pla<strong>in</strong> wave computation, they use<br />

separate driver and, of course, function modules.<br />

197

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!