# SPARSE_GRID_MIXED_DATASET Create Sparse Grid Using Mixed Rules

SPARSE_GRID_MIXED_DATASET is a C++ program which creates a sparse grid dataset from a mixture of 1D rules, using instructions from a user.

The available 1D quadrature rules are identified by a 2 or 3 letter code, and include:

1. CC, Clenshaw-Curtis:
defined on [-1,+1], with w(x)=1,
a closed, fully nested rule.
2. F2, Fejer Type 2:
defined on (-1,+1), with w(x)=1,
an open, fully nested rule.
3. GP, Gauss Patterson:
defined on (-1,+1), with w(x)=1,
a family of the midpoint rule, the 3 point Gauss Legendre rule, and then successive Patterson refinements,
an open, fully nested rule.
4. GL, Gauss Legendre:
defined on (-1,+1), with w(x)=1,
an open, weakly nested rule.
5. GH, Gauss Hermite:
defined on (-oo,+oo), with w(x)=exp(-x*x),
an open, weakly nested rule.
6. GGH, Generalized Gauss Hermite:
defined on (-oo,+oo), with w(x)=|x|^alpha * exp(-x*x),
an open, weakly nested rule.
7. LG, Gauss Laguerre:
defined on (0,+oo) with w(x)=exp(-x),
an open, non-nested rule.
8. GLG, Generalized Gauss Laguerre:
defined on (0,+oo) with w(x)=x^alpha * exp(-x),
an open, non-nested rule.
9. GJ, Gauss Jacobi:
defined on [-1,+1] with w(x)=(1-x)^alpha (1+x)^beta
an open, non-nested rule.
10. GW, Golub Welsch:
a rule defined by the user based on the Golub-Welsch algorithm,
with points and weights supplied by external routines,
presumably an open, non-nested rule.
(not supported yet)
11. CCS, Clenshaw-Curtis Slow-Growth:
defined on [-1,+1], with w(x)=1,
a closed, fully nested rule.
12. F2S, Fejer Type 2, Slow-Growth:
defined on (-1,+1), with w(x)=1,
an open, fully nested rule.
13. GPS, Gauss Patterson, Slow-Growth:
defined on (-1,+1), with w(x)=1,
a family of the midpoint rule, the 3 point Gauss Legendre rule, and then successive Patterson refinements,
an open, fully nested rule.

### Usage:

The user first specifies:

• M the spatial dimension of the quadrature region,
• L the level that defines the Smolyak grid.
and these two values can actuallyb be specified on the command line.

Then the user specifies rules for each of the M dimensions. A rule, when specified, may be used for one, or for multiple consecutive dimensions.

• RULE identifies the 1D rule, and must be one of "CC", "F2", "GP", "GL", "GH", "GGH", "LG", "GLG", "GJ", "GW", "CCS", "F2S", "GPS".
• the number of times the rule is to be used for consecutive dimensions;
• ALPHA, a rule parameter, if needed. (Rules GGH, GLG and GJ);
• BETA, a rule parameter, if needed. (Rule GJ only).

Finally, the user specifies a "file identifier", that is, the main part of a string to be used when creating the files.

### Languages:

SPARSE_GRID_MIXED_DATASET is available in a C++ version and a FORTRAN90 version and a MATLAB version.

### Related Data and Programs:

SANDIA_RULES, a C++ library which produces 1D quadrature rules of Chebyshev, Clenshaw Curtis, Fejer 2, Gegenbauer, generalized Hermite, generalized Laguerre, Hermite, Jacobi, Laguerre, Legendre and Patterson types.

SPARSE_GRID_CC, a dataset directory which contains multidimensional Smolyak sparse grids based on the 1D Clenshaw Curtis rule;

SPARSE_GRID_CC_DATASET, a C++ program which creates a sparse grid dataset based on Clenshaw-Curtis rules.

SPARSE_GRID_CCS, a dataset directory which contains multidimensional Smolyak sparse grids based on the 1D Clenshaw Curtis rule with Slow Exponential Growth;

SPARSE_GRID_F2, a dataset directory which contains multidimensional Smolyak sparse grids based on the 1D Fejer type 2 rule;

SPARSE_GRID_GL, a dataset directory which contains multidimensional Smolyak sparse grids based on the 1D Gauss-Legendre rule;

SPARSE_GRID_GL_DATASET, a C++ program which creates a sparse grid dataset based on Gauss-Legendre rules.

SPARSE_GRID_GP, a dataset directory which contains multidimensional Smolyak sparse grids based on the 1D Gauss-Patterson rule;

SPARSE_GRID_HERMITE, a dataset directory which contains multidimensional Smolyak sparse grids based on the 1D Gauss-Hermite rule;

SPARSE_GRID_HERMITE_DATASET, a C++ program which creates a sparse grid dataset based on Gauss-Hermite rules.

SPARSE_GRID_LAGUERRE, a dataset directory which contains multidimensional Smolyak sparse grids based on the 1D Gauss-Laguerre rule;

SPARSE_GRID_LAGUERRE_DATASET, a C++ program which creates a sparse grid dataset based on Gauss-Laguerrre rules.

SPARSE_GRID_MIXED, a C++ library which creates a sparse grid dataset based on a mixed set of 1D factor rules.

SPARSE_GRID_MIXED, a dataset directory which contains multidimensional Smolyak sparse grids based on a mixed set of 1D factor rules.

SPARSE_GRID_NCC, a dataset directory which contains multidimensional Smolyak sparse grids based on the 1D Newton Cotes Closed rule;

SPARSE_GRID_NCO, a dataset directory which contains multidimensional Smolyak sparse grids based on the 1D Newton Cotes Open rule;

SPARSE_GRID_OPEN_DATASET, a C++ program which creates a sparse grid dataset based on open rules (Fejer 2, Gauss-Patterson, Newton-Cotes-Open).

SPARSE_GRID_TANH_SINH, a dataset directory which contains multidimensional Smolyak sparse grids based on a 1D tanh-sinh rule;

### Reference:

1. Thomas Gerstner, Michael Griebel,
Numerical Integration Using Sparse Grids,
Numerical Algorithms,
Volume 18, Number 3-4, 1998, pages 209-232.
2. Fabio Nobile, Raul Tempone, Clayton Webster,
A Sparse Grid Stochastic Collocation Method for Partial Differential Equations with Random Input Data,
SIAM Journal on Numerical Analysis,
Volume 46, Number 5, 2008, pages 2309-2345.
3. Sergey Smolyak,
Quadrature and Interpolation Formulas for Tensor Products of Certain Classes of Functions,
Volume 4, 1963, pages 240-243.

### List of Routines:

• MAIN is the main program for SPARSE_GRID_MIXED_DATASET.
• CH_CAP capitalizes a single character.
• RULE_STRING_TO_INDEX converts a string identifying a rule to an index.
• S_EQI is a case insensitive comparison of two strings for equality.
• SPARSE_GRID_MIXED_DATASET_HANDLE handles the creation of the dataset.

You can go up one level to the C++ source codes.

Last revised on 25 December 2009.