const MPI_Comm communicator,
const bool vector_writable = false);
+ /**
+ * Release all memory and return to a state just like after having called
+ * the default constructor.
+ */
+ void
+ clear();
+
/**
* Reinit functionality. This function destroys the old vector content
* and generates a new one based on the input partitioning. The flag
+ template <typename Number, typename MemorySpace>
+ void
+ Vector<Number, MemorySpace>::clear()
+ {
+ vector = Utilities::Trilinos::internal::make_rcp<VectorType>(
+ Utilities::Trilinos::internal::make_rcp<MapType>(
+ 0, 0, Utilities::Trilinos::tpetra_comm_self()));
+ has_ghost = false;
+ compressed = true;
+ }
+
+
+
template <typename Number, typename MemorySpace>
void
Vector<Number, MemorySpace>::reinit(const IndexSet ¶llel_partitioner,
v1.reinit(set, communicator);
deallog << "reinit: " << v1.size() << ' ';
+ v1.clear();
#ifdef DEAL_II_WITH_MPI
MPI_Comm_free(&communicator);
#endif
v1.reinit(v2);
deallog << v1.size() << std::endl;
+ v1.clear();
+ v2.clear();
#ifdef DEAL_II_WITH_MPI
MPI_Comm_free(&communicator);
#endif
v1 = v2;
deallog << v1.size() << std::endl;
+ v1.clear();
+ v2.clear();
#ifdef DEAL_II_WITH_MPI
MPI_Comm_free(&communicator);
#endif
v3->reinit(v1);
deallog << "reinit pool " << v1.size() << ' ' << v3->size() << ' ';
+ v1.clear();
+ v3->clear();
#ifdef DEAL_II_WITH_MPI
MPI_Comm_free(&communicator);
#endif
v3->reinit(v1);
deallog << "reinit pool " << v3->size() << std::endl;
+ v1.clear();
+ v3->clear();
#ifdef DEAL_II_WITH_MPI
MPI_Comm_free(&communicator);
#endif
--- /dev/null
+
+DEAL::reinit: 5 5 5
+DEAL::assign 5 5
+DEAL::reinit pool 5 5 reinit pool 5
+DEAL::reinit: 5 5 5
+DEAL::assign 5 5
+DEAL::reinit pool 5 5 reinit pool 5
+DEAL::reinit: 5 5 5
+DEAL::assign 5 5
+DEAL::reinit pool 5 5 reinit pool 5
+DEAL::reinit: 5 5 5
+DEAL::assign 5 5
+DEAL::reinit pool 5 5 reinit pool 5