22 namespace DivisionOperatorUnitTest {
25 template <
typename OrdinalType,
typename ValueType>
35 Stokhos::OrthogPolyApprox<OrdinalType,ValueType> x,
y,
u,
u2,
cx,
cu,
cu2,
sx,
su,
su2,
c1;
46 const OrdinalType d = 2;
47 const OrdinalType p = 7;
51 for (OrdinalType i=0; i<d; i++)
94 for (OrdinalType i=0; i<d; i++) {
115 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 0, 100, 0, 0,1));
123 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 2, 100, 0, 0,1));
124 cg_diag_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.x, 0.0);
131 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 3, 100, 0, 0,1));
132 cg_jacobi_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.x, 0.0);
139 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 0, 1e-12, 4, 100, 0, 0,1));
140 cg_schur_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.x, 0.0);
148 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 0, 100, 0, 0,1));
149 cg_nonlin_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
156 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 2, 100, 0, 0,1));
157 cg_nonlin_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
164 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 3, 100, 0, 0,1));
165 cg_nonlin_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 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_nonlin_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
181 Teuchos::rcp(
new Stokhos::CGDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 0, 1e-12, 4, 100, 1, 0,1));
182 cg_nonlin_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
189 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 0, 100, 0, 0,1));
198 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 2, 100, 0, 0,1));
206 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 3, 100, 0, 0,1));
215 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 0, 1e-12, 4, 100, 0, 0,1));
223 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 0, 100, 0, 0,1));
224 gmres_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
231 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 2, 100, 0, 0,1));
232 gmres_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
240 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 1, 1e-12, 3, 100, 0, 0,1));
241 gmres_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
251 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 0, 1e-12, 4, 100, 0, 0,1));
252 gmres_division_strategy->divide(
setup.u, 1.0,
setup.c1,
setup.cu, 0.0);
259 Teuchos::rcp(
new Stokhos::GMRESDivisionExpansionStrategy<
int,
double,
Stokhos::StandardStorage<int, double> >(
setup.basis,
setup.Cijk, 0, 1e-12, 4, 100, 1, 0,1));
260 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.