Skip to content

Add initial topography from World Builder - #7155

Merged
MFraters merged 1 commit into
geodynamics:mainfrom
Minerallo:feature/gwb-initial-topography
Jul 30, 2026
Merged

Add initial topography from World Builder#7155
MFraters merged 1 commit into
geodynamics:mainfrom
Minerallo:feature/gwb-initial-topography

Conversation

@Minerallo

@Minerallo Minerallo commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Hi everyone,

Here is a plugin for the initial topography from World Builder. It allows ASPECT to read the initial surface topography directly from the same World Builder file used for temperature and composition.

ASPECT normally needs to know the lower and upper bounds of the model to build the geometry, such as the distance between the bottom and top of the model. Therefore, if we want to use initial topography, we also need to take into account the initial maximum topography when defining the “box” or sphere.

I opened a PR in GWB to retrieve the maximum topography automatically (GeodynamicWorldBuilder/WorldBuilder#945), but if this does not work, I provide a fallback option that allows the user to set it manually. It only needs to be a value greater than the expected topography of the model.

I also added box and spherical-shell tests.

GWB_init_topography

@MFraters
Cheers,
Michael

For all pull requests:

  • I have followed the instructions for indenting my code.
  • I followed the AI Policy:
    • Significant parts of this PR were written by AI (please add a sentence below).
      helped in replacing similar documentation/text in multiple files.
    • AI has not been used in significant ways.

If yes, please describe your usage of AI models in the creation of this pull request

For new features/models or changes of existing features:

  • I have tested my new feature locally to ensure it is correct.
  • I have created a testcase for the new feature/benchmark in the tests/ directory.
  • I have added a changelog entry in the doc/modules/changes directory that will inform other users of my change.

@MFraters MFraters left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this coupling. I will review it fully later, but I think it would make sense to add the functionality to the world builder in the contrib folder, and increase the version number to 1.1.1. I don't think having a "temporary" fallback parameter is the way to go.

@Minerallo

Minerallo commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Ready for review ! @MFraters :)

@MFraters MFraters left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me, just a few small comments.

const Objects::NaturalCoordinate &position_in_natural_coordinates,
double topography) const override final;

double maximum_topography() const override final;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of them you already have documentation, but could you also add documentation for the rest these new functions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

AssertThrow(maximum_topography >= 0.0,
ExcMessage("World Builder returned a negative maximum "
"topography, but this value must be a "
"nonnegative upper bound."));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it non-negative?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you require a larger than 0 maximum topography? What if you make a model of the ocean part of a larger model (or Schiphol in the Netherlands, which is below 0)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right lets remove that


namespace aspect
{
#ifdef ASPECT_WITH_WORLD_BUILDER

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should also check here whether the gwb version is larger than 1.1.1 with something like:
#if WORLD_BUILDER_VERSION_GTE(1,1,1)

@gassmoeller

Copy link
Copy Markdown
Member

@MFraters is this ready?

@Minerallo you will have to rebase this one more time to trigger the tests.

@Minerallo

Minerallo commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Hi everyone,

Here is a plugin for the initial topography from World Builder. It allows ASPECT to read the initial surface topography directly from the same World Builder file used for temperature and composition.

ASPECT normally needs to know the lower and upper bounds of the model to build the geometry, such as the distance between the bottom and top of the model. Therefore, if we want to use initial topography, we also need to take into account the initial maximum topography when defining the “box” or sphere.

I opened a PR in GWB to retrieve the maximum topography automatically (GeodynamicWorldBuilder/WorldBuilder#945), but if this does not work, I provide a fallback option that allows the user to set it manually. It only needs to be a value greater than the expected topography of the model.

I also added box and spherical-shell tests.

GWB_init_topography @MFraters Cheers, Michael

Added thanks

@Minerallo
Minerallo force-pushed the feature/gwb-initial-topography branch 2 times, most recently from 82d57ec to b4d35bb Compare July 29, 2026 12:39
@Minerallo

Copy link
Copy Markdown
Contributor Author

@MFraters is this ready?

@Minerallo you will have to rebase this one more time to trigger the tests.

I rebased @gassmoeller @MFraters. :)

@MFraters MFraters left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small question left. I am not sure what the best approach is. Let me know what you think.

double
SubductingPlate::maximum_topography() const
{
return 0.0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking whether it would make sense to leave it like this, or not. The topography implementation of the slab is currently just directly returning, leaving the value of the topography unchanged. I think the equivalent of that would be to return -infinity. Another option would be to just use the feature min depth here. This is also relevant for the other places where you return 0 at the moment.

@MFraters

Copy link
Copy Markdown
Member

You need to rebase onto the newest master, and re-run make indent. Can you also squash your commits down a bit into logical blocks?

@Minerallo
Minerallo force-pushed the feature/gwb-initial-topography branch from d0db9c6 to 300c158 Compare July 30, 2026 09:13
@Minerallo

Copy link
Copy Markdown
Contributor Author

You need to rebase onto the newest master, and re-run make indent. Can you also squash your commits down a bit into logical blocks?

okay done @MFraters thanks !

@Minerallo Minerallo mentioned this pull request Jul 30, 2026
5 tasks

@MFraters MFraters left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@MFraters
MFraters merged commit 3e8d0ca into geodynamics:main Jul 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants