[Dune] Two GridPtrs do not work

Andreas Dedner dedner at mathematik.uni-freiburg.de
Tue Apr 15 13:03:47 CEST 2008


Hi,
could you figure out if this is a UG problem
or a problem in the DGF part?
If you simply construct two UG Grids using the
insert methods directly, does that work for you on
your PC and your laptop?
Andreas

Yufei Cao wrote:
> Dear Dune,
> 
> it would be great if you could help me on this: declaring two GridPtr objects 
> leads to a segmentation fault on my PC (Intel(R) Core(TM)2 Duo CPU E6850 @ 
> 3.00GHz, gcc 4.1.2). Nevertheless, it runs on my laptop (Intel Centrino, gcc 
> 4.1.3).
> 
> I attached an example with corresponding grid.
> 
> Thank you!
> Yufei
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> #include "config.h"
> #include <dune/grid/io/file/dgfparser/dgfparser.hh>
> #include <dune/grid/io/file/dgfparser/dgfug.hh>
> 
> 
> 
> int main(int argc, char** argv) 
> {
>   try{
>     // define the problem dimensions  
>     const int dim=2;
> 
>     // create a grid object
>     typedef Dune::UGGrid<dim> GridType; 
>     typedef GridType::ctype DT;
>     typedef double NumberType; 
> 
>     std::stringstream dgfFileName;
>     dgfFileName << "mesh.dgf";
> 
>     // create grid pointer
>     Dune::GridPtr<GridType> gridPtr1( dgfFileName.str() );    
> 
>     Dune::GridPtr<GridType> gridPtr2( dgfFileName.str() );
> 
>     return 0;
>   }
>   catch (Dune::Exception &e){
>     std::cerr << "Dune reported error: " << e << std::endl;
>   }
>   catch (...){
>     std::cerr << "Unknown exception thrown!" << std::endl;
>   }
> }
> 
> 
> ------------------------------------------------------------------------
> 
> DGF
> VERTEX 
> firstindex 1
>     0.0000000000    0.0000000000
>     0.2500000000    0.0000000000
>     0.5000000000    0.0000000000
>     0.7500000000    0.0000000000
>     1.0000000000    0.0000000000
>     0.0000000000    0.2500000000
>     0.2500000000    0.2500000000
>     0.5000000000    0.2500000000
>     0.7500000000    0.2500000000
>     1.0000000000    0.2500000000
>     0.0000000000    0.5000000000
>     0.2500000000    0.5000000000
>     0.5000000000    0.5000000000
>     0.7500000000    0.5000000000
>     1.0000000000    0.5000000000
>     0.0000000000    0.7500000000
>     0.2500000000    0.7500000000
>     0.5000000000    0.7500000000
>     0.7500000000    0.7500000000
>     1.0000000000    0.7500000000
>     0.0000000000    1.0000000000
>     0.2500000000    1.0000000000
>     0.5000000000    1.0000000000
>     0.7500000000    1.0000000000
>     1.0000000000    1.0000000000
> #
> CUBE 
> map 0 1 3 2 4 5 7 6
>        1       2       7       6
>        2       3       8       7
>        3       4       9       8
>        4       5      10       9
>        6       7      12      11
>        7       8      13      12
>        8       9      14      13
>        9      10      15      14
>       11      12      17      16
>       12      13      18      17
>       13      14      19      18
>       14      15      20      19
>       16      17      22      21
>       17      18      23      22
>       18      19      24      23
>       19      20      25      24
> # 
> BOUNDARYDOMAIN
> default 1     
> #
> # 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune




More information about the Dune mailing list