Slab Design Using Python Scripts on Abaqus

32 Views Asked by At

I am new here. I am trying to learn Abaqus python scripting for a school assignment. It has been a few weeks since I have started learning Abaqus and I have just started learning python. The issue is that I feel like I can't learn both by myself without any guidance, so I would really appreciate some help. Any idea/suggestion is more than welcomed!

I have to design a slab and do a comparative study on finite elements analysis on Abaqus. I have been able to use GUI to create the model. However, I want to use python scripts to do this.

So, what I know is the coordinates of initial point and the opposite corner point of one rectangular face. I have tried to create the nodes on it. The python script runs swiftly but I do not know how to use it in Abaqus.

class Point:
    def __init__(self, p1, p2, p3):
        self.p1 = p1
        self.p2 = p2
        self.p3 = p3
    def get_prop(self, prop):
        if prop == 'p1':
            return self.p1
        if prop == 'p2':
            return self.p2
        if prop == 'p3':
            return self.p3
    def show(self):
        return 'x: '+str(self.p1)+' y: '+str(self.p2)+' z: '+str(self.p3)

co_ordinates = []
node_names = []

start = Point(0,0,0)
end = Point(6,20,0)

x_div = 3
y_div = 2
z_div = 0

x_inc = 1
y_inc = 100

for y in range(0,y_div+1):
    for x in range(0,x_div+1):
        temp_x_start = start.get_prop('p1')
        temp_y_start = start.get_prop('p2')
       
        temp_x_end = end.get_prop('p1')
        temp_y_end = end.get_prop('p2')
       
        co_ordinates.append(Point(((temp_x_start*(x_div-x) + temp_x_end*x)/x_div),((temp_y_start*(y_div-y) + temp_y_end*y)/y_div), 0)))
       
       
        node_names.append(1+x*x_inc+y*y_inc)

print(node_names)
print('p', (x_div+1)*(y_div+1)*(z_div+1), len(co_ordinates))

for r in range(len(co_ordinates)):
    print(co_ordinates[r].show())

PLEASE HELP ME!! Thank you so much.

0

There are 0 best solutions below