Add Chile

parent 8a22a1bd
...@@ -290,6 +290,64 @@ bool Controller::handleKeyPress( SDL_keysym *keysym) { ...@@ -290,6 +290,64 @@ bool Controller::handleKeyPress( SDL_keysym *keysym) {
visualization->updateBathymetryVBO(simulation); visualization->updateBathymetryVBO(simulation);
} }
break; break;
case SDLK_6:
// Load scenario 6
{
allowStep = paused;
if (scenarios[5] == 0) {
//simulation area
float simulationArea[4];
simulationArea[0] = -13775000;
simulationArea[1] = 1655000;
simulationArea[2] = -2765000;
simulationArea[3] = 8870000;
scenarios[5] = new SWE_AsagiScenario(
ASAGI_INPUT_DIR "chile_gebco_usgs_500m_bath.nc",
ASAGI_INPUT_DIR "chile_gebco_usgs_500m_displ.nc",
(float) 28800., simulationArea);
}
SWE_Scenario* newScene = scenarios[5];
// define grid size and initial time step
float dx = (newScene->getBoundaryPos(BND_RIGHT) - newScene->getBoundaryPos(BND_LEFT) )/SWE_Block::getNx();
float dy = (newScene->getBoundaryPos(BND_TOP) - newScene->getBoundaryPos(BND_BOTTOM) )/SWE_Block::getNy();
SWE_Block::initGridData(SWE_Block::getNx(),SWE_Block::getNy(),dx,dy);
simulation->loadNewScenario(newScene, NULL);
visualization->updateBathymetryVBO(simulation);
}
break;
case SDLK_7:
// Load scenario 7
{
allowStep = paused;
if (scenarios[6] == 0) {
//simulation area
float simulationArea[4];
simulationArea[0] = -2275000;
simulationArea[1] = 1655000;
simulationArea[2] = -2265000;
simulationArea[3] = 1870000;
scenarios[6] = new SWE_AsagiScenario(
ASAGI_INPUT_DIR "chile_gebco_usgs_500m_bath.nc",
ASAGI_INPUT_DIR "chile_gebco_usgs_500m_displ.nc",
(float) 28800., simulationArea);
}
SWE_Scenario* newScene = scenarios[6];
// define grid size and initial time step
float dx = (newScene->getBoundaryPos(BND_RIGHT) - newScene->getBoundaryPos(BND_LEFT) )/SWE_Block::getNx();
float dy = (newScene->getBoundaryPos(BND_TOP) - newScene->getBoundaryPos(BND_BOTTOM) )/SWE_Block::getNy();
SWE_Block::initGridData(SWE_Block::getNx(),SWE_Block::getNy(),dx,dy);
simulation->loadNewScenario(newScene, NULL);
visualization->updateBathymetryVBO(simulation);
}
break;
#endif // ASAGI #endif // ASAGI
default: default:
break; break;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "visualization.h" #include "visualization.h"
/** The number of different scenarios */ /** The number of different scenarios */
#define SCENARIO_COUNT 5 #define SCENARIO_COUNT 7
class Controller { class Controller {
public: public:
......
...@@ -111,16 +111,16 @@ void Visualization::renderDisplay() { ...@@ -111,16 +111,16 @@ void Visualization::renderDisplay() {
text->showText("Keys:", location); text->showText("Keys:", location);
location.y -= location.h; location.y -= location.h;
#ifdef ASAGI #ifdef ASAGI
text->showText(" Scenarios: 1-5", location); text->showText(" 1-7: Select scenario", location);
#else // ASAGI #else // ASAGI
text->showText(" Scenarios: 1-3", location); text->showText(" 1-3: Select scenario", location);
#endif // ASAGI #endif // ASAGI
location.y -= location.h; location.y -= location.h;
text->showText(" Pause/Resume: Space", location); text->showText(" Space: Pause/Resume", location);
location.y -= location.h; location.y -= location.h;
text->showText(" Next frame (when paused): ->", location); text->showText(" ->: Next frame (when paused)", location);
location.y -= location.h; location.y -= location.h;
text->showText(" Reset scenario: r", location); text->showText(" r: Restart scenario", location);
location.y -= location.h; location.y -= location.h;
text->showText("Mouse:", location); text->showText("Mouse:", location);
location.y -= location.h; location.y -= location.h;
......
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