# material # Material "Material01": matTag E v rho ops.opsfunc('nDMaterial', 'ElasticIsotropic', 1, 1e5, 0.25, 6.75) # elements elements = rec1_element + rec2_element for element in elements: nodes = [node.tag for node in element.nodes] ops.opsfunc('element', 'quad', element.tag, *nodes, 1.0, 'PlaneStrain', 1) # contact nodes slave_nodes = part.Node.search([0.0, 1.0], [10.0, 1.0], rec1_nodes) master_nodes = part.Node.search([0.0, 1.0], [10.0, 1.0], rec2_nodes) contact_nodes = slave_nodes[-1::-1] + master_nodes ele = part.Element(contact_nodes, id0='contact') ops.opsfunc('element', 'zeroLengthInterface2D', ele.tag, '-sNdNum', len(slave_nodes), '-mNdNum', len(master_nodes), '-dof', 2, 2, '-Nodes', *[node.tag for node in ele.nodes], 1e9, 0, 0) # load pattern ops.opsfunc('timeSeries', 'Constant', 1) ops.opsfunc('pattern', 'Plain', 1, 1, '{') load_node = part.Node.search([10.0, 2.0]) load_node = load_node[0] ops.opsfunc('load', load_node.tag, 0.0, -100, '}') # recorder ops.opsfunc('printGID', 'example2.msh') node_list = ops.opsfunc('getNodeTags') ops.opsfunc('recorder', 'Node', '-file', 'disp.txt', '-node', *node_list,
mat1 = ops.Material('ElasticIsotropic') mat1.nDMaterial(1.0e5, .25, 6.75) # elements elements = rec1_element + rec2_element for element in elements: node_tags = [node.tag for node in element.nodes] ele = ops.Element(node_tags, 'quad', tag=element.tag) ele.element(1, 'PlaneStrain', mat1.tag) # contact nodes slave_nodes = part.Node.search([0.0, 1.0], [10.0, 1.0], rec1_nodes) master_nodes = part.Node.search([0.0, 1.0], [10.0, 1.0], rec2_nodes) contact_nodes = ([node.tag for node in slave_nodes[-1::-1]] + [node.tag for node in master_nodes]) ele = part.Element(id0='contact_element') ops.opsfunc('element', 'zeroLengthContactNTS2D', ele.tag, '-sNdNum', len(slave_nodes), '-mNdNum', len(master_nodes), '-Nodes', *contact_nodes, 1.0e10, 1.0e10, 0 ) # load pattern ops.opsfunc('timeSeries', 'Constant', 1) ops.opsfunc('pattern', 'Plain', 1, 1, '{') load_node = part.Node.search([10.0, 2.0]) load_node = load_node[0] # ops.opsfunc('load', load_node.tag, 0.0, -1000, '}') ops.opsfunc('load', 39, 0.0, -1000, '}') # recorder ops.opsfunc('printGID', 'example2.msh')
ops.opsfunc('geomTransf', 'Linear', 1) # pile node translation = np.array([0.5, 0.0]) arm_nodes = [] arm_elements = [] for node in line.nodes: node1 = part.Node(node.coord + translation) node2 = part.Node(node.coord - translation) arm_nodes += [node1, node2] # nodes ops.opsfunc('node', node.tag, *node.coord) ops.opsfunc('node', node1.tag, *node1.coord) ops.opsfunc('node', node2.tag, *node2.coord) # rigid arm ele1 = part.Element([node, node1]) ele2 = part.Element([node, node2]) arm_elements += [ele1, ele2] ops.opsfunc('element', 'elasticBeamColumn', ele1.tag, node.tag, node1.tag, AREA * 1E3, E * 1e3, IZ * 1e3, 1) ops.opsfunc('element', 'elasticBeamColumn', ele2.tag, node.tag, node2.tag, AREA * 1E3, E * 1e3, IZ * 1e3, 1) # pile elements for element in line.elements: nodes = [node.tag for node in element.nodes] ops.opsfunc('element', 'elasticBeamColumn', element.tag, *nodes, AREA, 3.25e7, IZ, 1) # boundary pile_bottom_node = part.Node.search([0.0, -10.0])
# element('quad', eleTag, *eleNodes, thick, type, matTag, <pressure=0.0, # rho=0.0, b1=0.0, b2=0.0>) ops.opsfunc('element', 'quad', element.tag, *nodes, 1.0, 'PlaneStrain', 1, 0.0, 2.0, 0.0, 0.0) # concrete element for element in rec2.elements: nodes = [node.tag for node in element.nodes] ops.opsfunc('element', 'quad', element.tag, *nodes, 1.0, 'PlaneStrain', 2, 0.0, 2.5, 0.0, 0.0) # contact element contact_nodes1 = part.Node.search([-0.5, -10.0], [-0.5, 0], rec1.nodes) contact_nodes2 = part.Node.search([-0.5, -10.0], [-0.5, 0], rec2.nodes) contact_nodes3 = part.Node.search([0.5, -10.0], [0.5, 0], rec2.nodes) contact_nodes4 = part.Node.search([0.5, -10.0], [0.5, 0], rec3.nodes) ele1 = part.Element(contact_nodes1 + contact_nodes2[-1::-1], id0='contact01') ops.opsfunc('element', 'zeroLengthContactNTS2D', ele1.tag, '-sNdNum', len(contact_nodes1), '-mNdNum', len(contact_nodes2), '-Nodes', *[node.tag for node in ele1.nodes], 1.0e10, 1.0e10, 0.0) ele2 = part.Element(contact_nodes4[-1::-1] + contact_nodes3, id0='contact2') ops.opsfunc('element', 'zeroLengthContactNTS2D', ele2.tag, '-sNdNum', len(contact_nodes4), '-mNdNum', len(contact_nodes3), '-Nodes', *[node.tag for node in ele2.nodes], 1.0e10, 1.0e10, 0.0) # boundary bottom_boundary = part.Node.search([-10, -10], [10, -10]) for node in bottom_boundary[1:-1:1]: ops.opsfunc('fix', node.tag, 0, 1) ops.opsfunc('fix', bottom_boundary[0].tag, 1, 1) ops.opsfunc('fix', bottom_boundary[-1].tag, 1, 1) # left side nodes