From: guido Date: Fri, 7 Mar 2003 11:17:57 +0000 (+0000) Subject: untested (and unaccessed) code for easy matrices X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82bc6acbeee6a743a89c54718de79f1e4fe57835;p=dealii-svn.git untested (and unaccessed) code for easy matrices git-svn-id: https://svn.dealii.org/trunk@7275 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/multigrid/mg_transfer.h b/deal.II/deal.II/include/multigrid/mg_transfer.h index 1b234e5906..b7bb6d19f9 100644 --- a/deal.II/deal.II/include/multigrid/mg_transfer.h +++ b/deal.II/deal.II/include/multigrid/mg_transfer.h @@ -14,9 +14,14 @@ #define __deal2__mg_transfer_h -#include #include -#include +#ifdef DEAL_PREFER_MATRIX_EZ +# include +# include +#else +# include +# include +#endif #include #include @@ -165,7 +170,21 @@ class MGTransferPrebuilt : public MGTransferBase > */ std::vector sizes; - +#ifdef DEAL_PREFER_MATRIX_EZ + /** + * The actual prolongation matrix. + * column indices belong to the + * dof indices of the mother cell, + * i.e. the coarse level. + * while row indices belong to the + * child cell, i.e. the fine level. + */ + std::vector > prolongation_matrices; +#else + /** + * Sparsity patterns for transfer + * matrices. + */ std::vector prolongation_sparsities; /** @@ -177,6 +196,7 @@ class MGTransferPrebuilt : public MGTransferBase > * child cell, i.e. the fine level. */ std::vector > prolongation_matrices; +#endif }; diff --git a/deal.II/deal.II/source/multigrid/multigrid.cc b/deal.II/deal.II/source/multigrid/multigrid.cc index 5cdce03577..0491b8132e 100644 --- a/deal.II/deal.II/source/multigrid/multigrid.cc +++ b/deal.II/deal.II/source/multigrid/multigrid.cc @@ -51,9 +51,10 @@ void MGTransferPrebuilt::build_matrices ( // have a size greater zero. prolongation_matrices.resize (0); prolongation_matrices.resize (n_levels-1); +#ifndef DEAL_PREFER_MATRIX_EZ prolongation_sparsities.resize (0); prolongation_sparsities.resize (n_levels-1); - +#endif // two fields which will store the // indices of the multigrid dofs // for a cell and one of its children @@ -74,10 +75,18 @@ void MGTransferPrebuilt::build_matrices ( // necessary. this, of course, is the // number of degrees of freedom per // cell +#ifdef DEAL_PREFER_MATRIX_EZ + prolongation_matrices[level].reinit (sizes[level+1], + sizes[level], + dofs_per_cell); +#else + // increment dofs_per_cell + // since a useless diagonal + // element will be stored prolongation_sparsities[level].reinit (sizes[level+1], - sizes[level], -//TODO:[WB,GK] evil hack, must be corrected! - dofs_per_cell+1); + sizes[level], + dofs_per_cell+1); +#endif for (typename MGDoFHandler::cell_iterator cell=mg_dof.begin(level); cell != mg_dof.end(level); ++cell)