
% Setup for letter paper with SAND report spacings and margins
\setlength{\textwidth}{6in}
\setlength{\oddsidemargin}{0.5in}
\setlength{\evensidemargin}{0.0in}
\setlength{\marginparwidth}{1.0in}
\addtolength{\marginparwidth}{-\marginparsep}
\setlength{\textheight}{9in}
\addtolength{\textheight}{-\footskip}
\addtolength{\textheight}{-\headheight}
\addtolength{\textheight}{-\headsep}
\setlength{\topmargin}{0.0in}
\setlength{\parskip}{2ex}

\newcommand{\makearticle}{
  \date{}
  \maketitle
}

\newcommand{\CoverFont}[3]{
    \fontencoding{OT1}
    \fontfamily{phv}
    \fontseries{#1}
    \fontshape{n}
    \fontsize{#2}{#3}
    \selectfont
}

\newcommand{\SANDreleaseval}{Unlimited Release}
\newcommand{\SANDrelease}[1]{\renewcommand{\SANDreleaseval}{#1}}

\newcommand{\SANDsupersedVar}{\\}
\newcommand{\SANDsupersedBox}{}
\newlength{\adjustsupersed}
\setlength{\adjustsupersed}{1.0in}
\newcommand{\SANDsupersed}[2]{
    \renewcommand{\SANDsupersedVar}{
        \vspace{0.125in}\\
        Supersedes #1 \\
        dated #2
    }
    \renewcommand{\SANDsupersedBox}{
      \mbox{\begin{tabular}{c}
              Supersedes #1 \\
              dated #2
            \end{tabular}}
    }
    \setlength{\adjustsupersed}{1.5in}
}

\newcommand{\makeSANDreport}[3]{

    % Some measurements to format the title page properly
    \newlength{\textwidththird}
    \newlength{\topheight}
    \newlength{\topleftwidth}
    \newlength{\topmiddlewidth}
    \newlength{\toprightwidth}
    \setlength{\textwidththird}{2in}
    \addtolength{\textwidththird}{-\fboxsep}
    \addtolength{\textwidththird}{-\fboxsep}
    \setlength{\topleftwidth}{\the\textwidththird}
    \setlength{\topmiddlewidth}{\the\textwidththird}
    \setlength{\toprightwidth}{\the\textwidththird}
    \addtolength{\topleftwidth}{-3em}
    \addtolength{\topmiddlewidth}{+4em}
    \addtolength{\toprightwidth}{-3em}

    % We want a blank line between paragraphs
    \setlength{\parskip}{2ex}

    {
        \pagestyle{empty}
        \newlength{\coverindent}
        \setlength{\coverindent}{1em}
        \setlength{\parindent}{0em}


        %
        % Front Cover
        %
        \addtolength{\headheight}{-0.625in}
        \hspace*{-0.5in}
        \begin{minipage}[t]{6.0in}
        {
        \CoverFont{b}{18}{20pt}
        SAND REPORT
        \vspace{0.125in}\\
        \CoverFont{m}{12}{14pt}
        #1\\
        \SANDreleaseval\\
        Printed #2
        \SANDsupersedVar

        \vspace{0.25in}
        \CoverFont{b}{24}{28pt}
        \parbox[t]{\textwidth}{
            \raggedright
            \thetitle
        }


        \vspace{0.75in}
        \CoverFont{m}{12}{14pt}
        #3

        \vspace{0.25in}
        \CoverFont{m}{8}{10pt}
        \selectfont
        Prepared by\\
        Sandia National Laboratories\\
        Albuquerque, New Mexico 87185 and Livermore, California 94550\\
        \\
        Sandia is a multiprogram laboratory operated by Sandia Corporation,\\
        a Lockheed Martin Company, for the United States Department of Energy's\\
        National Nuclear Security Administration under Contract DE-AC04-94-AL85000.\\
        \\
        Approved for public release; further dissemination unlimited.\\

        \includegraphics{figures/snllineblk}
        }
        \end{minipage}

        %
        % Back cover
        %
        \newpage
        \hspace{1.0in}
        \begin{minipage}[t]{5.0in}
            \fontencoding{OT1}
            \fontfamily{pnc}
            \fontseries{m}
            \fontshape{n}
            \fontsize{9}{11pt}
            \selectfont

            Issued by Sandia National Laboratories, operated for the
            United States Department of Energy by Sandia Corporation.
            \vspace{\baselineskip}

            {\fontsize{11}{13pt}\fontseries{b}\selectfont NOTICE:}
            This report was prepared
            as an account of work sponsored by an agency of
            the United States Government. Neither the United
            States Government, nor any agency thereof, nor any
            of their employees, nor any of their contractors,
            subcontractors, or their employees, make any warranty,
            express or implied, or assume any legal liability or
            responsibility for the accuracy, completeness, or
            usefulness of any information, apparatus, product,
            or process disclosed, or represent that its use
            would not infringe privately owned rights. Reference
            herein to any specific commercial product, process,
            or service by trade name, trademark, manufacturer, or
            otherwise, does not necessarily constitute or imply
            its endorsement, recommendation, or favoring by the
            United States Government, any agency thereof, or any
            of their contractors or subcontractors. The views and
            opinions expressed herein do not necessarily state
            or reflect those of the United States Government,
            any agency thereof, or any of their contractors.
            \vspace{\baselineskip}

            Printed in the United States of America. This report has
            been reproduced directly from the best available copy.
            \vspace{\baselineskip}

            Available to DOE and DOE contractors from\\
            \begin{tabular}{ll}
                \hspace*{\coverindent} & U.S. Department of Energy \\
                & Office of Scientific and Technical Information \\
                & P.O. Box 62 \\
                & Oak Ridge, TN 37831 \\
                &  \\
            \end{tabular}
            \\
            \begin{tabular}{lll}
                \hspace*{\coverindent} & Telephone: & (865) 576-8401\\
                & Facsimile: & (865) 576-5728\\
                & E-Mail: &         reports@adonis.osti.gov\\
                & Online ordering: & http://www.doe.gov/bridge\\
            \end{tabular}
            \vspace{\baselineskip}
            \vspace{0.25in}

            Available to the public from\\
            \begin{tabular}{ll}
                \hspace*{\coverindent} & U.S. Department of Commerce \\
                & National Technical Information Service \\
                & 5285 Port Royal Rd \\
                & Springfield, VA 22161 \\
                &  \\
            \end{tabular}
            \\
            \begin{tabular}{lll}
                \hspace*{\coverindent} & Telephone: & (800) 553-6847 \\
                & Facsimile: & (703) 605-6900 \\
                & E-Mail: & orders@ntis.fedworld.gov \\
                & Online ordering: & http://www.ntis.gov/help/ordermethods.asp?loc=7-4-0\#online \\
            \end{tabular}
            \vspace{\baselineskip}
            \vspace{0.125in}

            \includegraphics[width=0.75in]{figures/DOEbwlogo}
        \end{minipage}
        \newpage
        \addtolength{\headheight}{0.5in}
    }

  \date{}
  \newpage
  \begin{center}
      #1\\
      \SANDreleaseval\\
      Printed #2\\
      \bigskip
      \SANDsupersedBox
  \end{center}
  \bigskip

  \begin{center}
      \let \footnote \thanks
      {\LARGE \bf \thetitle\par}
      \vskip 1.5em
      {\large
          \lineskip .5em%
          \begin{tabular}[t]{c}
          \theauthor
          \end{tabular}\par
      }
  \end{center}
  \par
  \vskip 1.5em
}

\newcommand{\SANDdistInternal}[4]{
  \item[#1] MS \makebox[6ex][r]{#2}\\
    \mbox{}
    \hspace{1em} \parbox[t]{2.0in}{#3, \mbox{#4}}
}

\newcommand{\SANDdistExternal}[2]{
    \item[#1] \parbox[t]{2.1in}{#2}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%vectors
\newcommand{\E}{\overrightarrow {E}}
\newcommand{\B}{\bf{B}}
\newcommand{\Jb}{\overrightarrow {J}}
\newcommand{\A}{\overrightarrow {A}}
\newcommand{\jv}{\overrightarrow {j}}
\newcommand{\vv}{\overrightarrow {v}}

%vector operators
\newcommand{\del}{\nabla}
\newcommand{\lap}{\nabla^2}
\newcommand{\deld}{\del \cdot}
\newcommand{\curl}{\del \times}
\newcommand{\vxB}{\vv \times \B}

%partial derivatives
\newcommand{\dBdt}{\frac{\partial{\B}}{\partial{t}} }
\newcommand{\dBdx}{\frac{\partial{\B}}{\partial{x}} }
\newcommand{\dEdt}{\frac{\partial{\E}}{\partial{t}} }

%Equations
\newcommand{\beq}{\begin{equation}}
\newcommand{\eeq}{\end{equation}}
\newcommand{\beqn}{\begin{eqnarray*}}
\newcommand{\eeqn}{\end{eqnarray*}\beq \eeq }

\def \la{\langle}
\def \ra{\rangle}
\def \lp{\left(}
\def \rp{\right)}
\def \lb{\left[}
\def \rb{\right]}
\def \lc{\left\{}
\def \rc{\right\}}
\def \om{\omega}
\def \oom{\frac{1}{\omega}}
\def \ha{\frac{1}{2}}
\def \sA{{\bf A}}
\def \su{{\bf u}}
\def \sb{{\bf b}}
\def \sr{{\bf r}}
\def \pD{D^{(\pi)}}
\def \pC{C^{(\pi)}}
\def \pL{C_L^{(\pi)}}
\def \pU{C_U^{(\pi)}}

\def\bI{{\bf I}}
\def\bJ{{\bf J}}
\def\bA{{\bf A}}
\def\bE{{\bf E}}
\def\bD{{\bf D}}
\def\bB{{\bf B}}
\def\bH{{\bf H}}
\def\bS{{\bf S}}
\def\bT{{\bf T}}
\def\bv{{\bf v}}
\def\bx{{\bf x}}
\def\be{{\bf e}}
\def\ba{{\bf a}}
\def\Bf{{\bf f}}
\def\bg{{\bf g}}


\newcommand{\hf}{\frac{1}{2}}
%\newcommand{\ip1}{i+1}
%\newcommand{\im1}{i-1}
%\newcommand{\jp1}{j+1}
%\newcommand{\jm1}{j-1}

\newcommand{\HRule}{\rule{\linewidth}{1mm}}
\renewcommand{\theequation}{\thesection.\arabic{equation}}


% The altdescription environment is a modification of the description
% environment used to define math nomenclature, acronyms, etc.  Use
%    \begin{altdescription}{longest item}
%      \item{short item} blah blah
%      \item{longest item} blah blah
%    \end{altdescription}
% The argument is typically the longest typeset item value.  This environment
% takes an optional argument which is a length value. It adds length to the
% distance from the item values to their descirptions, such as 5em or 10pt.
%
\newenvironment{altdescription}[2][0pt]
  {\begin{list}{}%
    {\renewcommand\makelabel[1]{##1\hfil}%
     \settowidth\labelwidth{\makelabel{#2}}%
     \addtolength\labelwidth{#1}%
     \setlength\leftmargin{\labelwidth}%
     \addtolength\leftmargin{\labelsep}%
     \setlength\itemsep{-\parsep}}}%
  {\end{list}}


% The twocolumntable command is mainly used to hide the differences between
% the commands that produce nice output in PDF/DVI and in HTML.  Usage:
%   \twocolumntable{This is the caption text.\label{tablabel}}{
%     % put tabular environment here
%   }
% The first argument is the caption text, which should include the label.
% The second argument is the contents of the table.  An optional argument
% allows the column specification to be passed into the "tabularx"
% environment, which defaults to "|l|l|X|".
%
\latexhtml{
\newcommand{\twocolumntable}[3][|l|X|]%
  % use the column specifiers (if given) for PDF and DVI output
  {\begin{table}[ht]%
        \centering%
        \caption{#2}%
        \bigskip%
   \begin{tabularx}{\linewidth}{#1} #3 \end{tabularx}\end{table}}
}{
\newcommand{\twocolumntable}[3][|l|X|]%
  % do not use the column specifiers for latex2html output
  {\begin{table}[ht]%
        \begin{makeimage}\end{makeimage}%
        \centering%
        \caption{#2}%
        \bigskip%
   \begin{tabularx}{\linewidth}{|l|X|} #3 \end{tabularx}\end{table}}
}


% The threecolumntable command is mainly used to hide the differences between
% the commands that produce nice output in PDF/DVI and in HTML.  Usage:
%   \threecolumntable{This is the caption text.\label{tablabel}}{
%     % put tabular environment here
%   }
% The first argument is the caption text, which should include the label.
% The second argument is the contents of the table.  An optional argument
% allows the column specification to be passed into the "tabularx"
% environment, which defaults to "|l|l|X|".
%
\latexhtml{
\newcommand{\threecolumntable}[3][|l|l|X|]%
  % use the column specifiers (if given) for PDF and DVI output
  {\begin{table}[ht]%
        \centering%
        \caption{#2}%
        \bigskip%
   \begin{tabularx}{\linewidth}{#1} #3 \end{tabularx}\end{table}}
}{
\newcommand{\threecolumntable}[3][|l|l|X|]%
  % do not use the column specifiers for latex2html output
  {\begin{table}[ht]%
        \begin{makeimage}\end{makeimage}%
        \centering%
        \caption{#2}%
        \bigskip%
   \begin{tabularx}{\linewidth}{|l|l|X|} #3 \end{tabularx}\end{table}}
}

\latexhtml{
\newcommand{\mthreecolumntable}[3][|X|l|X|]%
  % use the column specifiers (if given) for PDF and DVI output
  {\begin{table}[ht]%
        \centering%
        \caption{#2}%
        \bigskip%
   \begin{tabularx}{\linewidth}{#1} #3 \end{tabularx}\end{table}}
}{
\newcommand{\mthreecolumntable}[3][|X|l|X|]%
  % do not use the column specifiers for latex2html output
  {\begin{table}[ht]%
        \begin{makeimage}\end{makeimage}%
        \centering%
        \caption{#2}%
        \bigskip%
   \begin{tabularx}{\linewidth}{|l|l|X|} #3 \end{tabularx}\end{table}}
}


% The fourcolumntable command is mainly used to hide the differences between
% the commands that produce nice output in PDF/DVI and in HTML.  Usage:
%   \fourcolumntable{This is the caption text.\label{tablabel}}{
%     % put tabular environment here
%   }
% The first argument is the caption text, which should include the label.
% The second argument is the contents of the table.  An optional argument
% allows the column specification to be passed into the "tabularx"
% environment, which defaults to "|l|l|l|X|".
%
\latexhtml{
\newcommand{\fourcolumntable}[3][|l|l|l|X|]%
  % use the column specifiers (if given) for PDF and DVI output
  {\begin{table}[ht]%
        \centering%
        \caption{#2}%
        \bigskip%
   \begin{tabularx}{\linewidth}{#1} #3 \end{tabularx}\end{table}}
}{
\newcommand{\fourcolumntable}[3][|l|l|l|X|]%
  % do not use the column specifiers for latex2html output
  {\begin{table}[ht]%
        \begin{makeimage}\end{makeimage}%
        \centering%
        \caption{#2}%
        \bigskip%
   \begin{tabularx}{\linewidth}{|l|l|l|X|} #3 \end{tabularx}\end{table}}
}


% The twocolumnlongtable command is mainly used to hide the differences
% between the commands that produce nice output in PDF/DVI and in HTML.  Usage:
%   \twocolumnlongtable{This is the caption text.\label{mytablelabel}}{
%     % tabular environment here
%   }
% The first argument is the caption text, which should include the label.
% The second argument is the contents of the table.  An optional argument
% allows the column specification to be passed into the "longtable"
% environment, which defaults to "|l|l|".
%
\latexhtml{
  % use longtable for PDF and DVI output
  \newcommand{\twocolumnlongtable}[3][|l|l|]%
 {\begin{longtable}{#1}%
     \caption{#2}%
  \endfirsthead%
     \hline%
     \multicolumn{2}{|l|}{\small\slshape continued from previous page} \\ \hline%
  \endhead%
     \multicolumn{2}{|r|}{\small\slshape continued on next page} \\ \hline%
  \endfoot%
     \hline%
  \endlastfoot%
  #3 %
  \end{longtable} }
}{
  % use table with tabularx for latex2html output
  \newcommand{\twocolumnlongtable}[3][|l|X|]%
 {\begin{table}[ht]%
    \begin{makeimage}  \end{makeimage}%
    \caption{#2}%
  \begin{tabularx}{\linewidth}{|l|X|}%
    \centering%
  #3 %
  \end{tabularx}\end{table} }
}


% The threecolumnlongtable command is mainly used to hide the differences
% between the commands that produce nice output in PDF/DVI and in HTML.  Usage:
%   \threecolumnlongtable{This is the caption text.\label{mytablelabel}}{
%     % tabular environment here
%   }
% The first argument is the caption text, which should include the label.
% The second argument is the contents of the table.  An optional argument
% allows the column specification to be passed into the "longtable"
% environment, which defaults to "|l|l|l|".
%
\latexhtml{
  % use longtable for PDF and DVI output
  \newcommand{\threecolumnlongtable}[3][|l|l|l|]%
 {\begin{longtable}{#1}%
     \caption{#2}%
  \endfirsthead%
     \hline%
     \multicolumn{3}{|l|}{\small\slshape continued from previous page} \\ \hline%
  \endhead%
     \multicolumn{3}{|r|}{\small\slshape continued on next page} \\ \hline%
  \endfoot%
     \hline%
  \endlastfoot%
  #3 %
  \end{longtable} }
}{
  % use table with tabularx for latex2html output
  \newcommand{\threecolumnlongtable}[3][|l|l|X|]%
 {\begin{table}[ht]%
    \begin{makeimage}  \end{makeimage}%
    \caption{#2}%
  \begin{tabularx}{\linewidth}{|l|l|X|}%
    \centering%
  #3 %
  \end{tabularx}\end{table} }
}


% The fourcolumnlongtable command is mainly used to hide the differences
% between the commands that produce nice output in PDF/DVI and in HTML.  Usage:
%   \fourcolumnlongtable{This is the caption text.\label{mytablelabel}}{
%     % tabular environment here
%   }
% The first argument is the caption text, which should include the label.
% The second argument is the contents of the table.  An optional argument
% allows the column specification to be passed into the "longtable"
% environment, which defaults to "|l|l|l|l|".
%
\latexhtml{
  % use longtable for PDF and DVI output
  \newcommand{\fourcolumnlongtable}[3][|l|l|l|l|]%
 {\begin{longtable}{#1}%
     \caption{#2}%
  \endfirsthead%
     \hline%
     \multicolumn{4}{|l|}{\small\slshape continued from previous page} \\ \hline%
  \endhead%
     \multicolumn{4}{|r|}{\small\slshape continued on next page} \\ \hline%
  \endfoot%
     \hline%
  \endlastfoot%
  #3 %
  \end{longtable} }
}{
  % use table with tabularx for latex2html output
  \newcommand{\fourcolumnlongtable}[3][|l|l|l|X|]%
 {\begin{table}[ht]%
    \begin{makeimage}  \end{makeimage}%
    \caption{#2}%
  \begin{tabularx}{\linewidth}{|l|l|l|X|}%
    \centering%
  #3 %
  \end{tabularx}\end{table} }
}
