Beispiel #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
nodes = rec1_nodes + rec2_nodes
for node in nodes:
    ops.Node(node.coord, tag=node.tag)

# boundary
for node in part.Node.search([0.0, 0.0], [0.0, 2.0]):
    ops.opsfunc('fix', node.tag, 1, 1)

# material
# Material "Material01":    matTag    E    v    rho
ops.opsfunc('nDMaterial', 'ElasticIsotropic', 1, 1e5, 0.25, 6.75)
p2 = part.Point([4.0, 0.0])
p3 = part.Point([6.0, 1.0])

# rectangle
rec = part.Rectangle([p2, p3])
line = part.Line([p0, p1])

# mesh
rec.set_seed(1)
rec.set_seed(2, direction='horizontal')
rec.nodes, rec.elements = rec.mesh()
line.set_seed(2)
line.nodes, line.elements = line.mesh()

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

# soil nodes
for node in rec.nodes:
    ops.opsfunc('node', node.tag, *node.coord)

# soil material
ops.opsfunc('nDMaterial', 'ElasticIsotropic', 1, 1.0e10, 0.49, 6.75)

# soil element
for element in rec.elements:
    nodes = [node.tag for node in element.nodes]
    ops.opsfunc('element', 'quad', element.tag, *nodes, 1.0, 'PlaneStrain', 1)

# load
              bias_ratio=1.2,
              flip_para=True,
              direction='horizontal')
rec1.mesh()
line.set_seed(0.5)
line.mesh()
rec2.set_seed(1.0)
rec2.set_seed(point_num=11,
              bias_ratio=1.2,
              flip_para=False,
              direction='horizontal')
rec2.mesh()

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

# soil node
for node in rec1.nodes + rec2.nodes:
    ops.opsfunc('node', node.tag, *node.coord)

# material
ops.opsfunc('nDMaterial', 'ElasticIsotropic', 1, 2.24e5, 0.4, 2.0)

# soil elements
for element in rec1.elements + rec2.elements:
    nodes = [node.tag for node in element.nodes]
    ops.opsfunc('element', 'quad', element.tag, *nodes, 1.0, 'PlaneStrain', 1)

# boundary
# -*- coding: utf-8
# author: zarhin
# date: 2020/8/6 16:01

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

ops.opsfunc('wipe')

ops.opsfunc('model', 'basic', '-ndm', 2, '-ndf', 2)
# nDMaterial ElasticIsotropic $matTag $E $v <$rho>
ops.opsfunc('nDMaterial', 'ElasticIsotropic', 1, 1.0e10, 0.49, 6.75)

# ################################
# build the model
# #################################
# y
# |
# 7-------6
# | slave |
# 8-------5
# 4-------3
# | master|
# 1-------2---->x
#

ops.opsfunc('node', 1, 0.0, 0.0)
ops.opsfunc('node', 2, 1.0, 0.0)
ops.opsfunc('node', 3, 1.0, 1.0)
ops.opsfunc('node', 4, 0.0, 1.0)
Beispiel #5
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
nodes = rec1_nodes + rec2_nodes
for node in nodes:
    ops.Node(node.coord, tag=node.tag)

# boundary
boundary_nodes = part.Node.search([0.0, 0.0], [10.0, 0.0])
for node in boundary_nodes:
    ops.opsfunc('fix', node.tag, 1, 1)
# ops.opsfunc('fix', 34, 1, 1)
# material
# Material "Material01":    matTag    E    v    rho
mat1 = ops.Material('ElasticIsotropic')
rec1.set_seed(point_num=11,
              bias_ratio=1.2,
              direction='horizontal',
              flip_para=True)
rec1.nodes, rec1.elements = rec1.mesh()

rec2.set_seed(0.5)
rec2.set_seed(point_num=4, direction='horizontal')
rec2.nodes, rec2.elements = rec2.mesh()

rec3.set_seed(1.0)
rec3.set_seed(point_num=11, bias_ratio=1.2, direction='horizontal')
rec3.nodes, rec3.elements = rec3.mesh()

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

# node
nodes = rec1.nodes + rec2.nodes + rec3.nodes
for node in nodes:
    ops.opsfunc('node', node.tag, *node.coord)

# material
# nDMaterial('ElasticIsotropic', matTag, E, nu, rho=0.0)
ops.opsfunc('nDMaterial', 'ElasticIsotropic', 1, 2.24e5, 0.4, 0.0)
ops.opsfunc('nDMaterial', 'ElasticIsotropic', 2, 3.25e7, 0.2, 0.0)

# element
# soil element
elements = rec1.elements + rec3.elements