From b61246d621a99204a88799128f53238757a85139 Mon Sep 17 00:00:00 2001 From: Sam Reeve <6740307+streeve@users.noreply.github.com> Date: Fri, 24 May 2024 16:07:36 -0400 Subject: [PATCH] Move temperature comm after BC update --- src/CabanaPD_Solver.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/CabanaPD_Solver.hpp b/src/CabanaPD_Solver.hpp index 24bc55ca..81b3864a 100644 --- a/src/CabanaPD_Solver.hpp +++ b/src/CabanaPD_Solver.hpp @@ -202,10 +202,6 @@ class SolverElastic void init_force() { init_timer.reset(); - // Communicate temperature. - if constexpr ( std::is_same::value ) - comm->gatherTemperature(); // Compute/communicate LPS weighted volume (does nothing for PMB). force->computeWeightedVolume( *particles, *neighbors, @@ -220,7 +216,11 @@ class SolverElastic computeEnergy( *force, *particles, *neighbors, neigh_iter_tag() ); // Add boundary condition. - boundary_condition.apply( exec_space(), *particles, 0.0 ); + // boundary_condition.apply( exec_space(), *particles, 0.0 ); + // Communicate temperature. + if constexpr ( std::is_same::value ) + comm->gatherTemperature(); particles->output( 0, 0.0, output_reference ); init_time += init_timer.seconds(); @@ -233,10 +233,6 @@ class SolverElastic // Main timestep loop. for ( int step = 1; step <= num_steps; step++ ) { - if constexpr ( std::is_same::value ) - comm->gatherTemperature(); - // Integrate - velocity Verlet first half. integrate_timer.reset(); integrator->initialHalfStep( *particles ); @@ -265,6 +261,10 @@ class SolverElastic // Add boundary condition. boundary_condition.apply( exec_space(), *particles, step * dt ); + if constexpr ( std::is_same::value ) + comm->gatherTemperature(); + // Integrate - velocity Verlet second half. integrate_timer.reset(); integrator->finalHalfStep( *particles );