

A Compendium of scuffem Examples

Here's a collection of example calculations carried out
using scuffem.
This is intended solely as an illustration of the capabilities
of the scuffem suite, and
is not intended to serve as documentation for
the various commandline 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 scuffem
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
scuffanalyze mesh Geometry.msh ),
and then use something like Geometry_345.scuffgeo
as the filename for the
scuffem geometry file
that uses this mesh file. In many of the
scuffem example directories
you will two or more .msh and .scuffgeo
files describing the same geometry meshed with different
levels of fineness.



The files for this example may be found in the
share/scuffem/examples/SolidSphere directory
within your scuffem installation.
gmsh geometry file: 
Sphere.geo 
scuffem 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 scuffanalyze
to visualize the geometry as interpreted
by scuffem:

% scuffanalyze geometry SiCSphere.scuffgeo WriteGMSHFiles
% gmsh SiCSphere.gmsh

File containing scuffscatter commandline arguments:

geometry SiCSphere.scuffgeo
cache Sphere.scuffcache
PFTFile SiCSphere.PFT
OmegaFile OmegaList
pwDirection 0 0 1
pwPolarization 1 0 0

Run scuffscatter:

% scuffscatter < 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 

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 nonflipped
chiral particles. The flipping is done by means of a
ROTATED statement in the .scuffgeo
file.
gmsh geometry file: 
ChiralParticle.geo 
scuffem geometry file for
twoparticle 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 scuffanalyze
to visualize the twoparticle geometry as interpreted
by scuffem:

% scuffanalyze geometry TwoChiralParticles_R5_1392.scuffgeo WriteGMSHFiles
% gmsh TwoChiralParticles_R5_1392.pp

File containing scuffscatter commandline 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 scuffscatter:

% scuffscatter < TwoChiralParticles.args
This produces the file
TwoChiralParticles_R5_1392.PFT. Plotting the 10th
vs the 1st data column of this file yields plots of
zdirected torque vs. frequency.

Data plot 

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
multimaterial 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 
scuffem 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 scuffscatter commandline arguments:
BiHemisphere.args

geometry BiHemisphere.scuffgeo
pwDirection 0 0 1
pwPolarization 1 0 0
omega 1.0
EPFile BiHemisphere.EPFile

Run scuffscatter:

% scuffscatter < 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) xcomponent 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 

Calculations similar to these were among those published
here
and
here.
The files for this example may be found in the
share/scuffem/examples/TwoSpheres directory
within your scuffem installation.
gmsh geometry file: 
Sphere.geo 
scuffem geometry file for
twosphere 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
scuffem
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 scuffanalyze
to visualize the twosphere geometry and the list of
transformations as interpreted
by scuffem:

% scuffanalyze geometry GoldSpheres_339.scuffgeo TransFile TwoSpheres.trans
% gmsh GoldSpheres_339.transformed.pp

File containing scuffcas3d commandline arguments:
GoldSpheres.args

geometry GoldSpheres_339.scuffgeo
transFile TwoSpheres.trans
energy
zforce

Run scuffcas3d:

% scuffcas3D < 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 zdirected force vs. separation:

Data plot produced by
gnuplot


The files for this example may be found in the
share/scuffem/examples/CubeTorus directory
within your scuffem 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 
scuffem geometry file for
cubetorus 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 + (eps0epsf)/(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
scuffem
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 scuffanalyze
to visualize the twosphere geometry and the list of
transformations as interpreted
by scuffem:

% scuffanalyze geometry CubeTorus.scuffgeo TransFile CubeTorus.trans
% gmsh CubeTorus.transformed.pp

File containing scuffcas3d commandline arguments:
CubeTorus.args

geometry CubeTorus.scuffgeo
transFile CubeTorus.trans
zforce
torque 0 1 0

Run scuffcas3d:

% scuffcas3D < CubeTorus.args
This produces the file
CubeTorus.out:

The files for this example may be found in the
share/scuffem/examples/CorrugatedDisc directory
within your scuffem installation.
See
here
for a more indepth discussion of this example.
gmsh geometry file: 
CorrugatedDisc.geo 
gmsh mesh image 

scuffem 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/(1w*w/w12) + A2/(1w*w/w22) + A3/(1w*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 scuffcaspol
to compute the CasimirPolder potential at the specified
list of evaluation points:

% scuffcaspol 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 CasimirPolder 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 (noncorrugated)
sapphire disc of the same radius and thickness.]

Data plot produced by
gnuplot


This example calculates the frequencydependent 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/scuffem/examples/PerforatedThinFilm subdirectory
of your scuffem installation.
Note that, in the filenames, PFS stands for
"perforated screen."
gmsh geometry file for lattice unit cell:

PFSUnitCell.geo 
scuffem 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
nearestneighbor cell in each direction:

% scuffanalyze geometry PFS_340.scuffgeo WriteGMSHFiles Neighbors 1
% gmsh PFS_340.pp

List of angular frequencies (in units of
c/1μm=3•10^{14} 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 scufftransmission commandline arguments:
PFS_340.args

geometry PFS_340.scuffgeo
OmegaFile OmegaFile.PFS
ZAbove 5.0
ZBelow 5.0

Run scufftransmission:

% scufftransmission< 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
scufftransmission 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]
