From: Martin Kronbichler Date: Tue, 22 Mar 2011 10:15:14 +0000 (+0000) Subject: Trilinos expects a valid pointer for constant modes also when there is no data owned... X-Git-Tag: v8.0.0~4214 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24cad6023974e035da0b6c35f924de25d1455f02;p=dealii.git Trilinos expects a valid pointer for constant modes also when there is no data owned locally. git-svn-id: https://svn.dealii.org/trunk@23488 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/lac/trilinos_precondition.cc b/deal.II/source/lac/trilinos_precondition.cc index fdf798dac6..c8e4d938ca 100644 --- a/deal.II/source/lac/trilinos_precondition.cc +++ b/deal.II/source/lac/trilinos_precondition.cc @@ -578,6 +578,7 @@ namespace TrilinosWrappers additional_data.constant_modes.size(); Epetra_MultiVector distributed_constant_modes (domain_map, constant_modes_dimension); + std::vector 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);