Dear all,
I have a problem with imposing homogeneous Dirichlet boundary conditions for pressure in a vector-valued problem.
I have defined interpolate_ and apply_boundary_values as following in the assembly routine:
std::map<types::global_dof_index, double> boundary_values;
VectorTools::interpolate_boundary_values(dof_handler,
1,
BoundaryValues<dim>(), //copied from step-22 with slight modifications
boundary_values,
fe.component_mask(pressure));
MatrixTools::apply_boundary_values(boundary_values, system_matrix, solution, system_rhs);
But it throws an exception (in line 261, matrix_tools.cc) stating:
matrix.get_sparsity_pattern().get_column_indices() == solution.get_block_indices()
Additional information:
You are providing a matrix whose subdivision into blocks in either row or column direction does not use the same block sizes as the solution vector or right hand side vectors, respectively.
(Stacktrace:...
void dealii::MatrixTools::apply_boundary_values<double>(std::map<unsigned int, double, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, double> > > const&, dealii::BlockSparseMatrix<double>&, dealii::BlockVector<double>&, dealii::BlockVector<double>&, bool)
)
The code (and setup_system in particular) is basically based on step-20 (i.e. I used the component_wise renumbering approach, BlockSparseMatrix and BlockVectors, but no Schur complement, no LinearOperator, and a matrix much simpler). But I still do not understand the problem with my definitions. Could anyone have some hints please?
Thank you very much,
Ali