<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Dear Dune,<br>
<br>
I found a strange problem with GmshReader<>::read() function.
<br>
Sample code that I send you constructs well a UGGrid grid from
"simple.msh" file. <br>
But, if I uncomment the code that iterates over all vertices the <br>
GmshReader<>::read() functions finishes with a segmentation
fault. <br>
In the other hand, iteration over elements does not affect the mesh
reading. <br>
Can you reproduce this error? <br>
<br>
Best regards,<br>
Mladen<br>
<br>
<br>
#ifdef HAVE_CONFIG_H<br>
# include "config.h" <br>
#endif<br>
#include <iostream><br>
#include <vector><br>
<br>
#include <dune/common/mpihelper.hh> <br>
#include <dune/grid/uggrid.hh> <br>
#include <dune/grid/io/file/gmshreader.hh><br>
<br>
int main(int argc, char** argv)<br>
{<br>
Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc,
argv);<br>
// read grid<br>
const int dim =2;<br>
typedef Dune::UGGrid<dim> GridType;<br>
GridType * p_grid =
Dune::GmshReader<GridType>::read("simple.msh");<br>
<br>
// iterate over all vertices<br>
// typedef typename GridType::LeafGridView LeafGridView;<br>
// LeafGridView leafView = p_grid->leafView(); <br>
//<br>
// typedef typename LeafGridView::template
Codim<dim>::Iterator VertexLeafIterator;<br>
// for (VertexLeafIterator it = leafView.template
begin<dim>();<br>
// it != leafView.template
end<dim>(); ++it) {<br>
// //<br>
//<br>
// }<br>
return 0;<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<div class="moz-signature">-- <br>
<small>
Mladen Jurak <br>
Department of Mathematics <br>
Faculty of Science <br>
University of Zagreb <br>
Bijenicka 30 <br>
10000 Zagreb <br>
Croatia <br>
<br>
Tel: +385 (0)1 460 5738 <br>
Fax: +385 (0)1 468 0335 <br>
E-mail: <a href="mailto:jurak@math.hr">jurak@math.hr</a> <br>
Web: <a href="http://web.math.hr/%7Ejurak">http://web.math.hr/~jurak</a>
</small>
</div>
</body>
</html>