56 namespace DivisionOperatorUnitTest {
59 template <
typename OrdinalType,
typename ValueType>
69 Stokhos::OrthogPolyApprox<OrdinalType,ValueType> x,
y,
u,
u2,
cx,
cu,
cu2,
sx,
su,
su2,
c1;
80 const OrdinalType d = 2;
81 const OrdinalType p = 7;
85 for (OrdinalType i=0; i<d; i++)
128 for (OrdinalType i=0; i<d; i++) {
149 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 0, 100, 0, 0,1));
157 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 2, 100, 0, 0,1));
158 cg_diag_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.x, 0.0);
165 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 3, 100, 0, 0,1));
166 cg_jacobi_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.x, 0.0);
173 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 0, 1e-12, 4, 100, 0, 0,1));
174 cg_schur_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.x, 0.0);
182 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 0, 100, 0, 0,1));
183 cg_nonlin_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
190 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 2, 100, 0, 0,1));
191 cg_nonlin_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
198 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 3, 100, 0, 0,1));
199 cg_nonlin_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
207 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 0, 1e-12, 4, 100, 0, 0,1));
208 cg_nonlin_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
215 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 0, 1e-12, 4, 100, 1, 0,1));
216 cg_nonlin_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
223 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 0, 100, 0, 0,1));
232 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 2, 100, 0, 0,1));
240 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 3, 100, 0, 0,1));
249 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 0, 1e-12, 4, 100, 0, 0,1));
257 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 0, 100, 0, 0,1));
258 gmres_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
265 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 2, 100, 0, 0,1));
266 gmres_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
274 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 3, 100, 0, 0,1));
275 gmres_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
285 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 0, 1e-12, 4, 100, 0, 0,1));
286 gmres_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
293 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 0, 1e-12, 4, 100, 1, 0,1));
294 gmres_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > cu
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > cu2
Strategy interface for computing PCE of a/b using only b[0].
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > c1
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeLinearTripleProductTensor() const
Compute linear triple product tensor where k = 0,1,..,d.
Teuchos::RCP< const Stokhos::CompletePolynomialBasis< OrdinalType, ValueType > > basis
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > sx
void exp(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > su2
bool comparePCEs(const PCEType &a1, const std::string &a1_name, const Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &a2, const std::string &a2_name, const ValueType &rel_tol, const ValueType &abs_tol, Teuchos::FancyOStream &out)
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > u
Teuchos::RCP< Stokhos::QuadOrthogPolyExpansion< OrdinalType, ValueType > > qexp
Teuchos::RCP< const Stokhos::Quadrature< OrdinalType, ValueType > > quad
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > su
TEUCHOS_UNIT_TEST(Stokhos_DivisionOperator, CG_Divide)
Teuchos::RCP< Stokhos::DenseDirectDivisionExpansionStrategy< int, double, Stokhos::StandardStorage< int, double > > > direct_division_strategy
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > x
static int runUnitTestsFromMain(int argc, char *argv[])
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void reset(const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > &new_basis, ordinal_type sz=0)
Reset to a new basis.
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > y
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > cx
UnitTestSetup< int, double > setup
Teuchos::RCP< Stokhos::QuadOrthogPolyExpansion< OrdinalType, ValueType > > exp
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const
Compute triple product tensor.
Teuchos::RCP< Stokhos::Sparse3Tensor< int, double > > Cijk_linear
Strategy interface for computing PCE of a/b using only b[0].
int main(int argc, char **argv)
Teuchos::RCP< Stokhos::Sparse3Tensor< int, double > > Cijk
Strategy interface for computing PCE of a/b using only b[0].
Defines quadrature for a tensor product basis by tensor products of 1-D quadrature rules...
Teuchos::RCP< Stokhos::QuadOrthogPolyExpansion< OrdinalType, ValueType > > exp_linear
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > u2
reference term(ordinal_type dimension, ordinal_type order)
Get coefficient term for given dimension and order.