Skip to content

Commit

Permalink
fmk - mat cite name fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fmckenna committed May 10, 2024
1 parent 5af257e commit 97523f3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
38 changes: 38 additions & 0 deletions WorkflowAppHydroUQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,3 +1050,41 @@ int
WorkflowAppHydroUQ::getMaxNumParallelTasks() {
return theUQ_Selection->getNumParallelTasks();
}

int
WorkflowAppHydroUQ::createCitation(QJsonObject &citation, QString citeFile) {

QString cit("{\"HydroUQ\": { \"citations\": [{\"citation\": \"Frank McKenna, Justin Bonus, Ajay B Harish, & Nicolette Lewis. (2024). NHERI-SimCenter/HydroUQ: Version 3.1.0 (v3.1.0). Zenodo. https://doi.org/10.5281/zenodo.10902090 \",\"description\": \"This is the overall tool reference used to indicate the version of the tool.\"},{\"citation\": \"Gregory G. Deierlein, Frank McKenna, Adam Zsarnóczay, Tracy Kijewski-Correa, Ahsan Kareem, Wael Elhaddad, Laura Lowes, Matthew J. Schoettler, and Sanjay Govindjee (2020) A Cloud-Enabled Application Framework for Simulating Regional-Scale Impacts of Natural Hazards on the Built Environment. Frontiers in the Built Environment. 6:558706. doi: 10.3389/fbuil.2020.558706\",\"description\": \" This marker paper describes the SimCenter application framework, which was designed to simulate the impacts of natural hazards on the built environment.It is a necessary attribute for publishing work resulting from the use of SimCenter tools, software, and datasets.\"}]}}");

QJsonDocument docC = QJsonDocument::fromJson(cit.toUtf8());
if(!docC.isNull()) {
if(docC.isObject()) {
citation = docC.object();
} else {
qDebug() << "WorkflowdAppEE_UQ citation text is not valid JSON: \n" << cit << endl;
}
}
theSIM->outputCitation(citation);
theEventSelection->outputCitation(citation);
theAnalysisSelection->outputCitation(citation);
theUQ_Selection->outputCitation(citation);
theEDP_Selection->outputCitation(citation);

// write the citation to a citeFile if provided

if (!citeFile.isEmpty()) {

QFile file(citeFile);
if (!file.open(QFile::WriteOnly | QFile::Text)) {
errorMessage(QString("writeCitation - could not open file") + citeFile);
progressDialog->hideProgressBar();
return 0;
}

QJsonDocument doc(citation);
file.write(doc.toJson());
file.close();
}

return 0;
}
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ int main(int argc, char *argv[])
w.setVersion(version);

// Citation
QString citeText("1) Frank McKenna, Justin Bonus, Ajay B Harish, & Nicolette Lewis. (2024). NHERI-SimCenter/HydroUQ: Version 3.1.0 (v3.1.0). Zenodo. https://doi.org/10.5281/zenodo.10902090 \n\n 2) Deierlein GG, McKenna F, Zsarnóczay A, Kijewski-Correa T, Kareem A, Elhaddad W, Lowes L, Schoettler MJ and Govindjee S (2020) A Cloud-Enabled Application Framework for Simulating Regional-Scale Impacts of Natural Hazards on the Built Environment. Front. Built Environ. 6:558706. doi: 10.3389/fbuil.2020.558706");
QString citeText("1) Frank McKenna, Justin Bonus, Ajay B Harish, & Nicolette Lewis. (2024). NHERI-SimCenter/HydroUQ: Version 3.1.0 (v3.1.0). Zenodo. https://doi.org/10.5281/zenodo.10902090 \n\n 2) \n\n2) Gregory G. Deierlein, Frank McKenna, Adam Zsarnóczay, Tracy Kijewski-Correa, Ahsan Kareem, Wael Elhaddad, Laura Lowes, Matthew J. Schoettler, and Sanjay Govindjee (2020) A Cloud-Enabled Application Framework for Simulating Regional-Scale Impacts of Natural Hazards on the Built Environment. Frontiers in the Built Environment. 6:558706. doi: 10.3389/fbuil.2020.558706");
w.setCite(citeText);

// Link to repository
Expand Down

0 comments on commit 97523f3

Please sign in to comment.