57 {
58
59 if (!data["Type"]) {
60 std::cerr << "Error; Can not read geometry type in yaml data in block = "
61 << data_block_name << ".\n";
62 exit(EXIT_FAILURE);
63 }
64 name = data["Type"].as<std::string>();
65
66 if (name == "complex") {
67
68 if (data["Vec_Type"]) {
69 for (auto f: data["Vec_Type"])
70 complexInfo.first.push_back(f.as<std::string>());
71 } else {
72 std::cerr << "Error: To define complex geometry, we require vector of "
73 "types in yaml data block = "
74 << data_block_name << "\n";
75 exit(EXIT_FAILURE);
76 }
77
78 if (data["Vec_Flag"]) {
79 for (auto f: data["Vec_Flag"])
80 complexInfo.second.push_back(f.as<std::string>());
81 } else {
82 std::cerr << "Error: To define complex geometry, we require vector of "
83 "flags in yaml data block = "
84 << data_block_name << "\n";
85 exit(EXIT_FAILURE);
86 }
87 }
88
89 params.clear();
90 if (data["Parameters"]) {
91 for (auto f : data["Parameters"])
92 params.push_back(f.as<double>());
93 } else {
94 std::cerr << "Error: Parameters defining geometry is not present in data block = "
95 << data_block_name << ".\n";
96 exit(EXIT_FAILURE);
97 }
98}