44#ifdef HAVE_STOKHOS_DAKOTA
45#include "sandia_rules.hpp"
47#include "Teuchos_TestForException.hpp"
49template <
typename ordinal_type,
typename value_type>
55#ifdef HAVE_STOKHOS_DAKOTA
60template <
typename ordinal_type,
typename value_type>
69template <
typename ordinal_type,
typename value_type>
75template <
typename ordinal_type,
typename value_type>
79 Teuchos::Array<value_type>& quad_points,
80 Teuchos::Array<value_type>& quad_weights,
81 Teuchos::Array< Teuchos::Array<value_type> >& quad_values)
const
83#ifdef HAVE_STOKHOS_DAKOTA
103 ordinal_type l = std::ceil(std::log((quad_order+1.0)/3.0)/std::log(2.0));
104 num_points = (1 << (l+1)) - 1;
107 quad_points.
resize(num_points);
108 quad_weights.resize(num_points);
109 quad_values.resize(num_points);
111 webbur::patterson_lookup(num_points, &quad_points[0], &quad_weights[0]);
114 quad_weights[i] *= 0.5;
115 quad_values[i].resize(this->
p+1);
120 TEUCHOS_TEST_FOR_EXCEPTION(
121 true, std::logic_error,
"Clenshaw-Curtis requires TriKota to be enabled!");
125template <
typename ordinal_type,
typename value_type>
134 ordinal_type l = std::floor(std::log(n+1.0)/std::log(2.0)-1.0);
138template <
typename ordinal_type,
typename value_type>
139Teuchos::RCP<Stokhos::OneDOrthogPolyBasis<ordinal_type,value_type> >
147template <
typename ordinal_type,
typename value_type>
158 return (3 << (n-1)) - 1;
161template <
typename ordinal_type,
typename value_type>
Legendre polynomial basis using Gauss-Patterson quadrature points.
~GaussPattersonLegendreBasis()
Destructor.
virtual void getQuadPoints(ordinal_type quad_order, Teuchos::Array< value_type > &points, Teuchos::Array< value_type > &weights, Teuchos::Array< Teuchos::Array< value_type > > &values) const
Compute quadrature points, weights, and values of basis polynomials at given set of points points.
bool isotropic
Flag determining if expansion is iostropic (same basis in every dim)
GaussPattersonLegendreBasis(ordinal_type p, bool normalize=false, bool isotropic=false)
Constructor.
virtual ordinal_type pointGrowth(ordinal_type n) const
Evaluate point growth rule for Smolyak-type bases.
virtual Teuchos::RCP< OneDOrthogPolyBasis< ordinal_type, value_type > > cloneWithOrder(ordinal_type p) const
Clone this object with the option of building a higher order basis.
virtual ordinal_type coefficientGrowth(ordinal_type n) const
Evaluate coefficient growth rule for Smolyak-type bases.
virtual ordinal_type quadDegreeOfExactness(ordinal_type n) const
LegendreBasis(ordinal_type p, bool normalize=false, GrowthPolicy growth=SLOW_GROWTH)
Constructor.
void resize(const Teuchos::RCP< const Epetra_BlockMap > &map)
Resize to map map.
bool normalize
Normalize basis.
virtual void evaluateBases(const value_type &point, Teuchos::Array< value_type > &basis_pts) const
Evaluate each basis polynomial at given point point.
ordinal_type p
Order of basis.
virtual void setSparseGridGrowthRule(LevelToOrderFnPtr ptr)
Set sparse grid rule.