Skip to content

Commit

Permalink
Merge pull request #116 from streeve/custom_lps_particles
Browse files Browse the repository at this point in the history
Custom particle creation for LPS and thermal systems
  • Loading branch information
streeve authored Jul 12, 2024
2 parents 27cd8c0 + 395a535 commit b1ae49b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/CabanaPD_Particles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,13 +559,14 @@ class Particles<MemorySpace, LPS, TemperatureIndependent, Dimension>
_init_timer.stop();
}

template <class ExecSpace>
void createParticles( const ExecSpace& exec_space )
template <typename... Args>
void createParticles( Args&&... args )
{
base_type::createParticles( exec_space );
// Forward arguments to standard or custom particle creation.
base_type::createParticles( std::forward<Args>( args )... );
_init_timer.start();
_aosoa_m.resize( 0 );
_aosoa_theta.resize( 0 );
_aosoa_m.resize( n_local );
_aosoa_theta.resize( n_local );
_init_timer.stop();
}

Expand Down Expand Up @@ -711,11 +712,12 @@ class Particles<MemorySpace, PMB, TemperatureDependent, Dimension>
init_temp();
}

template <class ExecSpace>
void createParticles( const ExecSpace& exec_space )
template <typename... Args>
void createParticles( Args&&... args )
{
base_type::createParticles( exec_space );
_aosoa_temp.resize( 0 );
// Forward arguments to standard or custom particle creation.
base_type::createParticles( std::forward<Args>( args )... );
_aosoa_temp.resize( n_local );
}

auto sliceTemperature()
Expand Down

0 comments on commit b1ae49b

Please sign in to comment.