Block
Block
Const MAX_NUMBER_LOADS = 20
Sub FindLateralPressure_multiple_loads()
Dim A_total#, Yo#, Xj#, Yj#, H#, poi#, Lx#, Ly#, dx#, dy#, dz#, pfe#, A#, q#, P#
Application.ScreenUpdating = False
Yo = Range("Ys")
H = Range("H")
poi = Range("poi")
nz = Range("nz") + 1
dz = H / (nz - 1)
z(1) = 0
For iz = 2 To nz
z(iz) = z(iz - 1) + dz
ph(iz) = 0
Next iz
'1-q
' 2 - xo
' 3 - yo
'4-L
'5-B
'6-A
'7-P
j=0
For i1 = 1 To Range("Number_area_loads")
q = rngRow(1)
Xj = rngRow(2)
Yj = rngRow(3)
Lx = rngRow(4)
Ly = rngRow(5)
A = rngRow(6)
P = rngRow(7)
ny = Int(nfe / nx) + 1
nfe = nx * ny
pfe = P / nfe
dx = Lx / nx
dy = Ly / ny
x = Xj - Lx / 2 - dx / 2
For ix = 1 To nx
x = x + dx
y = Yj + Yo - Ly / 2 - dy / 2
For iy = 1 To ny
y = y + dy
For iz = 1 To nz
r1 = Sqr(x * x + y * y)
Next iz
Next iy
Next ix
End If
Next i1
V(1) = 0: M(1) = 0
For iz = 2 To nz
Next iz
Sheets("Input").Unprotect
With Range("FirstZ").Resize(200, 4)
.ClearContents
.Borders(xlInsideHorizontal).LineStyle = xlNone
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
For iz = 1 To nz
Next iz
End With
With Range("FirstZ").Resize(nz, 4)
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = 0
.Weight = xlMedium
End With
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = 0
.Weight = xlMedium
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = 0
.Weight = xlMedium
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = 0
.Weight = xlMedium
End With
With .Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = 0
.Weight = xlMedium
End With
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
Sheets("Input").Protect
Application.ScreenUpdating = True
End Sub
Sub Activate_wsInput()
ThisWorkbook.Sheets("Input").Activate
End Sub
Sub Activate_wsSketch()
ThisWorkbook.Sheets("Sketch").Activate
End Sub