]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid VectorView in matrix-free operators.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 24 Oct 2017 10:36:25 +0000 (12:36 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 24 Oct 2017 13:13:31 +0000 (15:13 +0200)
include/deal.II/matrix_free/operators.h

index c72ec5a5c4210bc29811c73e18084c5b53bfe667..cc65ed759ca4164fa0b8b91b5fa5194fd1c0169b 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <deal.II/lac/diagonal_matrix.h>
 #include <deal.II/lac/la_parallel_vector.h>
-#include <deal.II/lac/vector_view.h>
 #include <deal.II/multigrid/mg_constrained_dofs.h>
 #include <deal.II/matrix_free/matrix_free.h>
 #include <deal.II/matrix_free/fe_evaluation.h>
@@ -1197,14 +1196,10 @@ namespace MatrixFreeOperators
 
         // copy the vector content to a temporary vector so that it does not get
         // lost
-        VectorView<Number> view_src_in(subblock(src,i).local_size(),
-                                       subblock(src,i).begin());
-        const Vector<Number> copy_vec = view_src_in;
+        LinearAlgebra::distributed::Vector<Number> copy_vec(subblock(src,i));
         subblock(const_cast<VectorType &>(src),i).
         reinit(data->get_dof_info(mf_component).vector_partitioner);
-        VectorView<Number> view_src_out(subblock(src,i).local_size(),
-                                        subblock(src,i).begin());
-        static_cast<Vector<Number>&>(view_src_out) = copy_vec;
+        subblock(const_cast<VectorType &>(src),i).copy_locally_owned_data_from(copy_vec);
       }
   }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.