Skip to content

Conversation

@jdoelz
Copy link
Collaborator

@jdoelz jdoelz commented Jun 20, 2025

This pull request enhances the handling of SurfacePoints by introducing a new SurfacePoint class. Previously, SurfacePoints were simply a relabelling of a fixed-length eigenvector, which made data access based on segments somewhat cumbersome for users.

This update aims improve usability by eliminating the need for explicit index access. The new class provides intuitive functions for easy access to geometric entities, streamlining the user experience.

Please note that all files utilizing SurfacePoints will need to be updated accordingly.

jdoelz and others added 25 commits June 3, 2022 10:27
…ix to an std::vector of the size of the number of elements. This is to address cache based performance issues with larger refinement levels. Running the tests indicates that there is no significant change in performance. Logs below.

Before changes:
===============================================================================

Running tests...
Test project /home/doelz/Dokumente/Codes/bembeldev_juergen/build
      Start  1: Spline
 1/18 Test  #1: Spline ............................   Passed    0.02 sec
      Start  2: GeometryImportAndEval
 2/18 Test  #2: GeometryImportAndEval .............   Passed    0.01 sec
      Start  3: SurfacePointUpdate
 3/18 Test  #3: SurfacePointUpdate ................   Passed    0.01 sec
      Start  4: Projector
 4/18 Test  #4: Projector .........................   Passed    0.02 sec
      Start  5: Glue
 5/18 Test  #5: Glue ..............................   Passed    0.39 sec
      Start  6: FMMTransferMatrices
 6/18 Test  #6: FMMTransferMatrices ...............   Passed    0.03 sec
      Start  7: FMMForwardTransformation
 7/18 Test  #7: FMMForwardTransformation ..........   Passed    0.06 sec
      Start  8: FMMBackwardTransformation
 8/18 Test  #8: FMMBackwardTransformation .........   Passed    0.05 sec
      Start  9: DuffyTrick
 9/18 Test  #9: DuffyTrick ........................   Passed   10.56 sec
      Start 10: AnsatzSpaceExample
10/18 Test #10: AnsatzSpaceExample ................   Passed    0.01 sec
      Start 11: BlockClusterTreeExample
11/18 Test #11: BlockClusterTreeExample ...........   Passed   12.52 sec
      Start 12: GeometryExample
12/18 Test #12: GeometryExample ...................   Passed    0.01 sec
      Start 13: LaplaceSingleLayerFullExample
13/18 Test #13: LaplaceSingleLayerFullExample .....   Passed   21.49 sec
      Start 14: LaplaceSingleLayerH2Example
14/18 Test #14: LaplaceSingleLayerH2Example .......   Passed   19.89 sec
      Start 15: HelmholtzSingleLayerFullExample
15/18 Test #15: HelmholtzSingleLayerFullExample ...   Passed   27.73 sec
      Start 16: HelmholtzSingleLayerH2Example
16/18 Test #16: HelmholtzSingleLayerH2Example .....   Passed   16.72 sec
      Start 17: MaxwellSingleLayerFullExample
17/18 Test #17: MaxwellSingleLayerFullExample .....   Passed   49.92 sec
      Start 18: MaxwellSingleLayerH2Example
18/18 Test #18: MaxwellSingleLayerH2Example .......   Passed  216.39 sec

100% tests passed, 0 tests failed out of 18

Total Test time (real) = 375.87 sec

After changes:
===============================================================================
Running tests...
Test project /home/doelz/Dokumente/Codes/bembeldev_juergen/build
      Start  1: Spline
 1/18 Test  #1: Spline ............................   Passed    0.02 sec
      Start  2: GeometryImportAndEval
 2/18 Test  #2: GeometryImportAndEval .............   Passed    0.01 sec
      Start  3: SurfacePointUpdate
 3/18 Test  #3: SurfacePointUpdate ................   Passed    0.01 sec
      Start  4: Projector
 4/18 Test  #4: Projector .........................   Passed    0.02 sec
      Start  5: Glue
 5/18 Test  #5: Glue ..............................   Passed    0.39 sec
      Start  6: FMMTransferMatrices
 6/18 Test  #6: FMMTransferMatrices ...............   Passed    0.03 sec
      Start  7: FMMForwardTransformation
 7/18 Test  #7: FMMForwardTransformation ..........   Passed    0.06 sec
      Start  8: FMMBackwardTransformation
 8/18 Test  #8: FMMBackwardTransformation .........   Passed    0.03 sec
      Start  9: DuffyTrick
 9/18 Test  #9: DuffyTrick ........................   Passed   10.42 sec
      Start 10: AnsatzSpaceExample
10/18 Test #10: AnsatzSpaceExample ................   Passed    0.02 sec
      Start 11: BlockClusterTreeExample
11/18 Test #11: BlockClusterTreeExample ...........   Passed   12.42 sec
      Start 12: GeometryExample
12/18 Test #12: GeometryExample ...................   Passed    0.01 sec
      Start 13: LaplaceSingleLayerFullExample
13/18 Test #13: LaplaceSingleLayerFullExample .....   Passed   17.39 sec
      Start 14: LaplaceSingleLayerH2Example
14/18 Test #14: LaplaceSingleLayerH2Example .......   Passed   19.76 sec
      Start 15: HelmholtzSingleLayerFullExample
15/18 Test #15: HelmholtzSingleLayerFullExample ...   Passed   23.60 sec
      Start 16: HelmholtzSingleLayerH2Example
16/18 Test #16: HelmholtzSingleLayerH2Example .....   Passed   16.52 sec
      Start 17: MaxwellSingleLayerFullExample
17/18 Test #17: MaxwellSingleLayerFullExample .....   Passed   47.77 sec
      Start 18: MaxwellSingleLayerH2Example
18/18 Test #18: MaxwellSingleLayerH2Example .......   Passed  216.50 sec

100% tests passed, 0 tests failed out of 18

Total Test time (real) = 365.03 sec
…SurfacePoint. Runtimes are comparable to master branch (that is, before start of refactoring) or quicker
@jdoelz jdoelz requested review from Copilot and mx-nlte June 20, 2025 15:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a new SurfacePoint class along with an example demonstrating the Dirichlet Trace to improve the usability of geometric data access. Key changes include:

  • Replacing raw Eigen vector segment accesses with intuitive getter functions (e.g. get_f(), get_xi(), get_w(), etc.) across Laplace, Helmholtz, and HomogenisedLaplace modules.
  • Updating geometry and basis function evaluations to leverage the new SurfacePoint interface.
  • Adjusting related files in Geometry, AnsatzSpace, and supporting modules to work with the new SurfacePoint class.

Reviewed Changes

Copilot reviewed 20 out of 42 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Bembel/src/Laplace/* Updated SurfacePoint accesses for Single/DoubleLayer operators using getter methods.
Bembel/src/Helmholtz/* Migrated segment-based geometry evaluations to the new SurfacePoint API.
Bembel/src/HomogenisedLaplace/* Updated kernel and integrand evaluations to use SurfacePoint getters.
Bembel/src/Geometry/SurfacePoint.hpp Replaced typedef with a class interface that encapsulates geometry and quadrature data.
Bembel/src/Geometry/Patch.hpp Modified updateSurfacePoint to use the new API and reuse the internal buffer of SurfacePoint.
Bembel/src/AnsatzSpace/* Adjusted basis function evaluations and projections to use get_xi() instead of raw segment access.
Bembel/LinearForm Added a new include for DirichletTraceOnReferenceDomain to support the updated trace interface.

srf_pt->allocate_buffer(2 * (polynomial_degree_x_ + polynomial_degree_y_) +
12);
double *buffer = srf_pt->get_buffer();
std::memset(buffer, 0, 12 * sizeof(double));
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

Consider using the allocated buffer size rather than a fixed value (12 * sizeof(double)) in the memset call, so that all of the buffer is properly cleared when polynomial degrees change.

Suggested change
std::memset(buffer, 0, 12 * sizeof(double));
std::memset(buffer, 0, sizeof(double) * (2 * (polynomial_degree_x_ + polynomial_degree_y_) + 12));

Copilot uses AI. Check for mistakes.
jdoelz and others added 2 commits June 20, 2025 17:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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