[Dune] calling ISTL solvers for dense matrices

Steffen Müthing steffen.muething at iwr.uni-heidelberg.de
Wed Jun 28 17:21:35 CEST 2017


> Am 28.06.2017 um 11:10 schrieb Christian Engwer <christian.engwer at uni-muenster.de>:
> 
> On Wed, Jun 28, 2017 at 09:23:42AM +0200, Markus Blatt wrote:
>> Hi,
>> 
>> On Tue, Jun 27, 2017 at 10:01:47AM +0200, Christian Engwer wrote:
>>> in complexmatrixtest ISTL krylov solvers are called for FieldMatrix
>>> and FieldVector. Is this a feature we want to support? I was a bit
>>> surprised and bitten by this usag. I tried to make ISTL work with
>>> custom allocators, but this requires the solvers to ask for the
>>> allocators in the vector in order to properly rebind te allocator for
>>> internal data. This obviously fails for FieldVector, as it doesn't
>>> need any allocator.
>>> 
>> 
>> While I never used them for dense matrix, I have expected and would
>> expect them to work. If they do, why change that?
> 
> As I said, this does not work anymore, if we need a particular
> allocator. The GMRES (and some other solvers have similar problems)
> have to allocate an std::vector of weights of the size of the restart
> length. If the field type needs higher alignment, the std::vector has
> to use the apprpriate allocator. This information is (usually) already
> there, as the user passed in the according ISTL-vector we can deduce
> the allocator by rebinding.
> 
> 
> If we want to support FieldMatrix and sparse matrice (for DenseMatrix
> it should work, or should be achievable, as that one could also export
> an allocator), we could use s SFINAE to try to rebind the allocator
> and fall back to std::allocator if there is no allocator defined.

Yes, we definitely need a fallback to a default allocator for those cases, either
with SFINAE trickery or by just having a freestanding AllocationTraits struct
that can be specialized for containers that export an allocator.

Steffen

> 
> Ciao
> Christian
> 
> 
> _______________________________________________
> Dune mailing list
> Dune at lists.dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: Message signed with OpenPGP
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20170628/0fc083a2/attachment.sig>


More information about the Dune mailing list