Number of degrees of freedom: 337
System matrix memory consumption: 0.02232 MBytes.
Multigrid objects memory consumption: 0.04438 MBytes.
-Convergence in 8 CG iterations.
+Convergence in 9 CG iterations.
Cycle 1
Number of degrees of freedom: 1313
System matrix memory consumption: 0.08101 MBytes.
Multigrid objects memory consumption: 0.1564 MBytes.
-Convergence in 9 CG iterations.
+Convergence in 10 CG iterations.
Cycle 2
Number of degrees of freedom: 5185
System matrix memory consumption: 0.3141 MBytes.
Multigrid objects memory consumption: 0.5939 MBytes.
-Convergence in 9 CG iterations.
+Convergence in 10 CG iterations.
Cycle 3
Number of degrees of freedom: 20609
System matrix memory consumption: 1.243 MBytes.
Multigrid objects memory consumption: 2.328 MBytes.
-Convergence in 9 CG iterations.
+Convergence in 10 CG iterations.
Cycle 4
Number of degrees of freedom: 82177
Number of degrees of freedom: 328193
System matrix memory consumption: 19.77 MBytes.
Multigrid objects memory consumption: 36.83 MBytes.
-Convergence in 9 CG iterations.
+Convergence in 10 CG iterations.
@endcode
As in step-16, we see that the number of CG iterations stays constant with
Number of degrees of freedom: 517
System matrix memory consumption: 0.09649 MBytes.
Multigrid objects memory consumption: 0.1389 MBytes.
-Convergence in 7 CG iterations.
+Convergence in 9 CG iterations.
Cycle 1
Number of degrees of freedom: 3817
System matrix memory consumption: 0.6333 MBytes.
Multigrid objects memory consumption: 0.8396 MBytes.
-Convergence in 8 CG iterations.
+Convergence in 9 CG iterations.
Cycle 2
Number of degrees of freedom: 29521
Number of degrees of freedom: 232609
System matrix memory consumption: 38.68 MBytes.
Multigrid objects memory consumption: 49.26 MBytes.
-Convergence in 10 CG iterations.
+Convergence in 9 CG iterations.
Cycle 4
Number of degrees of freedom: 1847617
System matrix memory consumption: 308.4 MBytes.
Multigrid objects memory consumption: 391.5 MBytes.
-Convergence in 11 CG iterations.
+Convergence in 9 CG iterations.
@endcode
-We observe a slight increase in the number of CG iterations, but also for the
-largest size with almost two million unknowns, the iteration count is still
-very modest.
+A comparison of the memory consumption of the MatrixFree class with a
+standard SparseMatrix object shows that, for the largest problem considered
+in 3D, the memory consumption for SparseMatrix and its sparsity pattern
+would be about 1.3 GBytes, which is a factor of 4 more memory. If combined
+with cubic elements in 3D, the MatrixFree class would decrease memory
+consumption by a factor of 12.
std::size_t memory_consumption () const;
// The private member variables of the
- // <code>MatrixFree</code> class are a small matrix that
- // does the transformation from solution
- // values to quadrature points, a list with
- // the mapping between local degrees of
- // freedom and global degrees of freedom
- // for each cell (stored as a
- // two-dimensional array, where the each
- // row corresponds to one cell, and the
- // columns within individual cells are the
- // local degrees of freedom), the
- // transformation variable for implementing
- // derivatives, a constraint matrix for
- // handling boundary conditions as well as
- // a few other variables that store matrix
- // properties.
+ // <code>MatrixFree</code> class are a
+ // small matrix that does the
+ // transformation from solution values to
+ // quadrature points, a list with the
+ // mapping between local degrees of freedom
+ // and global degrees of freedom for each
+ // cell (stored as a two-dimensional array,
+ // where the each row corresponds to one
+ // cell, and the columns within individual
+ // cells are the local degrees of freedom),
+ // the transformation variable for
+ // implementing derivatives, a constraint
+ // matrix for handling boundary conditions
+ // as well as a few other variables that
+ // store matrix properties.
private:
template <typename number2>
void vmult_on_subrange (const unsigned int first_cell,
// This function we need if we want to
// delete the content of the matrix,
- // e.g. when are finished with one grid
+ // e.g. when we are finished with one grid
// level and continue to the next one. Just
- // let all fields have size 0.
+ // put all fields sizes to 0.
template <typename number, class Transformation>
void
MatrixFree<number,Transformation>::clear ()
// order elements, since smoothing gets
// more difficult then. Smooth out a
// range of
- // $[\lambda_{\max}/8,\lambda_{\max}]$.
+ // $[\lambda_{\max}/10,\lambda_{\max}]$.
typename SMOOTHER::AdditionalData smoother_data;
- smoother_data.smoothing_range = 8.;
- smoother_data.degree = 3;
+ smoother_data.smoothing_range = 10.;
+ smoother_data.degree = fe.degree+1;
+ smoother_data.eig_cg_n_iterations = 4+2*fe.degree;
mg_smoother.initialize(mg_matrices, smoother_data);
MGMatrix<MatrixFreeType, Vector<double> >
};
}
-
+
int main ()
{
max_eigenvalue = T.eigenvalue(T.n()-1);
}
- const double beta = 1.1 * max_eigenvalue;
+ const double beta = 1.2 * max_eigenvalue;
const double alpha = (data.smoothing_range > 0 ?
max_eigenvalue / data.smoothing_range :
max_eigenvalue / min_eigenvalue);