[Dune] help with defining a ellipse grid in dune
Christian Engwer
christian.engwer at uni-muenster.de
Mon Sep 9 20:33:47 CEST 2013
Hi Mario,
> I have a problem similar to example 5 of dune pdelab howto (a two-component
> diļ¬usion-reaction problem) but with different domain.
> In howto problem the domain is (0,2)^2 but mine is
> {(x; y) : ((x-0.5)/0.25)^2+((y-0.5)/0.5)^2<1}
>
> Also, in howto problem the domain is defined with:
> Dune::FieldVector<double,2> L(2.0);
> Dune::FieldVector<int,2> N(1);
> Dune::FieldVector<bool,2> periodic(false);
> int overlap=0;
> Dune::YaspGrid<2> grid(L,N,periodic,overlap);
> grid.globalRefine(level);
> typedef Dune::YaspGrid<2>::LeafGridView GV;
> const GV& gv=grid.leafView();
>
> Now I shoud replace that YaspGrid (0,2)^2 with something of myown but I am
> unsure how.
Dune offers support for a range of different grid managers. The afore
mentioned YaspGrid is a structured cartesian mesh. I suggest you
install the ALUGrid library and recompile DUNE (the installation notes
on the DUNE website). DUNE will then find ALUGrid and include its
support layer. ALUGrid is an unstructured grid manager which support
simplex and cube meshes. With you favorite CAD-tool and mesher you can
create a mesh file. If you create GMesh files (the easiest way is to
use GMesh to create the geometry and the mesh, otherwise you have to
write a conversion tool), you can read those files using the gmesh
reader of DUNE.
Ciao
Christian
PS: Please refer from cross posting, the dune at dune-project.org mailing
list is the correct one for questions regarding support for the DUNE
core modules.
More information about the Dune
mailing list