15 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
24 sz(ps_op->coeff_size()),
25 nqp(ps_op->point_size()),
37 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
38 template <
typename FuncT>
60 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
66 ps_op->transformPCE2QP(1.0, a_sdv, avals, 0.0,
false);
71 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
77 fvals[qp] = func(avals[qp]);
83 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
89 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0,
false);
94 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
95 template <
typename FuncT>
106 if (pa == 1 && pb == 1)
114 c[0] = func(a[0], b[0]);
119 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
126 ps_op->transformPCE2QP(1.0, a_sdv, avals, 0.0,
false);
127 ps_op->transformPCE2QP(1.0, b_sdv, bvals, 0.0,
false);
132 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
138 fvals[qp] = func(avals[qp], bvals[qp]);
143 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
149 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0,
false);
154 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
155 template <
typename FuncT>
173 c[0] = func(a, b[0]);
178 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
184 ps_op->transformPCE2QP(1.0, b_sdv, bvals, 0.0,
false);
189 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
195 fvals[qp] = func(a, bvals[qp]);
200 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
206 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0,
false);
211 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
212 template <
typename FuncT>
230 c[0] = func(a[0], b);
235 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
241 ps_op->transformPCE2QP(1.0, a_sdv, avals, 0.0,
false);
246 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
252 fvals[qp] = func(avals[qp], b);
257 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
263 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0,
false);
268 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
269 template <
typename FuncT>
276 const int N = FuncT::N;
278 for (
int i=0; i<N; i++) {
279 if (na[i]->size() > 1) {
294 for (
int i=0; i<N; i++)
295 val[i] = (*na[i])[0];
300 if (N >= navals.size())
302 if (navals[N].size() != N) {
304 for (
int i=0; i<N; i++)
305 navals[N][i].resize(nqp);
309 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
314 for (
int i=0; i<N; i++) {
317 ps_op->transformPCE2QP(1.0, sdv, navals[N][i], 0.0,
false);
323 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
330 for (
int i=0; i<N; i++)
331 val[i] = navals[N][i][qp];
332 fvals[qp] = func(val);
338 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
344 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0,
false);
349 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
359 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
369 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
376 if (use_quad_for_times)
382 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
389 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
400 if (use_quad_for_division)
407 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
414 if (use_quad_for_times)
420 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
430 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
440 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
447 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
463 if (use_quad_for_division)
470 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
477 if (use_quad_for_division)
483 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
493 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
502 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
511 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
520 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
529 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
538 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
548 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
558 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
568 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
577 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
586 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
595 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
604 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
613 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
622 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
631 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
640 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
649 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
659 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
669 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
679 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
688 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
697 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
706 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
707 template <
typename ExprT1,
typename ExprT2>
715 if (pa > 1 && pb > 1) {
725 "Stokhos::PseudoSpectralOrthogPolyExpansion::compute_times_coeff()"
726 <<
": Index " << i <<
" is out of range [0,"
727 << this->Cijk->num_i() <<
")!");
733 k_it != this->Cijk->k_end(i_it); ++k_it) {
740 aa = a.higher_order_coeff(k);
746 aa = b.higher_order_coeff(k);
749 j_it != this->Cijk->j_end(k_it); ++j_it) {
757 bb = b.higher_order_coeff(j);
763 bb = a.higher_order_coeff(j);
770 return cc / this->basis->norm_squared(i);
773 return a.val() * b.val();
775 return a.higher_order_coeff(i)*b.val();
778 return a.val()*b.higher_order_coeff(i);
782 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
783 template <
typename ExprT1,
typename ExprT2>
791 "Stokhos::PseudoSpectralOrthogPolyExpansion::fast_ompute_times_coeff()"
792 <<
": Index " << i <<
" is out of range [0,"
793 << this->Cijk->num_i() <<
")!");
799 k_it != this->Cijk->k_end(i_it); ++k_it) {
804 aa = a.higher_order_coeff(k);
806 j_it != this->Cijk->j_end(k_it); ++j_it) {
812 bb = b.higher_order_coeff(j);
817 return cc / this->basis->norm_squared(i);
void divideEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
void log10(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
#define TEUCHOS_FUNC_TIME_MONITOR(FUNCNAME)
Teuchos::RCP< Teuchos::ParameterList > params
Parameter list.
void resize(ordinal_type sz)
Resize coefficient array (coefficients are preserved)
void tanh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
T & get(ParameterList &l, const std::string &name)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void exp(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void divide(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
Base class for consolidating common expansion implementations.
void timesEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
void nary_op(const FuncT &func, OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > **a)
void divide(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
void acos(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
pointer coeff()
Return coefficient array.
PseudoSpectralOrthogPolyExpansion(const Teuchos::RCP< const OrthogPolyBasis< ordinal_type, value_type > > &basis, const Teuchos::RCP< const Stokhos::Sparse3Tensor< ordinal_type, value_type > > &Cijk, const Teuchos::RCP< const PseudoSpectralOperator< ordinal_type, value_type, point_compare_type > > &ps_op, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor.
void sqrt(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void log(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
Bi-directional iterator for traversing a sparse array.
void atan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
bool use_quad_for_times
Use quadrature for times functions.
Abstract base class for multivariate orthogonal polynomials.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void binary_op(const FuncT &func, OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
Nonlinear binary function.
value_type fast_compute_times_coeff(ordinal_type k, const ExprT1 &a, const ExprT2 &b) const
void sin(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void pow(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
void atan2(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
bool use_quad_for_division
Use quadrature for division functions.
void tan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
KOKKOS_INLINE_FUNCTION bool is_constant(const T &x)
void times(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
void atanh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void timesEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
KOKKOS_INLINE_FUNCTION constexpr std::enable_if< is_view_uq_pce< view_type >::value, typename CijkType< view_type >::type >::type cijk(const view_type &view)
void cos(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void cosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
Class to store coefficients of a projection onto an orthogonal polynomial basis.
void cbrt(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void times(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
void divideEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
ordinal_type size() const
Return size.
void asinh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void sinh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void unary_op(const FuncT &func, OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
Nonlinear unary function.
value_type compute_times_coeff(ordinal_type k, const ExprT1 &a, const ExprT2 &b) const
void asin(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void acosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)