Search found 24 matches

by MikeITExpert
Mon Aug 30, 2021 9:40 pm
Forum: OpenSeesPy
Topic: Which one is better OpenSeesPy or o3seespy ?
Replies: 0
Views: 11256

Which one is better OpenSeesPy or o3seespy ?

I am a python programmer and collaborating a structural engineer automate some pushover testing.

Previously I asked viewtopic.php?f=12&t=69145 ...

It turns how OpenSeesPy is as straightforward as OpenSees.exe/TCL. But, the problem is sometimes, I would like to have multiple analyzer engines side by side as different domains, so I don't have to wipe out some results and parts of the model and then rerun the analysis.

I have looked into O3SeesPy and it seems I can create more than solver engine / analyzer side by side.

Please let me know what are the pros and cons O3SeesPy compared to OpenSeesPy.

Regards
by MikeITExpert
Mon Aug 30, 2021 8:33 am
Forum: OpenSees.exe Users
Topic: What does return value of Analyze Command represent mathematically exactly?
Replies: 1
Views: 993

What does return value of Analyze Command represent mathematically exactly?

I am just curious what return value of Analyze Command represents mathematically exactly?

Does it mean that there is definitely no solution for the input system of equations given the convergence tolerance?

or

It means that there might be some, but OpenSees couldn't find any?

Please let me know regards,
by MikeITExpert
Mon Aug 30, 2021 8:23 am
Forum: OpenSeesPy
Topic: how smooth is model programming/analysis using OpenSeesPy compared to using TCL?
Replies: 5
Views: 4514

Re: how smooth is model programming/analysis using OpenSeesPy compared to using TCL?

How about O3Seespy?

How is that compared and contrasted to OpenSeesPy ?

I am guessing one benefit is that we can different instances of the solver engine simultaneously. While using OpenSeesPy you only have one instance and if you want try a different structural model, you have to wipe out everything and try again.

I guess o3Seespy is a better option theoretically though I am not sure how stabile it is compared to OpenSeesPy and TCL programming.

Please let me know you thoughts on that too.

Regards,
by MikeITExpert
Tue Aug 24, 2021 1:40 am
Forum: OpenSees.exe Users
Topic: How can get a list of all element tags of a specific type?
Replies: 1
Views: 9209

How can get a list of all element tags of a specific type?

Hi All,

Is there any command in Opensees so as to get a list of all element tags whose type is twoNodeLink?

I searched before I ask the question, though it might be documented somewhere I did find. Let me know if there is any document section or sth explaining queries regarding available nodes, elements, martials etc.

I know print command would potentially help, however, I don't want to go through text processing of print output. (I am newbie in tcl programming)

Any comment is much appreciate it.
by MikeITExpert
Tue Aug 24, 2021 1:31 am
Forum: OpenSeesPy
Topic: Is there anyway to load tcl file into OpenSeesPy model?
Replies: 4
Views: 3362

Re: Is there anyway to load tcl file into OpenSeesPy model?

mhscott wrote: Sun Aug 22, 2021 7:15 am This might be useful too: https://portwooddigital.com/2021/06/20/ ... or-python/
This one was the best approach so far ... I wish there was a Python driver for OpenSees.exe to pass commands using PIPE and retrieve the results from output pipe.

This way I could use python to drive OpenSees analysis and I didn't have to convert all the tcl files to OpenSeesPy or O3SeesPy.

Anyway thanks for the response!
by MikeITExpert
Sun Aug 22, 2021 10:23 pm
Forum: OpenSeesPy
Topic: Is it possible to wrap OpenSees interpreter / command line using python on Windows 10
Replies: 1
Views: 1583

Is it possible to wrap OpenSees interpreter / command line using python on Windows 10

Hi All,

I have a large number of .tcl files containing model and analysis. I know I can convert .tcl files to OpenSeesPy; however it would be a time consuming and tedious task.

I am wondering if anybody tried to wrap Python around the OpenSees Command line Interface to automate some analysis task using Python.

I have tried using subproecss module, though I wasn't successful for some reason I don't get the command output from stdout (for the OpenSees Command line subprocess) as soon as I write commands to stdin.

Below is the code I am using:

Please share your ideas and experiences if any.

Regards,

Code: Select all

import sys
import subprocess
from threading import Thread

from queue import Queue, Empty  # Python 3.x


def enqueue_output(out, queue):
    for line in iter(out.readline, b''):
        queue.put(line)
    out.close()


def getOutput(outQueue):
    outStr = ''
    try:
        while True: # Adds output from the Queue until it is empty
            outStr+=outQueue.get_nowait()

    except Empty:
        return outStr

p = subprocess.Popen("bin\\OpenSees.exe", 
                        stdin=subprocess.PIPE, 
                        stdout=subprocess.PIPE, 
                        stderr=subprocess.PIPE, 
                        shell=False, universal_newlines=True)

outQueue = Queue()
errQueue = Queue()

outThread = Thread(target=enqueue_output, args=(p.stdout, outQueue))
errThread = Thread(target=enqueue_output, args=(p.stderr, errQueue))

outThread.daemon = True
errThread.daemon = True

outThread.start()
errThread.start()

for i in range(3):
    try:
        someInput = raw_input("Input: ")
    except NameError:
        someInput = input("Input: ")

    p.stdin.write(someInput+"\n")
    errors = getOutput(errQueue)
    output = getOutput(outQueue)
    print(errors, output)
by MikeITExpert
Sun Aug 22, 2021 12:02 pm
Forum: OpenSeesPy
Topic: how smooth is model programming/analysis using OpenSeesPy compared to using TCL?
Replies: 5
Views: 4514

how smooth is model programming/analysis using OpenSeesPy compared to using TCL?

I am collaborating with a civil engineer so as to improve model analysis and tuning using algorithmic/computer science graph-search techniques.

I am more comfortable using Python/OpenSeesPy, however I am not sure how it would turn out in the long run as I am a newbie in OpenSeesPy?

I am wondering if using OpenSeesPy is as smooth/complete as TCL? Would there be potentially any challenges we might encounter in future?

I would like an expert to elaborate on that please.
Much appreciate it.
by MikeITExpert
Sat Aug 21, 2021 9:38 pm
Forum: OpenSeesPy
Topic: Is there anyway to load tcl file into OpenSeesPy model?
Replies: 4
Views: 3362

Is there anyway to load tcl file into OpenSeesPy model?

Hi All,

I am working with Civil engineer to automate some model analysis for him using Python. However, I don't know how to import his tcl files into Python.

I googled here and there and couldn't find anything relevant.

Please let me know your comments.
by MikeITExpert
Sat Aug 21, 2021 9:34 pm
Forum: OpenSeesPy
Topic: Exception: No Model_ODB specified. No active model found.
Replies: 0
Views: 9127

Exception: No Model_ODB specified. No active model found.

I just installed OpenSeesPy and I am getting error running the first example. Below please find the execution log:

Please let me know your valuable comments.

Regards,

Code: Select all

(base) C:\Users\Mike-laptop\Documents\SICO\SA\DampOptimize>pytest --pyargs openseespy.test
=============================================== test session starts ================================================
platform win32 -- Python 3.8.8, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: C:\Users\Mike-laptop\Documents\SICO\SA\DampOptimize
plugins: anyio-2.2.0
collected 18 items

test_base\test_DynAnal_BeamWithQuadElements.py .                                                              [  5%]
test_base\test_EigenAnal_twoStoryFrame1.py .                                                                  [ 11%]
test_base\test_EigenAnal_twoStoryShearFrame7.py .                                                             [ 16%]
test_base\test_EigenFrame.py .                                                                                [ 22%]
test_base\test_EigenFrameExtra.py .                                                                           [ 27%]
test_base\test_ElasticFrame.py .                                                                              [ 33%]
test_base\test_Ex1aCanti2DEQmodif.py .                                                                        [ 38%]
test_base\test_MomentCurvature.py .                                                                           [ 44%]
test_base\test_PinchedCylinder.py .                                                                           [ 50%]
test_base\test_PlanarShearWall.py .                                                                           [ 55%]
test_base\test_PlanarTruss.py .                                                                               [ 61%]
test_base\test_PlanarTrussExtra.py .                                                                          [ 66%]
test_base\test_PortalFrame2d.py .                                                                             [ 72%]
test_base\test_RCFrameGravity.py .                                                                            [ 77%]
test_base\test_RCFramePushover.py .                                                                           [ 83%]
test_base\test_Truss.py .                                                                                     [ 88%]
test_base\test_sanity.py .                                                                                    [ 94%]
test_base\test_sdofTransient.py .                                                                             [100%]

================================================= warnings summary =================================================
..\..\..\..\..\..\ProgramData\Anaconda3\lib\site-packages\pyreadline\py3k_compat.py:8
  C:\ProgramData\Anaconda3\lib\site-packages\pyreadline\py3k_compat.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
    return isinstance(x, collections.Callable)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================== 18 passed, 1 warning in 41.89s ==========================================

(base) C:\Users\Mike-laptop\Documents\SICO\SA\DampOptimize>
(base) C:\Users\Mike-laptop\Documents\SICO\SA\DampOptimize>python wb.py
No Model_ODB specified, trying to get data from the active model.
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\openseespy\postprocessing\Get_Rendering.py", line 280, in plot_model
    nodeArray, elementArray = idbf._getNodesandElements()
  File "C:\ProgramData\Anaconda3\lib\site-packages\openseespy\postprocessing\internal_database_functions.py", line 32, in _getNodesandElements
    ndm = len(ops.nodeCoord(nodeList[0]))
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "wb.py", line 14, in <module>
    opsplt.plot_model()
  File "C:\ProgramData\Anaconda3\lib\site-packages\openseespy\postprocessing\Get_Rendering.py", line 282, in plot_model
    raise Exception("No Model_ODB specified. No active model found.")
Exception: No Model_ODB specified. No active model found.

(base) C:\Users\Mike-laptop\Documents\SICO\SA\DampOptimize>python wb.py
No Model_ODB specified, trying to get data from the active model.
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\openseespy\postprocessing\Get_Rendering.py", line 280, in plot_model
    nodeArray, elementArray = idbf._getNodesandElements()
  File "C:\ProgramData\Anaconda3\lib\site-packages\openseespy\postprocessing\internal_database_functions.py", line 32, in _getNodesandElements
    ndm = len(ops.nodeCoord(nodeList[0]))
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "wb.py", line 14, in <module>
    opsplt.plot_model()
  File "C:\ProgramData\Anaconda3\lib\site-packages\openseespy\postprocessing\Get_Rendering.py", line 282, in plot_model
    raise Exception("No Model_ODB specified. No active model found.")
Exception: No Model_ODB specified. No active model found.

(base) C:\Users\Mike-laptop\Documents\SICO\SA\DampOptimize>