Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. // Time evolution
  2. #pragma omp parallel default(none) shared(P, D, dt, dx, file, time, std::cout)
  3. {
  4. for (int step = 1; step <= numSteps; step++) {
  5.  
  6. // Compute next time point
  7. diffusion1d_timestep(P, D, dt, dx);
  8.  
  9. // Update time only on one thread
  10. #pragma single
  11. {
  12. time += dt;
  13.  
  14. // Periodically add data to the file
  15. if (step % outputEvery == 0 and step > 0)
  16. diffusion1d_output(file, step, time, P, outputcols);
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement