[Dune] Preconditioner

Mike Rosing eresrch at sdf.org
Sat Sep 6 21:04:48 CEST 2025


I figured out how to get the MatrixAdaptor to be happy with my structures:

using Occupy = Matrix<double>;
using ElementVec = BlockVector<double>;

   MatrixAdapter<BCRSMatrix<Occupy>, BlockVector<ElementVec>,
                     BlockVector<ElementVec>> linearOperator(stiffns);

but none of the preconditioners are happy with this.
The ILU preconditioner gives the attached error output.

Does it make any sense to attempt to create a preconditioner that can deal 
with this structure, or should I just copy all the data into a flat 
matrix and vector with no sub-structure? Because I haven't gotten to call 
the solver yet, so this might be a lot deeper than I want to know about.

Thanks,


Mike Rosing
Engineering Research
Madison WI USA
Elliptic Curve Crypto:  http://mng.bz/D9NA
-------------- next part --------------
In file included from /home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ildl.hh:10,
                 from /home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/preconditioners.hh:26,
                 from /home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-centerbeam/src/dune-centerbeam.cc:22:
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh: In instantiation of ���void Dune::ILU::blockILU0Decomposition(M&) [with M = Dune::BCRSMatrix<Dune::Matrix<double> >]���:
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/preconditioners.hh:790:36:   required from ���Dune::SeqILU<M, X, Y, l>::SeqILU(const M&, int, real_field_type, bool) [with M = Dune::BCRSMatrix<Dune::Matrix<double> >; X = Dune::BlockVector<Dune::BlockVector<double> >; Y = Dune::BlockVector<Dune::BlockVector<double> >; int l = 1; real_field_type = double]���
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/preconditioners.hh:727:33:   required from ���Dune::SeqILU<M, X, Y, l>::SeqILU(const M&, real_field_type, bool) [with M = Dune::BCRSMatrix<Dune::Matrix<double> >; X = Dune::BlockVector<Dune::BlockVector<double> >; Y = Dune::BlockVector<Dune::BlockVector<double> >; int l = 1; real_field_type = double]���
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-centerbeam/src/dune-centerbeam.cc:734:107:   required from here
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh:57:31: error: ���class Dune::Matrix<double>��� has no member named ���rightmultiply���
   57 |           Impl::asMatrix(*ij).rightmultiply(Impl::asMatrix(*jj));
      |           ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh:67:33: error: ���class Dune::Matrix<double>��� has no member named ���leftmultiply���
   67 |               Impl::asMatrix(B).leftmultiply(Impl::asMatrix(*ij));
      |               ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh:84:31: error: ���class Dune::Matrix<double>��� has no member named ���invert���
   84 |           Impl::asMatrix(*ij).invert();   // compute inverse of diagonal block
      |           ~~~~~~~~~~~~~~~~~~~~^~~~~~
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh: In instantiation of ���typename M::field_type& Dune::ILU::firstMatrixElement(M&, std::enable_if_t<(! Dune::IsNumber<T>::value)>*) [with M = Dune::Matrix<double>; typename M::field_type = double; std::enable_if_t<(! Dune::IsNumber<T>::value)> = void]���:
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh:210:75:   required from ���void Dune::ILU::blockILUDecomposition(const M&, int, M&) [with M = Dune::BCRSMatrix<Dune::Matrix<double> >]���
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/preconditioners.hh:797:35:   required from ���Dune::SeqILU<M, X, Y, l>::SeqILU(const M&, int, real_field_type, bool) [with M = Dune::BCRSMatrix<Dune::Matrix<double> >; X = Dune::BlockVector<Dune::BlockVector<double> >; Y = Dune::BlockVector<Dune::BlockVector<double> >; int l = 1; real_field_type = double]���
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/preconditioners.hh:727:33:   required from ���Dune::SeqILU<M, X, Y, l>::SeqILU(const M&, real_field_type, bool) [with M = Dune::BCRSMatrix<Dune::Matrix<double> >; X = Dune::BlockVector<Dune::BlockVector<double> >; Y = Dune::BlockVector<Dune::BlockVector<double> >; int l = 1; real_field_type = double]���
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-centerbeam/src/dune-centerbeam.cc:734:107:   required from here
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh:153:32: error: no matching function for call to ���firstMatrixElement(double&)���
  153 |       return firstMatrixElement(*(A.begin()->begin()));
      |              ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh:150:29: note: candidate: ���template<class M> typename M::field_type& Dune::ILU::firstMatrixElement(M&, std::enable_if_t<(! Dune::IsNumber<T>::value)>*)���
  150 |     typename M::field_type& firstMatrixElement (M& A,
      |                             ^~~~~~~~~~~~~~~~~~
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh:150:29: note:   template argument deduction/substitution failed:
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh: In substitution of ���template<class M> typename M::field_type& Dune::ILU::firstMatrixElement(M&, std::enable_if_t<(! Dune::IsNumber<T>::value)>*) [with M = double]���:
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh:153:32:   required from ���typename M::field_type& Dune::ILU::firstMatrixElement(M&, std::enable_if_t<(! Dune::IsNumber<T>::value)>*) [with M = Dune::Matrix<double>; typename M::field_type = double; std::enable_if_t<(! Dune::IsNumber<T>::value)> = void]���
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/ilu.hh:210:75:   required from ���void Dune::ILU::blockILUDecomposition(const M&, int, M&) [with M = Dune::BCRSMatrix<Dune::Matrix<double> >]���
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/preconditioners.hh:797:35:   required from ���Dune::SeqILU<M, X, Y, l>::SeqILU(const M&, int, real_field_type, bool) [with M = Dune::BCRSMatrix<Dune::Matrix<double> >; X = Dune::BlockVector<Dune::BlockVector<double> >; Y = Dune::BlockVector<Dune::BlockVector<double> >; int l = 1; real_field_type = double]���
/home/drmike/Nuclear_reactions/Plasma_physics/Dune/dune-istl/dune/istl/preconditioners.hh:727:33:   required from ���Dune::SeqILU<M, X, Y, l>::SeqILU(const M&, real_field_type, bool) [with M = Dune::BCRSMatrix<Dune::Matrix<double> >; X = Dune::BlockVector<Dune::BlockVector<double> >; Y = Dune::BlockVector<Dune::BlockVector<double> >; int l = 1; real_field_type = double]���


More information about the Dune mailing list