http://ab-initio.mit.edu/wiki/index.php?title=Casimir_calculations_in_Meep&action=history&feed=atomCasimir calculations in Meep - Revision history2024-03-28T13:11:33ZRevision history for this page on the wikiMediaWiki 1.7.3http://ab-initio.mit.edu/wiki/index.php?title=Casimir_calculations_in_Meep&diff=4964&oldid=prevArdavan: /* Example: cylindrical symmetry */2017-04-20T17:11:01Z<p><span class="autocomment">Example: cylindrical symmetry</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 17:11, 20 April 2017</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 377:</strong></td>
<td colspan="2" align="left"><strong>Line 377:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==Example: cylindrical symmetry==</td><td> </td><td style="background: #eee; font-size: smaller;">==Example: cylindrical symmetry==</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">For systems with cylindrical symmetry, the Casimir force computation can be reduced as in the case of <math>z</math>-invariant geometries to a sum of forces obtained from two-dimensional computations. An example is a recently-discovered system [Levin et. al.<span style="color: red; font-weight: bold;">, in preparation</span>] that exhibits a repulsive Casimir force between vacuum-separated dielectrics. This system is shown below:</td><td>+</td><td style="background: #cfc; font-size: smaller;">For systems with cylindrical symmetry, the Casimir force computation can be reduced as in the case of <math>z</math>-invariant geometries to a sum of forces obtained from two-dimensional computations. An example is a recently-discovered system [<span style="color: red; font-weight: bold;">https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.105.090403 </span>Levin et. al.] that exhibits a repulsive Casimir force between vacuum-separated dielectrics. This system is shown below:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">[[Image:Repulsive.jpg|250px|thumb|center|Setup of the three-dimensional, cylindrically symmetric geometry of Levin et. al. As the ellipse approaches the hole in the plane, it feels a repulsive Casimir force upwards.]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Image:Repulsive.jpg|250px|thumb|center|Setup of the three-dimensional, cylindrically symmetric geometry of Levin et. al. As the ellipse approaches the hole in the plane, it feels a repulsive Casimir force upwards.]]</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">The hole in the bottom plane, coupled with the high degree of anisotropy of the upper elliptical particle, results in a repulsive force when the particle is centered above the hole. This system is simulated in <span style="color: red; font-weight: bold;">repulsive-particle.ctl (</span>[http://ab-initio.mit.edu/~mccauley/casimir-examples/repulsive-particle.ctl]<span style="color: red; font-weight: bold;">)</span>. The size parameters used in the ctl file are noted on the figure above.</td><td>+</td><td style="background: #cfc; font-size: smaller;">The hole in the bottom plane, coupled with the high degree of anisotropy of the upper elliptical particle, results in a repulsive force when the particle is centered above the hole. This system is simulated in [http://ab-initio.mit.edu/~mccauley/casimir-examples/<span style="color: red; font-weight: bold;">repulsive-particle.ctl </span>repulsive-particle.ctl]. The size parameters used in the ctl file are noted on the figure above.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">The harmonic expansion for systems with cylindrical symmetry is derived in Part II. The important change is that there is a new multipole index <math>m</math>, such that the field dependence of the source functions is of the form <math>\textbf{E}(r,\phi,z) = \textbf{E}(r\phi)e^{im\phi}</math>. The important code differences between cylindrical symmetry and a normal 2d computation are shown here:</td><td> </td><td style="background: #eee; font-size: smaller;">The harmonic expansion for systems with cylindrical symmetry is derived in Part II. The important change is that there is a new multipole index <math>m</math>, such that the field dependence of the source functions is of the form <math>\textbf{E}(r,\phi,z) = \textbf{E}(r\phi)e^{im\phi}</math>. The important code differences between cylindrical symmetry and a normal 2d computation are shown here:</td></tr>
</table>
Ardavanhttp://ab-initio.mit.edu/wiki/index.php?title=Casimir_calculations_in_Meep&diff=4949&oldid=prevArdavan at 17:52, 18 April 20172017-04-18T17:52:55Z<p></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 17:52, 18 April 2017</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 7:</strong></td>
<td colspan="2" align="left"><strong>Line 7:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">Calculating Casimir forces in a classical finite-difference time-domain (FDTD) Maxwell simulation like Meep is possible because of a new algorithm described in:</td><td> </td><td style="background: #eee; font-size: smaller;">Calculating Casimir forces in a classical finite-difference time-domain (FDTD) Maxwell simulation like Meep is possible because of a new algorithm described in:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">* Alejandro W. Rodriguez, Alexander P. McCauley, John D. Joannopoulos, and Steven G. Johnson, <span style="color: red; font-weight: bold;">"</span>[http://arxiv.org/abs/0904.0267 Casimir forces in the time domain: Theory],<span style="color: red; font-weight: bold;">" </span>Phys. Rev. A, 80 012115 (April 2009).</td><td>+</td><td style="background: #cfc; font-size: smaller;">* Alejandro W. Rodriguez, Alexander P. McCauley, John D. Joannopoulos, and Steven G. Johnson, [http://arxiv.org/abs/0904.0267 Casimir forces in the time domain: Theory], Phys. Rev. A, 80 012115 (April 2009).</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">* Alexander P. McCauley, Alejandro W. Rodriguez, John D. Joannopoulos, and Steven G. Johnson, <span style="color: red; font-weight: bold;">"</span>[http://arxiv.org/abs/0906.5170 Casimir forces in the time domain: Applications],<span style="color: red; font-weight: bold;">" </span>Phys. Rev. A, 81 012119 (January 2010).</td><td>+</td><td style="background: #cfc; font-size: smaller;">* Alexander P. McCauley, Alejandro W. Rodriguez, John D. Joannopoulos, and Steven G. Johnson, [http://arxiv.org/abs/0906.5170 Casimir forces in the time domain: Applications], Phys. Rev. A, 81 012119 (January 2010).</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">These papers describe how any time-domain code may be used to efficiently compute Casimir forces without modification of the internal code. <span style="color: red; font-weight: bold;">The newest version of </span>Meep contains several optimizations of these algorithms, allowing for very rapid computation of Casimir forces (reasonably-sized two-dimensional systems can be solved in a matter of seconds).</td><td>+</td><td style="background: #cfc; font-size: smaller;">These papers describe how any time-domain code may be used to efficiently compute Casimir forces without modification of the internal code. Meep contains several optimizations of these algorithms, allowing for very rapid computation of Casimir forces (reasonably-sized two-dimensional systems can be solved in a matter of seconds).</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">This page will provide some tutorial examples showing how these calculations are performed for simple geometries. For a derivation of these methods, the reader is referred to the papers above, which will be referred to as Part I and Part II in this webpage.</td><td> </td><td style="background: #eee; font-size: smaller;">This page will provide some tutorial examples showing how these calculations are performed for simple geometries. For a derivation of these methods, the reader is referred to the papers above, which will be referred to as Part I and Part II in this webpage.</td></tr>
<tr><td colspan="2" align="left"><strong>Line 16:</strong></td>
<td colspan="2" align="left"><strong>Line 16:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==Introduction==</td><td> </td><td style="background: #eee; font-size: smaller;">==Introduction==</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">In this section, we introduce the equations and basic considerations involved in computing the force using the method presented in Rodriguez et. al. ([<span style="color: red; font-weight: bold;">http</span>://<span style="color: red; font-weight: bold;">web</span>.<span style="color: red; font-weight: bold;">mit</span>.<span style="color: red; font-weight: bold;">edu</span>/<span style="color: red; font-weight: bold;">~alexrod7</span>/<span style="color: red; font-weight: bold;">www</span>/<span style="color: red; font-weight: bold;">papers</span>/<span style="color: red; font-weight: bold;">RodriguezMc09PRA</span>.<span style="color: red; font-weight: bold;">pdf</span>]). Note that we keep the details of the derivation to a minimum and instead focus on the calculational aspects of the resulting algorithm.</td><td>+</td><td style="background: #cfc; font-size: smaller;">In this section, we introduce the equations and basic considerations involved in computing the force using the method presented in Rodriguez et. al. ([<span style="color: red; font-weight: bold;">https</span>://<span style="color: red; font-weight: bold;">journals</span>.<span style="color: red; font-weight: bold;">aps</span>.<span style="color: red; font-weight: bold;">org</span>/<span style="color: red; font-weight: bold;">pra</span>/<span style="color: red; font-weight: bold;">abstract</span>/<span style="color: red; font-weight: bold;">10.1103</span>/<span style="color: red; font-weight: bold;">PhysRevA.80</span>.<span style="color: red; font-weight: bold;">012115</span>]). Note that we keep the details of the derivation to a minimum and instead focus on the calculational aspects of the resulting algorithm.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">The general setup for a Casimir force computation is shown in the following figure:</td><td> </td><td style="background: #eee; font-size: smaller;">The general setup for a Casimir force computation is shown in the following figure:</td></tr>
<tr><td colspan="2" align="left"><strong>Line 66:</strong></td>
<td colspan="2" align="left"><strong>Line 66:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==Example: two-dimensional blocks==</td><td> </td><td style="background: #eee; font-size: smaller;">==Example: two-dimensional blocks==</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">In this section we calculate the Casimir force in the two-dimensional Casimir piston configuration ([http://math.mit.edu/~stevenj/papers/RodriguezIb07.pdf Rodriguez et. al<span style="color: red; font-weight: bold;">, ''Physical Review Letters'', vol 99, p 080401, 2007</span>]) shown below:</td><td>+</td><td style="background: #cfc; font-size: smaller;">In this section we calculate the Casimir force in the two-dimensional Casimir piston configuration ([http://math.mit.edu/~stevenj/papers/RodriguezIb07.pdf Rodriguez et. al]) shown below:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">[[Image:dblocks-config.jpg|250px|thumb|center|Example structure: A two-dimensional piston-like configuration in which we will compute the Casimir force between two blocks between two parallel plates.]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Image:dblocks-config.jpg|250px|thumb|center|Example structure: A two-dimensional piston-like configuration in which we will compute the Casimir force between two blocks between two parallel plates.]]</td></tr>
<tr><td colspan="2" align="left"><strong>Line 77:</strong></td>
<td colspan="2" align="left"><strong>Line 77:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define a 1)</td><td> </td><td style="background: #eee; font-size: smaller;"> (define a 1)</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define-param h 0.5)</td><td> </td><td style="background: #eee; font-size: smaller;"> (define-param h 0.5)</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (set! geometry</td><td> </td><td style="background: #eee; font-size: smaller;"> (set! geometry</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (list (make block (center 0 (+ (/ a 2) h (/ resolution))) ;upper sidewall </td><td> </td><td style="background: #eee; font-size: smaller;"> (list (make block (center 0 (+ (/ a 2) h (/ resolution))) ;upper sidewall </td></tr>
<tr><td colspan="2" align="left"><strong>Line 152:</strong></td>
<td colspan="2" align="left"><strong>Line 152:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define total-force 0)</td><td> </td><td style="background: #eee; font-size: smaller;"> (define total-force 0)</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (do ((n 0 (1+ n))) ((= n (length n-list))) ;source components</td><td> </td><td style="background: #eee; font-size: smaller;"> (do ((n 0 (1+ n))) ((= n (length n-list))) ;source components</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (do ((side 0 (1+ side))) ((= side (length side-list))) ;sides of S</td><td> </td><td style="background: #eee; font-size: smaller;"> (do ((side 0 (1+ side))) ((= side (length side-list))) ;sides of S</td></tr>
<tr><td colspan="2" align="left"><strong>Line 182:</strong></td>
<td colspan="2" align="left"><strong>Line 182:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">The procedure for the double blocks case is illustrated below:</td><td> </td><td style="background: #eee; font-size: smaller;">The procedure for the double blocks case is illustrated below:</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">[[Image:Vac.jpg]]</td><td>+</td><td style="background: #cfc; font-size: smaller;"> </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">[[Image:Vac.jpg<span style="color: red; font-weight: bold;">|center</span>]]</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">In an ideal case of infinite spatial resolution, only the first term is nonzero. However, due to discretization effects, for finite resolution they can be quite large and will depend on the source surface. The total vacuum-subtracted force, however, will still be well-behaved for finite resolution.</td><td> </td><td style="background: #eee; font-size: smaller;">In an ideal case of infinite spatial resolution, only the first term is nonzero. However, due to discretization effects, for finite resolution they can be quite large and will depend on the source surface. The total vacuum-subtracted force, however, will still be well-behaved for finite resolution.</td></tr>
<tr><td colspan="2" align="left"><strong>Line 225:</strong></td>
<td colspan="2" align="left"><strong>Line 226:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define-param dd 0.25)</td><td> </td><td style="background: #eee; font-size: smaller;"> (define-param dd 0.25)</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define d-list (parallel-make-list d-min d-max dd))</td><td> </td><td style="background: #eee; font-size: smaller;"> (define d-list (parallel-make-list d-min d-max dd))</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define-param h-min 0.2)</td><td> </td><td style="background: #eee; font-size: smaller;"> (define-param h-min 0.2)</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define-param h-max 1)</td><td> </td><td style="background: #eee; font-size: smaller;"> (define-param h-max 1)</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define-param dh 0.1)</td><td> </td><td style="background: #eee; font-size: smaller;"> (define-param dh 0.1)</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define h-list (parallel-make-list h-min h-max dh))</td><td> </td><td style="background: #eee; font-size: smaller;"> (define h-list (parallel-make-list h-min h-max dh))</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define Ext-list (list d-list h-list))</td><td> </td><td style="background: #eee; font-size: smaller;"> (define Ext-list (list d-list h-list))</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td colspan="2" align="left"><strong>Line 240:</strong></td>
<td colspan="2" align="left"><strong>Line 241:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define Nint (list-ref param-info 2))</td><td> </td><td style="background: #eee; font-size: smaller;"> (define Nint (list-ref param-info 2))</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define Nsims (* Next Nint)) ;%%% Total number of simulations</td><td> </td><td style="background: #eee; font-size: smaller;"> (define Nsims (* Next Nint)) ;%%% Total number of simulations</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define force-list (make-list Next 0)) ;%%% Holds the final values of the forces</td><td> </td><td style="background: #eee; font-size: smaller;"> (define force-list (make-list Next 0)) ;%%% Holds the final values of the forces</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td colspan="2" align="left"><strong>Line 248:</strong></td>
<td colspan="2" align="left"><strong>Line 249:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define ngroups (min Nsims nproc))</td><td> </td><td style="background: #eee; font-size: smaller;"> (define ngroups (min Nsims nproc))</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define mygroup (meep-divide-parallel-processes ngroups)) ;%%% Index of the current processor group</td><td> </td><td style="background: #eee; font-size: smaller;"> (define mygroup (meep-divide-parallel-processes ngroups)) ;%%% Index of the current processor group</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define my-sims (get-indices Nsims nproc mygroup)) </td><td> </td><td style="background: #eee; font-size: smaller;"> (define my-sims (get-indices Nsims nproc mygroup)) </td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td colspan="2" align="left"><strong>Line 264:</strong></td>
<td colspan="2" align="left"><strong>Line 265:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (curr-pol (list-ref curr-params 3)) ;%%% Current source field polarization</td><td> </td><td style="background: #eee; font-size: smaller;"> (curr-pol (list-ref curr-params 3)) ;%%% Current source field polarization</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (curr-side (list-ref curr-params 4)) ;%%% Current source surface side </td><td> </td><td style="background: #eee; font-size: smaller;"> (curr-side (list-ref curr-params 4)) ;%%% Current source surface side </td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> ;%%% Set other relevant geometry parameters: computational cell size, etc.</td><td> </td><td style="background: #eee; font-size: smaller;"> ;%%% Set other relevant geometry parameters: computational cell size, etc.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (curr-force 0) ;%%% Value of the force contribution</td><td> </td><td style="background: #eee; font-size: smaller;"> (curr-force 0) ;%%% Value of the force contribution</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> ) ;close first paren of let*</td><td> </td><td style="background: #eee; font-size: smaller;"> ) ;close first paren of let*</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> ;%%%% Set up the geometry and run the computation as before, reading the result into curr-force</td><td> </td><td style="background: #eee; font-size: smaller;"> ;%%%% Set up the geometry and run the computation as before, reading the result into curr-force</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> ;%%% Add curr-force to the total force list</td><td> </td><td style="background: #eee; font-size: smaller;"> ;%%% Add curr-force to the total force list</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (list-set! force-list i-external (+ curr-force (list-ref force-list i-external)))))</td><td> </td><td style="background: #eee; font-size: smaller;"> (list-set! force-list i-external (+ curr-force (list-ref force-list i-external)))))</td></tr>
<tr><td colspan="2" align="left"><strong>Line 297:</strong></td>
<td colspan="2" align="left"><strong>Line 298:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (curr-force (list-ref total-force j)))</td><td> </td><td style="background: #eee; font-size: smaller;"> (curr-force (list-ref total-force j)))</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (print "Total force for d = "curr-d", h = "curr-h" = "curr-force"\n")))</td><td> </td><td style="background: #eee; font-size: smaller;"> (print "Total force for d = "curr-d", h = "curr-h" = "curr-force"\n")))</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (sleep 2) ;%%% Sometimes this is useful to keep the printing from getting entangled with end-divide-parallel below</td><td> </td><td style="background: #eee; font-size: smaller;"> (sleep 2) ;%%% Sometimes this is useful to keep the printing from getting entangled with end-divide-parallel below</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (meep-end-divide-parallel)</td><td> </td><td style="background: #eee; font-size: smaller;"> (meep-end-divide-parallel)</td></tr>
<tr><td colspan="2" align="left"><strong>Line 323:</strong></td>
<td colspan="2" align="left"><strong>Line 324:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define eps0 11.87) ;DC dielectric</td><td> </td><td style="background: #eee; font-size: smaller;"> (define eps0 11.87) ;DC dielectric</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define epsf 1.035) ;high frequency dielectric</td><td> </td><td style="background: #eee; font-size: smaller;"> (define epsf 1.035) ;high frequency dielectric</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define Silicon (make medium (epsilon epsf)</td><td> </td><td style="background: #eee; font-size: smaller;"> (define Silicon (make medium (epsilon epsf)</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (E-polarizations</td><td> </td><td style="background: #eee; font-size: smaller;"> (E-polarizations</td></tr>
<tr><td colspan="2" align="left"><strong>Line 387:</strong></td>
<td colspan="2" align="left"><strong>Line 388:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define pol-list (list Er Ep Ez Hr Hp Hz)) ;%%% Field polarizations for cylindrical symmetry</td><td> </td><td style="background: #eee; font-size: smaller;"> (define pol-list (list Er Ep Ez Hr Hp Hz)) ;%%% Field polarizations for cylindrical symmetry</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define sides (list 0 1 2)) ;%%% The source surface is a cylinder, which has only three sides when phi = const.</td><td> </td><td style="background: #eee; font-size: smaller;"> (define sides (list 0 1 2)) ;%%% The source surface is a cylinder, which has only three sides when phi = const.</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> </span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define-param m-min 0) ;%%% Integer values for the exp(i m phi) field dependence</td><td> </td><td style="background: #eee; font-size: smaller;"> (define-param m-min 0) ;%%% Integer values for the exp(i m phi) field dependence</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define-param m-max 0)</td><td> </td><td style="background: #eee; font-size: smaller;"> (define-param m-max 0)</td></tr>
</table>
Ardavanhttp://ab-initio.mit.edu/wiki/index.php?title=Casimir_calculations_in_Meep&diff=3922&oldid=prevAlexrod7: /* Improving Temporal Convergence */2010-02-03T15:13:41Z<p><span class="autocomment">Improving Temporal Convergence</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 15:13, 3 February 2010</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 426:</strong></td>
<td colspan="2" align="left"><strong>Line 426:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">===Improving Temporal Convergence===</td><td> </td><td style="background: #eee; font-size: smaller;">===Improving Temporal Convergence===</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">As discussed in Part I, the temporal convergence of the force <math>F(t)</math> can be accelerated by picking the right value of the global conductivity <math>\sigma</math>. <math>\sigma</math> should be high enough to dampen out oscillations in <math>F(t)</math>, but on the other hand a high conductivity reduces the velocity of waves propagating in the medium (see Part I), slowing convergence. We've found that if the characteristic separation between two objects (e.g. the distance between parallel plates) in vacuum is <math>d</math>, then picking <math>\sigma \sim 0.5/d</math>. This is illustrated in the function <code>scale-sigma-T</code> in periodic-sphere-plate.ctl above. Both the value of <math>\sigma</math> and the total runtime <math>T</math> of the simulation are adjusted depending on the separation between the objects.</td><td>+</td><td style="background: #cfc; font-size: smaller;">As discussed in Part I, the temporal convergence of the force <math>F(t)</math> can be accelerated by picking the right value of the global conductivity <math>\sigma</math>. <math>\sigma</math> should be high enough to dampen out oscillations in <math>F(t)</math>, but on the other hand a high conductivity reduces the velocity of waves propagating in the medium (see Part I), slowing convergence. We've found that if the characteristic separation between two objects (e.g. the distance between parallel plates) in vacuum is <math>d</math>, then picking <math>\sigma <span style="color: red; font-weight: bold;">~</span>\sim<span style="color: red; font-weight: bold;">~ </span>0.5/d</math>. This is illustrated in the function <code>scale-sigma-T</code> in periodic-sphere-plate.ctl above. Both the value of <math>\sigma</math> and the total runtime <math>T</math> of the simulation are adjusted depending on the separation between the objects.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">If the dielectric of the medium is non-zero, then for non-dispersive media the optimal value of <math>\sigma</math> follows from group velocity considerations. For dispersive media, the convergence should be experimented with to determine the best value. Generally, as the dielectric <math>\epsilon</math> of the medium increases, <math>\sigma</math> should decrease.</td><td> </td><td style="background: #eee; font-size: smaller;">If the dielectric of the medium is non-zero, then for non-dispersive media the optimal value of <math>\sigma</math> follows from group velocity considerations. For dispersive media, the convergence should be experimented with to determine the best value. Generally, as the dielectric <math>\epsilon</math> of the medium increases, <math>\sigma</math> should decrease.</td></tr>
</table>
Alexrod7http://ab-initio.mit.edu/wiki/index.php?title=Casimir_calculations_in_Meep&diff=3921&oldid=prevAlexrod7: /* Improving Temporal Convergence */2010-02-03T15:13:14Z<p><span class="autocomment">Improving Temporal Convergence</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 15:13, 3 February 2010</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 428:</strong></td>
<td colspan="2" align="left"><strong>Line 428:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">As discussed in Part I, the temporal convergence of the force <math>F(t)</math> can be accelerated by picking the right value of the global conductivity <math>\sigma</math>. <math>\sigma</math> should be high enough to dampen out oscillations in <math>F(t)</math>, but on the other hand a high conductivity reduces the velocity of waves propagating in the medium (see Part I), slowing convergence. We've found that if the characteristic separation between two objects (e.g. the distance between parallel plates) in vacuum is <math>d</math>, then picking <math>\sigma \sim 0.5/d</math>. This is illustrated in the function <code>scale-sigma-T</code> in periodic-sphere-plate.ctl above. Both the value of <math>\sigma</math> and the total runtime <math>T</math> of the simulation are adjusted depending on the separation between the objects.</td><td> </td><td style="background: #eee; font-size: smaller;">As discussed in Part I, the temporal convergence of the force <math>F(t)</math> can be accelerated by picking the right value of the global conductivity <math>\sigma</math>. <math>\sigma</math> should be high enough to dampen out oscillations in <math>F(t)</math>, but on the other hand a high conductivity reduces the velocity of waves propagating in the medium (see Part I), slowing convergence. We've found that if the characteristic separation between two objects (e.g. the distance between parallel plates) in vacuum is <math>d</math>, then picking <math>\sigma \sim 0.5/d</math>. This is illustrated in the function <code>scale-sigma-T</code> in periodic-sphere-plate.ctl above. Both the value of <math>\sigma</math> and the total runtime <math>T</math> of the simulation are adjusted depending on the separation between the objects.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">If the dielectric of the medium is non-zero, then for non-dispersive media the optimal value of <math>\sigma</math> follows from group velocity considerations.</td><td>+</td><td style="background: #cfc; font-size: smaller;">If the dielectric of the medium is non-zero, then for non-dispersive media the optimal value of <math>\sigma</math> follows from group velocity considerations<span style="color: red; font-weight: bold;">. For dispersive media, the convergence should be experimented with to determine the best value. Generally, as the dielectric <math>\epsilon</math> of the medium increases, <math>\sigma</math> should decrease</span>.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">[coming soon: <span style="color: red; font-weight: bold;">convergence parameters, </span>stair-casing effects, choosing the right dielectric lengthscale, PML size, etc...]</td><td>+</td><td style="background: #cfc; font-size: smaller;">[coming soon: stair-casing effects, choosing the right dielectric lengthscale, PML size, etc...]</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Meep]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Meep]]</td></tr>
</table>
Alexrod7http://ab-initio.mit.edu/wiki/index.php?title=Casimir_calculations_in_Meep&diff=3920&oldid=prevAlexrod7: /* Tricks and Pitfalls */2010-02-03T15:06:26Z<p><span class="autocomment">Tricks and Pitfalls</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 15:06, 3 February 2010</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 426:</strong></td>
<td colspan="2" align="left"><strong>Line 426:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">===Improving Temporal Convergence===</td><td> </td><td style="background: #eee; font-size: smaller;">===Improving Temporal Convergence===</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"><span style="color: red; font-weight: bold;">Fast calculation </span>of the <span style="color: red; font-weight: bold;">Casimir </span>force <span style="color: red; font-weight: bold;">requires </span></td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;">As discussed in Part I, the temporal convergence </span>of the force <span style="color: red; font-weight: bold;"><math>F(t)</math> can be accelerated by picking the right value of the global conductivity <math>\sigma</math>. <math>\sigma</math> should be high enough to dampen out oscillations in <math>F(t)</math>, but on the other hand a high conductivity reduces the velocity of waves propagating in the medium (see Part I), slowing convergence. We've found that if the characteristic separation between two objects (e.g. the distance between parallel plates) in vacuum is <math>d</math>, then picking <math>\sigma \sim 0.5/d</math>. This is illustrated in the function <code>scale-sigma-T</code> in periodic-sphere-plate.ctl above. Both the value of <math>\sigma</math> and the total runtime <math>T</math> of the simulation are adjusted depending on the separation between the objects.</span></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;">If the dielectric of the medium is non-zero, then for non-dispersive media the optimal value of <math>\sigma</math> follows from group velocity considerations.</span></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">[coming soon: convergence parameters, stair-casing effects, choosing the right dielectric lengthscale, PML size, etc...]</td><td> </td><td style="background: #eee; font-size: smaller;">[coming soon: convergence parameters, stair-casing effects, choosing the right dielectric lengthscale, PML size, etc...]</td></tr>
</table>
Alexrod7http://ab-initio.mit.edu/wiki/index.php?title=Casimir_calculations_in_Meep&diff=3919&oldid=prevAlexrod7: /* Parallelization */2010-02-03T14:56:39Z<p><span class="autocomment">Parallelization</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 14:56, 3 February 2010</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 273:</strong></td>
<td colspan="2" align="left"><strong>Line 273:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (list-set! force-list i-external (+ curr-force (list-ref force-list i-external)))))</td><td> </td><td style="background: #eee; font-size: smaller;"> (list-set! force-list i-external (+ curr-force (list-ref force-list i-external)))))</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">Now call <code>run-sim</code> for every index of <code>my-sims</code><span style="color: red; font-weight: bold;"></span>:</td><td>+</td><td style="background: #cfc; font-size: smaller;">Now call <code>run-sim</code> for every index of <code>my-sims</code>:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (do ((j 0 (1+ j))) ((= j (length my-sims)))</td><td> </td><td style="background: #eee; font-size: smaller;"> (do ((j 0 (1+ j))) ((= j (length my-sims)))</td></tr>
</table>
Alexrod7http://ab-initio.mit.edu/wiki/index.php?title=Casimir_calculations_in_Meep&diff=3918&oldid=prevAlexrod7: /* Tricks and Pitfalls */2010-02-03T14:55:21Z<p><span class="autocomment">Tricks and Pitfalls</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 14:55, 3 February 2010</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 421:</strong></td>
<td colspan="2" align="left"><strong>Line 421:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==Tricks and Pitfalls==</td><td> </td><td style="background: #eee; font-size: smaller;">==Tricks and Pitfalls==</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">If you examine periodic-sphere-plate.ctl in the example above, you will notice that center of each plane of the source surface is numerically rounded to center it exactly on a gridpoint. This is one of a number of tricks (in addition to vacuum subtraction) that help to improve convergence of the result with resolution. More will be discussed below.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">===Improving Temporal Convergence===</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">Fast calculation of the Casimir force requires </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">[coming soon: convergence parameters, stair-casing effects, choosing the right dielectric lengthscale, PML size, etc...]</td><td> </td><td style="background: #eee; font-size: smaller;">[coming soon: convergence parameters, stair-casing effects, choosing the right dielectric lengthscale, PML size, etc...]</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Meep]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Meep]]</td></tr>
</table>
Alexrod7http://ab-initio.mit.edu/wiki/index.php?title=Casimir_calculations_in_Meep&diff=3917&oldid=prevAlexrod7: /* Example: three-dimensional periodic systems */2010-02-03T00:02:13Z<p><span class="autocomment">Example: three-dimensional periodic systems</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 00:02, 3 February 2010</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 402:</strong></td>
<td colspan="2" align="left"><strong>Line 402:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==Example: three-dimensional periodic systems==</td><td> </td><td style="background: #eee; font-size: smaller;">==Example: three-dimensional periodic systems==</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">Three-dimensional periodic systems are another example of systems that can be easily analyzed with Meep. In this example, we consider the Casimir force between a periodic array of dielectric spheres and a <span style="color: red; font-weight: bold;">perfect metal </span>plate, shown below and simulated in periodic-sphere-plate.ctl ([http://ab-initio.mit.edu/~mccauley/casimir-examples/periodic-sphere-plate.ctl]):</td><td>+</td><td style="background: #cfc; font-size: smaller;">Three-dimensional periodic systems are another example of systems that can be easily analyzed with Meep. In this example, we consider the Casimir force between a periodic array of dielectric spheres and a <span style="color: red; font-weight: bold;">metallic </span>plate, shown below and simulated in periodic-sphere-plate.ctl ([http://ab-initio.mit.edu/~mccauley/casimir-examples/periodic-sphere-plate.ctl]):</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">[[Image:Spheres-plane.jpg|350px|thumb|center|Setup of the three-dimensional periodic array of dielectric spheres over metal. The unit cell consists of a single sphere and a square segment of the metal plate]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Image:Spheres-plane.jpg|350px|thumb|center|Setup of the three-dimensional periodic array of dielectric spheres over metal. The unit cell consists of a single sphere and a square segment of the metal plate]]</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">We denote the <math>z</math>-direction to be the vector normal to the plate, and the <math>x</math> and <math>y</math> directions to be parallel to the plate. In this case we have two directions of Bloch periodicity, <math>k_x</math> and <math>k_y</math>. However, unlike the previous case of <math>z</math>-invariance, here the source surface <math>S</math> intersects the periodic bounding surface.</td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;">In this example, the plate can either be perfect metal, or dispersive gold (the default). Set <code>dispersion?</code> to false to get a perfect metal plate. </span>We denote the <math>z</math>-direction to be the vector normal to the plate, and the <math>x</math> and <math>y</math> directions to be parallel to the plate. In this case we have two directions of Bloch periodicity, <math>k_x</math> and <math>k_y</math>. However, unlike the previous case of <math>z</math>-invariance, here the source surface <math>S</math> intersects the periodic bounding surface.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">The effect is that, instead of being a closed surface, <math>S</math> is now the union of two infinite planes. As we want the force per area of the unit cell, in the calculation we take <math>S</math> to be the transverse dimensions of the unit cell. For this type of surface, there are two modifications; first, there are only two sides:</td><td> </td><td style="background: #eee; font-size: smaller;">The effect is that, instead of being a closed surface, <math>S</math> is now the union of two infinite planes. As we want the force per area of the unit cell, in the calculation we take <math>S</math> to be the transverse dimensions of the unit cell. For this type of surface, there are two modifications; first, there are only two sides:</td></tr>
</table>
Alexrod7http://ab-initio.mit.edu/wiki/index.php?title=Casimir_calculations_in_Meep&diff=3916&oldid=prevAlexrod7 at 00:00, 3 February 20102010-02-03T00:00:38Z<p></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 00:00, 3 February 2010</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 206:</strong></td>
<td colspan="2" align="left"><strong>Line 206:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">If you look at the example file rods-plates.ctl ([http://ab-initio.mit.edu/~mccauley/casimir-examples/rods-plates.ctl]), you'll notice that the parameter lists are handled very differently than in the example given above. This is because it has been written in a way to take the most advantage of parallel computation. </td><td> </td><td style="background: #eee; font-size: smaller;">If you look at the example file rods-plates.ctl ([http://ab-initio.mit.edu/~mccauley/casimir-examples/rods-plates.ctl]), you'll notice that the parameter lists are handled very differently than in the example given above. This is because it has been written in a way to take the most advantage of parallel computation. </td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">Each Casimir force calculation requires many different, very short Meep simulations. For this type of computation, it is most efficient when running on a cluster to let each individual processor handle a subset of these simulations, rather than dividing up every simulation among the entire cluster (the default behavior for meep-mpi). This way the speedup is almost exactly linear in the number of processors used.</td><td>+</td><td style="background: #cfc; font-size: smaller;">Each Casimir force calculation requires many different, very short Meep simulations. For this type of computation, it is most efficient when running on a cluster to let each individual processor handle a subset of these simulations, rather than dividing up every simulation among the entire cluster (the default behavior for meep-mpi). This way the speedup is almost exactly linear in the number of processors used<span style="color: red; font-weight: bold;">. All of the functions used below are defined in the file parallel.scm ([http://ab-initio.mit.edu/~mccauley/casimir-examples/parallel.scm]), which should be included in the header of any ctl file using them</span>.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">Our strategy (shown in rods-plates.ctl) is as follows: each Casimir force calculation has a set of "internal" indices, each of which denotes a separate simulation. The sum of the results from all of these simulations gives the actual force. In our example (as in most examples), the internal indices are the source polarization, the list of sides for the source surface, and the harmonic moments <math>n</math>:</td><td>+</td><td style="background: #cfc; font-size: smaller;">Our strategy (shown in rods-plates.ctl <span style="color: red; font-weight: bold;">([http://ab-initio.mit.edu/~mccauley/casimir-examples/rods-plates.ctl])</span>) is as follows: each Casimir force calculation has a set of "internal" indices, each of which denotes a separate simulation. The sum of the results from all of these simulations gives the actual force. In our example (as in most examples), the internal indices are the source polarization, the list of sides for the source surface, and the harmonic moments <math>n</math>:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define pol-list (list Ex Ey Ez Hx Hy Hz)) ;source polarizations</td><td> </td><td style="background: #eee; font-size: smaller;"> (define pol-list (list Ex Ey Ez Hx Hy Hz)) ;source polarizations</td></tr>
<tr><td colspan="2" align="left"><strong>Line 317:</strong></td>
<td colspan="2" align="left"><strong>Line 317:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">So the new dispersion is a Lorentzian, but with an additional loss term. This is the correct material to define in Meep. </td><td> </td><td style="background: #eee; font-size: smaller;">So the new dispersion is a Lorentzian, but with an additional loss term. This is the correct material to define in Meep. </td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">It is easy to define a dispersive material in Meep (discussed further in [[Materials in Meep]], with examples in [[Meep Tutorial/Material dispersion]]). Here is how we go about it (further material examples are in materials.scm ([http://ab-initio.mit.edu/~mccauley/casimir-examples/materials.scm]), and rods-plates.ctl ([http://ab-initio.mit.edu/~mccauley/casimir-examples/rods-plates.ctl]) demonstrates their use.</td><td>+</td><td style="background: #cfc; font-size: smaller;">It is easy to define a dispersive material in Meep (discussed further in [[Materials in Meep]], with examples in [[Meep Tutorial/Material dispersion]]). Here is how we go about it (further material examples are <span style="color: red; font-weight: bold;">defined </span>in materials.scm ([http://ab-initio.mit.edu/~mccauley/casimir-examples/materials.scm]), and rods-plates.ctl ([http://ab-initio.mit.edu/~mccauley/casimir-examples/rods-plates.ctl]) demonstrates their use.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> (define length-scale 1e-6) ;length scale - units of 1 micron</td><td> </td><td style="background: #eee; font-size: smaller;"> (define length-scale 1e-6) ;length scale - units of 1 micron</td></tr>
<tr><td colspan="2" align="left"><strong>Line 339:</strong></td>
<td colspan="2" align="left"><strong>Line 339:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">[[Image:Extruded-blocks.jpg|250px|thumb|center|Example of a three-dimensional, <math>z</math>-invariant geometry]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Image:Extruded-blocks.jpg|250px|thumb|center|Example of a three-dimensional, <math>z</math>-invariant geometry]]</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">Now there is another parameter in the fields, <math>k_z</math>, the out-of-plane wavevector component of the fields. The field dependence is now of the form <math>\textbf{E}(x,y,z) = \textbf{E}(x,y) e^{i\pi k_z z}</math>. Consequently, an integral over the stress tensor will involve an integral over <math>k_z</math>, where for each <math>k_z</math>, the green's function can be determined by a two-dimensional computation. Each two-dimensional computation gives a force <math>\textbf{F}^{2D}(k_z)</math>, and the total force is expressed as an integral:</td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;">This example is also treated in rods-plates.ctl ([http://ab-initio.mit.edu/~mccauley/casimir-examples/rods-plates.ctl]). </span>Now there is another parameter in the fields, <math>k_z</math>, the out-of-plane wavevector component of the fields. The field dependence is now of the form <math>\textbf{E}(x,y,z) = \textbf{E}(x,y) e^{i\pi k_z z}</math>. Consequently, an integral over the stress tensor will involve an integral over <math>k_z</math>, where for each <math>k_z</math>, the green's function can be determined by a two-dimensional computation. Each two-dimensional computation gives a force <math>\textbf{F}^{2D}(k_z)</math>, and the total force is expressed as an integral:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">:<math>\textbf{F}^{3D} = \int_0^\infty dk_z F^{2D}(k_z) </math></td><td> </td><td style="background: #eee; font-size: smaller;">:<math>\textbf{F}^{3D} = \int_0^\infty dk_z F^{2D}(k_z) </math></td></tr>
<tr><td colspan="2" align="left"><strong>Line 402:</strong></td>
<td colspan="2" align="left"><strong>Line 402:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==Example: three-dimensional periodic systems==</td><td> </td><td style="background: #eee; font-size: smaller;">==Example: three-dimensional periodic systems==</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">Three-dimensional periodic systems are another example of systems that can be easily analyzed with Meep. In this example, we consider the Casimir force between a periodic array of dielectric spheres and a perfect metal plate, shown below:</td><td>+</td><td style="background: #cfc; font-size: smaller;">Three-dimensional periodic systems are another example of systems that can be easily analyzed with Meep. In this example, we consider the Casimir force between a periodic array of dielectric spheres and a perfect metal plate, shown below <span style="color: red; font-weight: bold;">and simulated in periodic-sphere-plate.ctl ([http://ab-initio.mit.edu/~mccauley/casimir-examples/periodic-sphere-plate.ctl])</span>:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">[[Image:Spheres-plane.jpg|350px|thumb|center|Setup of the three-dimensional periodic array of dielectric spheres over metal. The unit cell consists of a single sphere and a square segment of the metal plate]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Image:Spheres-plane.jpg|350px|thumb|center|Setup of the three-dimensional periodic array of dielectric spheres over metal. The unit cell consists of a single sphere and a square segment of the metal plate]]</td></tr>
</table>
Alexrod7http://ab-initio.mit.edu/wiki/index.php?title=Casimir_calculations_in_Meep&diff=3915&oldid=prevAlexrod7: /* Example: three-dimensional periodic systems */2010-02-02T23:56:13Z<p><span class="autocomment">Example: three-dimensional periodic systems</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 23:56, 2 February 2010</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 408:</strong></td>
<td colspan="2" align="left"><strong>Line 408:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">We denote the <math>z</math>-direction to be the vector normal to the plate, and the <math>x</math> and <math>y</math> directions to be parallel to the plate. In this case we have two directions of Bloch periodicity, <math>k_x</math> and <math>k_y</math>. However, unlike the previous case of <math>z</math>-invariance, here the source surface <math>S</math> intersects the periodic bounding surface.</td><td> </td><td style="background: #eee; font-size: smaller;">We denote the <math>z</math>-direction to be the vector normal to the plate, and the <math>x</math> and <math>y</math> directions to be parallel to the plate. In this case we have two directions of Bloch periodicity, <math>k_x</math> and <math>k_y</math>. However, unlike the previous case of <math>z</math>-invariance, here the source surface <math>S</math> intersects the periodic bounding surface.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">The effect is that, instead of being a closed surface, <math>S</math> is now the union of two infinite planes. As we want the force per area of the unit cell, in the calculation we take <math>S</math> to be the transverse dimensions of the unit cell.</td><td>+</td><td style="background: #cfc; font-size: smaller;">The effect is that, instead of being a closed surface, <math>S</math> is now the union of two infinite planes. As we want the force per area of the unit cell, in the calculation we take <math>S</math> to be the transverse dimensions of the unit cell<span style="color: red; font-weight: bold;">. For this type of surface, there are two modifications; first, there are only two sides:</span></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> (define side-list (list -1 1))</span></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;">and the surface used in the computation (which straddles the plate) will be either a plane on top (for <code>curr-side = 1</code>) or below (<code>curr-side = -1</code>) the plate.</span></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;">The second change is that instead of <code>casimir-force-contrib</code>, we call <code>casimir-force-contrib-bloch</code>, which is specifically designed for periodic systems:</span></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> (set! curr-force (* curr-side (casimir-force-contrib-bloch Z S (vector3 curr-kx curr-ky 0) Sigma T curr-pol gt)))</span></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;">The arguments are similar to <code>casimir-force-contrib</code>, except that now we pass in the Bloch vector (which will be set inside of the function), and instead of a side index we simply pass in <math>S</math>, which is only one side of the source surface. As the program cannot detect the orientation of the surface if there is only one side, we have to explicitly multiply by the normal vector (given by <code>curr-side</code>). Otherwise, the computation proceeds as in the above cases, with the integration over <math>k_x</math> and <math>k_y</math> done outside of the program</span>.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==Tricks and Pitfalls==</td><td> </td><td style="background: #eee; font-size: smaller;">==Tricks and Pitfalls==</td></tr>
</table>
Alexrod7