\section{Relax\-Subset  Class Reference}
\label{class_RelaxSubset}\index{RelaxSubset@{Relax\-Subset}}
{\tt \#include $<$jd\_\-relax\_\-subset.h$>$}

Inheritance diagram for Relax\-Subset\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=56pt]{class_RelaxSubset_inherit_graph}
\end{center}
\end{figure}
Collaboration diagram for Relax\-Subset:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=347pt]{class_RelaxSubset_coll_graph}
\end{center}
\end{figure}
\subsection*{Public Methods}
\begin{CompactItemize}
\item 
{\bf Relax\-Subset} (const Relax\-Subset \&ca)
\item 
{\bf Relax\-Subset} ({\bf Constraint\-Manager} \&{\bf CM}, double in\_\-fraction=0.5)
\item 
{\bf $\sim$Relax\-Subset} ()
\item 
int {\bf run} ()
\item 
void {\bf set\-Fraction} (double F)
\begin{CompactList}\small\item\em set the fraction of worst atoms \{0..1\} to be affected.\item\end{CompactList}\end{CompactItemize}
\subsection*{Private Attributes}
\begin{CompactItemize}
\item 
int {\bf Num\-To\-Relax}
\begin{CompactList}\small\item\em == (int) (number of atoms)$\ast$(fraction to relax).\item\end{CompactList}\item 
double$\ast$ {\bf Priority\-List}
\item 
double {\bf Fraction}
\begin{CompactList}\small\item\em Fraction' defines the number of worst atoms \{0..1\} to be affected.\item\end{CompactList}\end{CompactItemize}


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

File: {\bf jd\_\-relax\_\-subset.h}

This is a 'job' that works in the GRAPE system. It relaxes a subset of the molecule's atoms.

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



Definition at line 21 of file jd\_\-relax\_\-subset.h.

\subsection{Constructor \& Destructor Documentation}
\index{RelaxSubset@{Relax\-Subset}!RelaxSubset@{RelaxSubset}}
\index{RelaxSubset@{RelaxSubset}!RelaxSubset@{Relax\-Subset}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Relax\-Subset::Relax\-Subset (const Relax\-Subset \& {\em ca})}\label{class_RelaxSubset_a0}




Definition at line 3 of file jd\_\-relax\_\-subset.C.\footnotesize\begin{verbatim}00004   : SatisfyMolecule(*(ca.CM))
00005 {
00006   // FIX THIS...  I don't know what goes here.  -jd
00007   DIE("relax subset copt constructor called ");
00008 \end{verbatim}\normalsize 
\index{RelaxSubset@{Relax\-Subset}!RelaxSubset@{RelaxSubset}}
\index{RelaxSubset@{RelaxSubset}!RelaxSubset@{Relax\-Subset}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Relax\-Subset::Relax\-Subset ({\bf Constraint\-Manager} \& {\em cm\_\-in}, double {\em Fraction\_\-in} = 0.5)}\label{class_RelaxSubset_a1}


It is assumed that fraction is between 0 and 1. The behavior of Relax\-Subset when passed a double $>$= 1 will be to call a Relax\-Atom job on all of the atoms in the molecule. If the constructor recieves a negative double, nothing is done to the molecule, and a error message is written to Standard Error. 

Definition at line 11 of file jd\_\-relax\_\-subset.C.\footnotesize\begin{verbatim}00012   : SatisfyMolecule(cm_in)
00013   {
00014 
00015     Fraction = Fraction_in;
00016 
00017     // Create one child process for each atom in the list. Later only
00018     // the 'fraction' of these atoms will be queued to run.
00019     numC = CM->numAtoms();
00020     
00021     Children = new Process*[numC];
00022 
00023     PriorityList = new double [numC];
00024     
00025     // Create a new relaxation process for every atom in the molecule:
00026     for(int i=0; i<numC; ++i)
00027       Children[i] = new gwRelaxAtom(*CM,i);
00028 \end{verbatim}\normalsize 
\index{RelaxSubset@{Relax\-Subset}!~RelaxSubset@{$\sim$RelaxSubset}}
\index{~RelaxSubset@{$\sim$RelaxSubset}!RelaxSubset@{Relax\-Subset}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Relax\-Subset::$\sim$Relax\-Subset ()}\label{class_RelaxSubset_a2}




Definition at line 30 of file jd\_\-relax\_\-subset.C.\footnotesize\begin{verbatim}00031   { 
00032     // Don't delete my children (since Process takes care of it).
00033     // i.e. dont do for(int i=0; i<numChildren; ++i) delete Children[i].
00034     // or delete[] Children.
00035 
00036     //    CM_ptr=0;
00037     delete [] PriorityList;
00038 \end{verbatim}\normalsize 


\subsection{Member Function Documentation}
\index{RelaxSubset@{Relax\-Subset}!run@{run}}
\index{run@{run}!RelaxSubset@{Relax\-Subset}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Relax\-Subset::run (void)\hspace{0.3cm}{\tt  [virtual]}}\label{class_RelaxSubset_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 40 of file jd\_\-relax\_\-subset.C.\footnotesize\begin{verbatim}00041   {
00042 #ifdef JOB_VERBOSE
00043     cerr << "Start: \tRelaxSubset::run()"<<endl;
00044 #endif
00045 
00046     // DEBUG
00047     if (Fraction < 0 || Fraction > 1) {
00048       cerr << "tried to call RelaxSubset on a fraction = " << Fraction << endl;
00049       return (-1);
00050     }
00051 
00052     NumToRelax = (int) (Fraction * numC );
00053     
00054     // Compute the priorities of the children, based on their
00055     // residuals
00056     for(int i=0; i<numC; ++i)
00057       {
00058         double tempPriority = CM->stress(i);
00059 
00060         Children[i]->setPriority(tempPriority);
00061         PriorityList[i] = tempPriority;
00062 
00063 #ifdef JOB_VERBOSE3     
00064         cerr << "Set:   \t" << "Priority for atom " <<i<<"="<< tempPriority << endl;
00065 #endif
00066       }
00067 
00068     //double Cutoff = LinearSelect(PriorityList, NumToRelax, numC);
00069     
00070     // Queue children to run queue
00071     for(int i=0; i<numC; ++i)
00072       {
00073         //if (Children[i]->getPriority() > Cutoff) addChild(Children[i]);
00074         addChild(Children[i]); // add em all
00075       }
00076 
00077     // now do the queue!
00078     for(int i=0; i<NumToRelax; ++i){
00079       runNextChild();
00080     }
00081 \end{verbatim}\normalsize 
\index{RelaxSubset@{Relax\-Subset}!setFraction@{setFraction}}
\index{setFraction@{setFraction}!RelaxSubset@{Relax\-Subset}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Relax\-Subset::set\-Fraction (double {\em F})\hspace{0.3cm}{\tt  [inline]}}\label{class_RelaxSubset_a4}


set the fraction of worst atoms \{0..1\} to be affected.



Definition at line 40 of file jd\_\-relax\_\-subset.h.\footnotesize\begin{verbatim}00040                             {Fraction = F;}
00041 \end{verbatim}\normalsize 


\subsection{Member Data Documentation}
\index{RelaxSubset@{Relax\-Subset}!Fraction@{Fraction}}
\index{Fraction@{Fraction}!RelaxSubset@{Relax\-Subset}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Relax\-Subset::Fraction\hspace{0.3cm}{\tt  [private]}}\label{class_RelaxSubset_o2}


Fraction' defines the number of worst atoms \{0..1\} to be affected.



Definition at line 52 of file jd\_\-relax\_\-subset.h.\index{RelaxSubset@{Relax\-Subset}!NumToRelax@{NumToRelax}}
\index{NumToRelax@{NumToRelax}!RelaxSubset@{Relax\-Subset}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Relax\-Subset::Num\-To\-Relax\hspace{0.3cm}{\tt  [private]}}\label{class_RelaxSubset_o0}


== (int) (number of atoms)$\ast$(fraction to relax).



Definition at line 48 of file jd\_\-relax\_\-subset.h.\index{RelaxSubset@{Relax\-Subset}!PriorityList@{PriorityList}}
\index{PriorityList@{PriorityList}!RelaxSubset@{Relax\-Subset}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double $\ast$ Relax\-Subset::Priority\-List\hspace{0.3cm}{\tt  [private]}}\label{class_RelaxSubset_o1}




Definition at line 49 of file jd\_\-relax\_\-subset.h.

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