]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Do not assign NULL to boost::shared_ptr. 2404/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Thu, 24 Mar 2016 17:58:20 +0000 (13:58 -0400)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Thu, 24 Mar 2016 18:16:30 +0000 (14:16 -0400)
include/deal.II/lac/read_write_vector.templates.h
include/deal.II/lac/trilinos_epetra_communication_pattern.h
include/deal.II/lac/trilinos_epetra_vector.h
include/deal.II/lac/vector_space_vector.h
source/lac/trilinos_epetra_vector.cc

index 7d07c49b9d7e00213b6dbf3372aef5984677bb1f..7fb27e15484b11e63eb3f4bc62703f5ab9afeb57 100644 (file)
@@ -71,7 +71,7 @@ namespace LinearAlgebra
 
     // reset the communication patter
     source_stored_elements.clear();
-    comm_pattern = NULL;
+    comm_pattern.reset();
   }
 
 
@@ -91,7 +91,7 @@ namespace LinearAlgebra
 
     // reset the communication patter
     source_stored_elements.clear();
-    comm_pattern = NULL;
+    comm_pattern.reset();
   }
 
 
@@ -112,7 +112,7 @@ namespace LinearAlgebra
 
     // reset the communication patter
     source_stored_elements.clear();
-    comm_pattern = NULL;
+    comm_pattern.reset();
   }
 
 
index 9846515776159782d7a95b854b561ce791c730c5..a7f290f6241b98d7d168da8985c128f514de1ffd 100644 (file)
@@ -55,7 +55,7 @@ namespace LinearAlgebra
        */
       void reinit(const IndexSet &vector_space_vector_index_set,
                   const IndexSet &read_write_vector_index_set,
-                  const MPI_Comm &communicator) override;
+                  const MPI_Comm &communicator);
 
       /**
        * Return the underlying MPI communicator.
index e974863ae1b899e3d3cb4f90b18db4921059b464..f71a5217b9b176e2fbf9f1fd602917a9e0a8dd3a 100644 (file)
@@ -101,7 +101,8 @@ namespace LinearAlgebra
        */
       virtual void import(const ReadWriteVector<double>  &V,
                           VectorOperation::values         operation,
-                          std_cxx11::shared_ptr<const CommunicationPatternBase> communication_pattern = NULL);
+                          std_cxx11::shared_ptr<const CommunicationPatternBase> communication_pattern =
+                            std_cxx11::shared_ptr<const CommunicationPatternBase> ());
 
       /**
        * Multiply the entire vector by a fixed factor.
index b325607fc08fe9bf3198149b5e6cd59e294826cc..85b382835429862d01e371d1747c269ae32f59cf 100644 (file)
@@ -20,6 +20,7 @@
 #include <deal.II/base/mpi.h>
 #include <deal.II/base/numbers.h>
 #include <deal.II/base/std_cxx11/shared_ptr.h>
+#include <deal.II/lac/vector.h>
 
 
 DEAL_II_NAMESPACE_OPEN
@@ -81,7 +82,8 @@ namespace LinearAlgebra
      */
     virtual void import(const ReadWriteVector<Number> &V,
                         VectorOperation::values operation,
-                        std_cxx11::shared_ptr<const CommunicationPatternBase> communication_pattern = NULL) = 0;
+                        std_cxx11::shared_ptr<const CommunicationPatternBase> communication_pattern =
+                          std_cxx11::shared_ptr<const CommunicationPatternBase> ()) = 0;
 
     /**
      * Return the scalar product of two vectors.
index 854de65ff77ee758b4fcfe895b655f6879cc2587..58d3bae0f176622bbf7e41207112c4e60f50386d 100644 (file)
@@ -33,16 +33,14 @@ namespace LinearAlgebra
   {
     Vector::Vector()
       :
-      vector(new Epetra_FEVector(Epetra_Map(0,0,0,Utilities::Trilinos::comm_self()))),
-      epetra_comm_pattern(NULL)
+      vector(new Epetra_FEVector(Epetra_Map(0,0,0,Utilities::Trilinos::comm_self())))
     {}
 
 
 
     Vector::Vector(const Vector &V)
       :
-      vector(new Epetra_FEVector(V.trilinos_vector())),
-      epetra_comm_pattern(NULL)
+      vector(new Epetra_FEVector(V.trilinos_vector()))
     {}
 
 
@@ -50,8 +48,7 @@ namespace LinearAlgebra
     Vector::Vector(const IndexSet &parallel_partitioner,
                    const MPI_Comm &communicator)
       :
-      vector(new Epetra_FEVector(parallel_partitioner.make_trilinos_map(communicator,false))),
-      epetra_comm_pattern(NULL)
+      vector(new Epetra_FEVector(parallel_partitioner.make_trilinos_map(communicator,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.