[Dune] Extract coordinate of a point
Christian Engwer
christian.engwer at uni-muenster.de
Fri May 23 17:05:57 CEST 2014
Hi Marco,
judging from the compiler output, this is not a problem in your code
and how it uses the grid interface, but how it interacts with
dune-fem.
Ciao
Christian
On Fri, May 23, 2014 at 01:40:02PM +0000, Agnese, Marco wrote:
> Hello Christian,
> thank you for the answer. That is what I was doing but it complains when I compile.
> My grid is a wrapped one
>
> typedef GeometryGrid<HostGridType,GridDeformationType> WrappedGridType;
>
> where GridDeformationType is a class with this signature
>
> class VertexFunction:public DiscreteCoordFunction<typename HostGridImp::ctype,WORLDDIM,VertexFunction<HostGridImp>;
>
> which represent the position of my vertices. In the class VertexFunction I implemented the method
>
> template<class RangeVector>
> void evaluate(const EntityType& entity,unsigned int corner,RangeVector& y) const;
>
> to extract the vertices.
>
> When I try to call
>
> it->geometry().corner(0);
>
> I have the following error
>
> error: no matching function for call to ‘Dune::Fem::VertexFunction<Dune::AlbertaGrid<1, 2> >::evaluate(const Dune::Entity<1, 1, const Dune::AlbertaGrid<1, 2>, Dune::AlbertaGridEntity>&, unsigned int&, Dune::DiscreteCoordFunctionInterface<double, 2u, Dune::Fem::VertexFunction<Dune::AlbertaGrid<1, 2> > >::RangeVector&) const’
> asImp().evaluate( hostEntity, corner, y );
>
> note: candidate is:
> In file included from dynamicgridwrapper.hh:8:0,
> from dune_dynamic_grid.cc:15:
> vertexfunction.hh:75:17: note: template<class RangeVector> void Dune::Fem::VertexFunction<HostGridImp>::evaluate(const EntityType&, unsigned int, RangeVector&) const [with RangeVector = RangeVector; HostGridImp = Dune::AlbertaGrid<1, 2>]
> inline void evaluate(const EntityType& entity,unsigned int corner,RangeVector& y) const{
>
> note: cannot convert ‘hostEntity’ (type ‘const Dune::Entity<1, 1, const Dune::AlbertaGrid<1, 2>, Dune::AlbertaGridEntity>’) to type ‘const EntityType& {aka const Dune::Entity<0, 1, const Dune::AlbertaGrid<1, 2>, Dune::AlbertaGridEntity>&}’
> asImp().evaluate( hostEntity, corner, y );
>
> When I use with intersection iterator everything works fine. I do not understand what I am doing wrong.
> Thank you,
> Marco.
>
> ________________________________________
> From: christi at wg20.mathe-macht-spass.de [christi at wg20.mathe-macht-spass.de] on behalf of Christian Engwer [christian.engwer at uni-muenster.de]
> Sent: Friday, May 23, 2014 2:26 PM
> To: Agnese, Marco
> Cc: dune at dune-project.org
> Subject: Re: [Dune] Extract coordinate of a point
>
> On Fri, May 23, 2014 at 01:24:59PM +0000, Agnese, Marco wrote:
> > Hello DUNErs,
> > a very quick question.
> > I have an iterator over the points of the leaf view:
> > typename LeafViewType::template Codim<GRIDDIM>::Iterator it;
> > how can I extract the coordinates of the point?
>
> it->geometry().corner(0);
>
> Ciao
> Christian
>
> >
> > Thank you,
> > Marco.
> > _______________________________________________
> > Dune mailing list
> > Dune at dune-project.org
> > http://lists.dune-project.org/mailman/listinfo/dune
> >
>
> --
> 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
--
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