# Working with Adaptive Mesh Refinement (AMR) data

**URL:** https://discourse.paraview.org/t/working-with-adaptive-mesh-refinement-amr-data/10215
**Category:** ParaView Support
**Created:** [August 29, 2022, 8:22pm UTC](https://discourse.paraview.org/t/working-with-adaptive-mesh-refinement-amr-data/10215 "2022-08-29T20:22:03Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![trenton.carpenter](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/58f4c7/32.png) [@trenton.carpenter](https://discourse.paraview.org/u/trenton.carpenter)
#### Post date: [August 29, 2022, 8:22pm UTC](https://discourse.paraview.org/t/working-with-adaptive-mesh-refinement-amr-data/10215/1 "2022-08-29T20:22:03Z")

</div>

I’m working with a CFD data set, it is of an object floating in a fluid, about 300 \*.dat files (imports correctly with “TecPlot Reader” option selected). The data is from a CFD analysis with moving boundaries and adaptive mesh refinement (AMR), was costly, can’t be shared ☹, and can’t be easily redone in a different way, ie. with different block definitions.

I am only interested in data on the surface mesh of the “vessel” for loads analysis, i.e. integrating pressures over certain selected areas, etc. The surface mesh of the vessel does not change geometrically with time, but it’s ID’s change with time, every fourth time step, or \*.dat file. The vessel is moving through the domain, and the vessel’s mesh is defined as it’s own block.

In Paraview, I can load this data and visualize it no problem, make selections, and integrate pressures no problem, but the calculations are only correct for the first four time steps, then the ID’s change.

So, my issue is that the “selection” moves randomly around the mesh with time, because the ID’s are changing due to the AMR. I can’t use an absolute position selection because the surfaces of interest are moving (it’s floating).

Looking at other posts, this seems like a similar unsolved issue,

> [@extracting a cell info or a node info while using adaptive mesh refinmeent](https://discourse.paraview.org/t/extracting-a-cell-info-or-a-node-info-while-using-adaptive-mesh-refinmeent/9242):
>
> Hello, I am trying to extract the info from a cell from a fracture analysis that have adaptive mesh refinement in it during a certain amount of time in a transient analysis. At the start the meshes are coarse and when I select a cell with the cell locator (at a certain location of sample) and then play the rest of the analysis, the cell locator jumps from the original location and it won’t show the results from the desired selected location as the mesh refinement occur. Is there any trick or o…

I’m not seeing a solution in the GUI, what would be recommended to maintain a “static” selection over time in this case?

Adaptive mesh refinement is certainly a common CFD practice, do you think a solution could be created for these type of surface-mesh-re-numbering problems?

---

<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: [August 30, 2022, 12:44am UTC](https://discourse.paraview.org/t/working-with-adaptive-mesh-refinement-amr-data/10215/2 "2022-08-30T00:44:38Z")

</div>

You need a way to identify you particles/Points over time, is there no “global IDs” in your data ?

---

<div class="post-metadata">

### Author: ![trenton.carpenter](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/58f4c7/32.png) [@trenton.carpenter](https://discourse.paraview.org/u/trenton.carpenter)
#### Post date: [August 30, 2022, 2:13am UTC](https://discourse.paraview.org/t/working-with-adaptive-mesh-refinement-amr-data/10215/3 "2022-08-30T02:13:51Z")

</div>

Thank you for the reply,

Would these “ZONE T” definitions be considered global variables, or are “VARIABLES” considered globals?

Below is a snippet from the header of the first two data files. The cells/points that I’m interest in are defined within the zones, " ###.#### WALL\_FUNCTION\_B1". I would like to basically subdivide the “WALL\_FUNCTION” block into smaller selections.

\<---------- file 1.dat ----------\>  
TITLE = “Results ISIS : Surfaces”  
VARIABLES = X, Y, Z, “MASS FRACTION”, “PRESSURE”, “HYDRODYNAMIC PRESSURE”, “BLANKING” , “ID\_domain”  
ZONE T=" 104.4000 WALL\_FUNCTION\_B1"  
Nodes= 14789  
Faces= 29020  
Elements= 14232  
ZONETYPE=FEPolygon  
DATAPACKING=BLOCK  
NumConnectedBoundaryFaces=0  
TotalNumBoundaryConnections=0  
#nodes  
-46.0142660979566 -45.9717219290694 -45.9531226601512  
-45.9956669668536 -45.9307725500004 -45.9121732099462  
-45.8726825362817 -45.8912819051069 -45.8526582732924  
…(continues)

\<---------- file 2.dat ----------\>  
TITLE = “Results ISIS : Surfaces”  
VARIABLES = X, Y, Z, “MASS FRACTION”, “PRESSURE”, “HYDRODYNAMIC PRESSURE”, “BLANKING” , “ID\_domain”  
ZONE T=" 104.4250 WALL\_FUNCTION\_B1"  
Nodes= 14789  
Faces= 29020  
Elements= 14232  
ZONETYPE=FEPolygon  
DATAPACKING=BLOCK  
NumConnectedBoundaryFaces=0  
TotalNumBoundaryConnections=0  
#nodes  
-46.0974784458301 -46.0549305167282 -46.0363443949051  
-46.0788924617200 -46.0139775182516 -45.9953913253456  
…(continues)

Additionally, here are a couple screen shots (zoomed in on the data as to maintain confidentiality)  
The contour is colored by point ID, you can see how they change between step 3 & 4,

 ![image](https://discourse.paraview.org/uploads/default/original/2X/8/8518c232d3534c4fba79a7c97d589c8bdf5ac2a7.png)  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/3/30b02fc54836cb8ecf18e527e0e0f49873ca88c3.png)

I feel like the information is there to do what I want to do, but how does one go about updating a selection over time?

---

<div class="post-metadata">

### Author: ![trenton.carpenter](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/58f4c7/32.png) [@trenton.carpenter](https://discourse.paraview.org/u/trenton.carpenter)
#### Post date: [August 31, 2022, 8:02pm UTC](https://discourse.paraview.org/t/working-with-adaptive-mesh-refinement-amr-data/10215/4 "2022-08-31T20:02:25Z")

</div>

> [@mwestphal](#):
>
> You need a way to identify you particles/Points over time, is there no “global IDs” in your data

Any help there would be appreciated.

---

<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: [September 1, 2022, 5:50am UTC](https://discourse.paraview.org/t/working-with-adaptive-mesh-refinement-amr-data/10215/5 "2022-09-01T05:50:01Z")

</div>

Can you share an actual file ?

How are these files generated ?

---

<div class="post-metadata">

### Author: ![trenton.carpenter](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/58f4c7/32.png) [@trenton.carpenter](https://discourse.paraview.org/u/trenton.carpenter)
#### Post date: [September 3, 2022, 1:52am UTC](https://discourse.paraview.org/t/working-with-adaptive-mesh-refinement-amr-data/10215/6 "2022-09-03T01:52:26Z")

</div>

This data has passed hands to me. I don’t have access to the CFD software that was used to produce it, so I can’t recreate a public version, but the data was exported from that software to be compatible with Tecplot.

I’m sorry, this isn’t very illuminating. With the limited info you have, could you walk me through what you would look for and perhaps what strategies and/or function calls you might use?

---

<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: [September 3, 2022, 2:11am UTC](https://discourse.paraview.org/t/working-with-adaptive-mesh-refinement-amr-data/10215/7 "2022-09-03T02:11:17Z")

</div>

You need to generate an information that is actually static over time in order for your selection extraction to work.

A filter to do that could be implementable but I’m afraid it does not exists yet. It could be implemented in either python or C++.

Another solutution, If only the ID changes but not the actual geometry location, you could select by frustum instead of selecting by id.
