]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement TensorProductMatrixSymmetricSumBase::memory_consumption() 14175/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 4 Aug 2022 06:54:08 +0000 (08:54 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 4 Aug 2022 06:54:08 +0000 (08:54 +0200)
include/deal.II/lac/tensor_product_matrix.h

index 17d965128c9f0abab72e12964b9a42739570f75c..55206de2358cb064d4f2df5a2608f32bab95bbe3 100644 (file)
@@ -121,6 +121,12 @@ public:
   apply_inverse(const ArrayView<Number> &      dst,
                 const ArrayView<const Number> &src) const;
 
+  /**
+   * Return the memory consumption of the allocated memory in this class.
+   */
+  std::size_t
+  memory_consumption() const;
+
 protected:
   /**
    * Default constructor.
@@ -624,6 +630,21 @@ TensorProductMatrixSymmetricSumBase<dim, Number, n_rows_1d>::apply_inverse(
 }
 
 
+
+template <int dim, typename Number, int n_rows_1d>
+std::size_t
+TensorProductMatrixSymmetricSumBase<dim, Number, n_rows_1d>::
+  memory_consumption() const
+{
+  return MemoryConsumption::memory_consumption(mass_matrix) +
+         MemoryConsumption::memory_consumption(derivative_matrix) +
+         MemoryConsumption::memory_consumption(eigenvalues) +
+         MemoryConsumption::memory_consumption(eigenvectors) +
+         MemoryConsumption::memory_consumption(tmp_array);
+}
+
+
+
 //---------------------- TensorProductMatrixSymmetricSum ----------------------
 
 template <int dim, typename Number, int n_rows_1d>

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.