Hey everyone,
I am setting up a system matrix in Trilinos::Blocksparsematrix with a DOfHandler, which has 3 velocity components and 1 pressure component (analogously to step-32).
Somehow everything worked fine a long time, but now I get an error I dont understand.
I call:
std::vector<double> div_sol_u (dofs_per_cell);
std::vector<double> sol_p (dofs_per_cell);
[...]
for (unsigned int k=0; k<dofs_per_cell; ++k)
{
div_sol_u[k] = fe_values[velocities].divergence(k,q);
sol_p[k] = fe_values[pressure].value(k,q);
}
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j){
local_matrix(i,j) += (-1)* sol_p[i]*div_sol_u[j]*fe_values.JxW(q);
[...]
constraints.distribute_local_to_global (local_matrix,
local_dof_indices,
system_matrixt);
(In loval_matrix += ... I left out the other parts of the matrix to keep notation short in this question)
But when I run this I get the following error
void
dealii::TrilinosWrappers::SparseMatrix::add(dealii::TrilinosWrappers::SparseMatrix::size_type,
dealii::TrilinosWrappers::SparseMatrix::size_type, const size_type*,
const TrilinosScalar*, bool, bool)
The violated condition was:
ierr == 0
Additional information:
An error with error number 2 occurred while calling a Trilinos function
After some debugging I found out that the term (-1)* sol_p[i]*div_sol_u[j] makes this trouble. Can somebody tell me why?
Best
Gabriel