# Issue with Reading and Storing Data from AMR Simulation Files

**URL:** https://discourse.paraview.org/t/issue-with-reading-and-storing-data-from-amr-simulation-files/16082
**Category:** ParaView Support
**Created:** [January 30, 2025, 8:24am UTC](https://discourse.paraview.org/t/issue-with-reading-and-storing-data-from-amr-simulation-files/16082 "2025-01-30T08:24:01Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![bazharz](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@bazharz](https://discourse.paraview.org/u/bazharz)
#### Post date: [January 30, 2025, 8:24am UTC](https://discourse.paraview.org/t/issue-with-reading-and-storing-data-from-amr-simulation-files/16082/1 "2025-01-30T08:24:01Z")

</div>

Hello,  
[save\_data\_paraview.py](https://discourse.paraview.org/uploads/short-url/zxKL8Aim5DBi8CODgdSe6rhfglC.py) (2.9 KB)

I am writing to you because I have an issue with reading simulation files containing AMR (Adaptive Mesh Refinement).

I have a series of files representing each stored time step for a 2D domain. I want to store the data along a given line where the mesh changes based on the imposed criterion.

To achieve this, I automate data storage using “pvbatch,” but I only store data based on the initially imposed mesh (Nx), even though it is adaptive.

My question is as follows: Is there a way to store data based on the mesh of each stored time step?

I have attached the Python script.

Thank you in advance for your help.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 30, 2025, 8:24am UTC](https://discourse.paraview.org/t/issue-with-reading-and-storing-data-from-amr-simulation-files/16082/2 "2025-01-30T08:24:52Z")

</div>

Welcome @bazharz !

> [@bazharz](#):
>
> I have a series of files representing each stored time step for a 2D domain.

Please share your data. It will be helpful to help you.

---

<div class="post-metadata">

### Author: ![bazharz](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@bazharz](https://discourse.paraview.org/u/bazharz)
#### Post date: [January 30, 2025, 11:00am UTC](https://discourse.paraview.org/t/issue-with-reading-and-storing-data-from-amr-simulation-files/16082/3 "2025-01-30T11:00:26Z")

</div>

Please find in this [link](https://filesender.renater.fr/?s=download&token=e6e07925-d353-4a2c-a565-81cab9aec696) the initial case and the case with AMR.

---

<div class="post-metadata">

### Author: ![bazharz](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@bazharz](https://discourse.paraview.org/u/bazharz)
#### Post date: [February 18, 2025, 3:15pm UTC](https://discourse.paraview.org/t/issue-with-reading-and-storing-data-from-amr-simulation-files/16082/4 "2025-02-18T15:15:56Z")

</div>

Hello,

I’m still facing this issue. Could someone who is an expert in ParaView help me read this dynamic mesh using pvbatch?

In this [link](https://filesender.renater.fr/?s=download&token=a89b70d4-bf8f-4a6a-b963-f3b3fabcc07e), you will find “plt00000.tar.gz”, which contains data with the initial mesh, and “plt00200.tar.gz”, which includes data with AMR.

Thank you in advance.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 19, 2025, 9:12am UTC](https://discourse.paraview.org/t/issue-with-reading-and-storing-data-from-amr-simulation-files/16082/5 "2025-02-19T09:12:43Z")

</div>

Hi @bazharz

I’m able to open your data:

 ![image](https://discourse.paraview.org/uploads/default/original/3X/7/c/7c1a130b0fa973a84f2c431d0e35546e38047aa3.png)

What is not working for you ?

---

<div class="post-metadata">

### Author: ![bazharz](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@bazharz](https://discourse.paraview.org/u/bazharz)
#### Post date: [February 19, 2025, 9:49am UTC](https://discourse.paraview.org/t/issue-with-reading-and-storing-data-from-amr-simulation-files/16082/6 "2025-02-19T09:49:47Z")

</div>

Thank you for your feedback.

The issue I’m facing concerns data storage along a specific line (e.g., at y = Ly/2). I want to retrieve the data using the AMR mesh for the case plt00200.

I had previously automated the storage process, but only for the initial mesh. Now, I would like to store the data for each given mesh (AMR).

Here is the Python script I used to store the data.  
[save\_data\_paraview.py](https://discourse.paraview.org/uploads/short-url/zxKL8Aim5DBi8CODgdSe6rhfglC.py) (2.9 KB)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 19, 2025, 10:00am UTC](https://discourse.paraview.org/t/issue-with-reading-and-storing-data-from-amr-simulation-files/16082/7 "2025-02-19T10:00:24Z")

</div>

Good, so this script does not work ? What does not work ?

---

<div class="post-metadata">

### Author: ![bazharz](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@bazharz](https://discourse.paraview.org/u/bazharz)
#### Post date: [February 19, 2025, 10:13am UTC](https://discourse.paraview.org/t/issue-with-reading-and-storing-data-from-amr-simulation-files/16082/8 "2025-02-19T10:13:26Z")

</div>

This script only works for a uniform mesh with Nx = 1280. However, for plt00200, the mesh is adapted with 3 levels of AMR. My goal is to retrieve Nx as well as the refined mesh structure for each file.
