Extracting "Shear strains" using FISH

Hello Itasca team,
I’ve created two short FISH scripts aimed at capturing strains during loading to plot shear strain against time. However, neither of these codes is functioning as intended. I’ve verified that the variables gp1, bi1, and z1 (in the code) are correctly extracted, except for the ssi value which seems to be problematic. The values are zeros always. I would greatly appreciate your assistance in resolving this issue.
;-------------------------; Code: 1 ;---------------------------------------------------

def _ssi
gp1 = gp_near(x, y, z)
bi1 = gp_block(gp1)
z1 = b_zone(bi1)
ssi1 = z_ssi(z1)
end
@_ssi

hist @ssi1

;----------------------; Code: 2 ;------------------------------------------------------

def _ssi
z1 = z_near(x, y, z)
ssi1 = z_ssi(z1)
end
@_ssi

hist @ssi1

;----------------------------------------------------------------------------

Try using the same name for the function and variable

Hi @msepu
Thanks for your response.
I made the suggested changes, but no luck.
Should there be any misunderstanding, please correct.

Modified-code
def zi
z1 = z_near(x, y, z) ; Identifying the zone element 1 at location (x, y, z)
ss1 = z_ssi(z1) ; Renamed the variable (z1) to match the function.
end
@zi

hist @ss1

oh, since you’re using the previous version of 3DEC, I don’t remember exactly all available functions.
But you can modify your script as

[z1 = z_near(x,y,z)] ; you need to search the zone only one time
def ss1
ss1 = z_ssi(z1)
end
hist @ss1

i mean this way:

def _ssi1

gp1 = gp_near(x, y, z)
bi1 = gp_block(gp1)
z1 = b_zone(bi1)
ssi1 = z_ssi(z1)
end
@_ssi1

hist @ssi1

Hello @Huy,

I tried out your code, but unfortunately, it didn’t function as anticipated. I’ve included a snapshot below that showcases the error I came across.

image

It seems that you forgot the square brackets when defining the parameter z1?

[z1 = z_near(x,y,z)]

Hi @msepu

I have tried with the modified code as above. The issue remains unresolved. The values continue to remain at zero over time.

Certainly, @Huy. I’ve incorporated the square brackets in the definition of ‘z1’ now. However, the values still persist as zeros.

Can you show me your script? and can you check if the shear strain is non null in that zone ?

Could you please take a look at your direct messages, @Huy? I’ve personally shared the relevant files with you.
Many thanks,
Vijay

I’ve just replied your message. Please have a look.

Just checked. Your suggestions worked, @Huy.
Big thanks.
Vijay

what was the problem?, can you share the solution?

Certainly. @Huy has recommended a few adjustments for my code, which I’ll outline below.
His suggestion involves changing the function name to match the name of the initial history. By giving both the function and the historical fish variable the same name, the function can be executed during the simulation, thereby enabling the process to function correctly.
Additionally, he suggested that since the script only necessitates identifying the zones (z1, z2, etc.) once, it’s advisable to enhance the process by splitting the function into two distinct functions:

;-------------------|| Old Code ||---------------------

def _ssi
z1 = z_near(a1, b1, c1)
z2 = z_near(a2, b2, c2)

ssi1 = z_ssi(z1)
ssi2 = z_ssi(z2)

end
@_ssi
hist @ssi1
hist @ssi2

;-----------|| Modified Code ||-----------------

def find_Pointer
z1 = z_near(a1, b1, c1)
z2 = z_near(a2, b2, c2)

end
@find_Pointer
def ssi1
ssi2 = z_ssi(z2)
ssi3 = z_ssi(z3)

ssi1 = z_ssi(z1)
end

1 Like

Maybe just modified like below:

fish hist @_ssi
fish hist @ssi1