Export grid vertical displacement to a table in FLAC3D

What is the optimal method for exporting grid vertical settlements to a table? I am familiar with exporting histories, this pertains specifically to zone settlements after the seismic activity for all zones within the model

Hi @Milads!

May I suggest using Python?
In the IPython console, you can import these two modules:

>>> import itasca as it
>>> import numpy as np

Then, retrieve the displacements using the Flac3D Python API and export them using numpy:

>>> zdisps = it.gridpointarray.disp()[:,-1]
>>> np.savetxt('z_displacements.txt', zdisps)

If you want to export the gridpoint positions as well, you have to prepare an array having n-gridpoints rows and 4 columns (x,y,z,and zdisp) then fill it with the data:

>>> ngps = it.gridpoint.count()
>>> data = np.zeros((ngps,4))
>>> it.gridpointarray.fill_pos(data[:,:3])
>>> data[:,-1] = it.gridpointarray.disp()[:,-1]
>>> np.savetxt('z_displacements.txt', data)

If you prefer to stick with Flac3D/Fish commands, you can get inspiration from this usage example:

model new
zone create brick size 2 2 2
fish define output_gps
    local f = file.open("gps.txt","write","text")
    local l = list
    loop foreach local g gp.list
        local a = string.build("%1,%2,%3,%4", gp.id(g), ...
                       gp.pos(g)->x, gp.pos(g)->y, gp.pos(g)->z)
        l = list.append(l,a)
    endloop
    file.write(f,l)
    file.close(f)
end
[output_gps]

Hope it helps!

Théophile

2 Likes