Skip to content

Add a maximum topography for external usage - #945

Open
Minerallo wants to merge 3 commits into
GeodynamicWorldBuilder:mainfrom
Minerallo:feature/maximum-topography-api
Open

Add a maximum topography for external usage#945
Minerallo wants to merge 3 commits into
GeodynamicWorldBuilder:mainfrom
Minerallo:feature/maximum-topography-api

Conversation

@Minerallo

@Minerallo Minerallo commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Hi everyone,

this PR adds World::maximum_topography(). It returns an upper bound for the
topography configured in World Builder. This allows applications such as
ASPECT to determine the required geometry size before creating the mesh.

I added tests for a model with uniform topography and for a model without
topography. The complete unit test suite passes.

Cheers,
Michael

@Minerallo Minerallo changed the title Add a maximum topography API Add a maximum topography for external usage Jul 26, 2026
@coveralls

coveralls commented Jul 26, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 30487714247

Coverage increased (+0.008%) to 98.308%

Details

  • Coverage increased (+0.008%) from the base build.
  • Patch coverage: 62 of 62 lines across 11 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 12000
Covered Lines: 11797
Line Coverage: 98.31%
Coverage Strength: 815206.97 hits per line

💛 - Coveralls

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Benchmark Main Feature Difference (99.9% CI)
Slab interpolation simple none 1.303 ± 0.009 (s=362) 1.313 ± 0.005 (s=329) +0.6% .. +0.9%
Slab interpolation curved simple none 1.308 ± 0.006 (s=344) 1.319 ± 0.005 (s=344) +0.7% .. +0.9%
Spherical slab interpolation simple none 1.201 ± 0.010 (s=356) 1.200 ± 0.009 (s=396) -0.2% .. +0.1%
Slab interpolation simple curved CMS 1.347 ± 0.008 (s=342) 1.358 ± 0.009 (s=326) +0.6% .. +0.9%
Spherical slab interpolation simple CMS 1.633 ± 0.010 (s=280) 1.639 ± 0.009 (s=273) +0.2% .. +0.5%
Spherical fault interpolation simple none 1.290 ± 0.011 (s=351) 1.296 ± 0.006 (s=348) +0.3% .. +0.7%
Cartesian min max surface 3.091 ± 0.014 (s=140) 3.125 ± 0.025 (s=152) +0.8% .. +1.4%
Spherical min max surface 8.641 ± 0.111 (s=57) 8.722 ± 0.092 (s=49) +0.2% .. +1.7%

@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 generally good, but I have a few comments. I would like t ask you to add tests for every plugin and also add a test to show that you actually picked the correct max topography.

Would you also be willing to add a minimum topography function, while you are add it?

* feature. Features without topography return zero.
*/
virtual
double maximum_topography() const;

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 every plugin should implement this, because there is no sensible default implementation. So could you make it const = 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.

Done. now its double maximum_topography() const = 0;

Comment thread CHANGELOG.md Outdated

- Added Perlin noise models for composition and temperature across features, and gwb-dat coverage tests for Cartesian Perlin noise inputs. \[Tilman May; 2026-03-29; [#906](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/906)\]

- Added a `maximum_topography()` API that returns a guaranteed upper bound for all configured topography models. \[Michael Pons; 2026-07-26\]

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.

Can you add this pull request as a reference at the end?

Comment on lines +66 to +71
double
Interface::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 don't think the interface should define a default version. I think every plugin should define a correct value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants