const bool transposed)
{
(void)transposed;
- using Number = typename VectorType::value_type;
+ using Number = typename VectorType::value_type;
+ Number *dst_ptr = dst.begin();
+ const Number *src_ptr = src.begin();
if (i == 0)
{
- Number *dst_ptr = dst.begin();
- const Number *src_ptr = src.begin();
-
preconditioner.vmult(
dst,
src,
[&](const unsigned int start_range, const unsigned int end_range) {
// zero 'dst' before running the vmult operation
if (end_range > start_range)
- std::memset(dst.begin() + start_range,
+ std::memset(dst_ptr + start_range,
0,
sizeof(Number) * (end_range - start_range));
},
if (relaxation == 1.0)
return; // nothing to do
- const auto src_ptr = src.begin();
- const auto dst_ptr = dst.begin();
-
DEAL_II_OPENMP_SIMD_PRAGMA
for (std::size_t i = start_range; i < end_range; ++i)
dst_ptr[i] *= relaxation;
dst,
tmp,
[&](const unsigned int start_range, const unsigned int end_range) {
- const auto src_ptr = src.begin();
const auto tmp_ptr = tmp.begin();
if (relaxation == 1.0)
(void)transposed;
using Number = typename VectorType::value_type;
+ Number *dst_ptr = dst.begin();
+ const Number *src_ptr = src.begin();
+
if (i == 0)
{
- Number *dst_ptr = dst.begin();
- const Number *src_ptr = src.begin();
-
preconditioner.vmult(
dst,
src,
[&](const unsigned int start_range, const unsigned int end_range) {
// zero 'dst' before running the vmult operation
if (end_range > start_range)
- std::memset(dst.begin() + start_range,
+ std::memset(dst_ptr + start_range,
0,
sizeof(Number) * (end_range - start_range));
},
if (relaxation == 1.0)
return; // nothing to do
- const auto src_ptr = src.begin();
- const auto dst_ptr = dst.begin();
-
DEAL_II_OPENMP_SIMD_PRAGMA
for (std::size_t i = start_range; i < end_range; ++i)
dst_ptr[i] *= relaxation;
else
{
tmp.reinit(src, true);
+ const auto tmp_ptr = tmp.begin();
Assert(transposed == false, ExcNotImplemented());
// zero 'tmp' before running the vmult
// operation
if (end_range > start_range)
- std::memset(tmp.begin() + start_range,
+ std::memset(tmp_ptr + start_range,
0,
sizeof(Number) * (end_range - start_range));
},
[&](const unsigned int start_range, const unsigned int end_range) {
- const auto src_ptr = src.begin();
- const auto tmp_ptr = tmp.begin();
-
if (relaxation == 1.0)
{
DEAL_II_OPENMP_SIMD_PRAGMA
{
tmp.reinit(src, true);
- Number *dst_ptr = dst.begin();
- const Number *src_ptr = src.begin();
- const Number *tmp_ptr = tmp.begin();
- const Number *diag_ptr = preconditioner.get_vector().begin();
-
if (transposed)
Tvmult(A, tmp, dst);
else
A.vmult(tmp, dst);
+ Number *dst_ptr = dst.begin();
+ const Number *src_ptr = src.begin();
+ const Number *tmp_ptr = tmp.begin();
+ const Number *diag_ptr = preconditioner.get_vector().begin();
+
if (relaxation == 1.0)
{
DEAL_II_OPENMP_SIMD_PRAGMA
if (iteration_index == 0)
{
- const auto solution_old_ptr = solution_old.begin();
-
// compute t = P^{-1} * (b)
preconditioner.vmult(solution_old, rhs);
// compute x^{n+1} = f_2 * t
+ const auto solution_old_ptr = solution_old.begin();
DEAL_II_OPENMP_SIMD_PRAGMA
for (unsigned int i = 0; i < solution_old.locally_owned_size(); ++i)
solution_old_ptr[i] = solution_old_ptr[i] * factor2;
}
else if (iteration_index == 1)
{
- const auto solution_ptr = solution.begin();
- const auto solution_old_ptr = solution_old.begin();
-
// compute t = P^{-1} * (b-A*x^{n})
temp_vector1.sadd(-1.0, 1.0, rhs);
preconditioner.vmult(solution_old, temp_vector1);
// compute x^{n+1} = x^{n} + f_1 * x^{n} + f_2 * t
+ const auto solution_ptr = solution.begin();
+ const auto solution_old_ptr = solution_old.begin();
DEAL_II_OPENMP_SIMD_PRAGMA
for (unsigned int i = 0; i < solution_old.locally_owned_size(); ++i)
solution_old_ptr[i] =
}
else
{
- const auto solution_ptr = solution.begin();
- const auto solution_old_ptr = solution_old.begin();
- const auto temp_vector2_ptr = temp_vector2.begin();
-
// compute t = P^{-1} * (b-A*x^{n})
temp_vector1.sadd(-1.0, 1.0, rhs);
preconditioner.vmult(temp_vector2, temp_vector1);
// compute x^{n+1} = x^{n} + f_1 * (x^{n}-x^{n-1}) + f_2 * t
+ const auto solution_ptr = solution.begin();
+ const auto solution_old_ptr = solution_old.begin();
+ const auto temp_vector2_ptr = temp_vector2.begin();
DEAL_II_OPENMP_SIMD_PRAGMA
for (unsigned int i = 0; i < solution_old.locally_owned_size(); ++i)
solution_old_ptr[i] = factor1_plus_1 * solution_ptr[i] -
rhs,
[&](const auto start_range, const auto end_range) {
if (end_range > start_range)
- std::memset(solution.begin() + start_range,
+ std::memset(solution_ptr + start_range,
0,
sizeof(Number) * (end_range - start_range));
},
temp_vector1,
[&](const auto begin, const auto end) {
if (end > begin)
- std::memset(temp_vector2.begin() + begin,
+ std::memset(temp_vector2_ptr + begin,
0,
sizeof(Number) * (end - begin));