[Dune] Creating a Grid

Andreas Dedner dedner at mathematik.uni-freiburg.de
Sat Dec 25 18:40:06 CET 2010


Hi,
if you are interested in a simple grid creation procedure good alternative
is to use dgf. (dune-grid-howto/grids/unitcube3.dgf is a similar example):

DGF
Interval
-1 -1 -1 % lower left
  2  2  2 % upper right
10 10 10 % number of cubes (or simplicies)
#

That should do it and works with dune 2.0.
You are not restricted to UG by the way ALU or YASP works
just as good with this grid file. What sort of problems did you have
with dgf and the dune-grid-howto examples?

BTW: we always like to hear where users are from and what they are
planning to do with DUNE...

Best
Andreas


On 12/25/2010 08:23 AM, Oliver Sander wrote:
> Hi Alex!
> Great to hear you are using Dune.  A structured cube UGGrid is most easily
> created using the StructuredGridFactory class (only available in the 
> svn --
> not in dune 2.0).  Here is a code snippet:
>
>    const int dim = 3;
>    typedef UGGrid<dim> GridType;
>
>     FieldVector<double,dim> lowerLeft(0);
>     FieldVector<double,dim> upperRight(1);
>     array<unsigned int, dim> elements;
>     std::fill(elements.begin(), elements.end(), 10);
>
>     StructuredGridFactory<GridType> factory;
>     shared_ptr<GridType> grid = factory.createSimplexGrid(lowerLeft, 
> upperRight, elements);
>
> You can write the grid into a VTK file using the following two lines:
>
>    VTKWriter<GridType::LeafGridView> vtkWriter(grid->leafView());
>    vtkWriter.write("my_filename");
>
> BTW, what's your thesis about?
>
> Best,
> Oliver
>
>
>
>
> Am 25.12.2010 08:52, schrieb Alex Evanovic:
>> Hi,
>>
>> I am Master's student, new to DUNE. I have just started my Master's 
>> Thesis using DUNE. I want to create a 3D grid of cubes using DUNE and 
>> then visualize it using Paraview with the VTKWriter. But I have no 
>> clue how to go about it. I read through the dune-grid-howto 
>> documentation and also went through the DGF Parser and stuff. But I 
>> am not sure which is the starting point.
>>
>> Can someone be kind enough to suggest me how to create and visualize 
>> a grid in DUNE. Either by using the DGF Parser or with the UG Grid 
>> and then visualize the grid?
>>
>> Thanks,
>> Alex
>>
>>
>> _______________________________________________
>> Dune mailing list
>> Dune at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune
>>    
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20101225/52971dee/attachment.htm>


More information about the Dune mailing list