Skip to content

Conversation

@A-CGray
Copy link
Member

@A-CGray A-CGray commented Oct 10, 2025

Purpose

The current thickness to chord constraint implementations has a few limitations:

  1. You could only compute thickness to chord along a 1D line.
  2. The constraint didn't actually compute an accurate chord length, it just used two points spaced slightly apart in the chordwise direction. This meant you could only use the thickness to chord constraint in the scaled sense (relative to the baseline).

This PR adds a completely new implementation of t/c constraints in DVConstraints. The new implementation basically uses two sets of thickness constraints, one to compute the thicknesses and another to compute the chord lengths.

ToCConstraints

This new implementation has the following advantages:

  1. You can compute thickness to chord over a 1D line or a 2D grid
  2. The constraints use leading and trailing edge points to actually compute an accurate chord length and therefore accurate (non-scaled) t/c values
  3. The 2D version can compute the max t/c value for each chordwise section using KS aggregation

Technically these changes are backward incompatible because defining the 1D thickness to chord constraints now requires a set of leading and trailing edge coordinates instead of a projection direction and a chord direction. I don't think this is a big issue because these constraints weren't used by many people.

Expected time until merged

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

I've expanded the existing thickness to chord constraint test to test the new capabilities (2D, section max)

Checklist

  • I have run ruff check and ruff format to make sure the Python code adheres to PEP-8 and is consistently formatted
  • I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@A-CGray A-CGray requested a review from a team as a code owner October 10, 2025 03:36
@A-CGray A-CGray requested review from ArshSaja and anilyil October 10, 2025 03:36
@A-CGray A-CGray changed the title New thickness to chord implementation New thickness to chord constraint implementation Oct 10, 2025
@A-CGray A-CGray marked this pull request as draft October 10, 2025 18:12
@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 91.73554% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.02%. Comparing base (ee331a6) to head (00aa366).

Files with missing lines Patch % Lines
pygeo/constraints/DVCon.py 89.36% 15 Missing ⚠️
pygeo/mphys/mphys_dvgeo.py 33.33% 4 Missing ⚠️
pygeo/constraints/thicknessConstraint.py 98.93% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #280      +/-   ##
==========================================
+ Coverage   67.10%   69.02%   +1.92%     
==========================================
  Files          48       48              
  Lines       12378    12492     +114     
==========================================
+ Hits         8306     8623     +317     
+ Misses       4072     3869     -203     

☔ 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.

@A-CGray A-CGray marked this pull request as ready for review October 10, 2025 20:21
@A-CGray A-CGray requested a review from Copilot October 10, 2025 20:21
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 PR adds a new implementation of thickness-to-chord constraints in DVConstraints, providing more accurate chord length computations and 2D grid support. The new implementation uses separate thickness constraints for measuring thickness and chord lengths based on leading/trailing edge points.

  • Replaces the previous thickness-to-chord constraint implementation with a more accurate one that computes actual chord lengths
  • Adds support for 2D thickness-to-chord constraints with optional section maximum values using KS aggregation
  • Updates existing constraint methods to return constraint objects and improves surface projection utilities

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/reg_tests/test_DVConstraints.py Expands tests to cover new 1D/2D thickness-to-chord constraint variants and adds writeTecplot testing
pygeo/mphys/mphys_dvgeo.py Adds wrapper methods for new thickness-to-chord constraint functions
pygeo/geo_utils/ffd_generation.py Updates method name from _generateIntersections to _generateGridIntersections
pygeo/constraints/thicknessConstraint.py Complete rewrite of ThicknessToChordConstraint class with new architecture
pygeo/constraints/baseConstraint.py Adds documentation to GeometricConstraint.init method
pygeo/constraints/DVCon.py Major refactoring with new constraint methods, improved surface projection, and return values

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@A-CGray A-CGray requested a review from Copilot October 10, 2025 22:09
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

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@A-CGray A-CGray marked this pull request as draft October 10, 2025 22:13
@A-CGray A-CGray marked this pull request as ready for review October 10, 2025 22:55
@A-CGray A-CGray requested review from eirikurj and sabakhshi and removed request for ArshSaja and anilyil October 13, 2025 14:40
@A-CGray A-CGray requested review from marcomangano and removed request for eirikurj November 18, 2025 18:40
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