geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
224 stars 235 forks source link

initial topography before refinement #3402

Open MFraters opened 4 years ago

MFraters commented 4 years ago

I know that there is a discussion of replacing the initial topography totally, but I do have a question about the current implementation. Is there a specific reason it is done in the box geometry model after refinement instead of before? @anne-glerum, since you put it in, do you remember why?

The reason I am asking is because of an issue with the combination of refinement, topography and the world builder (https://github.com/GeodynamicWorldBuilder/WorldBuilder/issues/152). If there is a good reason to keep it where it is, I would need to rethink it, otherwise I could just change it to do the topography at 0.

anne-glerum commented 4 years ago

This was intentionally done. The initial topography is handled differently in the box model than in the (Elipsoidal)Chunk models, it does not have the push_forward/pull_back functionality. See the original PR #1187.

If we add the topography before initial refinement, the approximation of the topography is very rough ('cause the mesh is coarse). Subsequent refinement will not lead to a better approximation, it will just refine the first topography. In other words, if I want to prescribe a smooth hill, adding this topography before initial refinement will give me a pyramid. Further refinement does not give a hill. Adding topography to the finest mesh gives me a hill.

Without push_forward/pull_back functions that apply/undo the topography, calling the grid transform function at every initial refinement step won't work, because it will keep adding topography every step. I remember trying to add these functions, but I'm not sure if it didn't work at the time, or the solution reached in the PR was just the most elegant at the time.

That said, @Minerallo found another bug for the combination initial topography + free surface + later AMR, where if the minimum resolution of the initial mesh is not high enough, "holes" will form in the mesh after AMR. I haven't had time to check this out. Just to say this box+initial topography functionality might need an overhaul.

MFraters commented 4 years ago

Thanks the the quick reply and the clear answer :)

So changing it into some kind of push and pull mechanism would be the long term solution?

ricitron commented 4 years ago

I also have an issue with the topography defined after refinement. In the example image below I define a surface topography and also a crust-mantle interface topography. The code initially refines along the density gradient of the crust mantle interface, but when topography is inserted after refinement it pushes the refined cells below the crust mantle interface and unrefines the interface. Near the start of the change in crustal thickness it also seems to cause a negative slope and deflect the crust-mantle interface slightly downwards when it should be sloping upwards.

After initial refinement and then topography insertion, is it possible to do another round of composition insertion and refinement?

image

gassmoeller commented 4 years ago

We had a discussion about this on Friday (after @ricitron's comments) and documented our thoughts in #3720. In short we would like to convert initial topography into a mesh deformation plugin, which would hopefully automatically solve this issue. We will revisit this issue once the conversion is done.