Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
anne-glerum committed Sep 10, 2020
1 parent 5f96210 commit 558fdce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 30 deletions.
36 changes: 14 additions & 22 deletions source/simulator/solver_schemes.cc
Expand Up @@ -194,25 +194,18 @@ namespace aspect
{
// Advect the particles before they are potentially used to
// set up the compositional fields.
// TODO for the iterated Advection schemes, the particle positions
// and properties have to be reset after each nonlinear iteration.
// At the moment, there is no functionality to copy the ParticleHandler
// and use the copy to reset it after the nonlinear iterations.
// Therefore we exclude the iterated Advection schemes from the
// particle advection reordering, and still advect particles after
// all nonlinear iterations in this case.
if (particle_world.get() != nullptr)
{
// Do not advect the particles in the initial refinement stage
const bool in_initial_refinement = (timestep_number == 0)
&& (pre_refinement_step < parameters.initial_adaptive_refinement);
if (!in_initial_refinement)
// Advance the particles in the world to the current time
particle_world->advance_timestep();

if (particle_world->get_property_manager().need_update() == Particle::Property::update_output_step)
particle_world->update_particles();
}
{
// Do not advect the particles in the initial refinement stage
const bool in_initial_refinement = (timestep_number == 0)
&& (pre_refinement_step < parameters.initial_adaptive_refinement);
if (!in_initial_refinement)
// Advance the particles in the world to the current time
particle_world->advance_timestep();

if (particle_world->get_property_manager().need_update() == Particle::Property::update_output_step)
particle_world->update_particles();
}

std::vector<double> current_residual(introspection.n_compositional_fields,0.0);

Expand Down Expand Up @@ -969,7 +962,7 @@ namespace aspect
if ((particle_world.get() != nullptr) && (nonlinear_iteration > 0))
{
particle_world->copy_particle_handler(particle_handler_copy,
particle_world->get_particle_handler());
particle_world->get_particle_handler());
}

const double relative_temperature_residual =
Expand Down Expand Up @@ -1101,7 +1094,7 @@ namespace aspect
if ((particle_world.get() != nullptr) && (nonlinear_iteration > 0))
{
particle_world->copy_particle_handler(particle_handler_copy,
particle_world->get_particle_handler());
particle_world->get_particle_handler());
}

const double relative_temperature_residual =
Expand Down Expand Up @@ -1264,11 +1257,10 @@ namespace aspect
if ((particle_world.get() != nullptr) && (nonlinear_iteration > 0))
{
particle_world->copy_particle_handler(particle_handler_copy,
particle_world->get_particle_handler());
particle_world->get_particle_handler());
}

assemble_and_solve_temperature();

assemble_and_solve_composition();

if (use_picard == true &&
Expand Down
10 changes: 2 additions & 8 deletions tests/mesh_deformation_particles.prm
Expand Up @@ -5,16 +5,15 @@ set End time = 0.5
set Start time = 0
set Nonlinear solver scheme = single Advection, no Stokes
set CFL number = 1.0
set Maximum first time step = 0.5
set Pressure normalization = no
set Maximum first time step = 0.5
set Pressure normalization = no
set Use years in output instead of seconds = false
set Output directory = mesh_def_particles

subsection Prescribed Stokes solution
set Model name = function
end


subsection Geometry model
set Model name = box

Expand All @@ -26,7 +25,6 @@ subsection Geometry model
end
end


subsection Mesh deformation
# When only the top boundary function is specified, the entire cell moves up by 0.5
set Mesh deformation boundary indicators = top: boundary function
Expand All @@ -38,9 +36,6 @@ subsection Mesh deformation
end
end




subsection Gravity model
set Model name = vertical
end
Expand All @@ -53,7 +48,6 @@ subsection Mesh refinement
set Initial global refinement = 0
end


subsection Postprocess
set List of postprocessors = visualization, particles

Expand Down

0 comments on commit 558fdce

Please sign in to comment.