240{
241 if (key == "genesis input file") {
243 } else if (key == "exodus output file") {
245 } else if (key == "use two level mesh decomposition") {
246 std::string value_upper_case(value);
247 std::transform(
248 value_upper_case.begin(), value_upper_case.end(), value_upper_case.begin(), (int (*)(int))std::toupper);
249 if (value_upper_case == "TRUE" || value_upper_case == "YES" || value_upper_case == "ON") {
251 } else if (value_upper_case == "FALSE" || value_upper_case == "NO" || value_upper_case == "OFF") {
253 } else {
254 std::string msg =
255 "\n**** Error in Parser::ReadFile(), unexpected value for \"use two "
256 "level mesh decomposition\" " +
257 value + "\n";
258 throw std::invalid_argument(msg);
259 }
260 } else if (key == "write timing data file") {
261 std::string value_upper_case(value);
262 std::transform(
263 value_upper_case.begin(), value_upper_case.end(), value_upper_case.begin(), (int (*)(int))std::toupper);
264 if (value_upper_case == "TRUE" || value_upper_case == "YES" || value_upper_case == "ON") {
266 } else if (value_upper_case == "FALSE" || value_upper_case == "NO" || value_upper_case == "OFF") {
268 } else {
269 std::string msg =
270 "\n**** Error in Parser::ReadFile(), unexpected value for \"write "
271 "timing data file\" " +
272 value + "\n";
273 throw std::invalid_argument(msg);
274 }
275 } else if (key == "time integration scheme") {
277 } else if (key == "nonlinear solver relative tolerance") {
279 } else if (key == "nonlinear solver maximum iterations") {
281 } else if (key == "initial time") {
283 } else if (key == "final time") {
285 } else if (key == "number of load steps") {
287 } else if (key == "output frequency") {
289 } else if (key == "contact") {
291 } else if (key == "contact backend") {
293 } else if (key == "contact visualization") {
294 std::stringstream ss(value);
295 std::string val;
296 std::vector<std::string> vals;
297 while (ss >> val) { vals.push_back(val); }
298
299 if (vals.size() != 6 || vals[0] != "visualize_contact_entities" || (vals[1] != "on" && vals[1] != "off") ||
300 vals[2] != "visualize_bounding_boxes" || (vals[3] != "on" && vals[3] != "off") || vals[4] != "file_name") {
301 std::string msg =
302 "\n**** Error in Parser::ReadFile(), unexpected value for \"contact "
303 "visualization\"\n";
304 msg +=
305 "**** Allowable syntax is \"visualize_contact_entities <on/off> "
306 "visualize_bounding_boxes <on/off> file_name <file_name.e>\"\n";
307 throw std::invalid_argument(msg);
308 }
309
312
315
317 } else if (key == "material parameters") {
318 size_t space_pos = value.find(" ");
319 std::string material_key = value.substr(0, space_pos);
320 std::string material_props = value.substr(space_pos + 1, value.size());
322 } else if (key == "element block") {
323 BlockProperties block_props(value);
325 } else if (key == "boundary condition") {
327 } else if (key == "output fields") {
329 } else if (key == "contact dicing") {
330 int tmp = std::atoi(value.c_str());
331#ifdef NIMBLE_HAVE_BVH
332 contact_dicing_ = tmp;
333#else
334 std::cout << " **** Parser::ReadFile(), skipping key " + key + "\n";
335#endif
336 } else if (key == "contact splitting") {
337 size_t space_pos = value.find(" ");
338 std::string split_key = value.substr(0, space_pos);
339 std::string split_alg = value.substr(space_pos + 1, value.size());
340#ifdef NIMBLE_HAVE_BVH
341 contact_splitting_ = split_alg;
342#else
343 std::cout << " **** Parser::ReadFile(), skipping key " + key + "\n";
344#endif
345 }
346#ifdef NIMBLE_HAVE_UQ
347 else if (key == "uq parameters") {
348 size_t space_pos = value.find(" ");
349 std::string material_key = value.substr(0, space_pos);
350 std::string uq_params = value.substr(space_pos + 1, value.size());
351 uq_parameters_strings_[material_key] = uq_params;
352 } else if (key == "uq model") {
353 uq_model_string_ = value;
354 }
355#endif
356 else {
357 std::string msg = "\n**** Error in Parser::ReadFile(), unknown key " + key + "\n";
358 throw std::invalid_argument(msg);
359 }
360}
std::string contact_backend_string_
Definition nimble_parser.h:413