On 11/3/23 01:44, Tiny Y wrote:
My code, although there were errors before the change, could run under single
core mode. However, after I made some modifications, the following error
message appeared. When I run the code before the change again, the following
error message will also appear.
I just tried to change the error reported in the previous code and added a few
parameter definitions. Why do the same code produce different results?
Yu:
there must of course be a reason, and it will reveal itself by debugging the
issue :-)
Here, a good starting point would be to read the error message and how you get
into this place. From the backtrace, you find that the problem is in a the
following function:
void
PreconditionAMG::AdditionalData::set_operator_null_space(
Teuchos::ParameterList ¶meter_list,
std::unique_ptr<Epetra_MultiVector> &ptr_distributed_constant_modes,
const Epetra_RowMatrix &matrix) const
{
const Epetra_Map &domain_map = matrix.OperatorDomainMap();
const size_type constant_modes_dimension = constant_modes.size();
ptr_distributed_constant_modes = std::make_unique<Epetra_MultiVector>(
domain_map, constant_modes_dimension > 0 ? constant_modes_dimension : 1);
Epetra_MultiVector &distributed_constant_modes =
*ptr_distributed_constant_modes;
if (constant_modes_dimension > 0)
{
const size_type global_size = TrilinosWrappers::n_global_rows(matrix);
[...]
const bool constant_modes_are_global =
constant_modes[0].size() == global_size;
const size_type my_size = domain_map.NumMyElements();
// Reshape null space as a contiguous vector of doubles so that
// Trilinos can read from it.
const size_type expected_mode_size =
constant_modes_are_global ? global_size : my_size;
for (size_type d = 0; d < constant_modes_dimension; ++d)
{
Assert(constant_modes[d].size() == expected_mode_size,
ExcDimensionMismatch(constant_modes[d].size(),
expected_mode_size));
From the error messages you already know what the actual and the expected
size of the array is. Now it's for you to figure out why these are not the same.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.colostate.edu/~bangerth/
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/96fb4045-9b9e-0cb8-e817-3daf7ee4ff2b%40colostate.edu.