10 template <
typename ordinal_type,
typename value_type>
11 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
12 PecosOneDOrthogPolyBasis(
15 pecosPoly(pecosPoly_),
18 sparse_grid_growth_rule(webbur::level_to_order_linear_wn),
22 norms[i] = pecosPoly->norm_squared(i);
25 template <
typename ordinal_type,
typename value_type>
26 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
27 PecosOneDOrthogPolyBasis(
28 ordinal_type p_,
const PecosOneDOrthogPolyBasis& basis) :
29 pecosPoly(basis.pecosPoly),
32 sparse_grid_growth_rule(basis.sparse_grid_growth_rule),
36 norms[i] = pecosPoly->norm_squared(i);
39 template <
typename ordinal_type,
typename value_type>
40 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
41 ~PecosOneDOrthogPolyBasis()
45 template <
typename ordinal_type,
typename value_type>
47 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
53 template <
typename ordinal_type,
typename value_type>
55 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
61 template <
typename ordinal_type,
typename value_type>
63 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
69 template <
typename ordinal_type,
typename value_type>
71 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
77 template <
typename ordinal_type,
typename value_type>
79 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
80 computeTripleProductTensor()
const
85 Teuchos::rcp(
new Dense3Tensor<ordinal_type, value_type>(sz));
88 getQuadPoints(3*p, points, weights, values);
97 weights[l]*(values[l][i])*(values[l][
j])*(values[l][k]);
99 (*Cijk)(i,
j,k) = triple_product;
107 template <
typename ordinal_type,
typename value_type>
109 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
110 computeSparseTripleProductTensor(
ordinal_type order)
const
116 Teuchos::rcp(
new Sparse3Tensor<ordinal_type, value_type>());
119 getQuadPoints(3*p, points, weights, values);
128 weights[l]*(values[l][i])*(values[l][
j])*(values[l][k]);
130 if (
std::abs(triple_product/norms[i]) > sparse_tol)
131 Cijk->add_term(i,
j,k,triple_product);
135 Cijk->fillComplete();
140 template <
typename ordinal_type,
typename value_type>
142 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
143 computeDerivDoubleProductTensor()
const
148 getQuadPoints(2*p, points, weights, values);
154 evaluateBasesAndDerivatives(points[i], values[i], derivs[i]);
161 for (
int qp=0; qp<nqp; qp++)
162 b += weights[qp]*derivs[qp][i]*values[qp][
j];
170 template <
typename ordinal_type,
typename value_type>
172 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type,value_type>::
176 basis_pts[i] = pecosPoly->type1_value(x, i);
179 template <
typename ordinal_type,
typename value_type>
181 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type,value_type>::
182 evaluateBasesAndDerivatives(
const value_type& x,
187 vals[i] = pecosPoly->type1_value(x, i);
188 derivs[i] = pecosPoly->type1_gradient(x, i);
192 template <
typename ordinal_type,
typename value_type>
194 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type,value_type>::
197 return pecosPoly->type1_value(x, k);
200 template <
typename ordinal_type,
typename value_type>
202 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
203 print(std::ostream& os)
const
205 os <<
"Pecos " << name <<
" basis of order " << p <<
"." << std::endl;
206 os <<
"Basis polynomial norms (squared):\n\t";
208 os << norms[i] <<
" ";
212 template <
typename ordinal_type,
typename value_type>
214 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type, value_type>::
220 template <
typename ordinal_type,
typename value_type>
222 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type,value_type>::
231 const Pecos::RealArray& gp = pecosPoly->collocation_points(num_points);
232 const Pecos::RealArray& gw = pecosPoly->type1_collocation_weights(num_points);
233 quad_points.
resize(num_points);
234 quad_weights.
resize(num_points);
236 quad_points[i] = gp[i];
237 quad_weights[i] = gw[i];
241 quad_values.
resize(num_points);
243 quad_values[i].resize(p+1);
244 evaluateBases(quad_points[i], quad_values[i]);
248 template <
typename ordinal_type,
typename value_type>
250 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type,value_type>::
256 template <
typename ordinal_type,
typename value_type>
258 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type,value_type>::
262 Teuchos::rcp(
new Stokhos::PecosOneDOrthogPolyBasis<ordinal_type,value_type>(p,*
this));
265 template <
typename ordinal_type,
typename value_type>
267 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type,value_type>::
273 template <
typename ordinal_type,
typename value_type>
275 Stokhos::PecosOneDOrthogPolyBasis<ordinal_type,value_type>::
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
KOKKOS_INLINE_FUNCTION PCE< Storage > ceil(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > abs(const PCE< Storage > &a)
void resize(size_type new_size, const value_type &x=value_type())