Skip to content

Conversation

@sandro-elsweijer
Copy link
Member

@sandro-elsweijer sandro-elsweijer commented Jan 9, 2026

Closes #2074

Describe your changes here:
I am so sorry for the diff count. But a huge part of this PR is documentation.
Fixes a bug in our curved mesh algorithms in which in some edge cases geometries were either not linked to tree faces or they were linked with wrong parameters. This can be observed by executing the curved mesh tutorial for tetrahedra on main and on this branch.

All these boxes must be checked by the AUTHOR before requesting review:

  • The PR is small enough to be reviewed easily. If not, consider splitting up the changes in multiple PRs.
  • The title starts with one of the following prefixes: Documentation:, Bugfix:, Feature:, Improvement: or Other:.
  • If the PR is related to an issue, make sure to link it.
  • The author made sure that, as a reviewer, he/she would check all boxes below.

All these boxes must be checked by the REVIEWERS before merging the pull request:

As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.

General

  • The reviewer executed the new code features at least once and checked the results manually.
  • The code follows the t8code coding guidelines.
  • New source/header files are properly added to the CMake files.
  • The code is well documented. In particular, all function declarations, structs/classes and their members have a proper doxygen documentation. Make sure to add a file documentation for each file!
  • All new algorithms and data structures are sufficiently optimal in terms of memory and runtime (If this should be merged, but there is still potential for optimization, create a new issue).

Tests

  • The code is covered in an existing or new test case using Google Test.
  • The code coverage of the project (reported in the CI) should not decrease. If coverage is decreased, make sure that this is reasonable and acceptable.
  • Valgrind doesn't find any bugs in the new code. This script can be used to check for errors; see also this wiki article.

If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):

  • Should this use case be added to the github action?
  • If not, does the specific use case compile and all tests pass (check manually).

Scripts and Wiki

  • If a new directory with source files is added, it must be covered by the script/find_all_source_files.scp to check the indentation of these files.
  • If this PR introduces a new feature, it must be covered in an example or tutorial and a Wiki article.

License

  • The author added a BSD statement to doc/ (or already has one).

@sandro-elsweijer sandro-elsweijer self-assigned this Jan 9, 2026
@sandro-elsweijer sandro-elsweijer changed the title Bugfic: Curved geometries Bugfix: Curved geometries Jan 12, 2026
@sandro-elsweijer sandro-elsweijer removed their assignment Jan 13, 2026
@sandro-elsweijer sandro-elsweijer marked this pull request as ready for review January 13, 2026 14:39
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.05%. Comparing base (2625544) to head (1bac59c).
⚠️ Report is 35 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2073   +/-   ##
=======================================
  Coverage   77.05%   77.05%           
=======================================
  Files         112      112           
  Lines       18959    18959           
=======================================
  Hits        14608    14608           
  Misses       4351     4351           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@lenaploetzke lenaploetzke left a comment

Choose a reason for hiding this comment

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

First part of review

}
}

/* Lastly, we put the parameters into our output array. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok i think overall this function works.

/* Convert reference parameters to OCCT point */
gp_Pnt2d reference_point (reference_face_params.value ()[0], reference_face_params.value ()[1]);

/* If the edge is a seam we have to get both points and check which one is closer.
Copy link
Collaborator

Choose a reason for hiding this comment

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

points? parameters maybe?

We iterate over all edges of the face and check if the edges are the same as the
input edge. Then we check if the converted parameters are closer to the
already computed parameters. */
bool first_point = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

edge?

if (edge.IsSame (current_edge)) {
Handle_Geom2d_Curve curve_on_surface = BRep_Tool::CurveOnSurface (edge, face, first, last);
/* If it is the first seam we compute the parameters. */
if (first_point) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can also again solve this with uv as optional can't you?

}
/* Now we can check if every node lies on the surface and retrieve its parameters */
if (surface_index) {
int all_nodes_on_surface = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use maybe a bool? 😅

Copy link
Collaborator

@lenaploetzke lenaploetzke left a comment

Choose a reason for hiding this comment

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

Please also merge main

Comment on lines +40 to +41
#include <ranges>
#include <type_traits>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you check if you need these two includes?

if (dim == 2) {
face_nodes[i_face_node] = tree_nodes[i_face_node];
face_nodes.push_back (tree_nodes[i_face_node]);
T8_ASSERT (num_faces == 1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this necessary? Only chance that num_faces is set is here

switch (dim) {
 case 0:
   num_faces = 0;
   break;
 case 1:
   num_faces = 0;
   break;
 case 2:
   num_faces = 1;
   break;
 case 3:
   num_faces = t8_eclass_num_faces[eclass];
   break;
 default:
   SC_ABORTF ("Invalid dimension of tree. Dimension: %i\n", dim);
 }

for (auto &face_node : face_nodes) {
switch (face_node.entity_dim) {
case 2:
/* Nothing to do. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Dont have to convert because the face node is directly on surface right?

* If the edge is locked for edges on surfaces we have to skip this edge */
else if (edge_geometry_dim == 2 && edge_geometries[i_tree_edges + num_edges] >= 0) {

/* We also skip this exge if the edge is on a plane. Planes have no curvature and
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/* We also skip this exge if the edge is on a plane. Planes have no curvature and
/* We also skip this edge if the edge is on a plane. Planes have no curvature and

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.

Bugfic: Curved geometries

3 participants