Skip to content

Commit 64ec50c

Browse files
committed
fmk - updating backend to use UQ and not UQ_Method
1 parent a2931e6 commit 64ec50c

16 files changed

Lines changed: 50 additions & 52 deletions

File tree

modules/createEDP/standardWindEDP/input.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"type": "MDOF_BuildingModel",
101101
"weight": 144
102102
},
103-
"UQ_Method": {
103+
"UQ": {
104104
"samplingMethodData": {
105105
"method": "LHS",
106106
"samples": 10,

modules/createEVENT/DEDM_HRP/dakota.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"type": "MDOF_BuildingModel",
9595
"weight": "RV.weigh"
9696
},
97-
"UQ_Method": {
97+
"UQ": {
9898
"samplingMethodData": {
9999
"evalID": "RV.DAKOTA_EVAL_ID",
100100
"method": "LHS",

modules/createEVENT/DEDM_HRP/testInput.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"type": "MDOF_BuildingModel",
101101
"weight": 144
102102
},
103-
"UQ_Method": {
103+
"UQ": {
104104
"samplingMethodData": {
105105
"method": "LHS",
106106
"samples": 10,

modules/createEVENT/NonisolatedLowRiseTPU/dakota.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"type": "MDOF_BuildingModel",
111111
"weight": "RV.wF"
112112
},
113-
"UQ_Method": {
113+
"UQ": {
114114
"samplingMethodData": {
115115
"method": "LHS",
116116
"samples": 20,

modules/createEVENT/groundMotionIM/IntensityMeasureComputer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ def main(BIM_file, EVENT_file, IM_file, unitScaled, ampScaled):
548548
bim_im = bim_file.get('IntensityMeasure', None)
549549
output_periods = []
550550
if bim_im is None:
551-
# search it again under UQ_Method/surrogateMethodInfo
552-
bim_im = bim_file['UQ_Method']['surrogateMethodInfo'].get('IntensityMeasure',None)
551+
# search it again under UQ/surrogateMethodInfo
552+
bim_im = bim_file['UQ']['surrogateMethodInfo'].get('IntensityMeasure',None)
553553
if bim_im is None or len(bim_im)==0:
554554
# no intensity measure calculation requested
555555
return

modules/createEVENT/windTunnelExperiment/testInput.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"type": "MDOF_BuildingModel",
9494
"weight": 144
9595
},
96-
"UQ_Method": {
96+
"UQ": {
9797
"samplingMethodData": {
9898
"evalID": "RV.DAKOTA_EVAL_ID",
9999
"method": "LHS",

modules/performUQ/SimCenterUQ/SimCenterUQ.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def main(args):
7171
with open(inputFile) as data_file:
7272
data = json.load(data_file)
7373

74-
uq_data = data["UQ_Method"]
74+
uq_data = data["UQ"]
7575

7676
myScriptDir = os.path.dirname(os.path.realpath(__file__))
7777

modules/performUQ/SimCenterUQ/nataf_gsa/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,9 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
111111
add_compile_definitions(OPENMP_RUN)
112112
endif()
113113

114-
install(TARGETS nataf_gsa DESTINATION bin)
114+
install(TARGETS nataf_gsa DESTINATION ../..)
115115
add_compile_definitions($<$<CONFIG:Debug>:_ITERATOR_DEBUG_LEVEL=0>)
116116

117-
118-
119117
else()
120118

121119
ADD_DEFINITIONS("-DBOOST_ALL_NO_LIB")
@@ -236,4 +234,4 @@ else()
236234

237235
install(TARGETS nataf_gsa DESTINATION bin)
238236

239-
endif()
237+
endif()

modules/performUQ/SimCenterUQ/nataf_gsa/ERANataf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class ERANataf
108108
string workflowDriver,
109109
string osType,
110110
string runType);
111-
void ERANataf::simulateAppBatchSurrogate(string workflowDriver,
111+
void simulateAppBatchSurrogate(string workflowDriver,
112112
string osType,
113113
string runType,
114114
jsonInput inp,

modules/performUQ/SimCenterUQ/nataf_gsa/jsonInput.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ jsonInput::jsonInput(string workDir, string inpFile, int procno)
7777
// Check if I am the correct engine.
7878
//
7979

80-
uqType = UQjson["UQ_Method"]["uqType"];
81-
std::string uqEngine = UQjson["UQ_Method"]["uqEngine"];
80+
uqType = UQjson["UQ"]["uqType"];
81+
std::string uqEngine = UQjson["UQ"]["uqEngine"];
8282

8383
if ((uqEngine.compare("SimCenterUQ")==0)) {
8484
// pass
@@ -96,7 +96,7 @@ jsonInput::jsonInput(string workDir, string inpFile, int procno)
9696
} else
9797
{
9898
//*ERROR*
99-
std::string methodType = UQjson["UQ_Method"]["uqType"];
99+
std::string methodType = UQjson["UQ"]["uqType"];
100100
std::string errMsg = "Error reading json: 'Forward Analysis' or 'Sensitivity Analysis' backend is called, but the user requested " + methodType;
101101
theErrorFile.write(errMsg);
102102
}
@@ -158,9 +158,9 @@ jsonInput::jsonInput(string workDir, string inpFile, int procno)
158158
performPCA = false;
159159
}
160160

161-
if (UQjson["UQ_Method"].find("performPCA") != UQjson["UQ_Method"].end()) {
161+
if (UQjson["UQ"].find("performPCA") != UQjson["UQ"].end()) {
162162

163-
std::string PCAoption = UQjson["UQ_Method"]["performPCA"];
163+
std::string PCAoption = UQjson["UQ"]["performPCA"];
164164
if ((PCAoption.compare("Yes") == 0)) {
165165
performPCA = true;
166166
}
@@ -170,8 +170,8 @@ jsonInput::jsonInput(string workDir, string inpFile, int procno)
170170
}
171171

172172
if (performPCA && (uqType.compare("Sensitivity Analysis") == 0)) {
173-
if (UQjson["UQ_Method"].find("PCAvarianceRatio") != UQjson["UQ_Method"].end()) {
174-
PCAvarRatioThres = UQjson["UQ_Method"]["PCAvarianceRatio"];
173+
if (UQjson["UQ"].find("PCAvarianceRatio") != UQjson["UQ"].end()) {
174+
PCAvarRatioThres = UQjson["UQ"]["PCAvarianceRatio"];
175175
if (PCAvarRatioThres <= 0) {
176176
std::string errMsg = "Error reading input: PCA variance ratio should be greater than zero.";
177177
theErrorFile.write(errMsg);
@@ -200,7 +200,7 @@ jsonInput::jsonInput(string workDir, string inpFile, int procno)
200200
// Basic Info
201201
//
202202

203-
UQmethod = UQjson["UQ_Method"]["samplingMethodData"]["method"];
203+
UQmethod = UQjson["UQ"]["samplingMethodData"]["method"];
204204

205205

206206
//
@@ -216,13 +216,13 @@ jsonInput::jsonInput(string workDir, string inpFile, int procno)
216216
nrv++;
217217
rvNames.push_back(elem["name"]);
218218
}
219-
inpPath = UQjson["UQ_Method"]["samplingMethodData"]["inpFile"];
220-
outPath = UQjson["UQ_Method"]["samplingMethodData"]["outFile"];
219+
inpPath = UQjson["UQ"]["samplingMethodData"]["inpFile"];
220+
outPath = UQjson["UQ"]["samplingMethodData"]["outFile"];
221221

222222
getGroupIdx(UQjson);
223223

224-
inpFileType = UQjson["UQ_Method"]["samplingMethodData"]["inpFiletype"];
225-
outFileType = UQjson["UQ_Method"]["samplingMethodData"]["outFiletype"];
224+
inpFileType = UQjson["UQ"]["samplingMethodData"]["inpFiletype"];
225+
outFileType = UQjson["UQ"]["samplingMethodData"]["outFiletype"];
226226

227227
nmc = 0;
228228
rseed = 0;
@@ -234,8 +234,8 @@ jsonInput::jsonInput(string workDir, string inpFile, int procno)
234234
else {
235235
inpPath = "";
236236
outPath = "";
237-
nmc = UQjson["UQ_Method"]["samplingMethodData"]["samples"];
238-
rseed = UQjson["UQ_Method"]["samplingMethodData"]["seed"];
237+
nmc = UQjson["UQ"]["samplingMethodData"]["samples"];
238+
rseed = UQjson["UQ"]["samplingMethodData"]["seed"];
239239

240240
if (procno == 0) std::cout << " Nope we do sampling\n";
241241

@@ -255,14 +255,14 @@ jsonInput::jsonInput(string workDir, string inpFile, int procno)
255255
nre = 0;
256256

257257
std::string resampGroupTxt;
258-
if (UQjson["UQ_Method"]["samplingMethodData"].find("RVdataGroup") != UQjson["UQ_Method"]["samplingMethodData"].end()) {
258+
if (UQjson["UQ"]["samplingMethodData"].find("RVdataGroup") != UQjson["UQ"]["samplingMethodData"].end()) {
259259
// if the key "sensitivityGroups" exists
260-
resampGroupTxt = UQjson["UQ_Method"]["samplingMethodData"]["RVdataGroup"];
260+
resampGroupTxt = UQjson["UQ"]["samplingMethodData"]["RVdataGroup"];
261261
resampGroupTxt.erase(remove(resampGroupTxt.begin(), resampGroupTxt.end(), ' '), resampGroupTxt.end());
262262
}
263-
else if (UQjson["UQ_Method"].find("RVdataGroup") != UQjson["UQ_Method"].end()) {
263+
else if (UQjson["UQ"].find("RVdataGroup") != UQjson["UQ"].end()) {
264264
// FOR VERSION COMPETIBILITY - TO BE REMOVED SOON.... sy 08/12/2022
265-
resampGroupTxt = UQjson["UQ_Method"]["RVdataGroup"];
265+
resampGroupTxt = UQjson["UQ"]["RVdataGroup"];
266266
resampGroupTxt.erase(remove(resampGroupTxt.begin(), resampGroupTxt.end(), ' '), resampGroupTxt.end());
267267
}
268268
else {
@@ -852,10 +852,10 @@ jsonInput::getGroupIdx(json UQjson) {
852852
//
853853

854854
bool generate_default_RVsensitivityGroup = true;
855-
if (UQjson["UQ_Method"].find("RVsensitivityGroup") != UQjson["UQ_Method"].end()) {
855+
if (UQjson["UQ"].find("RVsensitivityGroup") != UQjson["UQ"].end()) {
856856

857857
// if the key "sensitivityGroups" exists
858-
std::string groupTxt = UQjson["UQ_Method"]["RVsensitivityGroup"];
858+
std::string groupTxt = UQjson["UQ"]["RVsensitivityGroup"];
859859
if (!groupTxt.empty()) {
860860
// if value of "sensitivityGroups" is nonempty
861861
groupTxt.erase(remove(groupTxt.begin(), groupTxt.end(), ' '), groupTxt.end()); // remove any white spaces
@@ -878,4 +878,4 @@ jsonInput::getGroupIdx(json UQjson) {
878878
}
879879

880880
ngr = groups.size();
881-
}
881+
}

0 commit comments

Comments
 (0)