From 6307e5380918aec1aaf9d5f43bf7f8e542df0ec1 Mon Sep 17 00:00:00 2001 From: iasonmanolas Date: Wed, 19 Jan 2022 12:28:13 +0200 Subject: [PATCH] Added json to SimulationResults containing the internalPotentialEnergy value of the simulation --- simulation_structs.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simulation_structs.hpp b/simulation_structs.hpp index 7f4b908..f1e267e 100755 --- a/simulation_structs.hpp +++ b/simulation_structs.hpp @@ -803,7 +803,10 @@ private: std::ifstream ifs(jsonFilepath); nlohmann::json json; ifs >> json; - internalPotentialEnergy = json.at(GET_VARIABLE_NAME(internalPotentialEnergy)); + if (json.contains(GET_VARIABLE_NAME(internalPotentialEnergy))) { + internalPotentialEnergy = json.at(GET_VARIABLE_NAME(internalPotentialEnergy)); + } + return true; } };