From 36ba0ddea01a081f637b0415dbe366ee5ce6496d Mon Sep 17 00:00:00 2001 From: Wensley <179432206+wensley-rushing@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:36:54 -0700 Subject: [PATCH 1/4] Update requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 24d00dd3b..b9080bfd0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ COMPAS >=1.0 +opensees>=0.1.0 From 9a7ae7b984f7d60c2ad022b0c424ebfd2d1288ae Mon Sep 17 00:00:00 2001 From: Wensley <179432206+wensley-rushing@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:47:29 -0700 Subject: [PATCH 2/4] Update opensees.py --- src/compas_fea/fea/opensees/opensees.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/compas_fea/fea/opensees/opensees.py b/src/compas_fea/fea/opensees/opensees.py index fdd9bf2d6..e406d947b 100644 --- a/src/compas_fea/fea/opensees/opensees.py +++ b/src/compas_fea/fea/opensees/opensees.py @@ -59,7 +59,7 @@ def input_generate(structure, fields, output, ndof): print('***** OpenSees input file generated: {0} *****\n'.format(filename)) -def launch_process(structure, exe, output): +def launch_process(structure, exe, output, subproc=True): """ Runs the analysis through OpenSees. Parameters @@ -70,6 +70,9 @@ def launch_process(structure, exe, output): OpenSees exe path to bypass defaults. output : bool Print terminal output. + subproc : bool (optional, default=True) + Whether to lauch OpenSees as a subprocess. If False, the + new opensees Python package is used to evaluate the input. Returns ------- @@ -90,6 +93,15 @@ def launch_process(structure, exe, output): tic = time() + if not subproc: + # use new opensees python package to execute the Tcl input + import opensees.tcl + with open(f"{path}{name}.tcl", "r") as f: + opensees.tcl.eval(f.read()) + toc = time() - tic + pprint('\n***** OpenSees analysis time : {0} s *****'.format(toc)) + return + if not exe: exe = 'C:/OpenSees.exe' From 3cd8943e1cc66b9a493e86cb4cb3f07e898e208b Mon Sep 17 00:00:00 2001 From: Wensley <179432206+wensley-rushing@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:53:39 -0700 Subject: [PATCH 3/4] Update requirements-dev.txt --- requirements-dev.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-dev.txt b/requirements-dev.txt index 40a3e5ebf..771a33c8e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,4 +16,5 @@ pytest >=3.2 sphinx_compas_theme >=0.13 sphinx >=3.4 twine +opensees>=0.1.0 -e . From 58c815c25bbfa2ec217e19a774783f48a64794ad Mon Sep 17 00:00:00 2001 From: Wensley <179432206+wensley-rushing@users.noreply.github.com> Date: Fri, 13 Sep 2024 08:17:16 -0700 Subject: [PATCH 4/4] Update requirements-dev.txt --- requirements-dev.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 771a33c8e..40a3e5ebf 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,5 +16,4 @@ pytest >=3.2 sphinx_compas_theme >=0.13 sphinx >=3.4 twine -opensees>=0.1.0 -e .