[Dune] Preconditioner
Christian Engwer
christian.engwer at uni-muenster.de
Tue Sep 9 15:20:51 CEST 2025
Dear Mike,
the main motivation for exposing the block structure is
efficiency. This would be significantly reduced when switching to
dynamic size, as in this case we can't store the data cosecutively.
You can just as well go with flat matrices and the simple
preconditioners.
Ciao
Christian
Am Tue, Sep 09, 2025 at 12:59:33PM +0000 schrieb Mike Rosing:
> Howdy Christian,
>
> Recompiling everytime I change size is annoying, but it's also not
> that big a deal. Worst case if I want different sizes I can just use
> different named variables - so I can see how to get there from here.
>
> I just have to change my thought process to the reality of the code.
>
> I did try flattening the matrix to BCRSMatrix<double> but I must have
> done something wrong because DUNE aborted with a NaN error. So I think
> being safe is the way to go.
>
> Thanks!
> Mike
>
> On Tue, 9 Sep 2025, Christian Engwer wrote:
>
> > Date: Tue, 09 Sep 2025 07:55:16 +0200
> > From: Christian Engwer <christian.engwer at uni-muenster.de>
> > To: dune at lists.dune-project.org, Mike Rosing <eresrch at sdf.org>
> > Subject: Re: [Dune] Preconditioner
> >
> > Dear Mike,
> >
> > I'm afraid also we DUNE people need to dig deeper into this.
> >
> > The issue here is that you're using Matrix for the blocks, which have
> > dynamic size. The usual pattern is to use FieldMatrix, which has static
> > size and a default constructor. The algorithms use this to decide where
> > to invest directly.
> >
> > The genetic algorithms usually expect BCRSMatrix to contain dense data,
> > but Matrix dies not where that everything below is dense.
> >
> > The safe way would be to use BCRSMatrix<FieldMatrix<double,n,n>> and
> > BlockVector<FieldVector<double, n>>
> >
> > Do you really need the dynamic size?
> >
> > I didn't test myself, but perhaps BCRSMatrix<DynamicMatrix<double,n,n>>
> > and BlockVector<DynamicVector<double, n>> work. I would expect
> > relaxation methods to work, but not AMG. Für ILU it might be a problem,
> > that the constructor of DynamicMatrix needs the size information.
> >
> > Best
> > Christian
> >
> > Am 6. September 2025 21:04:48 MESZ schrieb Mike Rosing <eresrch at sdf.org>:
> > > 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
> >
>
> Mike Rosing
> Engineering Research
> Madison WI USA
> Elliptic Curve Crypto: http://mng.bz/D9NA
--
Prof. Dr. Christian Engwer
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster
E-Mail christian.engwer at uni-muenster.de
Telefon +49 251 83-35067
FAX +49 251 83-32729
More information about the Dune
mailing list