From 7f22b4fe3f21fdbc739c6f09b1c9455567df275c Mon Sep 17 00:00:00 2001 From: chn Date: Wed, 27 Sep 2023 20:47:49 +0800 Subject: [PATCH] bug fix --- include/ufo/ufo.impl.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/ufo/ufo.impl.hpp b/include/ufo/ufo.impl.hpp index 105c4e7..dfa0794 100644 --- a/include/ufo/ufo.impl.hpp +++ b/include/ufo/ufo.impl.hpp @@ -86,7 +86,11 @@ inline Input::Input(std::string filename) if (AtomPositionInputFile.Format == "yaml") { auto node = YAML::LoadFile(AtomPositionInputFile.FileName); - auto points = node["points"].as>(); + std::vector points; + if (auto _ = node["points"]) + points = _.as>(); + else + points = node["unit_cell"]["points"].as>(); auto atom_position_to_super_cell = Eigen::MatrixX3d(points.size(), 3); for (unsigned i = 0; i < points.size(); i++) for (unsigned j = 0; j < 3; j++)