@@ -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