Skip to content

Commit

Permalink
fixup: warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed Dec 30, 2024
1 parent bbe120d commit a78bec9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
13 changes: 1 addition & 12 deletions examples/dem/powder_fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ void powderSettlingExample( const std::string filename )
auto particles = CabanaPD::createParticles<memory_space, model_type>(
exec_space(), low_corner, high_corner, num_cells, halo_width,
CabanaPD::BaseOutput{}, create_container, 0, true );
std::cout << particles->numFrozen() << " " << particles->numLocal()
<< std::endl;

// Create powder.
auto dx = particles->dx[0] * 2.0;
Expand All @@ -108,8 +106,6 @@ void powderSettlingExample( const std::string filename )
};
particles->createParticles( exec_space(), Cabana::InitRandom{},
create_powder, particles->numFrozen() );
std::cout << particles->numFrozen() << " " << particles->numLocal()
<< std::endl;

// Set density/volumes.
auto rho = particles->sliceDensity();
Expand Down Expand Up @@ -142,8 +138,6 @@ void powderSettlingExample( const std::string filename )
auto remove_functor = KOKKOS_LAMBDA( const int pid, int& k )
{
auto f_mag = Kokkos::hypot( f( pid, 0 ), f( pid, 1 ), f( pid, 2 ) );
if ( f( pid, 0 ) > 0 )
std::cout << f_mag << std::endl;
if ( f_mag > 1e8 )
keep( pid - num_frozen ) = 0;
else
Expand All @@ -153,13 +147,8 @@ void powderSettlingExample( const std::string filename )
particles->localOffset() );
Kokkos::parallel_reduce( "remove", policy, remove_functor,
Kokkos::Sum<int>( num_keep ) );
std::cout << num_frozen << " " << particles->localOffset() << " "
<< particles->numLocal() - num_keep << " " << keep.size()
<< std::endl;
cabana_pd->particles->remove( num_keep, keep );
std::cout << particles->numFrozen() << " " << particles->numLocal()
<< std::endl;
// Need to rebuild ghosts..
// FIXME: Will need to rebuild ghosts.

// ====================================================
// Boundary condition
Expand Down
10 changes: 5 additions & 5 deletions src/CabanaPD_Solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class SolverElastic
SolverElastic( input_type _inputs,
std::shared_ptr<particle_type> _particles,
force_model_type force_model )
: inputs( _inputs )
, particles( _particles )
: particles( _particles )
, inputs( _inputs )
, _init_time( 0.0 )
{
setup( force_model );
Expand All @@ -128,8 +128,8 @@ class SolverElastic
std::shared_ptr<particle_type> _particles,
force_model_type force_model,
contact_model_type contact_model )
: inputs( _inputs )
, particles( _particles )
: particles( _particles )
, inputs( _inputs )
, _init_time( 0.0 )
{
setup( force_model );
Expand Down Expand Up @@ -459,7 +459,7 @@ class SolverElastic
bool output_reference;
double dt;
int thermal_subcycle_steps;

// Sometimes necessary to update particles after solver creation.
std::shared_ptr<particle_type> particles;

protected:
Expand Down

0 comments on commit a78bec9

Please sign in to comment.