\section{Bin\-Envelope\-Constraint  Class Reference}
\label{class_BinEnvelopeConstraint}\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
{\tt \#include $<$bin\_\-envelope\_\-constraint.h$>$}

Inheritance diagram for Bin\-Envelope\-Constraint\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=70pt]{class_BinEnvelopeConstraint_inherit_graph}
\end{center}
\end{figure}
Collaboration diagram for Bin\-Envelope\-Constraint:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=331pt]{class_BinEnvelopeConstraint_coll_graph}
\end{center}
\end{figure}
\subsection*{Public Methods}
\begin{CompactItemize}
\item 
{\bf Bin\-Envelope\-Constraint} ({\bf Constraint\-Manager} \&cm, int atom, {\bf Envelope\-Constraint} $\ast$envelope\_\-in)
\begin{CompactList}\small\item\em Constructor: atom is constraint number for atom, same for envelope.\item\end{CompactList}\item 
{\bf $\sim$Bin\-Envelope\-Constraint} ()
\item 
{\bf j\-Vector} {\bf d\-Stress} (int k, const {\bf j\-Vector} \&pos) const
\begin{CompactList}\small\item\em Returns the (3x1)-- actually a 12x1 vector of derivatives of residual with respect to each dimension atom k at position pos.\item\end{CompactList}\item 
int {\bf Compare} (const Bin\-Envelope\-Constraint \&ec) const
\item 
{\bf MAKECOMPARISONS\_\-WITH\_\-COMPARE} (Bin\-Envelope\-Constraint)
\item 
int {\bf Output} (ostream \&os) const
\item 
int {\bf Output\-Binary} (ostream \&os) const
\end{CompactItemize}
\subsection*{Static Public Attributes}
\begin{CompactItemize}
\item 
{\bf Dyn\-String} {\bf Identifier} = "b\_\-env:"
\end{CompactItemize}
\subsection*{Protected Methods}
\begin{CompactItemize}
\item 
double {\bf compute\-Stress} () const
\begin{CompactList}\small\item\em returns stress on constraint.\item\end{CompactList}\item 
double {\bf compute\-Stress} (int k, const {\bf j\-Vector} \&pos) const
\begin{CompactList}\small\item\em returns stress on constraint if atom k' were in position pos'.\item\end{CompactList}\item 
int {\bf Read} (istream \&is)
\item 
int {\bf Read\-Binary} (istream \&is)
\begin{CompactList}\small\item\em Same scenerio as {\bf Read}() {\rm (p.\,\pageref{class_BinEnvelopeConstraint_b2})} only binary version.\item\end{CompactList}\item 
void {\bf Pre\-Setup} ()
\item 
void {\bf Post\-Setup} ()
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf Envelope\-Constraint}$\ast$ {\bf EC}
\begin{CompactList}\small\item\em passed in -- pointing to the parent envelope constraint.\item\end{CompactList}\item 
int {\bf EC\_\-id}
\item 
int {\bf Atom\_\-id}
\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Envelope\-Constraint}
\end{CompactItemize}


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

{\bf bin\_\-envelope\_\-constraint.h}

This is a constraint type for GRAPE. It constrains the envelope around a molecule. This is the sub-constraint type which is spawned by {\bf Envelope\-Constraint} {\rm (p.\,\pageref{class_EnvelopeConstraint})}.

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



Definition at line 23 of file bin\_\-envelope\_\-constraint.h.

\subsection{Constructor \& Destructor Documentation}
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!BinEnvelopeConstraint@{BinEnvelopeConstraint}}
\index{BinEnvelopeConstraint@{BinEnvelopeConstraint}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Bin\-Envelope\-Constraint::Bin\-Envelope\-Constraint ({\bf Constraint\-Manager} \& {\em cm}, int {\em atom\_\-in}, {\bf Envelope\-Constraint} $\ast$ {\em envelope\_\-in})}\label{class_BinEnvelopeConstraint_a0}


Constructor: atom is constraint number for atom, same for envelope.



Definition at line 5 of file bin\_\-envelope\_\-constraint.C.\footnotesize\begin{verbatim}00007   : Constraint(cm, IntVec(1,atom_in))  // supported by 1 atom
00008 {
00009 
00010   EC = envelope_in; 
00011   EC_id = EC->ID();
00012   Atom_id = atom_in;
00013   
00014 \end{verbatim}\normalsize 
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!~BinEnvelopeConstraint@{$\sim$BinEnvelopeConstraint}}
\index{~BinEnvelopeConstraint@{$\sim$BinEnvelopeConstraint}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Bin\-Envelope\-Constraint::$\sim$Bin\-Envelope\-Constraint ()}\label{class_BinEnvelopeConstraint_a1}




Definition at line 16 of file bin\_\-envelope\_\-constraint.C.\footnotesize\begin{verbatim}00016                                              {
00017 
00018 \end{verbatim}\normalsize 


\subsection{Member Function Documentation}
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!Compare@{Compare}}
\index{Compare@{Compare}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Bin\-Envelope\-Constraint::Compare (const Bin\-Envelope\-Constraint \& {\em ec}) const\hspace{0.3cm}{\tt  [inline]}}\label{class_BinEnvelopeConstraint_a3}




Definition at line 70 of file bin\_\-envelope\_\-constraint.h.\footnotesize\begin{verbatim}00071 {
00072   DIE("b_env Compare not Implemented");
00073 
00074   return 0;
00075 \end{verbatim}\normalsize 
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!MAKECOMPARISONS_WITH_COMPARE@{MAKECOMPARISONS\_\-WITH\_\-COMPARE}}
\index{MAKECOMPARISONS_WITH_COMPARE@{MAKECOMPARISONS\_\-WITH\_\-COMPARE}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Bin\-Envelope\-Constraint::MAKECOMPARISONS\_\-WITH\_\-COMPARE (Bin\-Envelope\-Constraint)}\label{class_BinEnvelopeConstraint_a4}


\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!Output@{Output}}
\index{Output@{Output}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Bin\-Envelope\-Constraint::Output (ostream \& {\em os}) const\hspace{0.3cm}{\tt  [virtual]}}\label{class_BinEnvelopeConstraint_a5}




Reimplemented from {\bf Constraint} {\rm (p.\,\pageref{class_Constraint_a11})}.

Definition at line 124 of file bin\_\-envelope\_\-constraint.C.\footnotesize\begin{verbatim}00125 {
00126   return 1;
00127   
00128 \end{verbatim}\normalsize 
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!OutputBinary@{OutputBinary}}
\index{OutputBinary@{OutputBinary}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Bin\-Envelope\-Constraint::Output\-Binary (ostream \& {\em os}) const\hspace{0.3cm}{\tt  [virtual]}}\label{class_BinEnvelopeConstraint_a6}




Reimplemented from {\bf Constraint} {\rm (p.\,\pageref{class_Constraint_a13})}.

Definition at line 136 of file bin\_\-envelope\_\-constraint.C.\footnotesize\begin{verbatim}00137 {
00138   //  os <= supportA <= measured <= variance;
00139   return 1;
00140 \end{verbatim}\normalsize 
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!PostSetup@{PostSetup}}
\index{PostSetup@{PostSetup}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Bin\-Envelope\-Constraint::Post\-Setup (void)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{class_BinEnvelopeConstraint_b5}


constraints get their ID when added to the constraint graph. this addition is done in the Input function between the pre- and post setup functions. constraint setup that needs to occur with an ID and an added constraint go in post setup. (like adding parent constraints, etc.) 

Reimplemented from {\bf Constraint} {\rm (p.\,\pageref{class_Constraint_b7})}.

Definition at line 32 of file bin\_\-envelope\_\-constraint.C.\footnotesize\begin{verbatim}00032                                       {
00033 
00034 
00035   
00036 \end{verbatim}\normalsize 
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!PreSetup@{PreSetup}}
\index{PreSetup@{PreSetup}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Bin\-Envelope\-Constraint::Pre\-Setup (void)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{class_BinEnvelopeConstraint_b4}


The setup function is called if the uninialized constraint method is used to create the constraint to allow different data representations within the constraint. Without this, only data read in from the input file will be available to the member functions. For simple constraints, this is really not very useful. However for multi-atom constraints that need to be a little 'smarter' about data representations, the Setup function will be helpful. 

Reimplemented from {\bf Constraint} {\rm (p.\,\pageref{class_Constraint_b6})}.

Definition at line 21 of file bin\_\-envelope\_\-constraint.C.\footnotesize\begin{verbatim}00021                                      {
00022   myType = BinEnvelopeConstraint::Identifier; // needs to be done here -- not read in by registry
00023   myIntType = ConstraintRegistry::getIntType(myType);
00024 
00025   addConstraintSupport(EC_id);
00026   // Valid Envelope constraint is a support
00027   // here valid means atoms are rotated correctly
00028     
00029 
00030 \end{verbatim}\normalsize 
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!Read@{Read}}
\index{Read@{Read}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Bin\-Envelope\-Constraint::Read (istream \& {\em is})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{class_BinEnvelopeConstraint_b2}


Derived classes need to define here how to read  themselves in. Notice that the base class defines {\bf Input}() {\rm (p.\,\pageref{class_Constraint_a12})} as a wrapper around this virtual function. Subclasses should typically overwrite just the {\bf Read}() {\rm (p.\,\pageref{class_BinEnvelopeConstraint_b2})} function (and not the {\bf Input}() {\rm (p.\,\pageref{class_Constraint_a12})} function).

In the {\bf Read}() {\rm (p.\,\pageref{class_BinEnvelopeConstraint_b2})} function, the derived class should $\ast$not$\ast$ log itself with the constraint manager since this is taken care of in the base classes {\bf Input}() {\rm (p.\,\pageref{class_Constraint_a12})} function. 

Reimplemented from {\bf Constraint} {\rm (p.\,\pageref{class_Constraint_b4})}.

Definition at line 130 of file bin\_\-envelope\_\-constraint.C.\footnotesize\begin{verbatim}00131 {
00132   // This called on the input stream from envelope_constraint
00133   return 1;
00134 \end{verbatim}\normalsize 
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!ReadBinary@{ReadBinary}}
\index{ReadBinary@{ReadBinary}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Bin\-Envelope\-Constraint::Read\-Binary (istream \& {\em is})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{class_BinEnvelopeConstraint_b3}


Same scenerio as {\bf Read}() {\rm (p.\,\pageref{class_BinEnvelopeConstraint_b2})} only binary version.



Reimplemented from {\bf Constraint} {\rm (p.\,\pageref{class_Constraint_b5})}.

Definition at line 142 of file bin\_\-envelope\_\-constraint.C.\footnotesize\begin{verbatim}00143 {
00144   // This called on the input stream from envelope_constraint
00145   return 1;
00146 \end{verbatim}\normalsize 
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!computeStress@{computeStress}}
\index{computeStress@{computeStress}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Bin\-Envelope\-Constraint::compute\-Stress (int {\em k}, const {\bf j\-Vector} \& {\em pos\_\-k}) const\hspace{0.3cm}{\tt  [protected, virtual]}}\label{class_BinEnvelopeConstraint_b1}


returns stress on constraint if atom k' were in position pos'.



Reimplemented from {\bf Constraint} {\rm (p.\,\pageref{class_Constraint_a27})}.

Definition at line 76 of file bin\_\-envelope\_\-constraint.C.\footnotesize\begin{verbatim}00077 {
00078 
00079   return util_max(0.,(MAX_ENV_DEN-(EC->getDensity(pos_k)))/ENV_DEN_RANGE);  
00080   DIE("");
00081 \end{verbatim}\normalsize 
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!computeStress@{computeStress}}
\index{computeStress@{computeStress}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Bin\-Envelope\-Constraint::compute\-Stress () const\hspace{0.3cm}{\tt  [protected, virtual]}}\label{class_BinEnvelopeConstraint_b0}


returns stress on constraint.



Reimplemented from {\bf Constraint} {\rm (p.\,\pageref{class_Constraint_a26})}.

Definition at line 40 of file bin\_\-envelope\_\-constraint.C.\footnotesize\begin{verbatim}00040                                            {
00041 
00042   double rv = util_max(0.,(MAX_ENV_DEN-(EC->getDensity(getMolecule()(supportA[0]))))/ENV_DEN_RANGE);
00043 //   cerr << "BEC " << myID << ", atom pos = " << getMolecule()(supportA[0]) << endl;
00044 //   cerr << "Calculated BEC stress = " << rv << " atom= " << Atom_id << endl;
00045     
00046 
00047 //   int atom = supportA[0];
00048 //   jVector pos = getMolecule()(atom);
00049 //   double den = EC->getDensity(pos);
00050 //   double diff = MAX_ENV_DEN-den;
00051 //   double scale = diff/ENV_DEN_RANGE;
00052 
00053 
00054 
00055 
00056 
00057   return rv;
00058 
00059   
00063 \end{verbatim}\normalsize 
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!dStress@{dStress}}
\index{dStress@{dStress}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf j\-Vector} Bin\-Envelope\-Constraint::d\-Stress (int {\em k}, const {\bf j\-Vector} \& {\em pos\_\-k}) const\hspace{0.3cm}{\tt  [virtual]}}\label{class_BinEnvelopeConstraint_a2}


Returns the (3x1)-- actually a 12x1 vector of derivatives of residual with respect to each dimension atom k at position pos.



Reimplemented from {\bf Constraint} {\rm (p.\,\pageref{class_Constraint_a6})}.

Definition at line 84 of file bin\_\-envelope\_\-constraint.C.\footnotesize\begin{verbatim}00085 {
00086    
00087 
00088   if(k != supportA[0])
00089     // trying to act on atom other than the one this constraint applies to
00090     {
00091       cerr << "Fatal error: bin_envelope_constraint.C, dStress("<< k \
00092            <<", pos) not legal " << endl;
00093       exit(1);
00094     }
00095 \end{verbatim}\normalsize 


\subsection{Friends And Related Function Documentation}
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!EnvelopeConstraint@{EnvelopeConstraint}}
\index{EnvelopeConstraint@{EnvelopeConstraint}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}class Envelope\-Constraint\hspace{0.3cm}{\tt  [friend]}}\label{class_BinEnvelopeConstraint_l0}




Definition at line 25 of file bin\_\-envelope\_\-constraint.h.

\subsection{Member Data Documentation}
\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!Atom_id@{Atom\_\-id}}
\index{Atom_id@{Atom\_\-id}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Bin\-Envelope\-Constraint::Atom\_\-id\hspace{0.3cm}{\tt  [protected]}}\label{class_BinEnvelopeConstraint_n2}




Definition at line 50 of file bin\_\-envelope\_\-constraint.h.\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!EC@{EC}}
\index{EC@{EC}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Envelope\-Constraint} $\ast$ Bin\-Envelope\-Constraint::EC\hspace{0.3cm}{\tt  [protected]}}\label{class_BinEnvelopeConstraint_n0}


passed in -- pointing to the parent envelope constraint.



Definition at line 48 of file bin\_\-envelope\_\-constraint.h.\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!EC_id@{EC\_\-id}}
\index{EC_id@{EC\_\-id}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Bin\-Envelope\-Constraint::EC\_\-id\hspace{0.3cm}{\tt  [protected]}}\label{class_BinEnvelopeConstraint_n1}




Definition at line 49 of file bin\_\-envelope\_\-constraint.h.\index{BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}!Identifier@{Identifier}}
\index{Identifier@{Identifier}!BinEnvelopeConstraint@{Bin\-Envelope\-Constraint}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Dyn\-String} Bin\-Envelope\-Constraint::Identifier = "b\_\-env:"\hspace{0.3cm}{\tt  [static]}}\label{class_BinEnvelopeConstraint_p0}




Reimplemented from {\bf Constraint} {\rm (p.\,\pageref{class_Constraint_p0})}.

Definition at line 112 of file globals.C.

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