Hi everyone,
I’m trying to implement a FISH function in FLAC 2D v.8 to compute the total strain at each gridpoint, based purely on geometric deformation of the mesh. My intention is to monitor the increase in deformation during the entire simulation and thus be able to see the increasing deformation at each step.
The theoretical approach I’m following is:
-
For each gridpoint, I compute the change in length between that point and its neighbors along the x and y directions.
-
I divide the change in length by the original (undeformed) distance in each direction, effectively calculating engineering strain components εₓ and εᵧ.
-
I then compute the total strain as the Euclidean norm: √(εₓ² + εᵧ²).
This is the structure of the function I wrote so far:
def strain
while_stepping
loop i (1, igp-1)
loop j (1, jgp-1)
a = xdisp(i, j) - xdisp(i+1, j) ; DL in x
b = x(i, j) - x(i+1, j) ; L0 in x
c = ydisp(i, j)- ydisp(i, j+1) ; DL in y
d = y(i, j) - y(i, j+1); L0 in y
ex_1(i, j) = a/b ; Strain in x
ex_2(i, j) = c/d ; Strain in y
ex_3(i, j) = sqrt((ex_1(i, j)^2)+(ex_2(i, j)^2)) ; Tot. strain
endloop
endloop
end
However, when I run the function, I occasionally get “divide by zero” errors. This happens because I don’t have access to the initial geometry, and so I’m trying to calculate strain using only the current coordinates — meaning that, before deformation, ΔL is zero and so is the original length (L₀), which obviously leads to issues.
To fix this, I need to reliably access or store the initial (undeformed) gridpoint coordinates at the beginning of the simulation, so I can later compare them to the deformed state.
Do you know how to solve this problem?
Thank you