geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
223 stars 235 forks source link

Free surface with particles, errors #3016

Open Djneu opened 5 years ago

Djneu commented 5 years ago

I thought I'd open an issue on the two errors I've ran into with using free surface and particles for the discussion with @gassmoeller, @bangerth, @anne-glerum.

Error 1:

An error occurred in line <3520> of file </home/acglerum/bin/tmp/unpack/deal.II-v8.5.1/include/deal.II/dofs/dof_accessor.templates.h> in function
    void dealii::DoFCellAccessor<DoFHandlerType, lda>::get_dof_values(const InputVector&, ForwardIterator, ForwardIterator) const [with InputVector = dealii::TrilinosWrappers::MPI::Vector; ForwardIterator = double*; DoFHandlerType = dealii::DoFHandler<2>; bool level_dof_access = false]
The violated condition was: 
    this->is_artificial() == false
Additional information: 
    Can't ask for DoF indices on artificial cells.

Stacktrace:
-----------
#0  /home/acglerum/bin/deal.II-v8.5.1/lib/libdeal_II.g.so.8.5.1: dealii::MappingQ1Eulerian<2, dealii::TrilinosWrappers::MPI::Vector, 2>::get_vertices(dealii::TriaIterator<dealii::CellAccessor<2, 2> > const&) const
#1  /home/acglerum/bin/deal.II-v8.5.1/lib/libdeal_II.g.so.8.5.1: dealii::MappingQGeneric<2, 2>::transform_real_to_unit_cell(dealii::TriaIterator<dealii::CellAccessor<2, 2> > const&, dealii::Point<2, double> const&) const
#2  /home/acglerum/bin/deal.II-v8.5.1/lib/libdeal_II.g.so.8.5.1: std::pair<dealii::parallel::distributed::Triangulation<2, 2>::active_cell_iterator, dealii::Point<2, double> > dealii::GridTools::find_active_cell_around_point<2, dealii::parallel::distributed::Triangulation, 2>(dealii::Mapping<2, 2> const&, dealii::parallel::distributed::Triangulation<2, 2> const&, dealii::Point<2, double> const&)
#3  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Particle::ParticleHandler<2, 2>::sort_particles_into_subdomains_and_cells()
#4  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Particle::World<2>::advect_particles()
#5  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Particle::World<2>::advance_timestep()
#6  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Postprocess::Particles<2>::execute(dealii::TableHandler&)
#7  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Postprocess::Manager<2>::execute(dealii::TableHandler&)
#8  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Simulator<2>::postprocess()
#9  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Simulator<2>::run()
#10  /home/djneuh/software/builds/lithosphere/build_debug/aspect: void run_simulator<2>(std::string const&, bool, bool)
#11  /home/djneuh/software/builds/lithosphere/build_debug/aspect: main

This error only occurs in debug mode, and is similar to the issue in #2050. Using a dealii version with the fix mentioned there I still hit the error, and the work around I've been using is in mapping_q1_eulerian.ccfound here: https://github.com/Djneu/dealii/commit/9df0ea27d29bfeb87681440ffffd277ba9b73694

Error 2:

An error occurred in line <1369> of file </home/djneuh/bin/deal.II-v9.0.0/include/deal.II/grid/tria_accessor.templates.h> in function
    int dealii::TriaAccessor<<anonymous>, <anonymous>, <anonymous> >::child_index(unsigned int) const [with int structdim = 2; int dim = 2; int spacedim = 2]
The violated condition was: 
    has_children()
Additional information: 
    The operation you are attempting can only be performed for (cell, face, or edge) iterators that have children, but the object on which you are trying the current operation does not have any.

Stacktrace:
-----------
#0  /home/djneuh/software/builds/lithosphere/build_debug/aspect: dealii::TriaAccessor<2, 2, 2>::child_index(unsigned int) const
#1  /home/djneuh/software/builds/lithosphere/build_debug/aspect: dealii::CellAccessor<2, 2>::child(unsigned int) const
#2  /home/djneuh/bin/deal.II-v9.0.0/build_test/lib/libdeal_II.g.so.9.1.0-pre: dealii::Triangulation<2, 2>::cell_iterator dealii::CellId::to_cell<2, 2>(dealii::Triangulation<2, 2> const&) const
#3  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Particle::ParticleHandler<2, 2>::send_recv_particles(std::vector<std::vector<aspect::Particle::ParticleIterator<2, 2>, std::allocator<aspect::Particle::ParticleIterator<2, 2> > >, std::allocator<std::vector<aspect::Particle::ParticleIterator<2, 2>, std::allocator<aspect::Particle::ParticleIterator<2, 2> > > > > const&, std::multimap<std::pair<int, int>, aspect::Particle::Particle<2, 2>, std::less<std::pair<int, int> >, std::allocator<std::pair<std::pair<int, int> const, aspect::Particle::Particle<2, 2> > > >&, std::vector<std::vector<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> >, std::allocator<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> > > >, std::allocator<std::vector<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> >, std::allocator<dealii::TriaActiveIterator<dealii::CellAccessor<2, 2> > > > > > const&)
#4  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Particle::ParticleHandler<2, 2>::sort_particles_into_subdomains_and_cells()
#5  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Particle::World<2>::advect_particles()
#6  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Particle::World<2>::advance_timestep()
#7  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Postprocess::Particles<2>::execute(dealii::TableHandler&)
#8  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Postprocess::Manager<2>::execute(dealii::TableHandler&)
#9  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Simulator<2>::postprocess()
#10  /home/djneuh/software/builds/lithosphere/build_debug/aspect: aspect::Simulator<2>::run()
#11  /home/djneuh/software/builds/lithosphere/build_debug/aspect: void run_simulator<2>(std::string const&, bool, bool)
#12  /home/djneuh/software/builds/lithosphere/build_debug/aspect: main

This error occurred randomly later on in runs, but every one I tried eventually crashed to this. I tried to track exactly what was going wrong, and it seems at some point in the run a cell at the surface which should have children has none, but still has child indices. Below is the last few outputs tracking the cell that caused the crash.


tocell 4926 -- has_children: 1  n_children: 4  n_child_indices: 3  (like this for all previous timesteps)
tocell 4926 -- has_children: 1  n_children: 4  n_child_indices: 3
tocell 4926 -- has_children: 0  n_children: 0  n_child_indices: 3
    --crashes here. when outputting other cells with 0 children n_child_indices is always 0.

The workaround I ended up using for this is in cell_id.cc and also found at https://github.com/Djneu/dealii/commit/9df0ea27d29bfeb87681440ffffd277ba9b73694, however I think this is really just ignoring the problem. Looking forward to hearing some thoughts on this!

bangerth commented 5 years ago

Can you attach the input file that reproduces this error?