Skip to content

Commit b429f82

Browse files
committed
Simplify some Fastcape code.
1 parent 120b4ea commit b429f82

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

source/mesh_deformation/fastscape.cc

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -571,16 +571,10 @@ namespace aspect
571571
if (fastscape_mesh_filled != true)
572572
throw aspect::QuietException();
573573

574-
// This is called solely so we can set the timer and will return immediately.
575-
std::vector<double> dummy(fastscape_array_size);
576-
execute_fastscape(mesh_velocity_z,
577-
mesh_velocity_z,
578-
mesh_velocity_z,
579-
mesh_velocity_z,
580-
mesh_velocity_z,
581-
dummy,
582-
aspect_timestep_in_years,
583-
fastscape_steps_per_aspect_step);
574+
// We only execute FastScape on process 0, but we have to make sure we
575+
// enter and leave the corresponding timer section on all processes:
576+
this->get_computing_timer().enter_subsection("Execute FastScape");
577+
this->get_computing_timer().leave_subsection("Execute FastScape");
584578
}
585579

586580
// At this point, the root process will have filled the mesh_velocity_z array,
@@ -891,13 +885,12 @@ namespace aspect
891885
const double &fastscape_timestep_in_years,
892886
const unsigned int &fastscape_iterations) const
893887
{
894-
this->get_computing_timer().enter_subsection("Execute FastScape");
888+
// This function can only be called on the root process where we run
889+
// Fastscape:
890+
Assert (Utilities::MPI::this_mpi_process(this->get_mpi_communicator()) == 0,
891+
ExcInternalError());
895892

896-
if (Utilities::MPI::this_mpi_process(this->get_mpi_communicator()) != 0)
897-
{
898-
this->get_computing_timer().leave_subsection("Execute FastScape");
899-
return;
900-
}
893+
this->get_computing_timer().enter_subsection("Execute FastScape");
901894

902895
// Because on the first timestep we will create an initial VTK file before running FastScape
903896
// and a second after, we first set the visualization step to zero.

0 commit comments

Comments
 (0)