Issue with topography plots while using adaptive mesh refinement

Hi everyone,

As the title suggests, I have a problem with plotting topography. The data seems “corrupted” if I use adaptive mesh refinement, please see the example below.

If I run the exact same model with a fixed mesh only by using X and Y repetitions (i.e., global and adaptive refinements are 0) then I don’t have this issue.

I’m assuming this is somehow related to the mesh getting finer or coarser with time, but I was wondering if this is normal and if there is a way to prevent this.

Cheers,

Ugurcan

Hi Ugurcan,

It looks like the points aren’t ordered. If you preprocess the profile by sorting points in order of ascending “Horizontal Distance”, you won’t get those lines. I don’t think anything is corrupted.

If you think something is more seriously in error, let us know how you output and plotted the profile from ASPECT.

Bob

Hi Bob,

Thank you for your answer. Sorting the data on the x-axis would probably fix the problem, the issue is that it is not sorted in the topography text outputs aspect provides. I couldn’t find a way to upload the text file but you can see a screenshot of one of the problematic bits in the data below.

Screenshot 2023-02-22 at 14.22.28

As you told me already the issue seems the be that the x values are not sorted properly but I did not modify these files in any way, I am just using a python script to take the data for x and y and plot it. I am happy to send you the topography files and python script if it’s any help.

Ugurcan

Ugurcan,
the values aren’t meant to be sorted. ASPECT just outputs topography values at a bunch of positions. If you want these to be sorted, you will have to sort them yourself.

The reason they are not sorted is that while that seems reasonable for 2d models where you only output topography along a one-dimensional line, there is no good way to define what “sorted” would mean for 3d models where you output topography values along the entire 2d surface. ASPECT simply loops over all cells and outputs topography. The order of the points you see reflects the order we visit cells. For uniformly refined meshes, this happens to be one in which the x-values are sorted, but that’s not true for adaptively refined meshes.

Best
W>

Dear Ugurcan,

As you can see in source/postprocess/topography.cc, the postprocessor loops over all of the surface faces, and reports the elevations at all the vertices. The surface faces are not looped over in any special spatial order.

So this is why you see repetitions and non-ordered output - it’s not “corruption”, it’s just that the sorting and uniqueifying that you expected has not been implemented. It is a simple task to perform using other non-ASPECT tools (e.g., the sort and uniq utility programs, or awk, or python).

If you’re particularly concerned about this, you can suggest an enhancement to the existing code on GitHub. I think that would be a reasonable thing to have in 2D. A sorting algorithm in 3D is not obvious to me (as Wolfgang says).

Bob

Thank you, Wolfgang, for the explanation, that makes a lot of sense, and thank you Bob for the clarification and suggestions. The solution to my problem seems easy enough I am just glad that it wasn’t a bug.

Ugurcan