- distributionsThe distribution names to be sampled, the number of distributions provided defines the number of columns per matrix and their type defines the quadrature.
C++ Type:std::vector<DistributionName>
Unit:(no unit assumed)
Controllable:No
Description:The distribution names to be sampled, the number of distributions provided defines the number of columns per matrix and their type defines the quadrature.
- orderSpecify the maximum order of the polynomials in the expansion.
C++ Type:unsigned int
Unit:(no unit assumed)
Controllable:No
Description:Specify the maximum order of the polynomials in the expansion.
QuadratureSampler
Quadrature sampler for Polynomial Chaos.
Overview
Numerical quadrature is a method of selecting specific points and weights in integrate a function,
where is the function being integrated, is weighting function, is the number of quadrature points, and are quadrature weights and points, respectively. The sampler generates the points and weights based on the weighting function and the desired integration order. A uniform weighting function uses Gauss-Legendre quadrature and a normal weighting function uses Gauss-Hermite quadrature. These two quadratures can exactly integrate a polynomial of order .
For multidimensional quadratures, the following options are available by setting "sparse_grid":
none
(default): Tensor gridsmolyak
: Smolyak sparse gridclenshaw-curtis
: Clenshaw-Curtis sparse grid
In general, a multi-dimensional quadrature grid is a combination of 1-D quadratures. For example, a tensor grid can be describe as
where is the number of dimensions and is the one-dimension quadrature set for dimension with points. In contrast, the Smolyak and Clenshaw-Curtis grid is described as:
where . See Gerstner and Griebel (1998) for more details regarding sparse grids.
Tensor Grid
A tensor grid is created by taking a Cartesian product of the points and a Kronecker product of the weights from each dimensions' full order quadrature set. The resulting number of points is , where is the number of dimensions. Currently, only Gauss quadrature types are used with tensor grid. Table 1 shows the number of points several different and . Figure 1 shows the points of a tensor grid of Gauss-Legendre quadrature with and .
Table 1: Resulting number of grid points for tensor grid
2 | 4 | 32 | 256 |
3 | 9 | 243 | 6,561 |
5 | 25 | 3,125 | 390,625 |
7 | 49 | 16,807 | 5,764,801 |
Figure 1:
Smolyak Sparse Grid
A Smolyak sparse grid is a multidimensional quadrature meant to integrate a complete monomial. This type of grid is effective for use with PolynomialChaos. The idea is that instead of taking the cartesian product of full order quadratures, it uses a combination of lower order quadratures to complete the monomial space. The Smolyak sparse grid scheme can reduce the number of points significantly in high dimensional space. Table 2 shows the number of points several different and . Figure 2 shows the points of a Smolyak grid of Gauss-Legendre quadrature with and .
Table 2: Resulting number of grid points for Smolyak sparse grid
2 | 5 | 11 | 17 |
3 | 14 | 66 | 153 |
5 | 55 | 1,001 | 4,845 |
7 | 140 | 7,997 | 74,613 |
Figure 2:
Clenshaw-Curtis Sparse Grid
A Clenshaw-Curtis (CC) grid is very similar to the Smolyak sparse, the only difference is that the Smolyak grid uses gauss quadrature, while (CC) grid appropriately uses (CC) quadrature. In one-dimension, Gauss quadrature is more accurate (with the same convergence rate) but CC has more nesting of points, which means that at high dimensions, CC grid might be more accurate with fewer number of sample points. Table 3 shows the number of points several different and . Figure 3 shows the points of a CC grid with and
Table 3: Resulting number of grid points for Clenshaw-Curtis sparse grid
2 | 5 | 11 | 17 |
3 | 9 | 51 | 129 |
5 | 21 | 301 | 1,937 |
7 | 49 | 1,113 | 11,937 |
Figure 3:
Implementation
The sampler uses inputted distributions to create a multidimensional quadrature of arbitrary order. The sampler can then be used to sample a sub-app. Another object can then use the results of the sampling and the quadrature weights from the sampler to integrate a quantity.
Example Input File Syntax
First, distributions are made, which define the weighting function of the integration:
(contrib/moose/modules/stochastic_tools/test/tests/surrogates/poly_chaos/main_2d_quad.i)The QuadratureSampler then uses the distributions to create a quadrature with order
points. The definition of order
is important for use with polynomial chaos.
Input Parameters
- execute_onLINEARThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:LINEAR
C++ Type:ExecFlagEnum
Unit:(no unit assumed)
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- limit_get_global_samples429496729The maximum allowed number of items in the DenseMatrix returned by getGlobalSamples method.
Default:429496729
C++ Type:unsigned long
Unit:(no unit assumed)
Controllable:No
Description:The maximum allowed number of items in the DenseMatrix returned by getGlobalSamples method.
- limit_get_local_samples429496729The maximum allowed number of items in the DenseMatrix returned by getLocalSamples method.
Default:429496729
C++ Type:unsigned long
Unit:(no unit assumed)
Controllable:No
Description:The maximum allowed number of items in the DenseMatrix returned by getLocalSamples method.
- limit_get_next_local_row429496729The maximum allowed number of items in the std::vector returned by getNextLocalRow method.
Default:429496729
C++ Type:unsigned long
Unit:(no unit assumed)
Controllable:No
Description:The maximum allowed number of items in the std::vector returned by getNextLocalRow method.
- max_procs_per_row4294967295This will ensure that the sampler is partitioned properly when 'MultiApp/*/max_procs_per_app' is specified. It is not recommended to use otherwise.
Default:4294967295
C++ Type:unsigned int
Unit:(no unit assumed)
Controllable:No
Description:This will ensure that the sampler is partitioned properly when 'MultiApp/*/max_procs_per_app' is specified. It is not recommended to use otherwise.
- min_procs_per_row1This will ensure that the sampler is partitioned properly when 'MultiApp/*/min_procs_per_app' is specified. It is not recommended to use otherwise.
Default:1
C++ Type:unsigned int
Unit:(no unit assumed)
Controllable:No
Description:This will ensure that the sampler is partitioned properly when 'MultiApp/*/min_procs_per_app' is specified. It is not recommended to use otherwise.
- seed0Random number generator initial seed
Default:0
C++ Type:unsigned int
Unit:(no unit assumed)
Controllable:No
Description:Random number generator initial seed
- sparse_gridnoneType of sparse grid to use, if none, full tensor product is used.
Default:none
C++ Type:MooseEnum
Unit:(no unit assumed)
Controllable:No
Description:Type of sparse grid to use, if none, full tensor product is used.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
References
- Thomas Gerstner and Michael Griebel.
Numerical integration using sparse grids.
Numerical Algorithms, 18(3):1572–9265, 1998.
doi:10.1023/A:1019129717644.[BibTeX]