\documentclass[12pt]{beamer}
\input{BEAMERoptions.tex}

% ----- Packages and libraries ----- %
\usepackage[T1]{fontenc} 				% cut/paste and search with "_"
\usepackage[english]{babel}
\usepackage{graphics}
\usepackage{verbatim}
\usepackage{times}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{subfigure}
\usepackage{amssymb}
\usepackage{amsmath, amsfonts}
\usepackage{amsthm}
\usepackage{color}
\usepackage{alltt}
\usepackage{anyfontsize}
\usepackage{tikz}
   \usetikzlibrary{shapes, arrows, shadows}

\newcommand{\Frametitle}[1]{\frametitle{\includegraphics[width=0.25in]{esp_logo.png}
      \hspace{0.05in} #1}}

\newcommand{\FrameTitle}[1]{\frametitle{\includegraphics[width=0.3in]{caps_logo.png}
      \hspace{0.05in} #1}}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]

%============================
% command to repeate a ~ n-times
%============================
\newcount\myloopcounter

\newcommand{\spaces}[1][10]{%
  \myloopcounter0% initialize the loop counter
  \loop\ifnum\myloopcounter < #1 % Test if the loop counter is < #1
  ~%
  \advance\myloopcounter by 1 %
  \repeat % start again
}
%============================

% ----- Presentation information ----- %
\title[AIM Utility Functions \& Tessellations]{
\includegraphics[width=1.0in]{caps_logo.png}\\
Computational Aircraft Prototype Syntheses\\
AIM Programming \\
Utility Functions \& Tessellations\\[0.02in]
For {\tt ESP} Rev 1.28}

\author[Haimes]{
Bob Haimes \\
  {\footnotesize \textcolor{blue}{bob@geocentrictech.com}~~or~~\textcolor{blue}{haimes@mit.edu} \\[-0.03in]
    Geocentric Technologies LLC}
}

\date[July 2025]{}

% ----- Document follows ----- %

\begin{document}

\begin{frame}
  \titlepage
\end{frame}


\begin{frame}

 \center
 {\LARGE AIM Helper Functions}

 \vspace{0.4in}
   \begin{itemize}
  \item provides useful functions for the AIM programmer
  \item gives access to CAPS Object data
  \item note that all function names begin with {\tt aim\_}
  \item if any of these functions are used, then the library must be included (libaimUtil.a/aimUtil.lib) in the AIM so/DLL build
  \end{itemize}

\end{frame}

\begin{frame}
  \FrameTitle{AIM Utility Library}

\vspace{-0.075in}  
  \begin{block}{Get CAPS revision}
{\scriptsize

{\tt
\textcolor{magenta}{void} aim\_capsRev(\textcolor{magenta}{int} *major, \textcolor{magenta}{int} *minor})

\begin{description}
\item[major] the returned major revision
\item[minor] the returned minor revision number
\end{description}}
\end{block}

\vspace{-0.075in}
  \begin{block}{Create Dynamic Output Value Object}
{\scriptsize

{\tt
icode = aim\_makeDynamicOutput(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *dynObjName, \\
\hspace{1.92in} \textcolor{blue}{capsValue} *value)}

\begin{description}
\item[aimInfo] the AIM context
\item[dynObjName] the Name to give the Dynamic Output Object\\
                     must be unique for Dynamic Objects in this AIM instance
\item[value]  the value structure used to create  the Dynamic Value Object\\
                     the contents are copied into the capsAnalysis structure
                     therefore any pointers in \textcolor{espred}{value} become ``owned'' by {\tt CAPS}
\item[icode] integer return code
\end{description}
\vspace{-0.02in}
Notes:\\
\begin{enumerate}
\item In {\it exercises/session08} see {\tt myAIM.c} for a simple programming example 
\item This function can only be called from within {\tt aimPostAnalysis}
\item When a Dynamic Output Object is requested (in pyCAPS) this marks the AIM as {\it dirty}
\end{enumerate}
}
\end{block}

\footnotesize


\end{frame}


 \begin{frame}
  \FrameTitle{AIM Utility Library -- Path handling}
   
 \vspace{-0.085in} 
  \begin{block}{{\tt CAPS} Directory Structure}
  \vspace{0.025in}
 {\footnotesize
  At the top specified directory level you will find {\it phase} subdirectories\\[0.05in]
  
  In each {\it phase} subdirectory you may see:
  \begin{itemize}
  \scriptsize
  \vspace{-0.05in}
  \item capsRestart.cpc -- a CSM saved state file -- or --\\
    capsRestart.egads -- an {\tt EGADS} file (for nonparametric runs)
    \vspace{-0.05in}
    \item capsRestart -- subdirectory that contains the {\tt CAPS} restart data
    \vspace{-0.05in}
  \item capsClosed -- the {\it phase} has been closed
   ({\tt caps\_close} has been called marking completion)
     \vspace{-0.05in}
  \item capsLock -- an indication that another application is executing in this subdirectory
       \vspace{-0.05in}
  \item AIMnames -- subdirectories each related to an AIM instance in the running {\tt CAPS} Problem/Phase
  \end{itemize}

 \vspace{-0.075in}  
 Notes:
\begin{itemize}
 \scriptsize
  \vspace{-0.05in}
\item {\it Scratch} phase (no name specified) is not as protected as the others
  \vspace{-0.05in}
\item {\tt CAPS} Problem directory or individual {\it phase} subdirectories can be copied and used elsewhere
\end{itemize}

\vspace{-0.12in}
\scriptsize
   \center
\begin{tikzpicture}
        \draw (0.0,0.8) node {Problem Directory};
        	\draw[o-,semithick] (0,0.5) -- ( 3,0.5);
	\draw[semithick]     (0,0.5) -- (-3,0.5);
	\draw[semithick]     (-2,0.1) -- (-2,0.5);
	\draw[semithick]     (-2.1,0.0) --  (-3.5,0.0);
	\draw[o-,semithick] (-2.1,0.0) --  (-0.5,0.0);
        \draw[semithick]     ( 2,0.1) -- ( 2,0.5);
	\draw[semithick]     ( 2.1,0.0) --  ( 3.5,0.0);
	\draw[o-,semithick] ( 2.1,0.0) --  ( 0.5,0.0);
	\draw (4.25,0.0) node {Phases};

        \draw[semithick]     (-0.75,0.0) -- (-0.75,-0.3);
        \draw[semithick]     (-1.5,0.0) -- (-1.5,-0.3);
         \draw[semithick]    (-2.5,0.0) -- (-2.5,-0.3);
         \draw[semithick]    (-3.25,0.0) -- (-3.25,-0.3);
         
        \draw[semithick]     ( 0.75,0.0) -- ( 0.75,-0.3);
        \draw[semithick]     ( 1.5,0.0) -- ( 1.5,-0.3);
         \draw[semithick]    ( 2.5,0.0) -- ( 2.5,-0.3);
         \draw[semithick]    ( 3.25,0.0) -- ( 3.25,-0.3);
         
         \draw[semithick]     (-0.75,-0.6) -- (-0.75,-0.8);
         \draw[semithick]    (-1.5,-0.6) -- (-1.5,-0.8);
         \draw[semithick]    (-2.5,-0.6) -- (-2.5,-0.8);
         \draw[semithick]    (-3.25,-0.6) -- (-3.25,-0.8);  
         
         \tiny
         \draw (-3.25,-0.45) node {AIM1};
         \draw (-2.5,-0.45) node {AIM2};
          \draw (-1.5,-0.45) node {...};
         \draw (-0.75,-0.45) node {capsRestart};

\end{tikzpicture}

  }
  
  \end{block}
\end{frame}

 \begin{frame}
  \FrameTitle{AIM Utility Library -- Path handling}

\begin{block}{Get Problem root}
{\scriptsize

{\tt
icode = aim\_getRootPath(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} **fullPath)}

\begin{description}
\item[aimInfo] the AIM context
\item[fullPath] the file path to find the root of the Problem/Phase directory structure\\
if on Windows it will contain the drive
\item[icode] integer return code
\end{description}}
\scriptsize
Note: All other uses of {\it path} is relative to this point.
\end{block}

\begin{block}{Get absolute file name in Problem/Phase/Instance directory}
{\scriptsize

{\tt
icode = aim\_file(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *rPath, \textcolor{magenta}{char} *aPath)}

\begin{description}
\item[aimInfo] the AIM context
\item[rPath] a path filename relative to the Problem/Phase/Instance directory structure
\item[aPath] returned absolute path filename in the Problem/Phase/Instance directory structure (length {\tt PATH\_MAX})
\item[icode] integer return code
\end{description}}
\end{block}
\end{frame}


\begin{frame}
  \FrameTitle{AIM Utility Library -- Path handling}

\begin{block}{Relative path file open}
{\scriptsize

{\tt
FILE *fp = aim\_fopen(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *rPath, \\
\spaces[21]\textcolor{magenta}{const char} *mode)}

\begin{description}
\item[aimInfo] the AIM context
\item[rPath] the relative path filename in the Problem/Phase/Instance directory structure
\item[mode] specifies the mode used for the file open
\item[fp] the returned {\tt FILE} pointer
\end{description}}
\end{block}

\begin{block}{Create relative path directory}
{\scriptsize

{\tt
icode = aim\_mkDir(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *rPath)}

\begin{description}
\item[aimInfo] the AIM context
\item[rPath] the relative path directory in the Problem/Phase/Instance directory structure
\item[icode] integer return code
\end{description}}
\end{block}

\end{frame}


\begin{frame}
  \FrameTitle{AIM Utility Library -- Path handling}

\vspace{-0.05in}
\begin{block}{Execute a command in the AIMs path}
{\scriptsize

{\tt
icode = aim\_system(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *rpath, \textcolor{magenta}{const char} *cmd)}

\begin{description}
\item[aimInfo] the AIM context
\vspace{-0.025in}
\item[rpath] the relative path from the Analysis' directory or \textcolor{magenta}{NULL} (in the Analysis path)
\vspace{-0.025in}
\item[cmd] the command to execute in a shell
\vspace{-0.025in}
\item[icode] integer return code
\end{description}}
\end{block}

\vspace{-0.05in}
\begin{block}{Check if relative path file exists}
{\scriptsize

{\tt
icode = aim\_isFile(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *rPath)}

\begin{description}
\item[aimInfo] the AIM context
\vspace{-0.025in}
\item[rPath] the relative path filename in the Problem/Phase/Instance directory structure
\vspace{-0.025in}
\item[icode] CAPS\_SUCCESS if the file exists, CAPS\_NOTFOUND otherwise
\end{description}}
\end{block}

\vspace{-0.05in}
\begin{block}{Check if relative path directory exists}
{\scriptsize

{\tt
icode = aim\_isDir(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *rPath)}

\begin{description}
\item[aimInfo] the AIM context
\vspace{-0.025in}
\item[rPath] the relative path filename in the Problem/Phase/Instance directory structure
\vspace{-0.025in}
\item[icode] CAPS\_SUCCESS if the directory exists, CAPS\_NOTFOUND otherwise
\end{description}}
\end{block}

\end{frame}

\begin{frame}
  \FrameTitle{AIM Utility Library -- Path handling}

\vspace{-0.075in}
\begin{block}{Copy a file}
{\scriptsize

{\tt
icode = aim\_cpFile(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *src, \textcolor{magenta}{const char} *dst)}

\begin{description}
\item[aimInfo] the AIM context
\item[src] the absolute path filename to copy
\item[dst] the path/filename (may be ``'') in the Problem/Phase/AIM specific directory structure where the file is copied to
\item[icode] integer return code
\end{description}}
\end{block}

\vspace{-0.075in}
\begin{block}{Make a relative symbolic Link}
{\scriptsize

{\tt
icode = aim\_symLink(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *src, \textcolor{magenta}{const char} *dst)}

\begin{description}
\item[aimInfo] the AIM context
\item[src] the absolute path filename to link to
\item[dst] the path/filename (may be ``'' or \textcolor{magenta}{NULL}) in the Problem/Phase/AIM specific directory structure where the relative link is made
\item[icode] integer return code
\end{description}}
\vspace{-0.075in}
\scriptsize
Notes:
\begin{enumerate}
\item On Windows this simply calls {\tt aim\_cpFile}
\item \textcolor{espred}{dst} must not exist
\end{enumerate}
\end{block}

\end{frame}


\begin{frame}
  \FrameTitle{AIM Utility Library -- Path handling}

\begin{block}{Relative path within a Problem/Phase/Instance directory}
{\scriptsize

{\tt
icode = aim\_relPath(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *src, \textcolor{magenta}{const char} *dst, \\
\spaces[20]\textcolor{magenta}{char} *relPath)}

\begin{description}
\item[aimInfo] the AIM context
\item[src] a filename in a Problem/Phase/AIM specific directory
\item[dst] the path/filename (may be ``'') in the Problem/Phase/AIM specific directory structure
\item[relPath] the relative path from \textcolor{espred}{dst} to \textcolor{espred}{src}
\item[icode] integer return code
\end{description}}
\end{block}

\begin{block}{Is this Analysis Directory a Link?}
{\scriptsize

{\tt
icode = aim\_fileLink(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{char} *srcPath)}

\begin{description}
\item[aimInfo] the AIM context
\item[srcPath] the returned full filename of the source directory (length {\tt PATH\_MAX})\\
can be \textcolor{magenta} {NULL} if this information is not required
\item[icode] integer return code\\
CAPS\_NOTFOUND indicates the analysis directory is not a CAPS link
\end{description}}
\end{block}

\end{frame}

\begin{frame}
  \FrameTitle{AIM Utility Library -- Path handling}

\begin{block}{Remove a relative path directory}
{\scriptsize

{\tt
icode = aim\_rmDir(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *rPath)}

\begin{description}
\item[aimInfo] the AIM context
\item[rPath] the relative path directory in the Problem/Phase/AIM directory structure
\item[icode] integer return code
\end{description}
Note: Wildcards * and/or ? may be used in \textcolor{espred}{rPath}}
\end{block}

\begin{block}{Remove a relative path file}
{\scriptsize

{\tt
icode = aim\_rmFile(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *rPath)}

\begin{description}
\item[aimInfo] the AIM context
\item[rPath] the relative path file in the Problem/Phase/AIM directory structure
\item[icode] integer return code
\end{description}
Note: Returns success even if the \textcolor{espred}{rPath} file does not exist}
\end{block}

\end{frame}


\begin{frame}
  \FrameTitle{AIM Utility Library -- Conversions}

\vspace{-0.075in}
 \begin{block}{Name to Index lookup}
{\scriptsize

{\tt
icode = aim\_getIndex(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *name, \\
\hspace{1.33in} \textcolor{magenta}{enum} \textcolor{blue}{capssType} stype)}

\begin{description}

\item[aimInfo] the AIM context
\item[name]  the pointer to the string specifying the name to look-up \\
\textcolor{magenta} {NULL} returns the total number of members in the subtype
\item[stype] GEOMETRYIN,  GEOMETRYOUT, ANALYSISIN, ANALYSISOUT or ANALYSISDYNO
\vspace{-0.015in}
\item[icode] index (1 bias) or negative integer return code
\end{description}}
\end{block}

\vspace{-0.075in}
 \begin{block}{Index to Name lookup}
{\scriptsize

{\tt
icode = aim\_getName(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{int} index, \textcolor{magenta}{enum} \textcolor{blue}{capssType} stype, \\
\hspace{1.26in} \textcolor{magenta}{const char} **name)}

\begin{description}

\item[aimInfo] the AIM context
\item[index] the index to use (1 bias)
\item[stype] GEOMETRYIN, GEOMETRYOUT,  ANALYSISIN, ANALYSISOUT or ANALYSISDYNO
\vspace{-0.015in}
\item[name]  the returned pointer to the string specifying the name
\item[icode] integer return code
\end{description}}
\end{block}

\end{frame}

\begin{frame}
  \FrameTitle{AIM Utility Library}

\vspace{-0.075in}
  \begin{block}{Get GeometryIn Type}
{\scriptsize

{\tt
icode = aim\_getGeomInType(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{int} index)}

\vspace{-0.025in}
\begin{description}

\item[aimInfo] the AIM context
\vspace{-0.03in}
\item[index] the index of GEOMETRYIN (1 bias)
\vspace{-0.03in}
\item[icode] integer return code -- 0 is Design, 1 is Configuration, 2 is Constant
\end{description}}
\end{block}

\vspace{-0.075in}
  \begin{block}{Get Discretization State}
{\scriptsize

{\tt
icode = aim\_getDiscrState(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *bname)}

\vspace{-0.025in}
\begin{description}

\item[aimInfo] the AIM context
\vspace{-0.03in}
\item[bname]  the Bound name
\vspace{-0.03in}
\item[icode] integer return code -- CAPS\_SUCCESS is clean
\end{description}}
\end{block}

\vspace{-0.075in}
  \begin{block}{Get Value Structure}
{\scriptsize

{\tt
icode = aim\_getValue(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{int} index, \textcolor{magenta}{enum} \textcolor{blue}{capssType} stype, \\
\hspace{1.32in} \textcolor{blue}{capsValue} **value)}

\vspace{-0.025in}
\begin{description}

\item[aimInfo] the AIM context
\vspace{-0.03in}
\item[index] the index to use (1 bias)
\vspace{-0.03in}
\item[stype] GEOMETRYIN, GEOMETRYOUT,  ANALYSISIN, ANALYSISOUT or ANALYSISDYNO
\vspace{-0.03in}
\item[value]  the returned pointer to the capsValue structure
%\vspace{-0.03in}
%\item[icode] integer return code
\end{description}}
\end{block}
\end{frame}

\begin{frame}
  \FrameTitle{AIM Utility Library}

  \begin{block}{Initialize Value Structure}
{\scriptsize

{\tt
icode = aim\_initValue(\textcolor{blue}{capsValue} *value)}

\begin{description}
\item[value]  a pointer to the capsValue structure\\
sets the initial state of the structure as if {\tt aimOutput} has been invoked
\item[icode] integer return code
\end{description}}
\end{block}

  \begin{block}{Free Value Structure}
{\scriptsize

{\tt
icode = aim\_freeValue(\textcolor{blue}{capsValue} *value)}

\begin{description}
\item[value]  a pointer to the capsValue structure\\
frees pointers in value and calls aim\_initValue to rest
\item[icode] integer return code
\end{description}}
\end{block}

 \begin{block}{Get AnalysisIn State WRT the Analysis}
 \vspace{-0.025in}
{\scriptsize

{\tt
icode = aim\_newAnalysisIn(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{int} index)}

\begin{description}

\item[aimInfo] the AIM context
\item[index] the index to use (1 bias)
\item[icode] integer return code -- CAPS\_SUCCESS is new (i.e., dirty), CAPS\_CLEAN if not
\end{description}}

\end{block}

\end{frame}

\begin{frame}
  \FrameTitle{AIM Utility Library}

 \begin{block}{Get Geometry State WRT the Analysis}
{\scriptsize

{\tt
icode = aim\_newGeometry(\textcolor{magenta}{void} *aimInfo)}

\vspace{0.025in}
\begin{description}

\item[aimInfo] the AIM context
\item[icode] CAPS\_SUCCESS for new, CAPS\_CLEAN if not regenerated since last here
\end{description}}
\end{block}

 \begin{block}{Get the number of instances in the Analysis}
{\scriptsize

{\tt
icode = aim\_numInstance(\textcolor{magenta}{void} *aimInfo)}

\vspace{0.025in}
\begin{description}

\item[aimInfo] the AIM context
\item[icode] Error code (negative) or the number of instances
\end{description}}
\end{block}

\begin{block}{Get the instance index for the Analysis}
{\scriptsize

{\tt
icode = aim\_getInstance(\textcolor{magenta}{void} *aimInfo)}

\vspace{0.025in}
\begin{description}

\item[aimInfo] the AIM context
\item[icode] Error code (negative) or the Instance index (Bias 0)
\end{description}}
\end{block}


\end{frame}


\begin{frame}
  \FrameTitle{AIM Utility Library}

 \begin{block}{Get Bound Names}
{\scriptsize

{\tt
icode = aim\_getBounds(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{int} *nBname, \textcolor{magenta}{char} ***bnames)}

\begin{description}

\item[aimInfo] the AIM context
\item[nBname] returned number of Bound names
\item[bnames]  returned pointer to list of Bound names (freeable)
\item[icode] integer return code
\end{description}}
\end{block}

 \begin{block}{Clear AIM's directory}
{\scriptsize

{\tt
icode = aim\_clear(\textcolor{magenta}{void} *aimInfo)}

\begin{description}

\item[aimInfo] the AIM context
\item[icode] integer return code
\end{description}}
\end{block}

\end{frame}

\begin{frame}
  \FrameTitle{AIM Utility Library -- Attributes}

  \begin{block}{Get Value Attributes}
{\scriptsize

{\tt
icode = aim\_valueAttrs(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{int} index, \textcolor{magenta}{enum} \textcolor{blue}{capssType} stype, \\
\hspace{1.46in} \textcolor{magenta}{int} *nValue, \textcolor{magenta}{char} ***names, \textcolor{blue}{capsValue} **values)}

\begin{description}

\item[aimInfo] the AIM context
\item[index] the index to use (1 bias)
\item[stype] GEOMETRYIN, GEOMETRYOUT,  ANALYSISIN, ANALYSISOUT or ANALYSISDYNO
\item[nValue] returned number of attributes
\item[names] the returned names -- nValue in length (freeable)
\item[values]  the returned pointer to the capsValue structures  -- nValue in length (freeable)
\item[icode] integer return code
\end{description}
Note: use {\tt aim\_freeAttrs} to free up the memory.}
\end{block}

\end{frame}

\begin{frame}
  \FrameTitle{AIM Utility Library -- Attributes}

  \begin{block}{Get Analysis (our) Attributes}
{\scriptsize

{\tt
icode = aim\_analysisAttrs(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{int} *nValue, \textcolor{magenta}{char} ***names, \\
\hspace{1.66in}  \textcolor{blue}{capsValue} **values)}

\begin{description}

\item[aimInfo] the AIM context
\item[nValue] returned number of attributes
\item[names] the returned names -- nValue in length (freeable)
\item[values]  the returned pointer to the capsValue structures  -- nValue in length (freeable)
\item[icode] integer return code
\end{description}
Note: use {\tt aim\_freeAttrs} to free up the memory.}
\end{block}

  \begin{block}{Free Attribute storage}
{\scriptsize

{\tt
\textcolor{magenta}{void} aim\_freeAttrs(\textcolor{magenta}{int} nValue, \textcolor{magenta}{char} **names, \textcolor{blue}{capsValue} *values)}

\begin{description}

\item[aimInfo] the AIM context
\item[nValue] the number of attributes
\item[names] the names to be freed -- nValue in length
\item[values]  the pointer to the capsValue structures  -- nValue in length
\end{description}}
\end{block}

\end{frame}

\begin{frame}
  \FrameTitle{AIM Utility Library -- Body/Tess handling}

  \begin{block}{Get Bodies}
{\scriptsize

{\tt
icode = aim\_getBodies(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} **intent, \textcolor{magenta}{int} *nBody, \\
\hspace{1.40in} \textcolor{blue}{ego} **bodies)}

\begin{description}

\item[aimInfo] the AIM context
\item[intent] the returned pointer to the capsIntent string used to filter the Bodies
\item[nBody] the returned number of EGADS Body Objects that match the {\tt intent}
\item[bodies] the returned pointer to a list of EGADS Body/Node Objects
\item[icode] integer return code
\end{description}}

\end{block}

 \begin{block}{Is Node Body}
{\scriptsize

{\tt
icode = aim\_isNodeBody(\textcolor{blue}{ego} body, \textcolor{magenta}{double} *xyz)}

\begin{description}

\item[body] the EGADS Body Objects to query
\item[xyz] the returned XYZ of the Node (if a Node Body)
\item[icode] integer return code
\end{description}}

\end{block}

\end{frame}

%\begin{frame}
%  \FrameTitle{AIM Utility Library -- Body/Tess handling}

%  \setbeamercolor{block title}{bg=green}
% \begin{block}{Retrieve Tessellations for a Bound}
%{\scriptsize

%{\tt
%icode = aim\_getTessBound(\textcolor{magenta}{void} *aimInfo, \textcolor{magenta}{const char} *bname, \textcolor{blue}{ego} **tess, \\
%\spaces[25]\textcolor{magenta}{int} *nTessface, \textcolor{magenta}{int} **tessfaces)}

%\vspace{0.025in}
%\begin{description}

%\item[aimInfo] the AIM context
%\item[bname]  the Bound name
%\item[tess]  returned pointer to a list of tessellations associated with the Bound (freeable)
%\item[nTessface] returned number of tessellation-face pairs
%\item[tessfaces] returned pointer to a list of tessellation-face index pairs (freeable) \\
% 2*\textcolor{espred}{nTessface} in length
%\item[icode] integer return code
%\end{description}

%\vspace{0.025in}
%Notes:\\
%\begin{enumerate}
%\item The tessellation-face index pairs are 1-biased where the first of the pair is the index into \textcolor{espred}{tess} and the second
%is the Face index in the associated Body
%\item If \textcolor{espred}{nTessface} is zero then both \textcolor{espred}{tess} and \textcolor{espred}{tessfaces} will be \textcolor{magenta}{NULL}
%\end{enumerate}
%\vspace{0.025in}
%}
%\end{block}

%\end{frame}

\begin{frame}
  \FrameTitle{AIM Utility Library -- Body/Tess handling}
 
 \begin{block}{Register a New Tessellation}
{\scriptsize

{\tt
icode = aim\_newTess(\textcolor{magenta}{void} *aimInfo, \textcolor{blue}{ego} tess)}

\vspace{0.025in}
\begin{description}

\item[aimInfo] the AIM context
\item[tess]  the EGADS Tessellation Object to register
\item[icode] integer return code
\end{description}

\vspace{0.025in}
Notes:\\
\begin{enumerate}
\item If the Body associated with \textcolor{espred}{tess} already has a registered Tessellation Object, the previous tessellation \textcolor{blue}{ego} will be deleted
\item Any Tessellation Object registered will be deleted by CAPS before a Geometry regeneration
\item If the Body associated with \textcolor{espred}{tess} is not on the {\tt OpenCSM} stack, the Body Object will be deleted when the Tessellation Object is cleaned up (i.e., CAPS takes ownership of the Body from the AIM)
\end{enumerate}
}
\end{block}

\end{frame}

\begin{frame}
\FrameTitle{Exercises}
  
\begin{itemize}
\item Modify {\tt session08.py} to:
 \begin{itemize}
 \item Filter ({\it capsIntent}) myAIM on ``CFD''
 \item A second instance of myAIM that filters on ``STRUCTURES''
 \end{itemize}
\item Analysis Dynamic Outputs:
\begin{itemize}
\item Move around the query of ``Everything'' -- ANALYSISDYNO\\
Does the execution sequence make sense (set the {\it define} DEBUG)
\item Examine {\tt dynoutOnly.py} -- note that requesting Dynamic Outputs alone triggers execution
\end{itemize}
\item Write a file in ``CFD'' that can we read in ``STRUCTURES''
\begin{itemize}
\item Does ``CFD'' get executed first?
\item How do you get the proper path AIM instance to AIM instance?
\end{itemize}
\item Do the same with a {\it linkage}
\begin{itemize}
\item Clue $\rightarrow$ you need to hook an output from ``CFD'' to an input into ``STRUCTURES''
\end{itemize}
\end{itemize}
  
 \end{frame}


\end{document}

