Skip to content

Make code easier to read.#327

Open
bangerth wants to merge 1 commit intoGeodynamicWorldBuilder:mainfrom
bangerth:bb-3
Open

Make code easier to read.#327
bangerth wants to merge 1 commit intoGeodynamicWorldBuilder:mainfrom
bangerth:bb-3

Conversation

@bangerth
Copy link
Contributor

The current code does

  Object x;
  sometype &y = x.internal_representation();
  y.a = ...;
  y.b = ...;
  return x;

This is hard to read, primarily because to the reader, the association between x and y is lost. But it's easy to avoid this.

Follow-up to #264. @alarshi FYI.

@github-actions
Copy link

Benchmark Master Feature Difference (99.9% CI)
Slab interpolation simple none 1.216 ± 0.004 (s=374) 1.217 ± 0.004 (s=368) +0.0% .. +0.2%
Slab interpolation curved simple none 1.290 ± 0.067 (s=355) 1.285 ± 0.066 (s=346) -1.7% .. +0.9%
Spherical slab interpolation simple none 1.348 ± 0.052 (s=351) 1.339 ± 0.055 (s=321) -1.7% .. +0.3%
Slab interpolation simple curved CMS 2.048 ± 0.019 (s=210) 2.042 ± 0.018 (s=233) -0.5% .. +0.0%
Spherical slab interpolation simple CMS 2.241 ± 0.073 (s=201) 2.218 ± 0.081 (s=205) -2.1% .. +0.1%
Spherical fault interpolation simple none 1.353 ± 0.116 (s=334) 1.344 ± 0.122 (s=336) -3.0% .. +1.5%

@MFraters
Copy link
Member

I like the simplification. Although it looks the correct to me (same code, just some reorganization), for some reason it fails the debug tests, complaining about the following for the spherical tests:
what(): Assert `boundary_points.first[i] <= boundary_points.second[i]` failed in /home/runner/work/WorldBuilder/WorldBuilder/include/world_builder/bounding_box.h at line 264: Bounding Box can't be created: the points' order should be bottom left, top right!
for two spherical tests: 24 - spherical_fault_interpolation_simple_none and 25 - spherical_slab_interpolation_simple_CMS.

This could either indicate that there is some small mistake I am missing or that there may be a bug in the original code. Could you have another quick look at it to see if you can find it?

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.

2 participants