Skip to content

Commit

Permalink
fixes specific body force
Browse files Browse the repository at this point in the history
  • Loading branch information
joergbuchwald committed Jun 24, 2024
1 parent 00bdee5 commit 84194da
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions ogs6py/classes/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,29 @@ def set_process(self, **args):
raise KeyError("type missing.")
if "integration_order" not in args:
raise KeyError("integration_order missing.")
if "darcy_gravity" in args:
for i, entry in enumerate(args["darcy_gravity"]):
if entry != 0.0:
self.process_baseentries["darcy_gravity"] = self.populate_tree(
for key, value in args.items():
if key == "darcy_gravity":
for i, entry in enumerate(args["darcy_gravity"]):
if entry != 0.0:
self.process_baseentries["darcy_gravity"] = self.populate_tree(
self.process, "darcy_gravity")
self.populate_tree(self.process_baseentries["darcy_gravity"],
self.populate_tree(self.process_baseentries["darcy_gravity"],
"axis_id",text =str(i))
self.populate_tree(self.process_baseentries["darcy_gravity"],
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']))
for key, value in args.items():
if isinstance(value, str):
self.populate_tree(self.process, key, text=value)
elif key == "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"])
else:
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):
Expand Down

0 comments on commit 84194da

Please sign in to comment.