示例#1
0
# -*- coding: utf-8
# author: zarhin
# date: 2020/8/6 16:04

import numpy as np
import part
import openseesfunction as ops
import opensees_to_gid as otg

p0 = part.Point([0.0, 0.0])
p1 = part.Point([10.0, 1.0])
p2 = part.Point([0.0, 1.0])
p3 = part.Point([10.0, 2.0])

# part 1
part.Node.reset()
part.Element.reset()
rec1 = part.Rectangle([p0, p1])
rec1.set_seed(1.0)
rec1_nodes, rec1_element = rec1.mesh()

# part 2
rec2 = part.Rectangle([p2, p3])
rec2.set_seed(1.0)
rec2_nodes, rec2_element = rec2.mesh()

# opensees model
ops.opsfunc('wipe')
ops.opsfunc('model', 'basic', '-ndm', 2, '-ndf', 2)

# opensees nodes
# -*-coding:utf-8
# author: zarhin
# email: [email protected]
# date: 2020.08.12

import numpy as np
import part
import openseesfunction as ops
import opensees_to_gid as otg

# points
p1 = part.Point([-10, -10])
p2 = part.Point([-0.5, 0.0])
p3 = part.Point([0.0, -10])
p4 = part.Point([0.0, 3.0])
p5 = part.Point([0.5, -10])
p6 = part.Point([10, 0.0])

# part
rec1 = part.Rectangle([p1, p2])
line = part.Line([p3, p4])
rec2 = part.Rectangle([p5, p6])

# mesh
part.Element.reset()
part.Node.reset()
rec1.set_seed(1.0)
rec1.set_seed(point_num=11,
              bias_ratio=1.2,
              flip_para=True,
              direction='horizontal')