Skip to content

Option to read initial texture from ascii file#918

Merged
MFraters merged 5 commits into
GeodynamicWorldBuilder:mainfrom
Wang-yijun:initial_texture_ascii_file
Apr 1, 2026
Merged

Option to read initial texture from ascii file#918
MFraters merged 5 commits into
GeodynamicWorldBuilder:mainfrom
Wang-yijun:initial_texture_ascii_file

Conversation

@Wang-yijun
Copy link
Copy Markdown
Contributor

I added the option to read the initial texture from an input file as a grain model for all features. Something to note about this grain model:

It will check that the number of particles and the number of grains in the input file are the same as provided by the ASPECT input file.
If there are multiple features, it allows each feature to have different initial textures (from an input file or using the other grain models), and the number of particles within this feature also needs to match the number of particles inside the input file provided. - Both Olivine and Enstatite are allowed.
It expects the input file to have the format of a particle_cpo output file from ASPECT. It expects an input file with headers (Olivine only):
id, mineral_0_volume_fraction, mineral_0_EA_phi, mineral_0_EA_theta, mineral_0_EA_z)
or headers (Olivine and Enstatite):
id mineral_0_volume_fraction mineral_0_EA_phi mineral_0_EA_theta mineral_0_EA_z mineral_1_volume_fraction mineral_1_EA_phi mineral_1_EA_theta mineral_1_EA_z

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 30, 2026

Pull Request Test Coverage Report for Build 23867577424

Details

  • 621 of 651 (95.39%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 98.3%

Changes Missing Coverage Covered Lines Changed/Added Lines %
source/world_builder/features/continental_plate_models/grains/ascii_file.cc 106 111 95.5%
source/world_builder/features/fault_models/grains/ascii_file.cc 101 106 95.28%
source/world_builder/features/mantle_layer_models/grains/ascii_file.cc 106 111 95.5%
source/world_builder/features/oceanic_plate_models/grains/ascii_file.cc 106 111 95.5%
source/world_builder/features/plume_models/grains/ascii_file.cc 101 106 95.28%
source/world_builder/features/subducting_plate_models/grains/ascii_file.cc 101 106 95.28%
Totals Coverage Status
Change from base Build 23803811457: -0.2%
Covered Lines: 11735
Relevant Lines: 11938

💛 - Coveralls

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 30, 2026

Benchmark Main Feature Difference (99.9% CI)
Slab interpolation simple none 1.305 ± 0.006 (s=363) 1.295 ± 0.008 (s=332) -0.9% .. -0.7%
Slab interpolation curved simple none 1.314 ± 0.007 (s=324) 1.302 ± 0.008 (s=367) -1.0% .. -0.7%
Spherical slab interpolation simple none 1.283 ± 0.009 (s=354) 1.281 ± 0.010 (s=350) -0.4% .. -0.0%
Slab interpolation simple curved CMS 1.210 ± 0.007 (s=373) 1.216 ± 0.007 (s=372) +0.3% .. +0.6%
Spherical slab interpolation simple CMS 1.621 ± 0.007 (s=287) 1.622 ± 0.009 (s=270) -0.1% .. +0.2%
Spherical fault interpolation simple none 1.298 ± 0.011 (s=357) 1.295 ± 0.011 (s=340) -0.4% .. +0.0%
Cartesian min max surface 3.100 ± 0.012 (s=156) 3.085 ± 0.017 (s=137) -0.6% .. -0.3%
Spherical min max surface 8.654 ± 0.109 (s=50) 8.604 ± 0.084 (s=57) -1.3% .. +0.2%

@danieldouglas92
Copy link
Copy Markdown
Contributor

This looks great, thanks for dividing up your original PR into these small PR's! The coverage has dropped by several percent because your test only covers the mantle feature, but I think just including the other features in your current test should help to overcome this. I'm not sure why some of the testers are failing though... thoughts on this @MFraters

@MFraters MFraters force-pushed the initial_texture_ascii_file branch from 5eb78ec to fab6507 Compare March 30, 2026 23:51
@MFraters
Copy link
Copy Markdown
Member

It took me a bit to figure out, but I was able to reproduce the issues on my computer and it now seems to work on my computer. The first issue had to do with that the c and cpp compilation tests where not using the mpi versions of the compiler when doing the manual compilation.

The second issue was that the gdb and valgrind were not having the same working directory as the normal tests.

I agree with @danieldouglas92 that it would be great if you could add tester coverage for all plugins :)

@MFraters
Copy link
Copy Markdown
Member

apparently it is not fixed on the tester.... Let's look at it again tomorrow.

@MFraters MFraters force-pushed the initial_texture_ascii_file branch 2 times, most recently from 970a734 to e591c52 Compare March 31, 2026 13:12
@MFraters
Copy link
Copy Markdown
Member

oke, it seems like the issues are fixed now. Can you add the missing tests? Otherwise good to merge I think.

btw, I had to rebase in the meantime, do you know how to update your branch?

@MFraters
Copy link
Copy Markdown
Member

hmm, I think I accidentally rebased onto an older main, resulting in a large diff for the declarations and a not accurate coverage result. I can fix this, since it was my mistake.

@MFraters MFraters force-pushed the initial_texture_ascii_file branch from 0a018b1 to 8404af5 Compare March 31, 2026 15:56
MFraters and others added 2 commits March 31, 2026 18:16
compiling the c and cpp tests and fix gdb and valgrind working directories.
@MFraters MFraters force-pushed the initial_texture_ascii_file branch from 8404af5 to d9b7330 Compare March 31, 2026 16:17
@MFraters
Copy link
Copy Markdown
Member

Fixed the declaration files issues.

The test that you made is not actually sampling the plume, subducting plate and oceanic plate. Can you either add points in those features, so that we know that they are tested, or you can also change to a gwb grid tests, which may be easier to sample all features.

Other than that, I think it is good to merge :)

@Wang-yijun Wang-yijun force-pushed the initial_texture_ascii_file branch from c820d83 to d2faa39 Compare April 1, 2026 13:25
@Wang-yijun Wang-yijun force-pushed the initial_texture_ascii_file branch from 927d7d5 to 1ca5cf3 Compare April 1, 2026 19:46
@Wang-yijun
Copy link
Copy Markdown
Contributor Author

Fixed the declaration files issues.

The test that you made is not actually sampling the plume, subducting plate and oceanic plate. Can you either add points in those features, so that we know that they are tested, or you can also change to a gwb grid tests, which may be easier to sample all features.

Other than that, I think it is good to merge :)

Thanks Menno! I've fixed the tests for coverage and also a small old typo, so that the typo tester doesn't break.

Copy link
Copy Markdown
Member

@MFraters MFraters left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@MFraters MFraters merged commit d3b8dbc into GeodynamicWorldBuilder:main Apr 1, 2026
35 of 36 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.

4 participants