Skip to content

Commit

Permalink
Workng deterministic local run of Stochastic Wave Model EVT (JONSWAP)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBonus committed May 16, 2024
1 parent 308ff9c commit 5c5e262
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion EDP/HydroEDP_Selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ HydroEDP_Selection::HydroEDP_Selection(QWidget *parent)
theStackedWidget->addWidget(theStandardStormSurgeEDPs);
theStackedWidget->addWidget(theUserDefinedEDPs);
theStackedWidget->addWidget(theStandardEDPs);
theStackedWidget->setCurrentIndex(4);
theStackedWidget->setCurrentIndex(0);
layout->addWidget(theStackedWidget);
this->setLayout(layout);

Expand Down
5 changes: 2 additions & 3 deletions EVENTS/HydroEventSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,8 @@ bool HydroEventSelection::copyFiles(QString &destDir) {

bool HydroEventSelection::supportsLocalRun()
{
// return theCurrentEvent->supportsLocalRun();
// if theCurrentEvent
return false;
if (theCurrentEvent != 0)
return theCurrentEvent->supportsLocalRun();
}

bool
Expand Down
4 changes: 4 additions & 0 deletions EVENTS/StochasticWaveModel/include/StochasticWaveInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ class StochasticWaveInput : public SimCenterAppWidget {
*/
bool outputAppDataToJSON(QJsonObject& rvObject);


bool supportsLocalRun() override;


signals:
void sendErrorMessage(QString message);

Expand Down
10 changes: 8 additions & 2 deletions EVENTS/StochasticWaveModel/src/Jonswap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ bool Jonswap::outputAppDataToJSON(QJsonObject& jsonObject) {
bool result = true;

jsonObject["Application"] = "StochasticWaveJonswap";
jsonObject["EventClassification"] = "Hydro";
// jsonObject["EventClassification"] = "Hydro";

// jsonObject["Application"] = "StochasticWindWittigSinha";
jsonObject["EventClassification"] = "Wind";
// squirel in the application data selection text
QJsonObject appData;
jsonObject["ApplicationData"] = appData;
Expand All @@ -139,7 +141,11 @@ bool Jonswap::outputToJSON(QJsonObject& jsonObject) {
bool result = true;

jsonObject["type"] = "StochasticWaveJonswap";
jsonObject["EventClassification"] = "Hydro";
// jsonObject["type"] = "StochasticWindWittigSinha";

// jsonObject["EventClassification"] = "Hydro";
jsonObject["EventClassification"] = "Wind";

dragCoefficient->outputToJSON(jsonObject, QString("dragCoefficient"));
gustWindSpeed->outputToJSON(jsonObject, QString("gustSpeed"));
jsonObject.insert("exposureCategory",exposureCategory->currentText());
Expand Down
5 changes: 5 additions & 0 deletions EVENTS/StochasticWaveModel/src/StochasticWaveInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ bool StochasticWaveInput::inputAppDataFromJSON(QJsonObject& jsonObject) {
return true;
}

bool StochasticWaveInput::supportsLocalRun() {
// TODO: Check if the selected model supports local run
return true;
}

void StochasticWaveInput::modelSelectionChanged(const QString& model) {

// Switch the model description and form layout based on model selection
Expand Down

0 comments on commit 5c5e262

Please sign in to comment.