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 24, 2024
1 parent 1bbc705 commit 7c7250b
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 @@ -200,10 +200,6 @@ class SolverElastic
void init()
{
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 @@ -218,7 +214,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 @@ -232,10 +232,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 @@ -264,6 +260,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 7c7250b

Please sign in to comment.