# Export grid vertical displacement to a table in FLAC3D

**URL:** https://forum.itascainternational.com/t/export-grid-vertical-displacement-to-a-table-in-flac3d/1263
**Category:** FLAC3D
**Created:** [December 4, 2023, 11:28pm UTC](https://forum.itascainternational.com/t/export-grid-vertical-displacement-to-a-table-in-flac3d/1263 "2023-12-04T23:28:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Milads](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@Milads](https://forum.itascainternational.com/u/Milads)
#### Post date: [December 4, 2023, 11:28pm UTC](https://forum.itascainternational.com/t/export-grid-vertical-displacement-to-a-table-in-flac3d/1263/1 "2023-12-04T23:28:36Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Theophile](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.itascainternational.com/theophile/32/299_2.png) [@Theophile](https://forum.itascainternational.com/u/Theophile)
#### Post date: [December 5, 2023, 8:22am UTC](https://forum.itascainternational.com/t/export-grid-vertical-displacement-to-a-table-in-flac3d/1263/2 "2023-12-05T08:22:18Z")

</div>

Hi @Milads!

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

```shell
>>> import itasca as it
>>> import numpy as np

```

Then, retrieve the displacements using the [Flac3D Python API](https://docs.itascacg.com/flac3d700/common/docproject/source/manual/scripting/python/doc/itasca.gridpointarray.html) and export them using numpy:

```shell
>>> 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:

```shell
>>> 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](https://docs.itascacg.com/flac3d700/common/fish/doc/fish_manual/fish_fish/file_utilities/fish_file.write.html?node3740):

```auto
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
