if (rank == 0)
{
for (unsigned int i = 0; i < 6; ++i)
- AssertThrow(2. * read_write_2[i] == read_write_3[i],
+ AssertThrow(Number(2.) * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in operator *=."));
}
else
{
for (unsigned int i = 4; i < 10; ++i)
- AssertThrow(2. * read_write_2[i] == read_write_3[i],
+ AssertThrow(Number(2.) * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in operator *=."));
}
if (rank == 0)
{
for (unsigned int i = 0; i < 6; ++i)
- AssertThrow(0.5 * read_write_2[i] == read_write_3[i],
+ AssertThrow(Number(0.5) * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in operator /=."));
}
else
{
for (unsigned int i = 4; i < 10; ++i)
- AssertThrow(0.5 * read_write_2[i] == read_write_3[i],
+ AssertThrow(Number(0.5) * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in operator /=."));
}
if (rank == 0)
{
for (unsigned int i = 0; i < 6; ++i)
- AssertThrow(2. * read_write_2[i] + read_write_1[i] == read_write_3[i],
+ AssertThrow(Number(2.) * read_write_2[i] + read_write_1[i] ==
+ read_write_3[i],
ExcMessage("Problem in operator +=."));
}
else
{
for (unsigned int i = 4; i < 10; ++i)
- AssertThrow(2. * read_write_2[i] + read_write_1[i] == read_write_3[i],
+ AssertThrow(Number(2.) * read_write_2[i] + read_write_1[i] ==
+ read_write_3[i],
ExcMessage("Problem in operator +=."));
}
if (rank == 0)
{
for (unsigned int i = 0; i < 6; ++i)
- AssertThrow(1.5 * read_write_2[i] + read_write_1[i] == read_write_3[i],
+ AssertThrow(Number(1.5) * read_write_2[i] + read_write_1[i] ==
+ read_write_3[i],
ExcMessage("Problem in operator -=."));
}
else
{
for (unsigned int i = 4; i < 10; ++i)
- AssertThrow(1.5 * read_write_2[i] + read_write_1[i] == read_write_3[i],
+ AssertThrow(Number(1.5) * read_write_2[i] + read_write_1[i] ==
+ read_write_3[i],
ExcMessage("Problem in operator -=."));
}
b.import(read_write_1, VectorOperation::insert);
c.import(read_write_1, VectorOperation::insert);
const Number val = b * c;
- AssertThrow(val == 285., ExcMessage("Problem in operator *."));
+ AssertThrow(val == Number(285.), ExcMessage("Problem in operator *."));
}
test<double>();
test<float>();
+ test<std::complex<float>>();
+ test<std::complex<double>>();
deallog << "OK" << std::endl;
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
- AssertThrow(1. + read_write_1[i] == read_write_3[i],
+ AssertThrow(Number(1.) + read_write_1[i] == read_write_3[i],
ExcMessage("Problem in add(scalar)."));
}
else
{
for (unsigned int i = 5; i < 10; ++i)
- AssertThrow(1. + read_write_1[i] == read_write_3[i],
+ AssertThrow(Number(1.) + read_write_1[i] == read_write_3[i],
ExcMessage("Problem in add(scalar)."));
}
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
- AssertThrow(1. + read_write_1[i] + 2. * read_write_2[i] ==
+ AssertThrow(Number(1.) + read_write_1[i] +
+ Number(2.) * read_write_2[i] ==
read_write_3[i],
ExcMessage("Problem in add(scalar,Vector)."));
}
else
{
for (unsigned int i = 5; i < 10; ++i)
- AssertThrow(1. + read_write_1[i] + 2. * read_write_2[i] ==
+ AssertThrow(Number(1.) + read_write_1[i] +
+ Number(2.) * read_write_2[i] ==
read_write_3[i],
ExcMessage("Problem in add(scalar,Vector)."));
}
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
- AssertThrow(4. + 4. * read_write_1[i] + 10. * read_write_2[i] ==
+ AssertThrow(Number(4.) + Number(4.) * read_write_1[i] +
+ Number(10.) * read_write_2[i] ==
read_write_3[i],
ExcMessage("Problem in add(scalar,Vector,scalar,Vector)."));
}
else
{
for (unsigned int i = 5; i < 10; ++i)
- AssertThrow(4. + 4. * read_write_1[i] + 10. * read_write_2[i] ==
+ AssertThrow(Number(4.) + Number(4.) * read_write_1[i] +
+ Number(10.) * read_write_2[i] ==
read_write_3[i],
ExcMessage("Problem in add(scalar,Vector,scalar,Vector)."));
}
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
- AssertThrow(3. * read_write_1[i] + 2. * read_write_2[i] ==
+ AssertThrow(Number(3.) * read_write_1[i] +
+ Number(2.) * read_write_2[i] ==
read_write_3[i],
ExcMessage("Problem in sadd(scalar,scalar,Vector)."));
}
else
{
for (unsigned int i = 5; i < 10; ++i)
- AssertThrow(3. * read_write_1[i] + 2. * read_write_2[i] ==
+ AssertThrow(Number(3.) * read_write_1[i] +
+ Number(2.) * read_write_2[i] ==
read_write_3[i],
ExcMessage("Problem in sadd(scalar,scalar,Vector)."));
}
if (rank == 0)
{
for (unsigned int i = 0; i < 5; ++i)
- AssertThrow(2. * read_write_2[i] == read_write_3[i],
+ AssertThrow(Number(2.) * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in scale."));
}
else
{
for (unsigned int i = 5; i < 10; ++i)
- AssertThrow(2. * read_write_2[i] == read_write_3[i],
+ AssertThrow((Number)2. * read_write_2[i] == read_write_3[i],
ExcMessage("Problem in equ."));
}
AssertThrow(b.l1_norm() == 95., ExcMessage("Problem in l1_norm."));
- const Number eps = 1e-6;
- AssertThrow(std::fabs(b.l2_norm() - 31.3847096) < eps,
+ const double eps = 1e-6;
+ AssertThrow(std::fabs(b.l2_norm() - Number(31.3847096)) < eps,
ExcMessage("Problem in l2_norm"));
AssertThrow(b.linfty_norm() == 14., ExcMessage("Problem in linfty_norm."));
a.import(read_write_1, VectorOperation::insert);
const Number val = a.add_and_dot(2., a, b);
- AssertThrow(val == 1530., ExcMessage("Problem in add_and_dot"));
+ AssertThrow(val == Number(1530.), ExcMessage("Problem in add_and_dot"));
}
test<double>();
test<float>();
+ test<std::complex<double>>();
+ test<std::complex<float>>();
deallog << "OK" << std::endl;
MPILogInitAll log;
test<double>();
test<float>();
+ test<std::complex<double>>();
+ test<std::complex<float>>();
}
[0]: 4.000e+00
[1]: 2.000e+02
[2]: 1.000e+02
+DEAL:0::Tpetra first import add:
+(2.000e+00,0.000e+00) (1.000e+02,0.000e+00)
+IndexSet: {[0,2]}
+
+[0]: (1.000e+00,0.000e+00)
+[1]: (1.000e+02,0.000e+00)
+[2]: (1.000e+01,0.000e+00)
+DEAL:0::Tpetra second import add:
+(4.000e+00,0.000e+00) (2.000e+02,0.000e+00)
+IndexSet: {[0,2]}
+
+[0]: (2.000e+00,0.000e+00)
+[1]: (2.000e+02,0.000e+00)
+[2]: (2.000e+01,0.000e+00)
+DEAL:0::ReadWrite import add:
+IndexSet: {[0,2]}
+
+[0]: (6.000e+00,0.000e+00)
+[1]: (4.000e+02,0.000e+00)
+[2]: (5.000e+01,0.000e+00)
+DEAL:0::ReadWrite import min:
+IndexSet: {[0,2]}
+
+[0]: (4.000e+00,0.000e+00)
+[1]: (1.000e+00,0.000e+00)
+[2]: (3.000e+01,0.000e+00)
+DEAL:0::ReadWrite import max:
+IndexSet: {[0,2]}
+
+[0]: (4.000e+00,0.000e+00)
+[1]: (2.000e+02,0.000e+00)
+[2]: (1.000e+02,0.000e+00)
+DEAL:0::Tpetra first import add:
+(2.000e+00,0.000e+00) (1.000e+02,0.000e+00)
+IndexSet: {[0,2]}
+
+[0]: (1.000e+00,0.000e+00)
+[1]: (1.000e+02,0.000e+00)
+[2]: (1.000e+01,0.000e+00)
+DEAL:0::Tpetra second import add:
+(4.000e+00,0.000e+00) (2.000e+02,0.000e+00)
+IndexSet: {[0,2]}
+
+[0]: (2.000e+00,0.000e+00)
+[1]: (2.000e+02,0.000e+00)
+[2]: (2.000e+01,0.000e+00)
+DEAL:0::ReadWrite import add:
+IndexSet: {[0,2]}
+
+[0]: (6.000e+00,0.000e+00)
+[1]: (4.000e+02,0.000e+00)
+[2]: (5.000e+01,0.000e+00)
+DEAL:0::ReadWrite import min:
+IndexSet: {[0,2]}
+
+[0]: (4.000e+00,0.000e+00)
+[1]: (1.000e+00,0.000e+00)
+[2]: (3.000e+01,0.000e+00)
+DEAL:0::ReadWrite import max:
+IndexSet: {[0,2]}
+
+[0]: (4.000e+00,0.000e+00)
+[1]: (2.000e+02,0.000e+00)
+[2]: (1.000e+02,0.000e+00)
DEAL:1::Tpetra first import add:
1.000e+01 1.010e+02
[0]: 4.000e+00
[3]: 2.010e+02
+DEAL:1::Tpetra first import add:
+(1.000e+01,0.000e+00) (1.010e+02,0.000e+00)
+IndexSet: {0, 3}
+
+[0]: (1.000e+00,0.000e+00)
+[3]: (1.010e+02,0.000e+00)
+DEAL:1::Tpetra second import add:
+(3.000e+01,0.000e+00) (2.010e+02,0.000e+00)
+IndexSet: {0, 3}
+
+[0]: (2.000e+00,0.000e+00)
+[3]: (2.010e+02,0.000e+00)
+DEAL:1::ReadWrite import add:
+IndexSet: {0, 3}
+
+[0]: (6.000e+00,0.000e+00)
+[3]: (4.020e+02,0.000e+00)
+DEAL:1::ReadWrite import min:
+IndexSet: {0, 3}
+
+[0]: (4.000e+00,0.000e+00)
+[3]: (1.000e+00,0.000e+00)
+DEAL:1::ReadWrite import max:
+IndexSet: {0, 3}
+
+[0]: (4.000e+00,0.000e+00)
+[3]: (2.010e+02,0.000e+00)
+DEAL:1::Tpetra first import add:
+(1.000e+01,0.000e+00) (1.010e+02,0.000e+00)
+IndexSet: {0, 3}
+
+[0]: (1.000e+00,0.000e+00)
+[3]: (1.010e+02,0.000e+00)
+DEAL:1::Tpetra second import add:
+(3.000e+01,0.000e+00) (2.010e+02,0.000e+00)
+IndexSet: {0, 3}
+
+[0]: (2.000e+00,0.000e+00)
+[3]: (2.010e+02,0.000e+00)
+DEAL:1::ReadWrite import add:
+IndexSet: {0, 3}
+
+[0]: (6.000e+00,0.000e+00)
+[3]: (4.020e+02,0.000e+00)
+DEAL:1::ReadWrite import min:
+IndexSet: {0, 3}
+
+[0]: (4.000e+00,0.000e+00)
+[3]: (1.000e+00,0.000e+00)
+DEAL:1::ReadWrite import max:
+IndexSet: {0, 3}
+
+[0]: (4.000e+00,0.000e+00)
+[3]: (2.010e+02,0.000e+00)
[0]: 8.000e+00
[1]: 2.000e+02
[2]: 1.000e+02
+DEAL:0::Tpetra first import add:
+(4.000e+00,0.000e+00) (1.000e+02,0.000e+00)
+IndexSet: {[0,2]}
+
+[0]: (1.000e+00,0.000e+00)
+[1]: (1.000e+02,0.000e+00)
+[2]: (1.000e+01,0.000e+00)
+DEAL:0::Tpetra second import add:
+(8.000e+00,0.000e+00) (2.000e+02,0.000e+00)
+IndexSet: {[0,2]}
+
+[0]: (2.000e+00,0.000e+00)
+[1]: (2.000e+02,0.000e+00)
+[2]: (2.000e+01,0.000e+00)
+DEAL:0::ReadWrite import add:
+IndexSet: {[0,2]}
+
+[0]: (1.000e+01,0.000e+00)
+[1]: (4.000e+02,0.000e+00)
+[2]: (5.000e+01,0.000e+00)
+DEAL:0::ReadWrite import min:
+IndexSet: {[0,2]}
+
+[0]: (4.000e+00,0.000e+00)
+[1]: (1.000e+00,0.000e+00)
+[2]: (3.000e+01,0.000e+00)
+DEAL:0::ReadWrite import max:
+IndexSet: {[0,2]}
+
+[0]: (8.000e+00,0.000e+00)
+[1]: (2.000e+02,0.000e+00)
+[2]: (1.000e+02,0.000e+00)
+DEAL:0::Tpetra first import add:
+(4.000e+00,0.000e+00) (1.000e+02,0.000e+00)
+IndexSet: {[0,2]}
+
+[0]: (1.000e+00,0.000e+00)
+[1]: (1.000e+02,0.000e+00)
+[2]: (1.000e+01,0.000e+00)
+DEAL:0::Tpetra second import add:
+(8.000e+00,0.000e+00) (2.000e+02,0.000e+00)
+IndexSet: {[0,2]}
+
+[0]: (2.000e+00,0.000e+00)
+[1]: (2.000e+02,0.000e+00)
+[2]: (2.000e+01,0.000e+00)
+DEAL:0::ReadWrite import add:
+IndexSet: {[0,2]}
+
+[0]: (1.000e+01,0.000e+00)
+[1]: (4.000e+02,0.000e+00)
+[2]: (5.000e+01,0.000e+00)
+DEAL:0::ReadWrite import min:
+IndexSet: {[0,2]}
+
+[0]: (4.000e+00,0.000e+00)
+[1]: (1.000e+00,0.000e+00)
+[2]: (3.000e+01,0.000e+00)
+DEAL:0::ReadWrite import max:
+IndexSet: {[0,2]}
+
+[0]: (8.000e+00,0.000e+00)
+[1]: (2.000e+02,0.000e+00)
+[2]: (1.000e+02,0.000e+00)
DEAL:1::Tpetra first import add:
1.000e+01 1.010e+02
[0]: 8.000e+00
[3]: 2.010e+02
[4]: 1.010e+02
+DEAL:1::Tpetra first import add:
+(1.000e+01,0.000e+00) (1.010e+02,0.000e+00)
+IndexSet: {0, [3,4]}
+
+[0]: (1.000e+00,0.000e+00)
+[3]: (1.010e+02,0.000e+00)
+[4]: (1.100e+01,0.000e+00)
+DEAL:1::Tpetra second import add:
+(3.000e+01,0.000e+00) (2.010e+02,0.000e+00)
+IndexSet: {0, [3,4]}
+
+[0]: (2.000e+00,0.000e+00)
+[3]: (2.010e+02,0.000e+00)
+[4]: (2.100e+01,0.000e+00)
+DEAL:1::ReadWrite import add:
+IndexSet: {0, [3,4]}
+
+[0]: (1.000e+01,0.000e+00)
+[3]: (4.020e+02,0.000e+00)
+[4]: (5.300e+01,0.000e+00)
+DEAL:1::ReadWrite import min:
+IndexSet: {0, [3,4]}
+
+[0]: (4.000e+00,0.000e+00)
+[3]: (1.000e+00,0.000e+00)
+[4]: (3.200e+01,0.000e+00)
+DEAL:1::ReadWrite import max:
+IndexSet: {0, [3,4]}
+
+[0]: (8.000e+00,0.000e+00)
+[3]: (2.010e+02,0.000e+00)
+[4]: (1.010e+02,0.000e+00)
+DEAL:1::Tpetra first import add:
+(1.000e+01,0.000e+00) (1.010e+02,0.000e+00)
+IndexSet: {0, [3,4]}
+
+[0]: (1.000e+00,0.000e+00)
+[3]: (1.010e+02,0.000e+00)
+[4]: (1.100e+01,0.000e+00)
+DEAL:1::Tpetra second import add:
+(3.000e+01,0.000e+00) (2.010e+02,0.000e+00)
+IndexSet: {0, [3,4]}
+
+[0]: (2.000e+00,0.000e+00)
+[3]: (2.010e+02,0.000e+00)
+[4]: (2.100e+01,0.000e+00)
+DEAL:1::ReadWrite import add:
+IndexSet: {0, [3,4]}
+
+[0]: (1.000e+01,0.000e+00)
+[3]: (4.020e+02,0.000e+00)
+[4]: (5.300e+01,0.000e+00)
+DEAL:1::ReadWrite import min:
+IndexSet: {0, [3,4]}
+
+[0]: (4.000e+00,0.000e+00)
+[3]: (1.000e+00,0.000e+00)
+[4]: (3.200e+01,0.000e+00)
+DEAL:1::ReadWrite import max:
+IndexSet: {0, [3,4]}
+
+[0]: (8.000e+00,0.000e+00)
+[3]: (2.010e+02,0.000e+00)
+[4]: (1.010e+02,0.000e+00)
DEAL:2::Tpetra first import add:
[0]: 8.000e+00
[5]: 2.020e+02
[6]: 1.020e+02
+DEAL:2::Tpetra first import add:
+(1.100e+01,0.000e+00) (1.020e+02,0.000e+00)
+IndexSet: {0, [5,6]}
+
+[0]: (1.000e+00,0.000e+00)
+[5]: (1.020e+02,0.000e+00)
+[6]: (1.200e+01,0.000e+00)
+DEAL:2::Tpetra second import add:
+(3.200e+01,0.000e+00) (2.020e+02,0.000e+00)
+IndexSet: {0, [5,6]}
+
+[0]: (2.000e+00,0.000e+00)
+[5]: (2.020e+02,0.000e+00)
+[6]: (2.200e+01,0.000e+00)
+DEAL:2::ReadWrite import add:
+IndexSet: {0, [5,6]}
+
+[0]: (1.000e+01,0.000e+00)
+[5]: (4.040e+02,0.000e+00)
+[6]: (5.600e+01,0.000e+00)
+DEAL:2::ReadWrite import min:
+IndexSet: {0, [5,6]}
+
+[0]: (4.000e+00,0.000e+00)
+[5]: (1.000e+00,0.000e+00)
+[6]: (3.400e+01,0.000e+00)
+DEAL:2::ReadWrite import max:
+IndexSet: {0, [5,6]}
+
+[0]: (8.000e+00,0.000e+00)
+[5]: (2.020e+02,0.000e+00)
+[6]: (1.020e+02,0.000e+00)
+DEAL:2::Tpetra first import add:
+(1.100e+01,0.000e+00) (1.020e+02,0.000e+00)
+IndexSet: {0, [5,6]}
+
+[0]: (1.000e+00,0.000e+00)
+[5]: (1.020e+02,0.000e+00)
+[6]: (1.200e+01,0.000e+00)
+DEAL:2::Tpetra second import add:
+(3.200e+01,0.000e+00) (2.020e+02,0.000e+00)
+IndexSet: {0, [5,6]}
+
+[0]: (2.000e+00,0.000e+00)
+[5]: (2.020e+02,0.000e+00)
+[6]: (2.200e+01,0.000e+00)
+DEAL:2::ReadWrite import add:
+IndexSet: {0, [5,6]}
+
+[0]: (1.000e+01,0.000e+00)
+[5]: (4.040e+02,0.000e+00)
+[6]: (5.600e+01,0.000e+00)
+DEAL:2::ReadWrite import min:
+IndexSet: {0, [5,6]}
+
+[0]: (4.000e+00,0.000e+00)
+[5]: (1.000e+00,0.000e+00)
+[6]: (3.400e+01,0.000e+00)
+DEAL:2::ReadWrite import max:
+IndexSet: {0, [5,6]}
+
+[0]: (8.000e+00,0.000e+00)
+[5]: (2.020e+02,0.000e+00)
+[6]: (1.020e+02,0.000e+00)
DEAL:3::Tpetra first import add:
[0]: 8.000e+00
[7]: 2.030e+02
+DEAL:3::Tpetra first import add:
+(1.200e+01,0.000e+00) (1.030e+02,0.000e+00)
+IndexSet: {0, 7}
+
+[0]: (1.000e+00,0.000e+00)
+[7]: (1.030e+02,0.000e+00)
+DEAL:3::Tpetra second import add:
+(3.400e+01,0.000e+00) (2.030e+02,0.000e+00)
+IndexSet: {0, 7}
+
+[0]: (2.000e+00,0.000e+00)
+[7]: (2.030e+02,0.000e+00)
+DEAL:3::ReadWrite import add:
+IndexSet: {0, 7}
+
+[0]: (1.000e+01,0.000e+00)
+[7]: (4.060e+02,0.000e+00)
+DEAL:3::ReadWrite import min:
+IndexSet: {0, 7}
+
+[0]: (4.000e+00,0.000e+00)
+[7]: (1.000e+00,0.000e+00)
+DEAL:3::ReadWrite import max:
+IndexSet: {0, 7}
+
+[0]: (8.000e+00,0.000e+00)
+[7]: (2.030e+02,0.000e+00)
+DEAL:3::Tpetra first import add:
+(1.200e+01,0.000e+00) (1.030e+02,0.000e+00)
+IndexSet: {0, 7}
+
+[0]: (1.000e+00,0.000e+00)
+[7]: (1.030e+02,0.000e+00)
+DEAL:3::Tpetra second import add:
+(3.400e+01,0.000e+00) (2.030e+02,0.000e+00)
+IndexSet: {0, 7}
+
+[0]: (2.000e+00,0.000e+00)
+[7]: (2.030e+02,0.000e+00)
+DEAL:3::ReadWrite import add:
+IndexSet: {0, 7}
+
+[0]: (1.000e+01,0.000e+00)
+[7]: (4.060e+02,0.000e+00)
+DEAL:3::ReadWrite import min:
+IndexSet: {0, 7}
+
+[0]: (4.000e+00,0.000e+00)
+[7]: (1.000e+00,0.000e+00)
+DEAL:3::ReadWrite import max:
+IndexSet: {0, 7}
+
+[0]: (8.000e+00,0.000e+00)
+[7]: (2.030e+02,0.000e+00)