Enumerations | Functions
AMA_Visit.h File Reference
#include <cnsplaVisit.h>

Go to the source code of this file.

Enumerations

enum  AMA_VisitNorm { AMA_VisitNorm_None, AMA_VisitNorm_Both, AMA_VisitNorm_Data, AMA_VisitNorm_Surface }
 This enumeration specifies the normalization employed by AMA_VisitUnv(), AMA_VisitMltv() and AMA_VisitMltvGrd(). More...
 

Functions

long int AMA_VisitMltv (AMA_OPTIONS *options, const char *approx, const char *datname, long int nind, long int n, double **x, double *z, AMA_SPLINE *spline)
 Write VisIt files for AMA Spline Library Multivariate Random Data Functions. More...
 
long int AMA_VisitMltvGrd (AMA_OPTIONS *options, const char *approx, const char *datname, long int nind, long int *ng, double **x, double *z, AMA_SPLINE *spline)
 Write VisIt files for AMA Spline Library Multivariate Gridded Data Functions. More...
 
long int AMA_VisitOptions (AMA_OPTIONS *options, CNSPLA_VISIT *visit)
 Read VisIt options. More...
 
long int AMA_VisitSpline (AMA_OPTIONS *options, const char *splroot, AMA_SPLINE *spline, AMA_SPLINE *partial, AMA_SPLINE *integral)
 Write VisIt files for AMA Spline Library Spline Functions. More...
 
long int AMA_VisitUnv (AMA_OPTIONS *options, const char *approx, const char *datname, long int n, double *x, double *z, AMA_SPLINE *spline)
 Write VisIt files for AMA Spline Library Univariate Data Functions. More...
 

Enumeration Type Documentation

This enumeration specifies the normalization employed by AMA_VisitUnv(), AMA_VisitMltv() and AMA_VisitMltvGrd().

These functions produce data, spline and grid files which can be used within VisIt to produce visualizations of spline approximations and interpolants computed by the AMA Spline Library approximation and interpolation functions. VisIt plots of univariate data and splines are produced with AMA_VisitUnv() and plots of multivariate data ${\bf X}\in {\rm R}^n$ and splines $s({\bf X}):{\rm R}^n\rightarrow {\rm R}^1$, for $n\le 3$, are produced with either AMA_VisitMltv() or AMA_VisitMltvGrd(). If nomalization is not performed, then the aspect ratio of the data plots is based on the range of the independent and dependent variable data. Similarly, the aspect ratio of unnormalize plots of spline approximations is based on the spline's independent variables and dependent variable range. The value of AMA_VisitNorm specifies normalizations which produce plots with an aspect ratio of one.

The value of AMA_VisitNorm defines normalizations of univariate data $(x_\ell,z_\ell)$, for $\ell=1,\ldots,N$, and univariate splines $s(x)$ given as

\[ s(x) = \sum_{j=1}^{m}\alpha_jB_{d,j}(x|{\bf\Lambda}) \]

as follows:

\begin{eqnarray*} x^l_1 &=& \min\lbrace{\min_l\lbrace{x_\ell\rbrace},\lambda_1\rbrace} \cr x^u_1 &=& \max\lbrace{\max_l\lbrace{x_\ell\rbrace},\lambda_m\rbrace} \cr z^l &=& \min\lbrace{\min_l\lbrace{z_\ell\rbrace},\min_j\lbrace{\alpha_j\rbrace}\rbrace} \cr z^u &=& \max\lbrace{\max_l\lbrace{z_\ell\rbrace},\max_j\lbrace{\alpha_j\rbrace}\rbrace}.\cr \end{eqnarray*}

Similarly, the value of AMA_VisitNorm defines normalizations of multivariate data $(x_{1,\ell},\cdots,,x_{n,\ell},z_\ell)$, for $\ell=1,\ldots,N$, and multivariate splines $s({\bf X})$ given as

\[ s({\bf X}) = \sum_{j_n=1}^{m_n}\cdots\sum_{j_1=1}^{m_1}\alpha_{j_1,\ldots,j_n}B_{d_1,j_1}(x_1|{\bf\Lambda}_1)\cdots B_{d_n,j_n}(x_n|{\bf\Lambda_n}) \]

as follows:

\begin{eqnarray*} x^l_k &=& \min\lbrace{\min_l\lbrace{x_{k,\ell}\rbrace},\lambda_{k,1}\rbrace} \cr x^u_k &=& \max\lbrace{\max_l\lbrace{x_{k,\ell}\rbrace},\lambda_{k,m_k}\rbrace} \cr z^l &=& \min\lbrace{\min_l\lbrace{z_\ell\rbrace},\min_{j_1,\ldots,j_n}\lbrace{\alpha_{j_1,\ldots,j_n}\rbrace}\rbrace} \cr z^u &=& \max\lbrace{\max_l\lbrace{z_\ell\rbrace},\max_{j_1,\ldots,j_n}\lbrace{\alpha_{j_1,\ldots,j_n}\rbrace}\rbrace}.\cr \end{eqnarray*}

By default the plots are normalized by the minimum and maximum values of the data and spline parameters. Alternate normalizations can be specified in the file VisIt.opt read by AMA_VisitOptions().

Documented 110815

Enumerator
AMA_VisitNorm_None 

Plots are not normalized.

AMA_VisitNorm_Both 

Plots are normalized by the minimum and maximum values of the data and spline parameters.

AMA_VisitNorm_Data 

Plots are normalized by the minimum and maximum data values.

AMA_VisitNorm_Surface 

Plots are normalized by the minimum and maximum spline parameters.

Function Documentation

long int AMA_VisitMltv ( AMA_OPTIONS options,
const char *  approx,
const char *  datname,
long int  nind,
long int  n,
double **  x,
double *  z,
AMA_SPLINE spline 
)

Write VisIt files for AMA Spline Library Multivariate Random Data Functions.

This function writes VisIt files for AMA Spline Library functions which compute spline approximations of independent variable data ${\bf X}\in{\rm R}^n$ and dependent variable data ${\bf Z}\in{\rm R}^1$. The data is given as $({\bf X}_\ell, z_\ell)$, for $\ell=1,\ldots,N$.

This function performs the following tasks:

  • Reads VisIt options, see AMA_VisitOptions().
  • Writes a VisIt data file named datname_approx_Data_Rn.silo.
  • Writes a VisIt grid file named datname_approx_Grid_Rn.silo.
  • Writes a VisIt surface file named datname_approx_Surf_Rn.silo.

The value of n is the number of independent variables for the spline. These files can be used within VisIt to produce the figures presented in Multivariate Random Data Functions.

Parameter Note: In the parameter definitions given below the limits on $k$ are $1\le k\le n$ and k = $k-1$.

Parameters
options[in] Pointer to AMA_OPTIONS. Should be initialized with AMA_Options() prior to calling AMA_VisitMltv().
approx[in] Approximation function. Should be one of AMA_MltvApprox, AMA_MltvInterp, AMA_MltvLstsqr, AMA_MltvMonoApprox or AMA_MltvMonoInterp.
datname[in] The data file name. Should satisfy datname $\ne$ NULL.
nind[in] The number of independent variables $n$. Should satisfy $2\le$ nind $\le 3$.
n[in] The number of data points $N$. Should satisfy n $\ge 2$.
x[in] Array of size nind containing arrays of size n where x[k] contains the independent variable data $x_{k,\ell}$, for $\ell=1,\ldots,N$.
z[in] Array of size n containing the dependent variable data $z_\ell$, for $\ell=1,\ldots,N$.
spline[in] Pointer to AMA_SPLINE containing the spline approximation. Should be a valid AMA_SPLINE structure.
Returns
Success/Error Code

User Support Function - Documented 110715 - !!!THIS IS NOT A USER CALLABLE FUNCTION - DOCUMENT IS INCLUDED FOR COMPLETENESS!!!

long int AMA_VisitMltvGrd ( AMA_OPTIONS options,
const char *  approx,
const char *  datname,
long int  nind,
long int *  ng,
double **  x,
double *  z,
AMA_SPLINE spline 
)

Write VisIt files for AMA Spline Library Multivariate Gridded Data Functions.

This function writes VisIt files for AMA Spline Library functions which compute spline approximations of independent variable data ${\bf X}\in{\rm R}^n$ and dependent variable data ${\bf Z}\in{\rm R}^1$. The independent variable data is given as $x_{k,\ell_k}$, for $\ell_k=1,\ldots,N^g_k$ and $1\le k\le n$, and it defines the rectilinear grid

\[ (x_{1,1},x_{1,2},\cdots,x_{1,N^g_1-1},x_{1,N^g_1})\times\cdots\times(x_{n,1},x_{n,2},\cdots,x_{n,N^g_n-1},x_{n,N^g_n}). \]

The dependent variable data lies on the grid and is given as $z_{\ell_1,\cdots,\ell_n}$, for $\ell_1=1,\ldots,N^g_1,\cdots,\ell_n=1,\ldots,N^g_n$.

This function performs the following tasks:

  • Reads VisIt options, see AMA_VisitOptions().
  • Writes a VisIt data file named datname_approx_Data_Rn.silo.
  • Writes a VisIt grid file named datname_approx_Grid_Rn.silo.
  • Writes a VisIt surface file named datname_approx_Surf_Rn.silo.

The value of n is the number of independent variables for the spline. These files can be used within VisIt to produce the figures presented in Multivariate Gridded Data Functions.

Parameter Note: In the parameter definitions given below the limits on $k$ are $1\le k\le n$ and k = $k-1$.

Parameters
options[in] Pointer to AMA_OPTIONS. Should be initialized with AMA_Options() prior to calling AMA_VisitMltvGrd().
approx[in] Approximation function. Should be one of AMA_MltvGrdApprox, AMA_MltvGrdInterp, AMA_MltvGrdLstsqr, AMA_MltvGrdMonoApprox or AMA_MltvGrdMonoInterp.
datname[in] The data file name. Should satisfy datname $\ne$ NULL.
nind[in] The number of independent variables $n$. Should satisfy $2\le$ nind $\le 3$.
ng[in] Array of size nind containing the number of points $N^g_k$ where ng[k] $= N^g_k$. Should satisfy ng[k] $\ge 2$.
x[in] Array of size nind containing arrays of size ng[k] where x[k] contains the independent variable data $x_{k,\ell_k}$, $\ell_k=1,\ldots,N^g_k$ .The values of x[k] should be in strictly ascending order.
z[in] Array of size $N$ containing the dependent variable data $z_{\ell_1,\cdots,\ell_n}$, for $\ell_1=1,\ldots,N^g_1,\cdots,\ell_n=1,\ldots,N^g_n$.
spline[in] Pointer to AMA_SPLINE containing the spline approximation. Should be a valid AMA_SPLINE structure.
Returns
Success/Error Code

User Support Function - Documented 110715 - !!!THIS IS NOT A USER CALLABLE FUNCTION - DOCUMENT IS INCLUDED FOR COMPLETENESS!!!

long int AMA_VisitOptions ( AMA_OPTIONS options,
CNSPLA_VISIT *  visit 
)

Read VisIt options.

This function reads the file VisIt.opt which specifies plot options employed by AMA_VisitMltv(), AMA_VisitMltvGrd() and AMA_VisitUnv().

The file VisIt.opt consists of several, optional, sections which specify options for writing VisIt plot files. It has the following structure:

\[ \begin{array}{l} {\bf Visit\_Options} \cr {\bf Visit\_Norm:\rm nrmflg} \cr {\bf End\_Visit\_Options} \cr \end{array} \]

The normalization flag ${\rm nrmflg}$ has the following values:

  • If ${\rm nrmflg}$ equals None, then the plots are not normalized.
  • If ${\rm nrmflg}$ equals Both, then the plots are normalized by the minimum and maximum values of the data and spline parameters.
  • If ${\rm nrmflg}$ equals Data, then the plots are normalized by the minimum and maximum data values.
  • If ${\rm nrmflg}$ equals Surface, then the plots are normalized by the minimum and maximum spline parameters.

See AMA_VisitNorm for additional information about the four normalization options.

The bold keywords are case sensitive and the string values for the approximation options are case insensitive.

Parameters
options[in] Pointer to AMA_OPTIONS. Should be initialized with AMA_Options() prior to calling AMA_VisitOptions().
visit[in] Pointer to CNSPLA_VISIT containing the VisIt file options.
Returns
Success/Error Code

User Support Function - Documented 110715 - !!!THIS IS NOT A USER CALLABLE FUNCTION - DOCUMENT IS INCLUDED FOR COMPLETENESS!!!

long int AMA_VisitSpline ( AMA_OPTIONS options,
const char *  splroot,
AMA_SPLINE spline,
AMA_SPLINE partial,
AMA_SPLINE integral 
)

Write VisIt files for AMA Spline Library Spline Functions.

This function writes the following files:

  • splroot_Spline_Surf_Rn.silo,
  • splroot_Partial_Surf_Rn.silo,
  • splroot_Integral_Surf_Rn.silo,

where n is the number of independent variables for the spline. These files can be used within VisIt to produce the figures presented in Spline Functions.

Parameters
options[in] Pointer to AMA_OPTIONS. Should be initialized with AMA_Options() prior to calling AMA_VisitSpline().
splroot[in] The root of spline file names. Should satisfy splroot $\ne$ NULL.
spline[in] Pointer to AMA_SPLINE containing the spline $s({\bf X})$.
partial[in] Pointer to AMA_SPLINE containing the partial derivative of $s({\bf X})$.
integral[in] Pointer to AMA_SPLINE containing the indefinite integral of $s({\bf X})$.
Returns
Success/Error Code.
Note
If spline $=$ NULL, then the file splroot_Spline_Surf_Rn.silo is not written.
If partial $=$ NULL, then the file splroot_Partial_Surf_Rn.silo is not written.
If integral $=$ NULL, then the file splroot_Integral_Surf_Rn.silo is not written.

User Support Function - Documented 012915 - !!!THIS IS NOT A USER CALLABLE FUNCTION - DOCUMENT IS INCLUDED FOR COMPLETENESS!!!

long int AMA_VisitUnv ( AMA_OPTIONS options,
const char *  approx,
const char *  datname,
long int  n,
double *  x,
double *  z,
AMA_SPLINE spline 
)

Write VisIt files for AMA Spline Library Univariate Data Functions.

This function writes VisIt files for AMA Spline Library functions which compute spline approximations of independent variable data ${\bf X}\in{\rm R}^1$ and dependent variable data ${\bf Z}\in{\rm R}^1$. The data is given as $(x_\ell,z_\ell)$, for $\ell=1,\ldots,N$.

This function performs the following tasks:

  • Reads VisIt options, see AMA_VisitOptions().
  • Writes a VisIt data file named datname_approx_Data_R1.silo.
  • Writes a VisIt grid file named datname_approx_Grid_R1.silo.
  • Writes a VisIt surface file named datname_approx_Surf_R1.silo.

These files can be used within VisIt to produce the figures presented in Univariate Data Functions.

Parameters
options[in] Pointer to AMA_OPTIONS initialized with AMA_Options(). Should be initialized with AMA_Options() prior to calling AMA_VisitUnv().
approx[in] Approximation function. Should be one of AMA_UnvApprox, AMA_UnvInterp, AMA_UnvLstsqr, AMA_UnvMonoApprox or AMA_UnvMonoInterp.
datname[in] The data file name. Should satisfy datname $\ne$ NULL.
n[in] The number of data points $N$. Should satisfy n $\ge 2$.
x[in] Array of size n containing the independent variable data $x_\ell$, for $\ell=1,\ldots,N$. Should be in strictly ascending order.
z[in] Array of size n containing the dependent variable data $z_\ell$, for $\ell=1,\ldots,N$.
spline[in] Pointer to AMA_SPLINE containing the spline approximation. Should be a valid AMA_SPLINE structure.
Returns
Success/Error Code

User Support Function - Documented 110715 - !!!THIS IS NOT A USER CALLABLE FUNCTION - DOCUMENT IS INCLUDED FOR COMPLETENESS!!!