From ebdf5cda5221b1878f42956408d4ac0015cc54ed Mon Sep 17 00:00:00 2001 From: joergbuchwald Date: Mon, 24 Jun 2024 16:59:45 +0200 Subject: [PATCH] fixes specific body force --- ogs6py/classes/processes.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ogs6py/classes/processes.py b/ogs6py/classes/processes.py index f477319..a6d3703 100644 --- a/ogs6py/classes/processes.py +++ b/ogs6py/classes/processes.py @@ -87,10 +87,19 @@ def set_process(self, **args): self.populate_tree(self.process_baseentries["darcy_gravity"], "g",text = str(entry)) if "specific_body_force" in args: - self.populate_tree(self.process, "specific_body_force", text=" ".join(str(x) for x in args['specific_body_force'])) + if isinstance(args["specific_body_force"], list): + self.populate_tree(self.process, "specific_body_force", + text=" ".join(str(x) for x in args['specific_body_force'])) + else: + self.populate_tree(self.process, "specific_body_force", + text=args["specific_body_force"]) for key, value in args.items(): - if isinstance(value, str): - self.populate_tree(self.process, key, text=value) + if key not in ["darcy_gravity", "specific_body_force"]: + if isinstance(value, str): + self.populate_tree(self.process, key, text=value) + else: + raise RuntimeError(f"{key} is not of type string") + def set_constitutive_relation(self, **args):