Search found 7 matches

by kolebron
Thu Jul 14, 2022 9:30 pm
Forum: OpenSeesPy
Topic: Linemesh and DiscretizeMember command
Replies: 6
Views: 2861

Re: Linemesh and DiscretizeMember command

mhscott wrote: Thu Jul 14, 2022 8:36 am Please post an updated script that is consistent with the plots you show. For example, the script has fix 1 1 1 for the supports but plot_model shows pins. I know this is not the issue, but I'm not assured I'm working with the most up to date script.
Only beam members are used to compare the two division methods. If "-QdlBeam" in "ops.eleload ('-ele', 315,'-type','-beamuniform', QdlBeam)" is changed to "QdlBeam", a seemingly reasonable result will be obtained.
  • import openseespy.opensees as ops
    import openseespy.preprocessing.DiscretizeMember as dm
    import opsvis as opsv
    import matplotlib.pyplot as plt

    H = 360
    L = 144

    ops.wipe()
    ops.model('basic','-ndm',2,'-ndf',3)

    ops.node(1,0,0)
    ops.node(2,0,L)
    ops.node(3,H,L)
    ops.node(4,H,0)
    ops.fix(1,1,1,0)
    ops.fix(4,1,1,0)

    E = 29000

    # W14x90
    ops.section('Elastic',1,E,26.5,999)
    ops.beamIntegration('Lobatto',1,1,3)

    # W18x76
    ops.section('Elastic',2,E,22.3,1330)
    ops.beamIntegration('Lobatto',2,2,3)

    # Corotational transformation
    ops.geomTransf('Corotational',1)

    # Number of elements/member
    Nele = 8



    # Columns
    # DiscretizeMember(ndI,ndJ,numEle,eleType,integrTag,transfTag,nodeTag,eleTag)
    dm.DiscretizeMember(1,2,Nele,'forceBeamColumn',1,1,100,100)
    dm.DiscretizeMember(3,4,Nele,'forceBeamColumn',1,1,300,300)

    # Beams
    # --------if DiscretizeMember--------
    # elems,nodes = dm.DiscretizeMember(2,3,Nele,'forceBeamColumn',2,1,500,200)

    #--------if linemesh--------
    # ("mesh",tag Npts nodes type dofs size eleType transfTag beamIntTag)
    ops.mesh('line', 2, 2, *[2, 3], 1, 3, 45, 'forceBeamColumn', 1, 1)

    ops.timeSeries('Linear', 1)
    # define Load Pattern
    ops.pattern('Plain', 1, 1)
    QdlBeam = 20.

    #--------if linemesh--------
    elems = [308, 309, 310, 311, 312, 313, 314]
    ops.eleLoad('-ele', *elems, '-type', '-beamUniform', -QdlBeam)
    ops.eleLoad('-ele', 315, '-type', '-beamUniform', -QdlBeam)

    # --------if DiscretizeMember--------
    # ops.eleLoad('-ele', *elems, '-type', '-beamUniform', -QdlBeam)

    Tol = 1.0e-4
    NstepGravity = 10
    DGravity = 1. / NstepGravity
    ops.wipeAnalysis()
    ops.constraints('Plain')
    ops.numberer('Plain')
    ops.system('BandGeneral')
    ops.test('EnergyIncr', Tol, 200)
    ops.algorithm('KrylovNewton')
    ops.integrator('LoadControl', DGravity)
    ops.analysis('Static')
    ops.analyze(NstepGravity)

    sfacN, sfacV, sfacM = 5.e-5, 5.e-5, 5.e-5
    opsv.plot_model(node_supports=True)
    plt.title('model')
    opsv.plot_loads_2d()
    plt.title('load')
    opsv.section_force_diagram_2d('N', sfacN)
    plt.title('Axial force distribution')
    opsv.section_force_diagram_2d('M', sfacM)
    plt.title('Bending moment distribution')

    plt.show()
    ops.wipe()
by kolebron
Wed Jul 13, 2022 9:11 pm
Forum: OpenSeesPy
Topic: Linemesh and DiscretizeMember command
Replies: 6
Views: 2861

Re: Linemesh and DiscretizeMember command

mhscott wrote: Wed Jul 13, 2022 5:20 am Upgrade to the latest version of opsvis and try again.
Hey, Professor, after testing, I found that it is not the problem of image display. When you manually reverse the load of the last element of the component divided by the linemesh command, you can get the correct result similar to the discretizemember command.

Image
Image
Image
by kolebron
Tue Jul 12, 2022 5:46 pm
Forum: OpenSeesPy
Topic: Linemesh and DiscretizeMember command
Replies: 6
Views: 2861

Re: Linemesh and DiscretizeMember command

mhscott wrote: Thu Jul 07, 2022 11:29 am What versions of openseespy and opsvis are you using?
hello, prof. here is the program version I use:
openseespywin-3.4.0.1.1
opsvis-0.96.7
by kolebron
Tue Jul 05, 2022 2:19 am
Forum: OpenSeesPy
Topic: Linemesh and DiscretizeMember command
Replies: 6
Views: 2861

Linemesh and DiscretizeMember command

Hello, everyone. Recently, when I used the Linemesh command and DiscretizeMember command, I found that when I used the linemesh command discrete component for gravity analysis, there seemed to be some problems with the direction of the last element. Please see the picture for details. I show an example here as a verification. Does anyone know what is going on here?
Image
Image
Image
Image

code:
  • import openseespy.opensees as ops
    import openseespy.preprocessing.DiscretizeMember as dm
    import opsvis as opsv
    import matplotlib.pyplot as plt

    H = 360
    L = 144

    ops.wipe()
    ops.model('basic','-ndm',2,'-ndf',3)

    ops.node(1,0,0); ops.fix(1,1,1,1)
    ops.node(2,0,L)
    ops.node(3,H,L)
    ops.node(4,H,0); ops.fix(4,1,1,1)

    E = 29000

    # W14x90
    ops.section('Elastic',1,E,26.5,999)
    ops.beamIntegration('Legendre',1,1,2)

    # W18x76
    ops.section('Elastic',2,E,22.3,1330)
    ops.beamIntegration('Legendre',2,2,2)

    # Corotational transformation
    ops.geomTransf('Corotational',1)

    # Number of elements/member
    Nele = 4

    # Columns
    dm.DiscretizeMember(1,2,Nele,'dispBeamColumn',1,1,10,10)
    dm.DiscretizeMember(3,4,Nele,'dispBeamColumn',1,1,30,30)
    # Beam - storing and printing the return values for demonstration
    elems,nodes = dm.DiscretizeMember(2,3,Nele,'dispBeamColumn',2,1,50,20)
    # ops.mesh('line', 2, 2, *[2, 3], 0, 3, 90, 'dispBeamColumn', 1, 1)
    opsv.plot_model()
    plt.figure()
    plt.show()
    print(f'Beam nodes: {nodes}')
    print(f'Beam elements: {elems}')
    ops.timeSeries('Linear', 1)
    # define Load Pattern
    ops.pattern('Plain', 1, 1)
    QdlBeam = 10.
    # elems = [38, 39, 40, 41]
    ops.eleLoad('-ele', *elems, '-type', '-beamUniform', -QdlBeam)
    Tol = 1.0e-4
    NstepGravity = 10
    DGravity = 1. / NstepGravity
    ops.wipeAnalysis()
    ops.constraints('Plain')
    ops.numberer('Plain')
    ops.system('BandGeneral')
    ops.test('EnergyIncr', Tol, 200)
    ops.algorithm('KrylovNewton')
    ops.integrator('LoadControl', DGravity)
    ops.analysis('Static')
    ops.analyze(NstepGravity)

    opsv.plot_supports_and_loads_2d()
    plt.show()
    sfac = 1
by kolebron
Mon Jun 20, 2022 11:13 pm
Forum: OpenSeesPy
Topic: question about 'remove element' command in OpenSeesPy
Replies: 4
Views: 2885

Re: question about 'remove element' command in OpenSeesPy

mhscott wrote: Mon Jun 20, 2022 5:17 am Please provide a minimal working example that demonstrates the issue: https://portwooddigital.com/2021/07/01/ ... g-example/
Hello Professor, I have chosen a cantilever column example 1a on the official website to illustrate the situation. I changed the column from one element to two elements, and the two nodes into three nodes. For gravity analysis, eleload is used to apply weight. Both element 1 and 2 have an weight load (assuming a value), and pushover load is applied to the top of the first element (node 2). Then the upper element is deleted for analysis.

The current situation is that after the gravity analysis is completed, element 2 and node 3 are deleted. Then, when pushover analysis is performed, the program will exit.

If the corresponding eleload command of element 2 is not applied in the gravity analysis module, the program can be run normally (that is, delete the command on line 80 to run the program, "ops.eleLoad('-ele', 2, '-type', '-beamUniform', 0, -20)").

However, I plan to conduct the gravity analysis of the intact structure including all elements, and then delete the components to conduct the pushover or pushdown analysis. How should I operate in openseespy to remove the eleload of failed components to ensure that the program can run. (there is no 'remove eleload' command in openseespy)
  • ############################################################
    # EXAMPLE:
    # pyEx1a.Canti2D.Push.tcl.py
    # for OpenSeesPy
    # --------------------------------------------------------#
    # by: Silvia Mazzoni, 2020
    # silviamazzoni@yahoo.com
    ############################################################
    # This file was obtained from a conversion of the updated Tcl script
    ############################################################

    # configure Python workspace
    import openseespy.opensees as ops
    import eSEESminiPy
    import os
    import math
    import numpy as numpy
    import matplotlib.pyplot as plt
    ops.wipe()
    # --------------------------------------------------------------------------------------------------
    # Example 1. cantilever 2D
    # static pushover analysis with gravity.
    # all units are in kip, inch, second
    # elasticBeamColumn ELEMENT
    # Silvia Mazzoni and Frank McKenna, 2006
    #
    # ^Y
    # or
    # 2 __
    # or |
    # or |
    # or |
    # (1) 36'
    # or |
    # or |
    # or |
    # =1= ---- -------->X
    #

    # SET UP ----------------------------------------------------------------------------
    ops.wipe() # clear opensees model
    ops.model('basic','-ndm',2,'-ndf',3) # 2 dimensions, 3 dof per node
    if not os.path.exists('Data'):
    os.mkdir('Data')

    # define GEOMETRY -------------------------------------------------------------
    # nodal coordinates:
    ops.node(1,0,0) # node , X Y
    ops.node(2,0,432/2)
    ops.node(3,0,432)

    # Single point constraints -- Boundary Conditions
    ops.fix(1,1,1,1) # node DX DY RZ

    # nodal masses:
    ops.mass(2,5.18/2,0.,0.) # node , Mx My Mz, Mass=Weight/g.
    ops.mass(3,5.18/2,0.,0.) # node , Mx My Mz, Mass=Weight/g.
    # Define ELEMENTS -------------------------------------------------------------
    # define geometric transformation: performs a linear geometric transformation of beam stiffness
    # and resisting force from the basic system to the global-coordinate system
    ops.geomTransf('Linear',1) # associate a tag to transformation

    # connectivity: (make A very large, 10e6 times its actual value)
    # element elasticBeamColumn eleTag iNode jNode A E Iz transfTag
    ops.element('elasticBeamColumn',1,1,2,3600000000,4227,1080000,1) # element elasticBeamColumn 1 1 2 3600000000 4227 1080000 1;
    ops.element('elasticBeamColumn',2,2,3,3600000000,4227,1080000,1) # element elasticBeamColumn 1 1 2 3600000000 4227 1080000 1;


    # Define RECORDERS -------------------------------------------------------------
    ops.recorder('Node','-file','Data/DFreeEx1aPush.out','-time','-node',2,'-dof',1,2,3,'disp') # displacements of free nodes
    ops.recorder('Node','-file','Data/RBaseEx1aPush.out','-time','-node',1,'-dof',1,2,3,'reaction') # support reaction
    ops.recorder('Element','-file','Data/FColEx1aPush.out','-time','-ele',1,'globalForce') # element forces -- column
    ops.recorder('Element','-file','Data/DColEx1aPush.out','-time','-ele',1,'deformation') # element deformations -- column
    # define GRAVITY -------------------------------------------------------------
    ops.timeSeries('Linear',1) # timeSeries Linear 1;
    # define Load Pattern
    ops.pattern('Plain',1,1) #
    ops.load(2,0.,-2000.,0.) # node , FX FY MZ -- superstructure-weight
    ops.eleLoad('-ele', 1, '-type', '-beamUniform', 0, -20)
    ops.eleLoad('-ele', 2, '-type', '-beamUniform', 0, -20)
    ops.wipeAnalysis() # adding this to clear Analysis module
    ops.constraints('Plain') # how it handles boundary conditions
    ops.numberer('Plain') # renumber dofs to minimize band-width (optimization), if you want to
    ops.system('BandGeneral') # how to store and solve the system of equations in the analysis
    ops.test('NormDispIncr',1.0e-8,6) # determine if convergence has been achieved at the end of an iteration step
    ops.algorithm('Newton') # use Newtons solution algorithm: updates tangent stiffness at every iteration
    ops.integrator('LoadControl',0.1) # determine the next time step for an analysis, apply gravity in 10 steps
    ops.analysis('Static') # define type of analysis static or transient
    ops.analyze(10) # perform gravity analysis
    ops.loadConst('-time',0.0) # hold gravity constant and restart time

    # define LATERAL load -------------------------------------------------------------
    # Lateral load pattern
    ops.timeSeries('Linear',2) # timeSeries Linear 2;
    # define Load Pattern
    ops.pattern('Plain',2,2) #
    ops.load(2,2000.,0.0,0.0) # node , FX FY MZ -- representative lateral load at top node
    ops.remove('ele', 2)
    ops.remove('node', 3)
    # pushover: diplacement controlled static analysis
    ops.integrator('DisplacementControl',2,1,0.1) # switch to displacement control, for node 11, dof 1, 0.1 increment
    ops.analyze(1000) # apply 100 steps of pushover analysis to a displacement of 10

    print('Done!')

    eSEESminiPy.drawModel()
    eSEESminiPy.drawDeformedShape(5)
    ops.wipe() # the wipe command here closes all recorder files
    plt.close('all')
    fname3 = 'Data/DFreeEx1aPush.out'
    dataDFree = numpy.loadtxt(fname3)
    plt.subplot(211)
    plt.title('Ex1a.Canti2D.Push.tcl')
    plt.grid(True)
    plt.plot(dataDFree[:,1])
    plt.xlabel('Step Number')
    plt.ylabel('Free-Node Displacement')
    plt.subplot(212)
    plt.grid(True)
    plt.plot(dataDFree[:,1],dataDFree[:,0])
    plt.xlabel('Free-Node Disp.')
    plt.ylabel('Pseudo-Time (~Force)')
    plt.show()
    print('End of Run: pyEx1a.Canti2D.Push.tcl.py')
by kolebron
Sun Jun 19, 2022 8:30 am
Forum: OpenSeesPy
Topic: question about 'remove element' command in OpenSeesPy
Replies: 4
Views: 2885

Re: question about 'remove element' command in OpenSeesPy

mhscott wrote: Fri Jun 17, 2022 4:42 am Do you have an element recorder defined for element 113?
Hello, Professor Scott. Thanks for your reply!

Nope, I only used the recorder command to record the displacement of the loading point.
And I found something. After the gravity analysis is completed, if pushdown analysis has to run normally, element 113 and node 13 need to be deleted, and the weight of element 13 defined by the 'eleload' command must also be deleted.
The above is validated without applying the weight load of eleload 113 in the gravity analysis. At present, I don't know how to consider how to remove the element weight load with 'remove' command to conduct pushdown analysis after completing the gravity analysis of the complete structure.
by kolebron
Thu Jun 16, 2022 10:52 pm
Forum: OpenSeesPy
Topic: question about 'remove element' command in OpenSeesPy
Replies: 4
Views: 2885

question about 'remove element' command in OpenSeesPy

hello, everyone! I encountered an error when using the 'remove element' command for pushdown analysis in OpenSeesPy.

Before gravity analysis, remove the column component with [ops.remove('ele', 113)' and 'ops.remove('node', 13)] command to conduct gravity analysis and pushdown analysis. The program runs accurately. However, after the gravity analysis is completed, remove the column component with 'remove element' command for pushdown analysis, and the OpenSeesPy program will crash and exit.

Does anyone know what happened? :?:
Thank you very much.