[dune-pdelab] [Dune] PDELab - ISTLBlockVectorContainer

Steffen Müthing steffen.muething at iwr.uni-heidelberg.de
Wed Aug 27 15:32:54 CEST 2014


Hi Christian,

as this question is more about PDELab than about DUNE in general, I’d suggest moving
the discussion to the dune-pdelab mailing list.

Am 27.08.2014 um 14:22 schrieb Christian Kaltenecker <christian_kalt at yahoo.de>:

> Dear Dune,
> I have an compilation error, when I try to use the mmv-function of the BCRSMatrix from dune-istl regarding the ISTLBlockVectorContainer from PDELab:
> ----------------------------------
> /home/user/Bachelor/Dune/dune-istl/dune/istl/bcrsmatrix.hh:1679:22: error: no match for ‘operator[]’ (operand types are ‘const Dune::PDELab::ISTLBlockVectorContainer<Dune::PDELab::GridFunctionSpace<Dune::GridView<Dune::DefaultLevelGridViewTraits<const Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u> >, Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLevelGridViewTraits<const Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u> >, double, double, 1ul>, Dune::PDELab::OverlappingConformingDirichletConstraints, Dune::PDELab::ISTLVectorBackend<>, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> >, Dune::BlockVector<Dune::FieldVector<double, 1>, std::allocator<Dune::FieldVector<double, 1> > > >’ and ‘Dune::BCRSMatrix<Dune::FieldMatrix<double, 1, 1>, std::allocator<Dune::FieldMatrix<double, 1, 1> > >::size_type {aka long unsigned int}’)
> (*j).umtv(x[i.index()],y[j.index()]);
> 
> /home/user/Bachelor/Dune/dune-istl/dune/istl/bcrsmatrix.hh:1679:22: note: candidates are:
> In file included from /home/user/Bachelor/Dune/dune-pdelab/dune/pdelab/boilerplate/pdelab.hh:62:0,
> from multigrid_overlapping.cc:7:
> /home/user/Bachelor/Dune/dune-pdelab/dune/pdelab/backend/istlvectorbackend.hh:206:10: note: Dune::PDELab::ISTLBlockVectorContainer<GFS, C>::E& Dune::PDELab::ISTLBlockVectorContainer<GFS, C>::operator[](const ContainerIndex&) [with GFS = Dune::PDELab::GridFunctionSpace<Dune::GridView<Dune::DefaultLevelGridViewTraits<const Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u> >, Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLevelGridViewTraits<const Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u> >, double, double, 1ul>, Dune::PDELab::OverlappingConformingDirichletConstraints, Dune::PDELab::ISTLVectorBackend<>, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> >; C = Dune::BlockVector<Dune::FieldVector<double, 1>, std::allocator<Dune::FieldVector<double, 1> > >; Dune::PDELab::ISTLBlockVectorContainer<GFS, C>::E = double; Dune::PDELab::ISTLBlockVectorContainer<GFS, C>::ContainerIndex = Dune::PDELab::MultiIndex<long unsigned int, 1ul>]
> E& operator[](const ContainerIndex& ci)
> -------------------------------------
> The affected line is the line 1607 of bcrsmatrix.hh from dune-istl.
> The arguments x and y are of the type ISTLBlockVectorContainer.
> I have noticed, that the needed method:
> const ElementType& operator[](size_type i) const
> {
> return container()[cache().containerIndex(i)];
> }
> was moved from ISTLBlockVectorContainer to ConstUncachedVectorView.
> 
> How can I fix this?

That method will not do what you want. PDELab uses a multi-index scheme to access linear algebra containers
in order to support nested containers and efficient assembly for stuff like Schur complement solvers.

That’s why we have the additional wrappers around vectors and matrices - those do not export standard LA functionality
for a number of very good reasons.

If you want to get at the bare ISTL containers, you can use the function Dune::PDELab::istl::raw(x) to access the ISTL object
contained in the wrapper. Note that those functions are idempotent, so you can also call them on a bare ISTL object.

Best,
Steffen

> 
> Regards,
> Christian
> _______________________________________________
> Dune mailing list
> Dune at 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: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20140827/ecd6f533/attachment.sig>


More information about the dune-pdelab mailing list