From 4e7e35f4c5b816566580db136a9d17f29f5fde68 Mon Sep 17 00:00:00 2001 From: Nitin Netake <118507703+nnetake@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:23:26 +0530 Subject: [PATCH] reverting to original implementation (#4103) --- pyaedt/modules/PostProcessor.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pyaedt/modules/PostProcessor.py b/pyaedt/modules/PostProcessor.py index 0d0f69261bf..e2229ec27e1 100644 --- a/pyaedt/modules/PostProcessor.py +++ b/pyaedt/modules/PostProcessor.py @@ -2350,10 +2350,17 @@ def get_scalar_field_value( else: variation_dict.append("0deg") - self.ofieldsreporter.ClcEval(solution, variation_dict) - value = self.ofieldsreporter.GetTopEntryValue(solution, variation_dict) + file_name = os.path.join(self._app.working_directory, generate_unique_name("temp_fld") + ".fld") + self.ofieldsreporter.CalculatorWrite(file_name, ["Solution:=", solution], variation_dict) + value = None + if os.path.exists(file_name) or settings.remote_rpc_session: + with open_file(file_name, "r") as f: + lines = f.readlines() + lines = [line.strip() for line in lines] + value = lines[-1] + os.remove(file_name) self.ofieldsreporter.CalcStack("clear") - return float(value[0]) + return float(value) @pyaedt_function_handler() def export_field_file_on_grid(