\section{jd\-Err\_\-Eval  Class Reference}
\label{class_jdErr_Eval}\index{jdErr_Eval@{jd\-Err\_\-Eval}}
{\tt \#include $<$jd\_\-err\_\-eval.h$>$}

Inheritance diagram for jd\-Err\_\-Eval\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=56pt]{class_jdErr_Eval_inherit_graph}
\end{center}
\end{figure}
Collaboration diagram for jd\-Err\_\-Eval:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=373pt]{class_jdErr_Eval_coll_graph}
\end{center}
\end{figure}
\subsection*{Public Methods}
\begin{CompactItemize}
\item 
{\bf jd\-Err\_\-Eval} ({\bf Constraint\-Manager} \&{\bf CM}, ifstream $\ast$in\-Stream, int skip\_\-in)
\item 
{\bf $\sim$jd\-Err\_\-Eval} ()
\item 
int {\bf run} ()
\end{CompactItemize}
\subsection*{Public Attributes}
\begin{CompactItemize}
\item 
int {\bf skip}
\item 
{\bf Dyn\-String} {\bf Base\-FN}
\end{CompactItemize}
\subsection*{Private Attributes}
\begin{CompactItemize}
\item 
ifstream$\ast$ {\bf mol\_\-file}
\end{CompactItemize}


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

File: {\bf jd\_\-err\_\-eval.h}

Created by: Jon Dugan

jd\-Err\_\-Eval job.

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



Definition at line 25 of file jd\_\-err\_\-eval.h.

\subsection{Constructor \& Destructor Documentation}
\index{jdErr_Eval@{jd\-Err\_\-Eval}!jdErr_Eval@{jdErr\_\-Eval}}
\index{jdErr_Eval@{jdErr\_\-Eval}!jdErr_Eval@{jd\-Err\_\-Eval}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}jd\-Err\_\-Eval::jd\-Err\_\-Eval ({\bf Constraint\-Manager} \& {\em cm}, ifstream $\ast$ {\em in\-Stream}, int {\em skip\_\-in} = 1)}\label{class_jdErr_Eval_a0}




Definition at line 3 of file jd\_\-err\_\-eval.C.\footnotesize\begin{verbatim}00004   : SatisfyMolecule(cm)
00005 {
00006   mol_file = inStream; 
00007   skip =skip_in;
00008   if (skip < 1)
00009     DIE ("invalid slip number, use int > 0");
00010 \end{verbatim}\normalsize 
\index{jdErr_Eval@{jd\-Err\_\-Eval}!~jdErr_Eval@{$\sim$jdErr\_\-Eval}}
\index{~jdErr_Eval@{$\sim$jdErr\_\-Eval}!jdErr_Eval@{jd\-Err\_\-Eval}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}jd\-Err\_\-Eval::$\sim$jd\-Err\_\-Eval ()}\label{class_jdErr_Eval_a1}




Definition at line 12 of file jd\_\-err\_\-eval.C.\footnotesize\begin{verbatim}00013   {
00014 \end{verbatim}\normalsize 


\subsection{Member Function Documentation}
\index{jdErr_Eval@{jd\-Err\_\-Eval}!run@{run}}
\index{run@{run}!jdErr_Eval@{jd\-Err\_\-Eval}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int jd\-Err\_\-Eval::run ()\hspace{0.3cm}{\tt  [virtual]}}\label{class_jdErr_Eval_a2}


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 16 of file jd\_\-err\_\-eval.C.

Referenced by main().\footnotesize\begin{verbatim}00016                     {
00017 
00018   DynString FN = "err_out.xmol";
00019   AnimFrame::Enabled =true;
00020   AnimFrame *Out = new AnimFrame(*CM, FN);  
00021   jVector E;
00022   
00023 #ifdef JOB_VERBOSE
00024   cerr << "Start: \tErr_Eval::run()" << endl;
00025 #endif
00026 
00027 
00028   int a1 = 0;
00029   int a2 = 0;
00030   int num = CM->numAtoms();
00031   double d;
00032   double msd;
00033   int numerr = 0;
00034   
00035   cerr << "Checking msd: " ;
00036   
00037   for (a1 = 0;a1<num;a1++){
00038     for (a2 = a1+1;a2<num;a2++){
00039       d = euclid (CM->getPosition(a1),CM->getPosition(a2));
00040       msd = CM->getMolecule().MSD(a1, a2);
00041       if ( d < msd && ((d-msd)/msd > 1e-3)){
00042         numerr ++;
00043         cerr << endl << endl  << "atom1 = " << a1 << " "<< CM->getAtom(a1).Label() <<endl
00044              << "atom2 = " << a2 << " " << CM->getAtom(a2).Label() <<endl
00045              << "bonded = " << CM->getAtom(a1).Bonded(a2) << endl
00046              << "d = " << d <<endl
00047              << "msd = " << msd;
00048       }
00049     }
00050   }
00051   if (numerr)
00052     cerr << endl << "Found " << numerr << " error(s) with msd" << endl;
00053   else 
00054     cerr << "ok" << endl << endl;
00055 
00056   if (CM->numConstraints() == 0){
00057     return 0;}
00058   
00059   int  i = 0;
00060   cerr << "Collecting constraint data..." << endl;
00061   E =  CM->getStressList();
00062   //  cerr << E << endl;
00063   cerr << i << " Total Error: " << E.sum() << endl;
00064   cerr << i << " Max   Error: " << E.max() << endl;
00065 
00066 //   for (int i=0;i<CM->numAtoms();i++){
00067 //     if (E[i] > 0.1){
00068 //       cerr << CM->getAtom(i).Label() << " " << CM->getPosition(i) << " "
00069 //         << E[i] << " " << CM->getEnvelope()->getGradient(CM->getPosition(i)) << endl;
00070 //     }
00071 //   }
00072   
00073   cerr << "======================================================================" << endl;
00074 
00075   mol_file->ipfx(); // gobbles whitespace & sets flags for good()
00076 
00077   cerr << "Writing xmol frame to " << FN << endl;
00078   Out->run();
00079   
00080   while (mol_file->good()){
00081     i++;
00082 
00083     //    M->writeXmol(cerr);
00084     //    CM->InvalidateAtoms();
00085 
00086     if (i%skip == 0){
00087       CM->readNewMoleculeXmol(*mol_file);
00088       CM->InvalidateEnvelope();
00089       E =  CM->getStressList();
00090       cerr << i << " Error: " << E.sum() << endl
00091            << "======================================================================" << endl;
00092       
00093       Out->run();
00094     } else {
00095       //CM->readNewMoleculeXmol(*mol_file);
00096       Molecule::skipXmol(*mol_file);
00097     }
00098       mol_file->ipfx();
00099 
00100   }
00101 
00102   delete Out;
00103 
00104 
00105   if (EnvelopeConstraint * E_ptr = CM->getEnvelope()){
00106     DynString F;
00107     char * s;
00108     ofstream * os;
00109     F = "err_out.iv";
00110     s = &(F[0]);  // ACK  not good, but it doesn't leak. -jd
00111     os = new ofstream (s);
00112     E_ptr->WriteVRML_OrigData(*os);
00113     delete os;
00114     cerr << "Wrote envelope data in inventor format to: " << F << endl;
00115     
00116     F = "err_out.csx";
00117     s = &(F[0]);  // ACK  not good, but it doesn't leak. -jd
00118     os = new ofstream (s);
00119     E_ptr->E[0]->WriteAvsTxt(*os);
00120     delete os;
00121     cerr << "Wrote envelope as constraint to: " << F << endl;
00122   }
00123 \end{verbatim}\normalsize 


\subsection{Member Data Documentation}
\index{jdErr_Eval@{jd\-Err\_\-Eval}!BaseFN@{BaseFN}}
\index{BaseFN@{BaseFN}!jdErr_Eval@{jd\-Err\_\-Eval}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Dyn\-String} jd\-Err\_\-Eval::Base\-FN}\label{class_jdErr_Eval_m1}




Reimplemented from {\bf Satisfy\-Molecule} {\rm (p.\,\pageref{class_SatisfyMolecule_p0})}.

Definition at line 34 of file jd\_\-err\_\-eval.h.\index{jdErr_Eval@{jd\-Err\_\-Eval}!mol_file@{mol\_\-file}}
\index{mol_file@{mol\_\-file}!jdErr_Eval@{jd\-Err\_\-Eval}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ifstream $\ast$ jd\-Err\_\-Eval::mol\_\-file\hspace{0.3cm}{\tt  [private]}}\label{class_jdErr_Eval_o0}




Definition at line 39 of file jd\_\-err\_\-eval.h.\index{jdErr_Eval@{jd\-Err\_\-Eval}!skip@{skip}}
\index{skip@{skip}!jdErr_Eval@{jd\-Err\_\-Eval}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int jd\-Err\_\-Eval::skip}\label{class_jdErr_Eval_m0}




Definition at line 32 of file jd\_\-err\_\-eval.h.

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