[Dune] Bug when construct yaspgrid with non-trivial origin

Oliver Sander oliver.sander at tu-dresden.de
Thu Sep 19 08:25:45 CEST 2019


Hi Junming,

an object of type YaspGrid<2> always has one corner hard-wired to (0,0).
If you want that corner to be somewhere else you have to use

YaspGrid<2,EquidistantOffsetCoordinates<double,2> >

In other words, change your code to

  Dune::YaspGrid<2,EquidistantOffsetCoordinates<double,2> > grid({-1.0,1.0}, {-1.0,1.0}, {2,2});

Best regards,
Oliver


On 18.09.19 17:25, 段俊明 wrote:
> Dear Dune community,
> 
> 
> When I try to use the yaspgrid as:
> 
> 
> Dune::YaspGrid<2>grid({-1.0,1.0}, {-1.0,1.0}, {2,2});
> 
> 
> the compiler tells me:
> 
> 
> error: static assertion failed: YaspGrid coordinate container template parameter and given constructor values do not match!
>        static_assert(std::is_same<Coordinates,EquidistantOffsetCoordinates<ctype,dim> >::value,
> 
> 
> If I replace "EquidistantOffsetCoordinates" with "EquidistantCoordinates" in yaspgrid.hh, then it is OK.
> 
> What is wrong here, and how can I use yaspgrid properly?
> 
> 
> Thanks!
> 
> 
> -- 
> 
> Yours sincerely,
> Junming Duan
> 
> _______________________________________________
> Dune mailing list
> Dune at lists.dune-project.org
> https://lists.dune-project.org/mailman/listinfo/dune
> 




More information about the Dune mailing list