Skip to content

Commit

Permalink
Move temperature comm after BC update
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed May 28, 2024
1 parent 1f8e369 commit b61246d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/CabanaPD_Solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ class SolverElastic
void init_force()
{
init_timer.reset();
// Communicate temperature.
if constexpr ( std::is_same<typename force_model_type::thermal_type,
TemperatureDependent>::value )
comm->gatherTemperature();

// Compute/communicate LPS weighted volume (does nothing for PMB).
force->computeWeightedVolume( *particles, *neighbors,
Expand All @@ -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<typename force_model_type::thermal_type,
TemperatureDependent>::value )
comm->gatherTemperature();

particles->output( 0, 0.0, output_reference );
init_time += init_timer.seconds();
Expand All @@ -233,10 +233,6 @@ class SolverElastic
// Main timestep loop.
for ( int step = 1; step <= num_steps; step++ )
{
if constexpr ( std::is_same<typename force_model_type::thermal_type,
TemperatureDependent>::value )
comm->gatherTemperature();

// Integrate - velocity Verlet first half.
integrate_timer.reset();
integrator->initialHalfStep( *particles );
Expand Down Expand Up @@ -265,6 +261,10 @@ class SolverElastic
// Add boundary condition.
boundary_condition.apply( exec_space(), *particles, step * dt );

if constexpr ( std::is_same<typename force_model_type::thermal_type,
TemperatureDependent>::value )
comm->gatherTemperature();

// Integrate - velocity Verlet second half.
integrate_timer.reset();
integrator->finalHalfStep( *particles );
Expand Down

0 comments on commit b61246d

Please sign in to comment.