[Dune] Two GridPtrs do not work

Yufei Cao cao at ians.uni-stuttgart.de
Fri Jun 20 10:27:32 CEST 2008


Dear Andreas, 

Thank you for your reply!

I have run the "test2ug" on the PC. I still get the "Segmentation fault".
After I debug it, I get the following information, hopefully it will be 
useful:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$gdb --args ./test2ug -ui cn

GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db 
library "/lib/tls/i686/cmov/libthread_db.so.1".

Breakpoint 1 at 0x804b137: file test2ug.cc, line 18.
(gdb) r
Starting program: /DUMUX/dune-grid/grid/io/file/dgfparser/test/test2ug -ui cn
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread -1210820928 (LWP 30857)]
[Switching to Thread -1210820928 (LWP 30857)]

Breakpoint 1, main () at test2ug.cc:18
18       std::stringstream dgfFileName;
(gdb) n
19       dgfFileName << "test2ug.dgf";
(gdb) n
22       Dune::GridPtr<GridType> gridPtr1( dgfFileName.str() );
(gdb) n
24       Dune::GridPtr<GridType> gridPtr2( dgfFileName.str() );
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x08062882 in Dune::ElementFaceUtil::generateCubeFace<2> (element=@0x85ce380, 
f=0)
    at ../../../../../dune/grid/io/file/dgfparser/entitykey.hh:154
154           k[ size - (i+1) ] = element[ idxdune ];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Best regards,
Yufei


On Wednesday 18 June 2008 23:04, Andreas Dedner wrote:
> This seems to be difficult:
> runs on my pc:
>   g++ 4.1.2
>   AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
> and on my laptop:
>   g++ 4.1.1
>   Intel(R) Core(TM)2 CPU         T7200  @ 2.00GHz
> do not have g++ 4.1.3 at the moment.
> Using dune release in both cases.
> Does anybody else have this problem?
> To make tests simples I have added test2ug.cc test2ug.dgf
> and updated Makefile.am to grid/io/file/dgfparser/test
> which I will remove again soon.
> Andreas
>
>
> On Wed, 18 Jun 2008 14:56:14 +0200
>
>  Yufei Cao <cao at ians.uni-stuttgart.de> wrote:
> > Dear Andreas,
> >
> > PS: sorry, in the last email I attached the wrong file.
> >
> > Thank you for your help!
> >
> > I have constructed two UG Grids using the insert methods
> > directly (see the
> > attached file) and implemented it on my PC and my laptop.
> > This time it works
> > well for both computers.
> >
> > Does it mean that this is a problem in the DGF part?
> > Thank you in advance!
> >
> > By the way, now I'm using the trunk version of dune on
> > both computers.  But
> > about one month ago, I used the release version on both
> > computers and for
> > this version of dune,  the construction of two UG grids
> > by the dgf file
> > worked well on both computers!
> >
> > Thank you in advance!
> >
> > Best regards,
> > Yufei
> >
> > On Tuesday 15 April 2008 13:03, you wrote:
> > > 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
> >
> > --
>
> ---------------------------------------------------------------------------
>----
>
> > Yufei Cao
> > Universität Stuttgart
> > Institut für Angewandte Analysis und Numerische
> > Simulation
> > Lehrstuhl für Numerische Mathematik für
> > Höchstleistungsrechner
> > Pfaffenwaldring 57
> > 70569 Stuttgart
> > Germany
> >
> > Tel.:  +49 (0)711 685-65558
> > Fax:  +49 (0)711 685-65507
> >
> > Email: cao at ians.uni-stuttgart.de
>
> ---------------------------------------------------------------------------
>----

-- 
------------------------------------------------------------------------------- 
Yufei Cao
Universität Stuttgart
Institut für Angewandte Analysis und Numerische Simulation
Lehrstuhl für Numerische Mathematik für Höchstleistungsrechner
Pfaffenwaldring 57 
70569 Stuttgart
Germany

Tel.:  +49 (0)711 685-65558
Fax:  +49 (0)711 685-65507

Email: cao at ians.uni-stuttgart.de 
------------------------------------------------------------------------------- 




More information about the Dune mailing list