From: kronbichler Date: Wed, 17 Sep 2008 14:49:15 +0000 (+0000) Subject: Fixed a problem in the setup of the null space in the ML preconditioner when run... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a73496de4cd621f3478d12aa8ede0826e441a13c;p=dealii-svn.git Fixed a problem in the setup of the null space in the ML preconditioner when run in parallel. git-svn-id: https://svn.dealii.org/trunk@16844 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/trilinos_precondition_amg.cc b/deal.II/lac/source/trilinos_precondition_amg.cc index ea61218f94..8a7a349edb 100755 --- a/deal.II/lac/source/trilinos_precondition_amg.cc +++ b/deal.II/lac/source/trilinos_precondition_amg.cc @@ -17,6 +17,7 @@ #ifdef DEAL_II_USE_TRILINOS #include +#include #include #include #include @@ -78,27 +79,39 @@ namespace TrilinosWrappers if (higher_order_elements) parameter_list.set("aggregation: type", "MIS"); + + const Epetra_Map * domain_map = &(matrix.matrix->DomainMap()); - std::vector null_space_modes; + Epetra_MultiVector null_space_modes (*domain_map, null_space_dimension); if (null_space_dimension > 1) { Assert (n_rows == null_space[0].size(), ExcDimensionMismatch(n_rows, null_space[0].size())); + Assert (n_rows == (unsigned int)null_space_modes.GlobalLength(), + ExcDimensionMismatch(n_rows, + null_space_modes.GlobalLength())); + + unsigned int my_size = domain_map->NumMyElements(); + Assert (my_size == domain_map->MaxLID()+1, + ExcDimensionMismatch (my_size, domain_map->MaxLID()+1)); // Reshape null space as a // contiguous vector of // doubles so that Trilinos // can read from it. - null_space_modes.resize (n_rows * null_space_dimension, 0.); for (unsigned int d=0; dGID(row); + null_space_modes.ReplaceMyValue(row, d, + (double)null_space[d][global_row_id]); + } parameter_list.set("null space: type", "pre-computed"); - parameter_list.set("null space: dimension", int(null_space_dimension)); - parameter_list.set("null space: vectors", &null_space_modes[0]); + parameter_list.set("null space: dimension", null_space_modes.NumVectors()); + parameter_list.set("null space: vectors", null_space_modes.Values()); } multigrid_operator = boost::shared_ptr