Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add python_script and curves to empty element removal #92

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/thm_test.prj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<OpenGeoSysProject>
<geometry>square_1x1_thm.gml</geometry>
<mesh axially_symmetric="true">quarter_002_2nd.vtu</mesh>
<processes>
<process>
Expand Down Expand Up @@ -324,5 +325,4 @@
</petsc>
</linear_solver>
</linear_solvers>
<geometry>square_1x1_thm.gml</geometry>
</OpenGeoSysProject>
1 change: 1 addition & 0 deletions ogs6py/classes/python_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class PythonScript(build_tree.BuildTree):
def __init__(self, tree):
self.tree = tree
self.root = self._get_root()
self.populate_tree(self.root, "python_script", overwrite=True)


def set_pyscript(self, filename):
Expand Down
5 changes: 2 additions & 3 deletions ogs6py/ogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def __init__(self, **args):
self.mesh = mesh.Mesh(self.tree)
self.processes = processes.Processes(self.tree)
self.python_script = python_script.PythonScript(self.tree)
self.processes = processes.Processes(self.tree)
self.media = media.Media(self.tree)
self.time_loop = timeloop.TimeLoop(self.tree)
self.local_coordinate_system = local_coordinate_system.LocalCoordinateSystem(self.tree)
Expand Down Expand Up @@ -146,8 +145,8 @@ def _get_root(self, remove_blank_text=False, remove_comments=False):

def _remove_empty_elements(self):
root = self._get_root()
empty_text_list = ["./geometry"]
empty_el_list = ["./time_loop/global_process_coupling"]
empty_text_list = ["./geometry", "./python_script"]
empty_el_list = ["./time_loop/global_process_coupling", "./curves"]
for element in empty_text_list:
entry = root.find(element)
if entry.text == "":
Expand Down
Loading