]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Trilinos expects a valid pointer for constant modes also when there is no data owned...
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 22 Mar 2011 10:15:14 +0000 (10:15 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 22 Mar 2011 10:15:14 +0000 (10:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@23488 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/lac/trilinos_precondition.cc

index fdf798dac61023c887125f94977ee89d76054220..c8e4d938ca2736d5af2aaea8b7ac7ba1926ef1db 100644 (file)
@@ -578,6 +578,7 @@ namespace TrilinosWrappers
       additional_data.constant_modes.size();
     Epetra_MultiVector distributed_constant_modes (domain_map,
                                                   constant_modes_dimension);
+    std::vector<double> dummy (constant_modes_dimension);
 
     if (constant_modes_dimension > 1)
       {
@@ -609,8 +610,16 @@ namespace TrilinosWrappers
        parameter_list.set("null space: type", "pre-computed");
        parameter_list.set("null space: dimension",
                           distributed_constant_modes.NumVectors());
-       parameter_list.set("null space: vectors",
-                          distributed_constant_modes.Values());
+       if (my_size > 0)
+         parameter_list.set("null space: vectors",
+                            distributed_constant_modes.Values());
+                               // We need to set a valid pointer to data even
+                               // if there is no data on the current
+                               // processor. Therefore, pass a dummy in that
+                               // case
+       else
+         parameter_list.set("null space: vectors",
+                            &dummy[0]);
       }
 
     initialize (matrix, parameter_list);

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.