]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Guard accessing values in Vector<Number>::zero_out_ghosts
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 30 Apr 2018 16:35:24 +0000 (18:35 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 30 Apr 2018 16:37:58 +0000 (18:37 +0200)
include/deal.II/lac/la_parallel_vector.templates.h

index c3619ddc6006003db193e712d62369574f06b7e1..fd40922872713ef9bc4827292d1038b67b0bee1c 100644 (file)
@@ -517,9 +517,10 @@ namespace LinearAlgebra
     void
     Vector<Number>::zero_out_ghosts () const
     {
-      std::fill_n (&values[partitioner->local_size()],
-                   partitioner->n_ghost_indices(),
-                   Number());
+      if (values != nullptr)
+        std::fill_n (&values[partitioner->local_size()],
+                     partitioner->n_ghost_indices(),
+                     Number());
       vector_is_ghosted = false;
     }
 

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.