[dune-pdelab] Segmentation fault

Tatiana Kim T.Kim at bath.ac.uk
Mon Jun 15 12:45:31 CEST 2015


Hello,


I would like to read in several meshes from Gmesh into UGGrid. Below is a simple example where I have two meshes: fine and coarse. I first read in the fine mesh and then I read in the coarse mesh. The idea is that I solve the problem on fine mesh first and on the coarse mesh second and then compare the results.


//*******************************************************************





    typedef UGGrid<dim> GridType;

    GridType grid;

    GridFactory<GridType> factory(&grid);

    GmshReader<GridType>::read(factory,"fine.msh");

    factory.createGrid();



    std::cout << " Fine mesh has been read " << std::endl;





//************************************************************************



    GmshReader<GridType>::read(factory,"coarse.msh");

    factory.createGrid();




    std::cout << " Coarse mesh has been read " << std::endl;

//************************************************************************?



It compiles fine, but when I run it, I get the following error (when creating cube2.msh grid):


Reading 3d Gmsh grid...

version 2.2 Gmsh file detected

file contains 6580 nodes

file contains 37673 elements

number of real vertices = 6580

number of boundary elements = 6266

number of elements = 31407

 Fine mesh has been read

Reading 3d Gmsh grid...

version 2.2 Gmsh file detected

file contains 1115 nodes

file contains 5961 elements

number of real vertices = 1115

number of boundary elements = 1476

number of elements = 4485

[138-38-185-242:14754] *** Process received signal ***

[138-38-185-242:14754] Signal: Segmentation fault: 11 (11)

[138-38-185-242:14754] Signal code: Address not mapped (1)

[138-38-185-242:14754] Failing at address: 0xe8

[138-38-185-242:14754] [ 0] 0   libsystem_platform.dylib            0x00007fff8647b5aa _sigtramp + 26

[138-38-185-242:14754] [ 1] 0   libsystem_c.dylib                   0x00007fff723d12a0 usual + 0

[138-38-185-242:14754] [ 2] 0   testproject                         0x00000001063ab5fa _ZN4Dune10GmshReaderINS_6UGGridILi3EEEE4readERNS_11GridFactoryIS2_EERKSsbb + 2426

[138-38-185-242:14754] [ 3] 0   testproject                         0x000000010642ce72 main + 226

[138-38-185-242:14754] [ 4] 0   libmpi.1.dylib                      0x0000000106d7df20 ompi_mpi_comm_world + 0

[138-38-185-242:14754] *** End of error message ***

Segmentation fault: 11


If, for the second part of the code, I write:



//************************************************************************


    typedef UGGrid<dim> GridType1;

    GridType1 grid1;

    GridFactory<GridType1> factory1(&grid1);

    GmshReader<GridType1>::read(factory1,"cube2.msh");

    factory1.createGrid();

    typedef GridType1::LeafGridView GridView;




    std::cout << " Coarse mesh has been read " << std::endl;

//************************************************************************

then I get this error instead of the segmentation fault:


"ERROR in InitCurrMG: opening more than one MG is not allowed in parallel"



Could you please help me figure out what I am doing wrong?


Thanks!

Tatiana.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20150615/07b9e7ee/attachment.htm>


More information about the dune-pdelab mailing list