[Dune] Creating a Grid
Oliver Sander
sander at mi.fu-berlin.de
Sat Dec 25 11:01:34 CET 2010
Hi Alex!
Please write such questions to the mailing list.
Do not include uggridfactory.hh directly. Use dune/grid/uggrid.hh
for the UGGrid class and dune/grid/utility/structuredgridfactory.hh
for the StructuredGridFactory.
Best,
Oliver
Am 25.12.2010 10:52, schrieb Alex Evanovic:
> Just a small question again! Which header file should I include?
> Should it be |<dune/grid/uggrid/uggridfactory.hh
> <http://www.dune-project.org/doc/doxygen/html/uggridfactory_8hh-source.html>>|
> ?
>
> Regards,
> Alex
> _ _
>
> On Sat, Dec 25, 2010 at 9:23 AM, Oliver Sander <sander at mi.fu-berlin.de
> <mailto:sander at mi.fu-berlin.de>> 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 <mailto: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/1c2527b9/attachment.htm>
More information about the Dune
mailing list