[dune-pdelab] Segmentation fault
Oliver Sander
sander at igpm.rwth-aachen.de
Mon Jun 15 14:01:20 CEST 2015
> Concerning the second error: as the message says, it is not possible to have two
> UGGrids at once.
It is not possible to have two *parallel* UGGrids at once. If you build UG without MPI
then you can have as may grids as you like.
--
Oliver
You should be able to circummvent that by putting the two stages in separate blocks
>
> {
> 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;
> }
> {
>
> 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;
> }
>
>
> The question is if that is useful for you. If you need both grids to be present at the same time in order to compare your results, you should either use another grid manager or have both the fine and
> the coarse grid within one UGGrid multigrid structure.
>
> Kind regards
> Bernd
>
> On 06/15/2015 12:45 PM, Tatiana Kim wrote:
>>
>> 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.
>>
>>
>>
>>
>> _______________________________________________
>> dune-pdelab mailing list
>> dune-pdelab at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune-pdelab
>
>
>
>
> _______________________________________________
> dune-pdelab mailing list
> dune-pdelab at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-pdelab
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20150615/0cfeb7ce/attachment.sig>
More information about the dune-pdelab
mailing list