[Dune] Problem with GmshReader
Mladen Jurak
jurak at math.hr
Fri Nov 8 12:18:43 CET 2013
Hi,
here is the mesh.
Mladen
On 11/08/2013 10:52 AM, Oliver Sander wrote:
> Hi Mladen,
> the code looks okay to me. Can you please send the simple.msh file you test with?
> Thanks,
> Oliver
>
> Am 08.11.2013 10:37, schrieb Mladen Jurak:
>> Dear Dune,
>>
>> I found a strange problem with GmshReader<>::read() function.
>> Sample code that I send you constructs well a UGGrid grid from "simple.msh" file.
>> But, if I uncomment the code that iterates over all vertices the
>> GmshReader<>::read() functions finishes with a segmentation fault.
>> In the other hand, iteration over elements does not affect the mesh reading.
>> Can you reproduce this error?
>>
>> Best regards,
>> Mladen
>>
>>
>> #ifdef HAVE_CONFIG_H
>> # include "config.h"
>> #endif
>> #include <iostream>
>> #include <vector>
>>
>> #include <dune/common/mpihelper.hh>
>> #include <dune/grid/uggrid.hh>
>> #include <dune/grid/io/file/gmshreader.hh>
>>
>> int main(int argc, char** argv)
>> {
>> Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
>> // read grid
>> const int dim =2;
>> typedef Dune::UGGrid<dim> GridType;
>> GridType * p_grid = Dune::GmshReader<GridType>::read("simple.msh");
>>
>> // iterate over all vertices
>> // typedef typename GridType::LeafGridView LeafGridView;
>> // LeafGridView leafView = p_grid->leafView();
>> //
>> // typedef typename LeafGridView::template Codim<dim>::Iterator VertexLeafIterator;
>> // for (VertexLeafIterator it = leafView.template begin<dim>();
>> // it != leafView.template end<dim>(); ++it) {
>> // //
>> //
>> // }
>> return 0;
>> }
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Dune mailing list
>> Dune at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune
>>
>
--
Mladen Jurak
Department of Mathematics
Faculty of Science
University of Zagreb
Bijenicka 30
10000 Zagreb
Croatia
Tel: +385 (0)1 460 5738
Fax: +385 (0)1 468 0335
E-mail: jurak at math.hr <mailto:jurak at math.hr>
Web: http://web.math.hr/~jurak <http://web.math.hr/%7Ejurak>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20131108/de8038c2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple.msh
Type: model/mesh
Size: 879 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20131108/de8038c2/attachment.msh>
More information about the Dune
mailing list