Skip to content

Commit ad2e075

Browse files
committed
Fix particles. Make restart more robust.
1 parent 0e7ecaf commit ad2e075

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

source/mesh_deformation/interface.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,17 +1354,21 @@ namespace aspect
13541354
// is because the numbering depends on the order the
13551355
// cells are created.
13561356
DoFRenumbering::hierarchical (mesh_deformation_dof_handler);
1357-
static bool first_time=true;
1358-
if (first_time)
1357+
1358+
if (dynamic_cast<const MappingQEulerian<dim, LinearAlgebra::Vector>*>(&(this->get_mapping())) == nullptr)
13591359
{
1360-
first_time = false;
13611360
// Now reset the mapping of the simulator to be something
13621361
// that captures mesh deformation in time. This has to
13631362
// happen after we distribute the mesh_deformation DoFs
13641363
// above.
1365-
sim.mapping.reset (new MappingQEulerian<dim, LinearAlgebra::Vector> (4,
1364+
sim.mapping.reset (new MappingQEulerian<dim, LinearAlgebra::Vector> (this->get_geometry_model().has_curved_elements() ? 4 : 1,
13661365
mesh_deformation_dof_handler,
13671366
mesh_displacements));
1367+
1368+
for (auto &pm : sim.particle_managers)
1369+
pm.get_particle_handler().initialize(this->get_triangulation(),
1370+
this->get_mapping(),
1371+
pm.get_property_manager().get_n_property_components());
13681372
}
13691373

13701374
if (this->is_stokes_matrix_free())

source/simulator/core.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ namespace aspect
9999
* of a curved mesh, and a cartesian mapping for a rectangular mesh that is
100100
* not deformed. Use a MappingQ1 if the initial mesh is deformed.
101101
* If mesh deformation is enabled, each mapping is later swapped out for a
102-
* MappingQ1Eulerian, which allows for mesh deformation during the
102+
* MappingQEulerian, which allows for mesh deformation during the
103103
* computation.
104104
*/
105105
template <int dim>

0 commit comments

Comments
 (0)