Dear all,

during the refinement of a quarter hyper ball in 3D in debug mode, I 
receive the following error when running on a single core (mpirun -np 1):




*An error occurred in line <2764> of file 
</path/to/dealii-9.0.1/source/distributed/tria.cc> in function    void 
dealii::parallel::distributed::Triangulation<dim, 
spacedim>::copy_local_forest_to_triangulation() [with int dim = 3; int 
spacedim = 3]The violated condition was:     static_cast<unsigned 
int>(parallel_forest->local_num_quadrants) == total_local_cells*

When running on multiple cores I hit another error message (probably 
because there are no ghosts when using only one core):




*An error occurred in line <2670> of file 
</path/to/dealii-9.0.1/source/distributed/tria.cc> in function    void 
dealii::parallel::distributed::Triangulation<dim, 
spacedim>::copy_local_forest_to_triangulation() [with int dim = 3; int 
spacedim = 3]The violated condition was:     num_ghosts == 
parallel_ghost->ghosts.elem_cou*nt

Currently I am using deal.II 9.0.1. 
This is the relevant part of the code (a full MWE is attached):
    
        const unsigned int dim = 3;

        parallel::distributed::Triangulation<dim> tria (
                          mpi_communicator,
                          typename 
Triangulation<dim>::MeshSmoothing(Triangulation<dim>::smoothing_on_refinement),
                          
parallel::distributed::Triangulation<dim>::default_setting);

        GridGenerator::quarter_hyper_ball(tria);

        for (unsigned int i_refinement = 0; i_refinement < 6; 
++i_refinement)
        {
            auto cell = tria.begin_active();
            auto endc = tria.end();

            for (; cell!=endc; ++cell)
                if(cell->is_locally_owned() && cell->at_boundary())
                    cell->set_refine_flag ();

            tria.prepare_coarsening_and_refinement ();
            tria.execute_coarsening_and_refinement ();
        }

Is there something wrong with my code? Or maybe with my installation (can 
anyone confirm the error)? 
The code works in 2D but crashes in 3D. When the number of refinement 
cycles is reduced to 4 instead of 6, it also works.
Out of curiosity, I've tried using GridGenerator::hyper_cube instead of the 
hyper_ball, there the code works just fine in 2D and 3D. 

I would really appreciate if anyone can help me with this.

Kind regards,
Stefan

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/8d86f847-dab7-4d49-9d45-e2c83b5f9fcd%40googlegroups.com.
#include <deal.II/distributed/tria.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>


int main (int argc, char *argv[]) {

    try {
        using namespace dealii;

        Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);

        const unsigned int dim = 3;


        MPI_Comm mpi_communicator = MPI_COMM_WORLD;

        parallel::distributed::Triangulation<dim> tria (
                          mpi_communicator,
                          typename Triangulation<dim>::MeshSmoothing(Triangulation<dim>::smoothing_on_refinement),
                          parallel::distributed::Triangulation<dim>::default_setting);

        GridGenerator::quarter_hyper_ball(tria);

        for (unsigned int i_refinement = 0; i_refinement < 6; ++i_refinement)
        {
            auto cell = tria.begin_active();
            auto endc = tria.end();

            for (; cell!=endc; ++cell)
                if(cell->is_locally_owned() && cell->at_boundary())
                    cell->set_refine_flag ();

            tria.prepare_coarsening_and_refinement ();
            tria.execute_coarsening_and_refinement ();
        }
    }
    catch (std::exception &exec)
    {
        std::cout << std::flush;
        std::cerr << "\n\n------------------------------------------------\n"
                  << "Exception thrown :\n" << exec.what() << std::endl
                  << "Aborting!\n"
                  << "----------------------------------------------------" << std::endl;
        return 1;
    }
    catch (...)
    {
        std::cout << std::flush;
        std::cerr << "\n\n------------------------------------------------\n"
                  << "Unknown exception!\n"
                  << "Aborting!\n"
                  << "----------------------------------------------------" << std::endl;
        return 1;
    }

    return 0;
}

Reply via email to