| 33 | } |
| 34 | |
| 35 | shared_ptr<Interface> newInterface(const string& infile, |
| 36 | const string& name, const vector<string>& adjacent) |
| 37 | { |
| 38 | auto sol = newSolution(infile, name, "default", adjacent); |
| 39 | auto iface = std::dynamic_pointer_cast<Interface>(sol); |
| 40 | if (!iface) { |
| 41 | auto rootNode = AnyMap::fromYamlFile(infile); |
| 42 | AnyMap& phaseNode = rootNode["phases"].getMapWhere("name", name); |
| 43 | throw InputFileError("newInterface", phaseNode, |
| 44 | "Phase definition does not define a surface phase"); |
| 45 | } |
| 46 | return iface; |
| 47 | } |
| 48 | |
| 49 | shared_ptr<Interface> newInterface(const string& infile, |
| 50 | const string& name, const vector<shared_ptr<Solution>>& adjacent) |