\section{Atom\-Buildup  Class Reference}
\label{class_AtomBuildup}\index{AtomBuildup@{Atom\-Buildup}}
{\tt \#include $<$atom\_\-buildup.h$>$}

Inheritance diagram for Atom\-Buildup\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=56pt]{class_AtomBuildup_inherit_graph}
\end{center}
\end{figure}
Collaboration diagram for Atom\-Buildup:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=347pt]{class_AtomBuildup_coll_graph}
\end{center}
\end{figure}
\subsection*{Public Methods}
\begin{CompactItemize}
\item 
{\bf Atom\-Buildup} (const Atom\-Buildup \&ca)
\item 
{\bf Atom\-Buildup} ({\bf Constraint\-Manager} \&{\bf CM})
\item 
{\bf $\sim$Atom\-Buildup} ()
\item 
int {\bf run} ()
\end{CompactItemize}
\subsection*{Static Public Attributes}
\begin{CompactItemize}
\item 
int {\bf Max\-Iterations} = 50
\item 
int {\bf Max\-Final\-Iterations} = 1000
\end{CompactItemize}
\subsection*{Private Attributes}
\begin{CompactItemize}
\item 
int {\bf Iteration\-Number}
\end{CompactItemize}


\subsection{Detailed Description}
//////////////////////////////////////////////////////////

File: {\bf atom\_\-buildup.h}

Created by: Jon Dugan

Atom\-Buildup job. iterates over all atoms based on error

////////////////////////////////////////////////////////// 



Definition at line 28 of file atom\_\-buildup.h.

\subsection{Constructor \& Destructor Documentation}
\index{AtomBuildup@{Atom\-Buildup}!AtomBuildup@{AtomBuildup}}
\index{AtomBuildup@{AtomBuildup}!AtomBuildup@{Atom\-Buildup}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Atom\-Buildup::Atom\-Buildup (const Atom\-Buildup \& {\em ca})}\label{class_AtomBuildup_a0}




Definition at line 3 of file atom\_\-buildup.C.\footnotesize\begin{verbatim}00004   : SatisfyMolecule(*(ca.CM))
00005 {
00006   DIE("AtomBuildup copy constructor called. ");
00007 \end{verbatim}\normalsize 
\index{AtomBuildup@{Atom\-Buildup}!AtomBuildup@{AtomBuildup}}
\index{AtomBuildup@{AtomBuildup}!AtomBuildup@{Atom\-Buildup}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Atom\-Buildup::Atom\-Buildup ({\bf Constraint\-Manager} \& {\em cm})}\label{class_AtomBuildup_a1}




Definition at line 10 of file atom\_\-buildup.C.\footnotesize\begin{verbatim}00011   : SatisfyMolecule(cm)
00012 {
00013 
00014 \end{verbatim}\normalsize 
\index{AtomBuildup@{Atom\-Buildup}!~AtomBuildup@{$\sim$AtomBuildup}}
\index{~AtomBuildup@{$\sim$AtomBuildup}!AtomBuildup@{Atom\-Buildup}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Atom\-Buildup::$\sim$Atom\-Buildup ()}\label{class_AtomBuildup_a2}




Definition at line 16 of file atom\_\-buildup.C.\footnotesize\begin{verbatim}00017   { 
00018     // Don't delete my children (since Process takes care of it).
00019     // i.e. dont do for(int i=0; i<numChildren; ++i) delete
00020     // Children[i].  or delete[] Children.
00021 
00022     // NB in THIS class I am not adding my children to the queue for
00023     // the parent class, Procss'  As a result, the children need to be
00024     // explicitly deleted. 
00025 
00026     delete Children[0];
00027     delete Children[1];
00028     //    delete Children[2];
00029     delete Children[3];
00030     // Normally a job would NOT do this --
00031     // ~Process would do it, but I am not adding these to the queue
00032 \end{verbatim}\normalsize 


\subsection{Member Function Documentation}
\index{AtomBuildup@{Atom\-Buildup}!run@{run}}
\index{run@{run}!AtomBuildup@{Atom\-Buildup}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Atom\-Buildup::run ()\hspace{0.3cm}{\tt  [virtual]}}\label{class_AtomBuildup_a3}


Execute this process. Returns the exit status of the process (0 is success, non-zero is error). 

Reimplemented from {\bf Process} {\rm (p.\,\pageref{class_Process_a1})}.

Definition at line 34 of file atom\_\-buildup.C.\footnotesize\begin{verbatim}00034                      {
00035 
00036 #ifdef JOB_VERBOSE
00037   cerr << "Start: \tAtom Buildup::run()" << endl;
00038 #endif
00039 
00040   //CM->PrintGraph(cout);
00041   
00042   int StopFlag = 0;
00043   int iteration = 0;
00044   int curr_atom = 0;
00045   
00046   Children = new Process*[4];
00047   
00048   Children[0] = new CycleAll(*CM);
00049   Children[1] = new AnimFrame(*CM, AnimFN);
00050   //  Children[2] = new StopEval(*CM, BaseFN);
00051   Children[3] = new RelaxSubset(*CM, .4);
00052 
00053   StopEval * SE = new StopEval(*CM);
00054 
00055   jVector JVdelta;
00056 
00057   JVdelta[0] = 0.5;
00058   JVdelta[1] = 1.0;
00059   JVdelta[2] = 1.5;
00060 
00061   jVector JVzero3(3,0);
00062 
00063   jVector away(3,200);
00064   for ( int i = 0;i<CM->numAtoms();i++){
00065     CM->setPosition(i, away); // move them out of the way
00066   }
00067   CM->TurnAtomsOff();
00068   CM->TurnEnvelopeOn();
00069 
00070   CM->TurnAtomOn(0);
00071   CM->setPosition(0, JVzero3); // put 0 at origin
00072   
00073   curr_atom = 1;
00074   CM->TurnAtomOn(curr_atom);
00075   CM->setPosition(curr_atom, CM->getPosition(curr_atom-1)+JVdelta);
00076 
00077   while (curr_atom<(CM->numAtoms()-1)) {
00078 
00079 #ifdef JOB_VERBOSE
00080     cerr << "Info: \t\t\t\tAtom Buildup added atom " << curr_atom+1 << endl;
00081 #endif
00082 
00083     iteration = StopFlag = 0;
00084     while (!StopFlag && iteration < MaxIterations){
00085 
00086 #ifdef JOB_VERBOSE
00087     cerr << "Value: \tAtom Buildup iteration =" << iteration << endl;
00088 #endif
00089     
00090     // CYCLE and RELAX
00091     StopFlag = Children[0]->run();
00092 
00093     
00094       //Children[3]->run();
00095       //Children[3]->run();
00096 
00097 
00098       // EVALUATE STOP CONDITION
00099 //     if ((StopFlag = (StopFlag && SE->check_errors(1e-7, 1e-6)))){  // FIX TO BE PARAMS
00100 //      
00101 // #ifdef JOB_VERBOSE2
00102 //      cerr << "Value: \tAtom Buildup stopping on  SE->check_errors " << iteration << endl;
00103 // #endif
00104 // 
00105 //       }
00106       iteration++;
00107     
00108     }
00109 
00110     curr_atom++;
00111     CM->TurnAtomOn(curr_atom);
00112     CM->setPosition(curr_atom, CM->getPosition(curr_atom-1)+JVdelta); // put 0 at origin
00113 
00114     // WRITE ANIMATION FRAME         
00115     Children[1]->run();
00116 
00117 
00118   }
00119 
00120   //  do final cycle
00121   //  CM->TurnAtomOn(curr_atom);
00122   //  CM->setPosition(curr_atom,  CM->getPosition(curr_atom-1)+JVdelta); // put 0 at origin
00123 
00124   iteration = StopFlag = 0;
00125   while (!StopFlag && iteration < MaxFinalIterations){  
00126     Children[0]->run();
00127        //    StopFlag = (SE->check_stress_max_tot(1e-6, 1e-4)) || (Children[2]->run());
00128     StopFlag = SE->check_stress_max_tot(1e-6, 1e-4);
00129     SE->check_low_error(gwNumerics::MaxAbsDistRes, gwNumerics::AveAbsDistRes);
00130 
00131     Children[1]->run();
00132     iteration++;
00133     //       cerr << iteration << " ";
00134   }
00135 \end{verbatim}\normalsize 


\subsection{Member Data Documentation}
\index{AtomBuildup@{Atom\-Buildup}!IterationNumber@{IterationNumber}}
\index{IterationNumber@{IterationNumber}!AtomBuildup@{Atom\-Buildup}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Atom\-Buildup::Iteration\-Number\hspace{0.3cm}{\tt  [private]}}\label{class_AtomBuildup_o0}




Definition at line 46 of file atom\_\-buildup.h.\index{AtomBuildup@{Atom\-Buildup}!MaxFinalIterations@{MaxFinalIterations}}
\index{MaxFinalIterations@{MaxFinalIterations}!AtomBuildup@{Atom\-Buildup}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Atom\-Buildup::Max\-Final\-Iterations = 1000\hspace{0.3cm}{\tt  [static]}}\label{class_AtomBuildup_p1}




Definition at line 57 of file globals.C.\index{AtomBuildup@{Atom\-Buildup}!MaxIterations@{MaxIterations}}
\index{MaxIterations@{MaxIterations}!AtomBuildup@{Atom\-Buildup}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Atom\-Buildup::Max\-Iterations = 50\hspace{0.3cm}{\tt  [static]}}\label{class_AtomBuildup_p0}




Definition at line 56 of file globals.C.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
{\bf atom\_\-buildup.h}\item 
{\bf atom\_\-buildup.C}\item 
{\bf globals.C}\end{CompactItemize}
