49 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
58 sz(ps_op->coeff_size()),
59 nqp(ps_op->point_size()),
71 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
72 template <
typename FuncT>
94 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
100 ps_op->transformPCE2QP(1.0, a_sdv, avals, 0.0,
false);
105 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
111 fvals[qp] = func(avals[qp]);
117 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
123 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0,
false);
128 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
129 template <
typename FuncT>
140 if (pa == 1 && pb == 1)
148 c[0] = func(a[0], b[0]);
153 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
160 ps_op->transformPCE2QP(1.0, a_sdv, avals, 0.0,
false);
161 ps_op->transformPCE2QP(1.0, b_sdv, bvals, 0.0,
false);
166 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
172 fvals[qp] = func(avals[qp], bvals[qp]);
177 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
183 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0,
false);
188 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
189 template <
typename FuncT>
207 c[0] = func(a, b[0]);
212 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
218 ps_op->transformPCE2QP(1.0, b_sdv, bvals, 0.0,
false);
223 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
229 fvals[qp] = func(a, bvals[qp]);
234 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
240 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0,
false);
245 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
246 template <
typename FuncT>
264 c[0] = func(a[0], b);
269 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
275 ps_op->transformPCE2QP(1.0, a_sdv, avals, 0.0,
false);
280 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
286 fvals[qp] = func(avals[qp], b);
291 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
297 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0,
false);
302 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
303 template <
typename FuncT>
310 const int N = FuncT::N;
312 for (
int i=0; i<N; i++) {
313 if (na[i]->size() > 1) {
328 for (
int i=0; i<N; i++)
329 val[i] = (*na[i])[0];
334 if (N >= navals.size())
336 if (navals[N].size() != N) {
338 for (
int i=0; i<N; i++)
339 navals[N][i].resize(nqp);
343 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
348 for (
int i=0; i<N; i++) {
351 ps_op->transformPCE2QP(1.0, sdv, navals[N][i], 0.0,
false);
357 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
364 for (
int i=0; i<N; i++)
365 val[i] = navals[N][i][qp];
366 fvals[qp] = func(val);
372 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
378 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0,
false);
383 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
393 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
403 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
410 if (use_quad_for_times)
416 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
423 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
434 if (use_quad_for_division)
441 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
448 if (use_quad_for_times)
454 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
464 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
474 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
481 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
497 if (use_quad_for_division)
504 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
511 if (use_quad_for_division)
517 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
527 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
536 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
545 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
554 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
563 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
572 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
582 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
592 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
602 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
611 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
620 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
629 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
638 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
647 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
656 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
665 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
674 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
683 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
693 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
703 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
713 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
722 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
731 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
740 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
741 template <
typename ExprT1,
typename ExprT2>
749 if (pa > 1 && pb > 1) {
759 "Stokhos::PseudoSpectralOrthogPolyExpansion::compute_times_coeff()"
760 <<
": Index " << i <<
" is out of range [0,"
761 << this->Cijk->num_i() <<
")!");
767 k_it != this->Cijk->k_end(i_it); ++k_it) {
774 aa = a.higher_order_coeff(k);
780 aa = b.higher_order_coeff(k);
783 j_it != this->Cijk->j_end(k_it); ++j_it) {
791 bb = b.higher_order_coeff(j);
797 bb = a.higher_order_coeff(j);
804 return cc / this->basis->norm_squared(i);
807 return a.val() * b.val();
809 return a.higher_order_coeff(i)*b.val();
812 return a.val()*b.higher_order_coeff(i);
816 template <
typename ordinal_type,
typename value_type,
typename po
int_compare_type,
typename node_type>
817 template <
typename ExprT1,
typename ExprT2>
825 "Stokhos::PseudoSpectralOrthogPolyExpansion::fast_ompute_times_coeff()"
826 <<
": Index " << i <<
" is out of range [0,"
827 << this->Cijk->num_i() <<
")!");
833 k_it != this->Cijk->k_end(i_it); ++k_it) {
838 aa = a.higher_order_coeff(k);
840 j_it != this->Cijk->j_end(k_it); ++j_it) {
846 bb = b.higher_order_coeff(j);
851 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)