예제 #1
0
def set_node():
    '''
    @Brief set node
    '''
    for i in range(argu.sum_row_num):
        for j in range(argu.sum_col_num):
            ops.node((i + 1) * argu.node_index + j + 1,
                     argu.length_div[i], 0, argu.hight_div[j])
            logger.info("node %d coord = [%f, %f, %f]", (i + 1) * argu.node_index + j + 1,
                        argu.length_div[i], 0, argu.hight_div[j])

    # fix node
    full_fixed: int = [1, 1, 1, 1, 1, 1]
    for i in range(1, 8):
        ops.fix(i * argu.node_index + 1, *full_fixed)
        logger.info("fix node = %d", i * argu.node_index + 1)
예제 #2
0
def ops_gravity():
    ops.recorder('Node', '-file', 'output\\gravity_disp.out',
                 '-nodeRange', 651, 663,  '-time', '-dof',  3, 'disp')
    ops.recorder('Node', '-file', 'output\\gravity_reaction.out',
                 '-nodeRange', 651, 663,  '-time', '-dof',  3, 'reaction')
    ops.timeSeries('Linear', 1)
    ops.pattern('Plain', 1, 1)
    load: float = [0, 0, (gravity_load + dead_load) / 13, 0, 0, 0]
    for i in range(651, 664):
        ops.load(i, *load)
    ops.constraints('Plain')
    ops.numberer('Plain')
    ops.system('BandGen')
    ops.test('NormDispIncr', 1.0, 1000)
    ops.algorithm('Newton')
    ops.integrator('LoadControl', 0.01)
    ops.analysis('Static')
    ok = ops.analyze(100)
    logger.info("gravity analyze result is %s", ok == 0)
예제 #3
0
def set_element():
    '''
    @Brief set element
    '''
    for i in range(1, 3):
        for j in range(1, 8):
            ops.element('ShellMITC4', i * 1000 + j, i * 1000 + j,
                        (i + 1) * 1000 + j, (i + 1) * 1000 + (j + 1),
                        i * 1000 + (j + 1), 1)
            logger.info("Shell %d = [%d, %d, %d, %d] confined region",
                        i * 1000 + j, i * 1000 + j, (i + 1) * 1000 + j,
                        (i + 1) * 1000 + (j + 1), i * 1000 + (j + 1))
            ops.element('ShellMITC4', (i + 4) * 1000 + j, (i + 4) * 1000 + j,
                        (i + 5) * 1000 + j, (i + 5) * 1000 + (j + 1),
                        (i + 4) * 1000 + (j + 1), 1)
            logger.info("Shell %d = [%d, %d, %d, %d] confined region",
                        (i + 4) * 1000 + j, (i + 4) * 1000 + j,
                        (i + 5) * 1000 + j, (i + 5) * 1000 + (j + 1),
                        (i + 4) * 1000 + (j + 1))

    for i in range(3, 5):
        for j in range(1, 8):
            ops.element('ShellMITC4', i * 1000 + j, i * 1000 + j,
                        (i + 1) * 1000 + j, (i + 1) * 1000 + (j + 1),
                        i * 1000 + (j + 1), 2)
            logger.info("Shell %d = [%d, %d, %d, %d] middle region",
                        i * 1000 + j, i * 1000 + j, (i + 1) * 1000 + j,
                        (i + 1) * 1000 + (j + 1), i * 1000 + (j + 1))
    for i in range(1, 3):
        for j in range(1, 8):
            ops.element('Truss', i * 100 + j, i * 1000 + j, i * 1000 + (j + 1),
                        223.53e-6, 1)
            logger.info(
                "Truss %d = [%d, %d] cross-sectional area = %f, confined region",
                i * 100 + j, i * 1000 + j, i * 1000 + (j + 1), 223.53e-6)
            ops.element('Truss', (i + 5) * 100 + j, (i + 5) * 1000 + j,
                        (i + 5) * 1000 + (j + 1), 223.53e-6, 1)
            logger.info(
                "Truss %d = [%d, %d] cross-sectional area = %f, confined region",
                (i + 5) * 100 + j, (i + 5) * 1000 + j,
                (i + 5) * 1000 + (j + 1), 223.53e-6)
예제 #4
0
def set_section():
    '''
    @Brief set section
    '''
    confined_region_1: float = [
        30, 0.015, 7, 0.0001839, 7, 0.0003676, 30, 0.039743, 30, 0.039743, 30,
        0.039743, 30, 0.039743, 7, 0.0003676, 7, 0.0001839, 30, 0.015
    ]
    middle_region_1: float = [
        30, 0.015, 7, 0.0001839, 6, 0.0002356, 30, 0.08458, 30, 0.08458, 6,
        0.0002356, 7, 0.0001839, 30, 0.015
    ]

    ops.section('LayeredShell', 1, 10, *confined_region_1)
    logger.info("confined region with [1]")
    logger.info(confined_region_1)

    ops.section('LayeredShell', 2, 8, *middle_region_1)
    logger.info("middle region with [2]")
    logger.info(middle_region_1)
예제 #5
0
def CyclicDisplace(Ddelta: float, Dnum: int, Dincr: float, Node: int, dof: int,
                   tol: float, ite: float):
    '''
      Ddelta: Displacement increment of each cyclic loading\n
      每一个循环圈的位移增量\n
      Dnum: Number of cyclic loading times\n
      循环的总圈数\n
      Dincr: Displacement increment in each analyze step\n
      每一圈循环的增量步\n
      Node: Node which applied displacment\n
      dof: Direction of cyclic loading\n
      tol: the tolerance criteria used to check for convergence\n
      iter: the max number of iterations to check before returning failure condition\n
      u:Maxmini of cyclic displacment\n
      每一圈循环的最大位移\n
      negdel: reverse of Dincr of cyclic increment step\n
      每圈的反向增量步\n
      u/Dincr: number of direction cyclic step\n
      一个方向的最大增量步步数\n
      2 * u/Dincr: reverse direction cyclic step\n
      反向加载的步数 因为要先回到远点再向负方向加载
    '''
    ops.constraints("Transformation")
    ops.numberer("RCM")
    ops.system("FullGeneral")
    ops.test('NormUnbalance', tol, ite, 0)
    ops.algorithm("Linear")
    for ii in range(1, Dnum + 1):

        u = Ddelta * ii
        negdel = -Dincr
        logger.info(
            "%d Cyclic of Displacement, node = %d, dof = %d , Dincr = %f Plus of Displacement...",
            ii, Node, dof, Dincr)
        Analysis_Proc(int(u / Dincr), Node, dof, Dincr)

        logger.info(
            "%d Cyclic of Displacement, node = %d, dof = %d, Dincr = %f Minus of Displacement...",
            ii, Node, dof, negdel)
        Analysis_Proc(int(2 * u / Dincr), Node, dof, negdel)

        logger.info(
            "%d Cyclic of Displacement, node = %d, dof = %d, Dincr = %f Back to Zero...",
            ii, Node, dof, Dincr)
        Analysis_Proc(int(u / Dincr), Node, dof, Dincr)
예제 #6
0
def Analysis_Proc(Num: int, Node: int, dof: int, Dincr: float):
    '''
      brief KrylovNewton → Newton -SecantNewton → ModifiedNewton → NewtonWithLineSearch → BGFS → Broyden\n
      pararm Num the number of analyze step\n
      return analyze if successful return 0
      if NOT successful return < 0\n
    '''
    for step in range(1, Num + 1):
        logger.info("No. %d of Cyclic. Anaylsis KrylovNewton..", step)
        ops.algorithm('KrylovNewton')
        ops.integrator("DisplacementControl", Node, dof, Dincr)
        ops.analysis("Static")
        ok = ops.analyze(1)

        if ok != 0:
            logger.info("No. %d of Cyclic. Anaylsis Trying SecantNewton ..",
                        step)
            ops.algorithm('SecantNewton')
            ops.integrator("DisplacementControl", Node, dof, Dincr)
            ops.analysis("Static")
            ok = ops.analyze(1)

        if ok != 0:
            logger.info(
                "NO. %d of Cyclic. Anaylsis Trying NewtonLineSearch ..", step)
            ops.algorithm('NewtonLineSearch', True, False, True, False, 0.8,
                          1000, 0.1, 10.0)
            ops.integrator("DisplacementControl", Node, dof, Dincr)
            ops.analysis("Static")
            ok = ops.analyze(1)

        if ok != 0:
            logger.info("No. %d of Cyclic. Anaylsis Trying PeriodicNewton ..",
                        step)
            ops.algorithm('PeriodicNewton')
            ops.integrator("DisplacementControl", Node, dof, Dincr)
            ops.analysis("Static")
            ok = ops.analyze(1)

        if ok != 0:
            logger.info(
                "NO. %d of Cyclic. Anaylsis Trying NewtonWithLineSearch ..",
                step)
            ops.algorithm('NewtonLineSearch')
            ops.integrator("DisplacementControl", Node, dof, Dincr)
            ops.analysis("Static")
            ok = ops.analyze(1)

        if ok != 0:
            logger.info("No. %d of Cyclic. Anaylsis Trying BFGS ..", step)
            ops.algorithm('BFGS', True, False, 10000000)
            ops.integrator("DisplacementControl", Node, dof, Dincr)
            ops.analysis("Static")
            ok = ops.analyze(1)

        if ok != 0:
            logger.info("No. %d of Cyclic. Anaylsis Trying Broyden ..", step)
            ops.algorithm('Broyden')
            ops.integrator("DisplacementControl", Node, dof, Dincr)
            ops.analysis("Static")
            ok = ops.analyze(1)

        if ok != 0:
            logger.info("No. $step of Cyclic. Analysis Convergence Failure!")
예제 #7
0
# import openseespy.postprocessing.Get_Rendering as opsplt
import openseespy.opensees as ops

import argument as argu
from liblog import logger
import libCycliAnalysis as lib
import perprocess
import nodes

ops.reset()
ops.wipe()

# set model
ops.start()
logger.info("begin")

ops.model('basic', '-ndm', argu.ndm, '-ndf', argu.ndf)

nodes.set_node()
perprocess.set_uniaxial_metrial()
perprocess.set_section()
perprocess.set_element()

ops.recorder('Node', '-file', 'output\\disp.out', '-node', 1008, 2008, 3008,
             4008, 5008, 6008, 7008, 8008, '-time', '-dof', 3, 'disp')
# set timeSeries
ops.timeSeries('Linear', 1)
logger.info("[Linear] timeSeries tag 1 created")

# set load pattern
예제 #8
0
def set_uniaxial_metrial():
    '''
    @Brief set material
    '''
    ops.uniaxialMaterial('Steel02', 1, *(argu.longitudinal_steel))
    logger.info("material tag 1 by [steel 02] and used on longitudinal steel")
    logger.info(argu.longitudinal_steel)

    ops.uniaxialMaterial('Steel02', 2, *(argu.transverse_steel))
    logger.info("material tag 2 by [steel 02] and used on transverse steel")
    logger.info(argu.transverse_steel)

    # set nDMaterial
    ops.nDMaterial('PlaneStressUserMaterial', 3, *(argu.c30_con[0:-1]))
    logger.info(
        "material tag 30 by [PlaneStressUserMaterial] and used on C30 concrete"
    )
    logger.info((argu.c30_con[0:-1]))
    ops.nDMaterial('PlateFromPlaneStress', 30, 3, argu.c30_con[-1])
    logger.info(
        "material tag 30 by [PlateFromPlaneStress] and used on C30 concrete OutofPlaneModulus %d",
        argu.c30_con[-1])

    # logger.info(
    #     "material tag 40 by [PlaneStressUserMaterial] and used on C40 concrete")
    # ops.nDMaterial('PlaneStressUserMaterial', 4, *(argu.c40_con[0:-1]))

    # logger.info(
    #     "material tag 40 by [PlateFromPlaneStress] and used on C40 concrete")
    # ops.nDMaterial('PlateFromPlaneStress', 40, 4, argu.c40_con[-1])

    logger.info(
        "material tag 5 by [PlateRebar] and used on angle 90 d = 10 longitudinal steel"
    )
    ops.nDMaterial('PlateRebar', 5, 1, 90)

    logger.info(
        "material tag 6 by [PlateRebar] and used angle 90 d = 6 transverse steel"
    )
    ops.nDMaterial('PlateRebar', 6, 2, 90)

    logger.info(
        "material tag 7 by [PlateRebar] and used angle 0 d = 6 transverse steel"
    )
    ops.nDMaterial('PlateRebar', 7, 2, 0)
예제 #9
0
# @Date: 2020-10-09 20:24:59
# @Last Modified by: Mengsen.Wang
# @Last Modified time: 2020-10-09 20:24:59

import time
import openseespy.opensees as ops
from liblog import logger, log_init

time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())
log_init(True, "output\\", time, '')

ops.reset()
ops.wipe()

ops.start()
logger.info("----- start -----")

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

ops.nDMaterial('PlaneStressUserMaterial', 1, 40, 7, 20.7e6, 2.07e6, -4.14e6,
               -0.002, -0.006, 0.001, 0.08)
ops.nDMaterial('PlateFromPlaneStress', 4, 1, 1.25e10)

ops.uniaxialMaterial('Steel02', 7, 379e6, 202.7e9, 0.01, 18.5, 0.925, 0.15)
ops.uniaxialMaterial('Steel02', 8, 392e6, 200.6e9, 0.01, 18.5, 0.925, 0.15)

ops.nDMaterial('PlateRebar', 9, 7, 90)

ops.nDMaterial('PlateRebar', 10, 8, 90)

ops.nDMaterial('PlateRebar', 11, 8, 0)
예제 #10
0
# Last Modified time: 2020-10-02 19:42:02

import time
from liblog import logger, log_init

import openseespy.opensees as ops
from data import data

time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())
log_init(True, "output\\", time, '')

ops.reset()
ops.wipe()

ops.start()
logger.info("opensees begin")

ndm: int = 3
ndf: int = ndm * (ndm - 1) / 2
ops.model('basic', '-ndm', 3, '-ndf', 6)

# set concrete
ops.nDMaterial('PlaneStressUserMaterial', 1, 40, 7, 30.8e6, 3.08e6, -6.16e6,
               -0.002, -0.005, 0.001, 0.05)
ops.nDMaterial('PlateFromPlaneStress', 4, 1, 1.283e10)

# set steel
ops.uniaxialMaterial('Steel02', 7, 379e6, 202.7e9, 0.01, 18.5, 0.925, 0.15)
ops.uniaxialMaterial('Steel02', 8, 392e6, 200.6e9, 0.01, 18.5, 0.925, 0.15)
ops.nDMaterial('PlateRebar', 9, 7, 90)
ops.nDMaterial('PlateRebar', 10, 8, 90)