Commit d4c3b1b3 authored by Alexander Breuer's avatar Alexander Breuer

Added an optional time step computation for teaching purposes.

parent df26b0be
...@@ -78,9 +78,9 @@ class SWE_WavePropagationBlockCuda: public SWE_BlockCUDA { ...@@ -78,9 +78,9 @@ class SWE_WavePropagationBlockCuda: public SWE_BlockCUDA {
float simulate(float, float); float simulate(float, float);
// TODO: not implemented, max time step reduction is done in each call of computeNumericalFluxes(...) // TODO: not implemented, max time step reduction is done in each call of computeNumericalFluxes(...)
void computeMaxTimestep() { //void computeMaxTimestep() {
assert(false); // assert(false);
}; //};
// compute the numerical fluxes (net-update formulation here). // compute the numerical fluxes (net-update formulation here).
void computeNumericalFluxes(); void computeNumericalFluxes();
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <cassert> #include <cassert>
#include <cstdlib> #include <cstdlib>
#include <string> #include <string>
#include <iostream>
#include "../tools/help.hh" #include "../tools/help.hh"
#include "../SWE_Block.hh" #include "../SWE_Block.hh"
...@@ -217,6 +218,11 @@ int main( int argc, char** argv ) { ...@@ -217,6 +218,11 @@ int main( int argc, char** argv ) {
while( l_t < l_checkPoints[c] ) { while( l_t < l_checkPoints[c] ) {
// set values in ghost cells: // set values in ghost cells:
l_wavePropgationBlock.setGhostLayer(); l_wavePropgationBlock.setGhostLayer();
// approximate the maximum time step
// TODO: This calculation should be replaced by the usage of the wave speeds occuring during the flux computation
// Remark: The code is executed on the CPU, therefore a "valid result" depends on the CPU-GPU-synchronization.
// l_wavePropgationBlock.computeMaxTimestep();
// compute numerical flux on each edge // compute numerical flux on each edge
l_wavePropgationBlock.computeNumericalFluxes(); l_wavePropgationBlock.computeNumericalFluxes();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment