Skip to content

Commit

Permalink
fixup: fixed seed for consistent results across MPI ranks
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed Jan 23, 2025
1 parent 4a7d464 commit 75fa8cd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/mechanics/random_cracks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ void randomCracksExample( const std::string filename )
Kokkos::Array<Kokkos::Array<double, 3>, Npn> notch_v1;
Kokkos::Array<Kokkos::Array<double, 3>, Npn> notch_v2;

// Set random number generator
std::random_device rd;
std::mt19937 gen( rd() );
// Changing this seed will re-randomize the cracks.
std::size_t seed = 44758454;
// Random number generator
std::mt19937 gen( seed );
std::uniform_real_distribution<> dis( 0.0, 1.0 );

// Loop over pre-notches
Expand Down

0 comments on commit 75fa8cd

Please sign in to comment.