M. T. Homer Reid MIT Home Page
Physics Problems Research teaching My Music About Me Miscellany


Codes





A Compendium of scuff-em Examples

Here's a collection of example calculations carried out using scuff-em. This is intended solely as an illustration of the capabilities of the scuff-em suite, and is not intended to serve as documentation for the various command-line applications or the core library bundled with the suite. (For the actual documentation, see the links to the individual application pages and the core library reference in the table of contents at right).

For each of the calculations below, the .msh files (surface meshes) are generated from the .geo files (gmsh geometry files) using the command

      gmsh -clscale 1.0 -2 Geometry.geo
      

(or sometimes with -clscale 0.5 for finer meshing). This produces a file named Geometry.msh, which is the actual surface mesh that scuff-em reads.

I typically rename this file to read Geometry_345.msh (where 345 is the number of triangular panels or interior edges in the mesh; you can get this information by typing scuff-analyze --mesh Geometry.msh), and then use something like Geometry_345.scuffgeo as the filename for the scuff-em geometry file that uses this mesh file. In many of the scuff-em example directories you will two or more .msh and .scuffgeo files describing the same geometry meshed with different levels of fineness.

A Compendium of scuff-em Examples
• Scattering from a dielectric sphere (Mie scattering)
• Radiation forces and torques on chiral nanoparticles
• Scattering from a composite hemisphere
• Casimir forces in a sphere--sphere geometry
• Casimir forces and torques in a cube--torus geometry
• Casimir-Polder potential for a rubidium atom near a corrugated sapphire disc
• Plane-wave transmission through a perforated perfectly conducting screen
• Plane-wave transmission through a perforated silver film
• Dyadic Green's functions of a conducting plate with a hole

scuff-em
Examples
Installation
Core Library
Applications
Reference



Scattering from a dielectric sphere (Mie scattering)


The files for this example may be found in the share/scuff-em/examples/SolidSphere directory within your scuff-em installation.

gmsh geometry file: Sphere.geo
scuff-em geometry file:
SiCSphere.scuffgeo
MATERIAL SiliconCarbide

   EpsInf = 6.7;
   a0     = -3.32377e28;
   a1     = +8.93329e11; 
   b0     = -2.21677e28;
   b1     = 8.93329e11;
   Eps(w) = EpsInf * (a0 + i*a1*w + w*w) / ( b0 + i*b1*w + w*w);

ENDMATERIAL

OBJECT TheSphere
	MESHFILE Sphere.msh
	MATERIAL SiliconCarbide
ENDOBJECT
  
Run scuff-analyze to visualize the geometry as interpreted by scuff-em:
 % scuff-analyze --geometry SiCSphere.scuffgeo --WriteGMSHFiles
 % gmsh SiCSphere.gmsh
  

File containing scuff-scatter command-line arguments:
geometry    SiCSphere.scuffgeo
cache       Sphere.scuffcache
PFTFile     SiCSphere.PFT
OmegaFile OmegaList
pwDirection 0 0 1 
pwPolarization 1 0 0 
  
Run scuff-scatter:
 % scuff-scatter < SiCSphere.args
  

This produces the file SiCSphere.PFT. Plotting the 1st vs. the 3rd and 4th columns of this file yields the power absorbed and scattered by the sphere vs. angular frequency.

Commands to plot data in gnuplot:
 gnuplot> set logscale xy
 gnuplot> set xlabel 'Size parameter k*R'
 gnuplot> set ylabel 'Absorbed / Scattered Power'
 gnuplot> plot 'SiCSphere.PFT' u 1:3 t 'Absorbed' w lp pt 7 ps 1.5,  \
               '' u 1:4 t 'Scattered' w lp pt 7 ps 1.5
 
Data plot



Radiation forces and torques on chiral nanoparticles


The results of these calculations are included in a publication recently submitted to IEEE Transactions on Antennas and Propagation and available as an arXiv preprint: http://arxiv.org/abs/1307.2966.

Note that the same gmsh geometry file is used to generate both the flipped and non-flipped chiral particles. The flipping is done by means of a ROTATED statement in the .scuffgeo file.

gmsh geometry file: ChiralParticle.geo
scuff-em geometry file for two-particle geometry: TwoChiralParticles_R5_1392.scuffgeo
OBJECT LowerParticle
	MESHFILE ChiralParticle_R5_1392.msh
	MATERIAL Gold
ENDOBJECT

OBJECT UpperParticle
	MESHFILE ChiralParticle_R5_1392.msh
	MATERIAL Gold
	ROTATED 180 ABOUT 1 0 0 
	DISPLACED 0 0 3
ENDOBJECT
  
Run scuff-analyze to visualize the two-particle geometry as interpreted by scuff-em:
 % scuff-analyze --geometry TwoChiralParticles_R5_1392.scuffgeo --WriteGMSHFiles
 % gmsh TwoChiralParticles_R5_1392.pp
  

File containing scuff-scatter command-line arguments:
TwoChiralParticles.args
geometry    TwoChiralParticles_R5_1392.scuffgeo
cache       ChiralParticle_1392.cache
PFTFile     TwoChiralParticles_R5_1392.PFT
OmegaFile   OmegaList
pwPolarization 1 0 0 
pwDirection 0 0 1 
  
Run scuff-scatter:
 % scuff-scatter < TwoChiralParticles.args
  

This produces the file TwoChiralParticles_R5_1392.PFT. Plotting the 10th vs the 1st data column of this file yields plots of z-directed torque vs. frequency.

Data plot



Scattering from a composite hemisphere


In this case we are considering a composite sphere (a "bihemisphere") whose upper and lower hemispheres respectively have dielectric constant ε=20 and ε=2. Because this geometry involves a multi-material junction, the .scuffgeo file that describes it defines Regions and Surfaces instead of Objects.

Here's a picture of the mesh in which the upper hemisphere, lower hemisphere, and equatorial plane are shown displaced from one another (in the actual mesh they are of course not displaced, but instead fit snugly together). Click the image for higher resolution.

gmsh geometry file: BiHemisphere.geo
scuff-em geometry file: BiHemisphere.scuffgeo
REGION Exterior        MATERIAL VACUUM
REGION UpperHemisphere MATERIAL CONST_EPS_20
REGION LowerHemisphere MATERIAL CONST_EPS_2

SURFACE LowerHemisphereSurface
        MESHFILE BiHemisphere_420.msh
        MESHTAG 1
        REGIONS Exterior LowerHemisphere
ENDSURFACE

SURFACE UpperHemisphereSurface
        MESHFILE BiHemisphere_420.msh
        MESHTAG 2
        REGIONS Exterior UpperHemisphere
ENDSURFACE

SURFACE EquatorialPlane
        MESHFILE BiHemisphere_420.msh
        MESHTAG 3
        REGIONS UpperHemisphere LowerHemisphere
ENDSURFACE
  
List of evaluation points at which we would like to know values of the total (incident+scattered) fields:
BiHemisphere.EPFile
0.0 0.0 -2.000
0.0 0.0 -1.950
0.0 0.0 -1.900
...
0.0 0.0 1.900
0.0 0.0 1.950
0.0 0.0 2.000
  
File containing scuff-scatter command-line arguments:
BiHemisphere.args
geometry        BiHemisphere.scuffgeo
pwDirection     0 0 1
pwPolarization  1 0 0
omega           1.0
EPFile          BiHemisphere.EPFile
  
Run scuff-scatter:
 % scuff-scatter < BiHemisphere.args
  

This produces the file BiHemisphere.EPFile.total. Plotting the 3rd vs the 4th data column of this file yields plots of the (real part of the) x-component of the total E field versus z coordinate for points on the zaxis running from below the sphere, through the lower hemisphere, through the upper hemisphere, and above the sphere.

Data plot



Casimir forces between spheres


Calculations similar to these were among those published here and here. The files for this example may be found in the share/scuff-em/examples/TwoSpheres directory within your scuff-em installation.

gmsh geometry file: Sphere.geo
scuff-em geometry file for two-sphere geometry: GoldSpheres_339.scuffgeo
MATERIAL GOLD
    wp = 1.37e16; 
    gamma = 5.32e13;
    Eps(w) = 1 - wp^2 / (w * (w + i*gamma));
ENDMATERIAL

OBJECT	UpperSphere
	MESHFILE Sphere_339.msh
	MATERIAL Gold
	DISPLACED 0 0 3
ENDOBJECT
	
OBJECT	LowerSphere
	MESHFILE Sphere_339.msh
	MATERIAL Gold
ENDOBJECT
  
File describing a list of scuff-em geometric transformations: TwoSpheres.trans
TRANS 3.0 OBJECT UpperSphere DISP 0.0 0.0 0.0
TRANS 5.0 OBJECT UpperSphere DISP 0.0 0.0 2.0
TRANS 7.0 OBJECT UpperSphere DISP 0.0 0.0 4.0
TRANS 9.0 OBJECT UpperSphere DISP 0.0 0.0 6.0
TRANS 11.0 OBJECT UpperSphere DISP 0.0 0.0 8.0
TRANS 13.0 OBJECT UpperSphere DISP 0.0 0.0 10.0
TRANS 15.0 OBJECT UpperSphere DISP 0.0 0.0 12.0
TRANS 17.0 OBJECT UpperSphere DISP 0.0 0.0 14.0
TRANS 19.0 OBJECT UpperSphere DISP 0.0 0.0 16.0
  
Run scuff-analyze to visualize the two-sphere geometry and the list of transformations as interpreted by scuff-em:
 % scuff-analyze --geometry GoldSpheres_339.scuffgeo --TransFile TwoSpheres.trans
 % gmsh GoldSpheres_339.transformed.pp
  

File containing scuff-cas3d command-line arguments:
GoldSpheres.args
geometry    GoldSpheres_339.scuffgeo
transFile   TwoSpheres.trans
energy
zforce
  
Run scuff-cas3d:
 % scuff-cas3D < GoldSpheres.args
  

This produces the file GoldSpheres_339.out. Plotting the 2nd and 4th data columns vs. the 1st data column of this file yields plots of energy and z-directed force vs. separation:

Data plot produced by gnuplot



Casimir forces and torques between cubical and toroidal nanoparticles


The files for this example may be found in the share/scuff-em/examples/CubeTorus directory within your scuff-em installation. The procedure for running this calculation is discussed in more detail here.

gmsh geometry file for cube: Cube.geo
gmsh geometry file for torus: Torus.geo
scuff-em geometry file for cube-torus geometry: CubeTorus.scuffgeo
MATERIAL TEFLON
    cIR = 0.239;
    cUV = 0.665;
    wIR = 2.356e14;
    wUV = 0.518e16;
    Eps(w) = 1 + cIR/(1-(w/wIR)^2) + cUV/(1-(w/wUV)^2);
ENDMATERIAL

MATERIAL ETHANOL
    cIR = 23.84;
    cUV = 0.852;
    wIR = 6.6e14;
    wUV = 1.14e16;
    Eps(w) = 1 + cIR/(1-(w/wIR)^2) + cUV/(1-(w/wUV)^2);
ENDMATERIAL

MATERIAL SILICON
    epsf = 1.035;
    eps0 = 11.87;
    wp = 6.6e15;
    Eps(w) = epsf + (eps0-epsf)/(1-(w/wp)^2);
ENDMATERIAL

OBJECT UpperCube
 	MESHFILE Cube.msh 
	MATERIAL Teflon
ENDOBJECT

OBJECT LowerTorus
	MESHFILE Torus.msh 
	MATERIAL Silicon
ENDOBJECT

MEDIUM 
	MATERIAL Ethanol
ENDMEDIUM 
  
File describing a list of scuff-em geometric transformations: CubeTorus.trans
TRANS 0 
TRANS 1    OBJECT UpperCube DISP 0 0 1.0
TRANS 1.5R OBJECT UpperCube ROT 45 ABOUT 0 1 0 ROT 45 ABOUT 0 0 1 DISP 0 0 1.5
  
Run scuff-analyze to visualize the two-sphere geometry and the list of transformations as interpreted by scuff-em:
 % scuff-analyze --geometry CubeTorus.scuffgeo --TransFile CubeTorus.trans
 % gmsh CubeTorus.transformed.pp
  

File containing scuff-cas3d command-line arguments:
CubeTorus.args
geometry    CubeTorus.scuffgeo
transFile   CubeTorus.trans
zforce
torque 0 1 0
  
Run scuff-cas3d:
 % scuff-cas3D < CubeTorus.args
  

This produces the file CubeTorus.out:

  



Casimir-Polder potential for a rubidium atom near a corrugated sapphire disc


The files for this example may be found in the share/scuff-em/examples/CorrugatedDisc directory within your scuff-em installation. See here for a more in-depth discussion of this example.

gmsh geometry file: CorrugatedDisc.geo
gmsh mesh image
scuff-em geometry file: CorrugatedDisc_2634.scuffgeo
MATERIAL Sapphire

 A1  = 1.5039759;
 A2  = 0.55069141;
 A3  = 6.5927379;
 
 w12 = 1.64221251416675e+31;
 w22 = 6.08131608351107e+30;
 w32 = 2.23383186132738e+26;

 Eps(w) = 1 + A1/(1-w*w/w12) + A2/(1-w*w/w22) + A3/(1-w*w/w32);

ENDMATERIAL 

OBJECT TheDisc
	MESHFILE CorrugatedDisc_2634.msh
	MATERIAL Sapphire
ENDOBJECT

  
File specifying coordinates of potential evaluation points in real space: EPFile3
-5.00 0.0 1.0
-4.60 0.0 1.0
...
 4.60 0.0 1.0
 5.00 0.0 1.0
-5.00 0.0 3.0
-4.60 0.0 3.0
...
 4.60 0.0 3.0
 5.00 0.0 3.0
  
Run scuff-caspol to compute the Casimir-Polder potential at the specified list of evaluation points:
 % scuff-caspol --geometry CorrugatedDisc_2634.scuffgeo --atom Rubidium --EPFile EPFile3
  

This produces a file named CorrugatedDisc_2634.out, which contains a legend at the top explaining which column is which. In particular, plotting the 4th vs. the 1st column gives the Casimir-Polder potential as a function of the lateral distance across the disc at two different heights, as shown below. [This data plot also includes results for a flat (non-corrugated) sapphire disc of the same radius and thickness.]

Data plot produced by gnuplot



Plane-wave transmission through a perforated perfectly conducting screen


This example calculates the frequency-dependent transmission of a plane wave through a perfectly conducting metallic screen perforated by a square lattice of circular holes. The calculation reproduces Figure 6 of this paper:

The files for this example may be found in the share/scuff-em/examples/PerforatedThinFilm subdirectory of your scuff-em installation. Note that, in the filenames, PFS stands for "perforated screen."

gmsh geometry file for lattice unit cell: PFSUnitCell.geo
scuff-em geometry file: PFS_340.scuffgeo
LATTICE 
	VECTOR 0.75 0
	VECTOR 0    0.75
ENDLATTICE
	

OBJECT UnitCell
	MESHFILE PFSUnitCell_340.msh
	MATERIAL PEC
ENDOBJECT
  
Generate a picture of the lattice unit cell and its nearest-neighbor cell in each direction:
     % scuff-analyze --geometry PFS_340.scuffgeo --WriteGMSHFiles --Neighbors 1
     % gmsh PFS_340.pp
     

List of angular frequencies (in units of c/1μm=3•1014 rad/sec) at which we want to calculate transmission:
OmegaFile.PFS
7.90
7.92
7.94
...
8.34
8.36
8.38
  
File containing scuff-transmission command-line arguments:
PFS_340.args
geometry  PFS_340.scuffgeo
OmegaFile OmegaFile.PFS
ZAbove     5.0
ZBelow    -5.0
  
Run scuff-transmission:
 % scuff-transmission< PFS_340.args
  

This produces the file PFS_430.transmission. Plotting the 3rd vs the 1st data column of this file yields plots of transmission (the squared modulus of the transmission coefficient) versus frequency. (Plotting the 3rd column vs. 2π over the 1st column yields plots of transmission vs. wavelength in microns.)

Data plot

 gnuplot> plot 'PFS_340.transmission' u (2*pi/(0.75*$1)):3 w lp pt 7 ps 1.5
  

(This plot is actually plotting data for two different scuff-transmission runs, one for the N=340 mesh discussed above and another for a finer mesh with N=1491 interior edges.)



[an error occurred while processing this directive]



[an error occurred while processing this directive]



[an error occurred while processing this directive]






scuff-em
Examples
Installation
Core Library
Applications
Reference

A Compendium of scuff-EM Examples, by Homer Reid
Last Modified: 11/16/16