[Dune] l2 interpolation error

Tatiana Kim T.Kim at bath.ac.uk
Tue Jul 7 14:11:20 CEST 2015


Hi Jö,

Thanks a lot for your reply. I'll try to adapt the existing code, but if someone has already done it and could share the code, that would be much appreciated!

With regards to posting to DUNE: sorry, I really meant to post it to the PDELab mailing list, but posted it to the Dune list by mistake. I will pay more attention in the future.

Thanks again,
Tatiana.


________________________________________
From: Jö Fahlke <jorrit at jorrit.de>
Sent: 07 July 2015 12:55
To: dune-pdelab at dune-project.org; Tatiana Kim
Cc: dune at dune-project.org
Subject: Re: [Dune] l2 interpolation error

Am Tue,  7. Jul 2015, 11:15:09 +0000 schrieb Tatiana Kim:
> Date: Tue, 7 Jul 2015 11:15:09 +0000
> From: Tatiana Kim <T.Kim at bath.ac.uk>
> To: "dune at dune-project.org" <dune at dune-project.org>
> Subject: [Dune] l2 interpolation error
> X-No-Auth: unauthenticated sender
> X-No-Relay: not in my network
> Thread-Topic: l2 interpolation error
> Thread-Index: AQHQuKX1cdcwvOoaPEeaEqZvQ4cGvg==
> Accept-Language: en-GB, en-US
> Content-Language: en-GB
> X-MS-Has-Attach:
> x-ms-exchange-transport-fromentityheader: Hosted
> X-BUCS-Cherished: true
> X-Envelope-From: <T.Kim at bath.ac.uk>
>
> Hello,
>
> I would like to use l2interpolationerror.hh described in the example q1interpolatione​rror.hh in PDELab-howto section 9.5 in my code.
>
> I have created analytic function object and made y interpolate u as in the example:
>
>     U<GridView,Real> u(grid.leafGridView());
>
>     PDELab::interpolate(u,gfs,y);
>
> This works fine. The next step is to compute l2-error:
>
>     std::cout.precision(8);
>     std::cout << "interpolation error: "
>     << std :: setw(8) << ijy << " elements "
>     << std :: scientific << l2interpolationerror(u,gfsf,y,4) << std :: endl ;
>
> This doesn't work in my code. I get an error along these lines:
>
> error: no type named 'FiniteElementType' in 'Dune::PDELab::VectorGridFunctionSpace
>
> in l2interpolationerror.hh:15:36 (The first few lines of the error message are below).
>
> I am a bit stuck on this problem and not sure what to do. Could you please help?
>
> Thanks,
> Tatiana.
>
>
>
>
> This is how GFS is set up in my code:
>
>     typedef GridType::ctype Coord;
>     typedef double Real;
>
>     // set up vector-valued finite element space
>     typedef PDELab::PkLocalFiniteElementMap<GridView,Coord, Real, 1> FEM;
>     FEM fem(grid.leafGridView());
>
>
>     typedef PDELab::VectorGridFunctionSpace<GridView,
>     FEM,
>     dim,
>     PDELab::ISTLVectorBackend<PDELab::ISTLParameters::static_blocking>,
>     PDELab::ISTLVectorBackend<>,
>     PDELab::ConformingDirichletConstraints,
>     PDELab::EntityBlockedOrderingTag,
>     PDELab::DefaultLeafOrderingTag
>     > GFSF;
>     GFSF gfsf(grid.leafGridView(),fem);

Hi!

The error occurs in the file
/Users/tatianakim/Documents/DUNE/master/testproject/l2interpolationerror.hh,
and the path does not look like any Dune module known to me.  The is a file
l2interpolationerror.hh in dune-pdelab-howto, so I'm assuming you copied that
file from there.  But the linenumber of the error is an empty line, so the
version of the file I'm looking at probably differs from your version of the
file.

Anyway, the l2interpolationerror.hh in dune-pdelab-howto looks like it is
meant to be used with scalar gridfunctionspaces only, that is why you get the
error.

@All: Has someone code to compute an l2error for a VectorGridFunctionSpace
      lying around somewhere and is willing to share?

Otherwise, you will have to adapt the code to properly work with
VectorGridFunctionSpaces.

BTW: The dune-list dune at dune-project.org is meant for discussions about the
     core modules.  For PDELab we have dune-pdelab at dune-project.org.  What
     made you decide to write to the dune-mailinglist?  I'm asking because
     this happens quiet often, maybe there is something that we can change on
     the homepage to make this preference clearer.

Regards,
Jö.

>
>
> **********************************
> The first few lines of the error message:
>
>
> Scanning dependencies of target testproject
>
> [100%] Building CXX object src/CMakeFiles/testproject.dir/testproject.cc.o
>
> In file included from /Users/tatianakim/Documents/DUNE/master/testproject/src/testproject.cc:47:0:
>
> /Users/tatianakim/Documents/DUNE/master/testproject/l2interpolationerror.hh: In instantiation of 'double l2interpolationerror(const U&, const GFS&, X&, int) [with U = U<Dune::GridView<Dune::UGGridLeafGridViewTraits<const Dune::UGGrid<3>, (Dune::PartitionIteratorType)4u> >, double>; GFS = Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::UGGridLeafGridViewTraits<const Dune::UGGrid<3>, (Dune::PartitionIteratorType)4u> >, Dune::PDELab::PkLocalFiniteElementMap<Dune::GridView<Dune::UGGridLeafGridViewTraits<const Dune::UGGrid<3>, (Dune::PartitionIteratorType)4u> >, double, double, 1u>, 3ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u>, Dune::PDELab::ISTLVectorBackend<>, Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> >; X = Dune::PDELab::ISTLBlockVectorContainer<Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::UGGridLeafGridViewTraits<const Dune::UGGrid<3>, (Dune::PartitionIteratorType)4u> >, Dune::PDELab::PkLocalFiniteElementMap<Dune::GridView<Dune::UGGridLeafGridViewTraits<const Dune::UGGrid<3>, (Dune::PartitionIteratorType)4u> >, double, double, 1u>, 3ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u>, Dune::PDELab::ISTLVectorBackend<>, Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> >, Dune::BlockVector<Dune::FieldVector<double, 3>, std::allocator<Dune::FieldVector<double, 3> > > >]':
>
> /Users/tatianakim/Documents/DUNE/master/testproject/src/testproject.cc:350:61:   required from here
>
> /Users/tatianakim/Documents/DUNE/master/testproject/l2interpolationerror.hh:15:36: error: no type named 'FiniteElementType' in 'Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::UGGridLeafGridViewTraits<const Dune::UGGrid<3>, (Dune::PartitionIteratorType)4u> >, Dune::PDELab::PkLocalFiniteElementMap<Dune::GridView<Dune::UGGridLeafGridViewTraits<const Dune::UGGrid<3>, (Dune::PartitionIteratorType)4u> >, double, double, 1u>, 3ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u>, Dune::PDELab::ISTLVectorBackend<>, Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> >::Traits {aka struct Dune::PDELab::PowerCompositeGridFunctionSpaceTraits<Dune::GridView<Dune::UGGridLeafGridViewTraits<const Dune::UGGrid<3>, (Dune::PartitionIteratorType)4u> >, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u>, Dune::PDELab::EntityBlockedOrderingTag, 3ul>}'
>
>      Traits::LocalBasisType::Traits FTraits;​
>
>
>
>

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


--
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729

featured product: Debian GNU/Linux - http://www.debian.org


More information about the Dune mailing list