From: Bruno Turcksin Date: Thu, 24 Mar 2016 14:23:55 +0000 (-0400) Subject: Fix a bug when using boost::shared_ptr X-Git-Tag: v8.5.0-rc1~1179^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=622eddb8169015878c0954ab515ce95761eb3c2c;p=dealii.git Fix a bug when using boost::shared_ptr --- diff --git a/include/deal.II/lac/communication_pattern_base.h b/include/deal.II/lac/communication_pattern_base.h index e63a2d25fd..56665b4e0e 100644 --- a/include/deal.II/lac/communication_pattern_base.h +++ b/include/deal.II/lac/communication_pattern_base.h @@ -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 diff --git a/include/deal.II/lac/read_write_vector.h b/include/deal.II/lac/read_write_vector.h index b8459a0573..0f55cda3bd 100644 --- a/include/deal.II/lac/read_write_vector.h +++ b/include/deal.II/lac/read_write_vector.h @@ -517,7 +517,6 @@ namespace LinearAlgebra inline ReadWriteVector::ReadWriteVector () : - comm_pattern(NULL), val(NULL) {} @@ -528,7 +527,6 @@ namespace LinearAlgebra ReadWriteVector::ReadWriteVector (const ReadWriteVector &v) : Subscriptor(), - comm_pattern(NULL), val(NULL) { this->operator=(v); @@ -540,7 +538,6 @@ namespace LinearAlgebra inline ReadWriteVector::ReadWriteVector (const size_type size) : - comm_pattern(NULL), val(NULL) { reinit (size, false); @@ -552,7 +549,6 @@ namespace LinearAlgebra inline ReadWriteVector::ReadWriteVector (const IndexSet &locally_stored_indices) : - comm_pattern(NULL), val(NULL) { reinit (locally_stored_indices); diff --git a/include/deal.II/lac/read_write_vector.templates.h b/include/deal.II/lac/read_write_vector.templates.h index 4b5fbad696..7d07c49b9d 100644 --- a/include/deal.II/lac/read_write_vector.templates.h +++ b/include/deal.II/lac/read_write_vector.templates.h @@ -151,7 +151,7 @@ namespace LinearAlgebra void ReadWriteVector::import(const PETScWrappers::MPI::Vector &petsc_vec, VectorOperation::values operation, - const CommunicationPatternBase *communication_pattern) + std_cxx11::shared_ptr communication_pattern) { //TODO: this works only if no communication is needed. Assert(petsc_vec.locally_owned_elements() == stored_elements, diff --git a/include/deal.II/lac/vector_space_vector.h b/include/deal.II/lac/vector_space_vector.h index 15cc4b7cd3..b325607fc0 100644 --- a/include/deal.II/lac/vector_space_vector.h +++ b/include/deal.II/lac/vector_space_vector.h @@ -25,6 +25,7 @@ DEAL_II_NAMESPACE_OPEN class IndexSet; +template class ReadWriteVector; namespace LinearAlgebra { diff --git a/tests/lac/la_vector_norms.cc b/tests/lac/la_vector_norms.cc index 73944b4ebd..4789c47882 100644 --- a/tests/lac/la_vector_norms.cc +++ b/tests/lac/la_vector_norms.cc @@ -51,7 +51,6 @@ void check_norms () for (unsigned int i=0; i