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 grid

  • smolyak: Smolyak sparse grid

  • clenshaw-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

2432256
392436,561
5253,125390,625
74916,8075,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

251117
31466153
5551,0014,845
71407,99774,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

251117
3951129
5213011,937
7491,11311,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:

[Distributions]
  [D_dist]
    type = Uniform
    lower_bound = 2.5
    upper_bound = 7.5
  []
  [S_dist]
    type = Uniform
    lower_bound = 2.5
    upper_bound = 7.5
  []
[]
(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.

[Samplers]
  [quadrature]
    type = Quadrature
    distributions = 'D_dist S_dist'
    execute_on = INITIAL
    order = 5
  []
[]
(modules/stochastic_tools/test/tests/surrogates/poly_chaos/main_2d_quad.i)

Input Parameters

  • 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>

    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

    Controllable:No

    Description:Specify the maximum order of the polynomials in the expansion.

Required Parameters

  • execute_onLINEARThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.

    Default:LINEAR

    C++ Type:ExecFlagEnum

    Options:FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, PRE_MULTIAPP_SETUP

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.

  • limit_get_global_samples429496729The maximum allowed number of items in the DenseMatrix returned by getGlobalSamples method.

    Default:429496729

    C++ Type:unsigned long

    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

    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

    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

    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

    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

    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

    Options:none, smolyak, clenshaw-curtis

    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>

    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

    Controllable:No

    Description:Set the enabled status of the MooseObject.

Advanced Parameters

References

  1. Thomas Gerstner and Michael Griebel. Numerical integration using sparse grids. Numerical Algorithms, 18(3):1572–9265, 1998. doi:10.1023/A:1019129717644.[BibTeX]