]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a bug when using boost::shared_ptr
authorBruno Turcksin <bruno.turcksin@gmail.com>
Thu, 24 Mar 2016 14:23:55 +0000 (10:23 -0400)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Thu, 24 Mar 2016 14:23:55 +0000 (10:23 -0400)
include/deal.II/lac/communication_pattern_base.h
include/deal.II/lac/read_write_vector.h
include/deal.II/lac/read_write_vector.templates.h
include/deal.II/lac/vector_space_vector.h
tests/lac/la_vector_norms.cc

index e63a2d25fd111de64daafe6bb7fe354e7df8b69c..56665b4e0e92a4d5c294b82f8e78f3529a2e8c98 100644 (file)
@@ -41,6 +41,11 @@ namespace LinearAlgebra
   class CommunicationPatternBase
   {
   public:
+    /**
+     * Destructor.
+     */
+    virtual ~CommunicationPatternBase() {};
+
     /**
      * Reinitialize the communication pattern. The first argument @p
      * vector_space_vector_index_set is the index set associated to a
index b8459a05730ca1be1f654c1d1356920f608b3b5b..0f55cda3bd68e335ad73d0a62de2aa6c54082c66 100644 (file)
@@ -517,7 +517,6 @@ namespace LinearAlgebra
   inline
   ReadWriteVector<Number>::ReadWriteVector ()
     :
-    comm_pattern(NULL),
     val(NULL)
   {}
 
@@ -528,7 +527,6 @@ namespace LinearAlgebra
   ReadWriteVector<Number>::ReadWriteVector (const ReadWriteVector<Number> &v)
     :
     Subscriptor(),
-    comm_pattern(NULL),
     val(NULL)
   {
     this->operator=(v);
@@ -540,7 +538,6 @@ namespace LinearAlgebra
   inline
   ReadWriteVector<Number>::ReadWriteVector (const size_type size)
     :
-    comm_pattern(NULL),
     val(NULL)
   {
     reinit (size, false);
@@ -552,7 +549,6 @@ namespace LinearAlgebra
   inline
   ReadWriteVector<Number>::ReadWriteVector (const IndexSet &locally_stored_indices)
     :
-    comm_pattern(NULL),
     val(NULL)
   {
     reinit (locally_stored_indices);
index 4b5fbad69680f1f03cd23fa38b53733ec802ab77..7d07c49b9d7e00213b6dbf3372aef5984677bb1f 100644 (file)
@@ -151,7 +151,7 @@ namespace LinearAlgebra
   void
   ReadWriteVector<Number>::import(const PETScWrappers::MPI::Vector &petsc_vec,
                                   VectorOperation::values operation,
-                                  const CommunicationPatternBase *communication_pattern)
+                                  std_cxx11::shared_ptr<const CommunicationPatternBase> communication_pattern)
   {
     //TODO: this works only if no communication is needed.
     Assert(petsc_vec.locally_owned_elements() == stored_elements,
index 15cc4b7cd356d542f8f5eb390a2ff011eb0ed3e8..b325607fc08fe9bf3198149b5e6cd59e294826cc 100644 (file)
@@ -25,6 +25,7 @@
 DEAL_II_NAMESPACE_OPEN
 
 class IndexSet;
+template <typename Number> class ReadWriteVector;
 
 namespace LinearAlgebra
 {
index 73944b4ebd55cfd0baf8724611e0afa0dc109a2c..4789c47882f3470d4e9181651f7390b7cd5101a3 100644 (file)
@@ -51,7 +51,6 @@ void check_norms ()
       for (unsigned int i=0; i<size; ++i)
         vec[i] = (number)value;
       const number l1_norma = vec.l1_norm();
-      std::cout<<l1_norma<<std::endl;
       AssertThrow (std::abs(l1_norma-value*size) < acc*size*value,
                    ExcInternalError());
       const number l2_norma = vec.l2_norm();

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.