*/
void
interpolate(VectorType &dst, const VectorType &src) const;
+
+ /**
+ * Return the memory consumption of the allocated memory in this class.
+ */
+ std::size_t
+ memory_consumption() const;
};
interpolate(LinearAlgebra::distributed::Vector<Number> & dst,
const LinearAlgebra::distributed::Vector<Number> &src) const;
+ /**
+ * Return the memory consumption of the allocated memory in this class.
+ */
+ std::size_t
+ memory_consumption() const;
+
private:
/**
* A multigrid transfer scheme. A multrigrid transfer class can have different
MGLevelObject<VectorType> & dst,
const InVector & src) const;
+ /**
+ * Return the memory consumption of the allocated memory in this class.
+ *
+ * @note Counts also the memory consumption of the underlying two-level
+ * transfer operators.
+ */
+ std::size_t
+ memory_consumption() const;
+
private:
/**
* Collection of the two-level transfer operators.
this->transfer[l].interpolate(dst[l - 1], dst[l]);
}
+
+
+template <int dim, typename VectorType>
+std::size_t
+MGTransferGlobalCoarsening<dim, VectorType>::memory_consumption() const
+{
+ std::size_t size = 0;
+
+ const unsigned int min_level = transfer.min_level();
+ const unsigned int max_level = transfer.max_level();
+
+ for (unsigned int l = min_level + 1; l <= max_level; ++l)
+ size += this->transfer[l].memory_consumption();
+
+ return size;
+}
+
#endif
DEAL_II_NAMESPACE_CLOSE
return cell_transfer.run(cell_transfer_test);
}
+
+
+template <int dim, typename Number>
+std::size_t
+MGTwoLevelTransfer<dim, LinearAlgebra::distributed::Vector<Number>>::
+ memory_consumption() const
+{
+ std::size_t size = 0;
+
+ for (const auto &scheme : schemes)
+ {
+ size += scheme.prolongation_matrix.memory_consumption();
+ size += scheme.prolongation_matrix_1d.memory_consumption();
+ size += scheme.restriction_matrix.memory_consumption();
+ size += scheme.restriction_matrix_1d.memory_consumption();
+ }
+
+ size += partitioner_fine->memory_consumption();
+ size += partitioner_coarse->memory_consumption();
+ size += vec_fine.memory_consumption();
+ size += vec_coarse.memory_consumption();
+ size +=
+ MemoryConsumption::memory_consumption(distribute_local_to_global_indices);
+ size +=
+ MemoryConsumption::memory_consumption(distribute_local_to_global_values);
+ size += MemoryConsumption::memory_consumption(distribute_local_to_global_ptr);
+ size += MemoryConsumption::memory_consumption(weights);
+ size += MemoryConsumption::memory_consumption(level_dof_indices_coarse);
+ size += MemoryConsumption::memory_consumption(level_dof_indices_fine);
+
+ return size;
+}
+
DEAL_II_NAMESPACE_CLOSE
#endif