Dear Lucas,
take a look at the tests directory of deal.II:
https://github.com/dealii/dealii/blob/master/tests/lac/block_linear_operator_05.cc
there are many small examples and snippets that show how to use this.
In particular, I think the problem is in the fact that you are calling directly dealii::TrilinosWrappers::linear_operator and dealii::TrilinosWrappers::block_operator.
These are used internally by the functions in linear_operator_tools, and, btw, you are not required to include
#include <deal.II/lac/trilinos_linear_operator.h>
as these are included by linear_operator_tools.h, and the typical usage is through the functions dealii::linear_operator, dealii::block_operator, dealii::block_diagonal_operator, etc. (notice these are in dealii namespace, not in dealii::TrilinosWrappers namespace).
e.g., this should compile:
using vec = dealii::LinearAlgebraTrilinos::MPI::Vector;
using block_vec = dealii::LinearAlgebraTrilinos::MPI::BlockVector;
const auto B = linear_operator<vec>(system_matrix.block(0, 0)); // Notice this is not dealii::TrilinosWrappers::linear_operator
const auto P_inv = block_diagonal_operator<1, block_vec >(std::array<decltype(B), 1>({{B}}));
Creating (as for your example) a block operator with a single block.
L.
Ps: I don’t see an obvious reason why your example should not compile too. Could you try to modify
https://github.com/dealii/dealii/blob/master/tests/lac/block_linear_operator_05.cc
to reflect your example, and open an issue with a MWE that fails to compile? Reading your code, I would have expected it to compile, and I think you have spotted a problem in deal.II due to an unusual way in which you are using the code.
> --
> 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
dealii+un...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/8a6be404-f323-4edc-9720-fe603c92dfe6n%40googlegroups.com.
> <linear_operator_bug.txt>