Merging feature/improved geometry definitions branch into main#44
Merged
Merging feature/improved geometry definitions branch into main#44
Conversation
…hived old versions of some key modules with legacy_ prefixes, and began setting up the new WingCrossSection module.
Replaces legacy position and orientation parameters with local_position and local_rotations for both Wing and WingCrossSection. Adds support for arbitrary symmetry planes via symmetry_plane_normal and symmetry_plane_point, and introduces mirror_only flag. Updates docstrings and validation logic to clarify new transformation and symmetry handling. Temporarily disables panel meshing and related properties pending update to new coordinate system.
Added geometry_to_wing_axes_transformation_matrix property to compute the homogeneous transformation from geometry axes to wing axes, including translation, rotation, and optional reflection. Restored and updated properties for unit vectors, projected area, wetted area, span, standard mean chord, and mean aerodynamic chord to use the new transformation logic and provide correct geometric calculations for the Wing class.
Expanded CLAUDE.md with comprehensive conventions for naming and referencing axes, points, and frames in Ptera Software. The new appendix standardizes variable naming, text references, and context rules, improving clarity and consistency for multi-object simulations.
Added process_wing_symmetry and validate_first_airplane_constraints methods to the Airplane class. Updated documentation to clarify the role of Cgi_E_I and improved constructor parameters for clarity. Expanded class docstring to detail coordinate system conventions and responsibilities.
…ocs, and updated CLAUDE.md
Updated Airplane and Wing classes to clarify parameter names and docstrings, improving consistency and readability. Added generate_rotation_matrix_from_a_to_b to functions.py for flexible rotation matrix generation. Moved transformation and angle vector documentation to dedicated files and updated references throughout the codebase.
…tive vs. passive transformations.
Introduced functions to convert 3D vectors to homogeneous coordinates and generate rotational and translational transformation matrices in functions.py. Also renamed Wing property to clarify passive transformation matrix usage in geometry.py.
…ions to a new file.
…, and generate_T_trans functions.
Introduced pterasoftware/parameter_validation.py for common parameter validation functions. Refactored Airplane and Wing classes to use these validation utilities, improved docstrings, and clarified symmetry processing logic. Updated mesh generation and reference dimension handling for robustness and maintainability.
Updated Airplane and Wing classes to use new symmetry parameter names and logic, improved symmetry plane coincidence checks, and centralized parameter validation in geometry.py. Added new validation functions to parameter_validation.py for 3D unit vectors and finite value checks, and refactored integer/float validation to ensure values are finite. Commented out unused Wing property methods pending further review.
Removed the requirement for custom spacing functions to have zero mean in movement modules and validation logic. Updated docstrings to clarify that non-zero mean is permitted and may be useful for asymmetric motion. Removed related test and fixture for zero mean validation.
…xed a bug in Airfoil.
Refactored convergence analysis functions in pterasoftware/convergence.py to improve parameter validation, documentation, and mesh generation logic. Removed unused and redundant methods from Panel class, replacing average span/chord and vector properties with a new aspect_ratio property. Added average_panel_aspect_ratio property to Wing class for mesh quality assessment. Updated benchmarks and experimental scripts to use new convergence API and mesh parameters. Minor docstring and formatting improvements throughout affected modules.
Introduces concurrency groups and cancel-in-progress for black, codespell, and tests workflows to prevent overlapping runs and improve CI efficiency.
Refactored unsteady benchmark scripts to use consistent naming (e.g., benchmark_airplane), added reflected wing handling, and updated docstrings to discourage committing changes. Improved logging in convergence.py for clarity and consistency, including more informative messages and capitalization. Enhanced the calculation of spanwise panels to consider only relevant time steps, and made minor bugfixes and docstring updates.
Formation flight simulations were incorrectly stacking all Airplanes on top of each other instead of positioning them according to their Cg_E_CgP1 parameters. Panel and vortex positions were stored in local geometry axes (G_Cg) but never transformed to common axes/ref points for multi-Airplane simulations. Solved by implementing dual-frame coordinate storage where all solver computations use the first Airplane's geometry axes and CG (GP1_CgP1). Panels maintain both local (G_Cg) and formation (GP1_CgP1) coordinates, while vortices store only GP1_CgP1. Coordinate transformations occur once in Problem.__init__() via new Airplane.compute_T_pas_G_Cg_to_GP1_CgP1() method.
…iable_formation.py
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 56 out of 1713 changed files in this pull request and generated 5 comments.
Files not reviewed (13)
- .idea/PteraSoftware.iml: Language not supported
- .idea/copilot.data.migration.agent.xml: Language not supported
- .idea/copilot.data.migration.ask.xml: Language not supported
- .idea/copilot.data.migration.ask2agent.xml: Language not supported
- .idea/copilot.data.migration.edit.xml: Language not supported
- .idea/dictionaries/project.xml: Language not supported
- .idea/inspectionProfiles/Ptera_Software_Default.xml: Language not supported
- .idea/inspectionProfiles/profiles_settings.xml: Language not supported
- .idea/jsonCatalog.xml: Language not supported
- .idea/misc.xml: Language not supported
- .idea/scopes/to_inspect.xml: Language not supported
- .idea/statistic.xml: Language not supported
- .idea/vcs.xml: Language not supported
…o use new images for example outputs.
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 50 out of 1714 changed files in this pull request and generated 2 comments.
Files not reviewed (13)
- .idea/PteraSoftware.iml: Language not supported
- .idea/copilot.data.migration.agent.xml: Language not supported
- .idea/copilot.data.migration.ask.xml: Language not supported
- .idea/copilot.data.migration.ask2agent.xml: Language not supported
- .idea/copilot.data.migration.edit.xml: Language not supported
- .idea/dictionaries/project.xml: Language not supported
- .idea/inspectionProfiles/Ptera_Software_Default.xml: Language not supported
- .idea/inspectionProfiles/profiles_settings.xml: Language not supported
- .idea/jsonCatalog.xml: Language not supported
- .idea/misc.xml: Language not supported
- .idea/scopes/to_inspect.xml: Language not supported
- .idea/statistic.xml: Language not supported
- .idea/vcs.xml: Language not supported
Comments suppressed due to low confidence (3)
pterasoftware/geometry/init.py:1
- The docstring lists a 'panel.py' module that doesn't exist in this package. The Panel class is now in pterasoftware._panel.py, not in the geometry package.
"""This package contains the geometry classes.
pterasoftware/_transformations.py:1
- The code snippet in lines 287-288 appears to be incorrect - it references
panel.moments_W_CgP1which is unrelated to the transformation composition function. This should likely return the composed transformation matrix instead.
"""This module contains functions used for geometric transformations."""
pterasoftware/_parameter_validation.py:1
- The parameter 'passive' is validated but then marked as unused with a noinspection comment. If the parameter is truly unused, consider removing it from the function signature rather than suppressing the warning.
"""This module contains common parameter validation functions."""
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR represents a comprehensive refactoring that radically expands the types of geometry and motion Ptera Software can represent, while adopting a much more formal representation of axes, frames, and reference points. The changes enable more complex aircraft configurations and motion patterns through a complete architectural overhaul.
Motivation
Previously, Ptera Software modeled geometry using XFLR5-style definitions, which worked great for standard aircraft-like configurations. However, this approach was limiting in specifying wings with complex features like non-parallel cross sections and discontinuous symmetry. Since motion in Ptera Software is represented by a list of Airplane objects (each at a particular time step), these geometric limitations also constrained the types of motion Ptera Software was capable of modeling.
This refactor addresses these fundamental limitations by:
Relevant Issues
Closes #40
Changes
Implemented formal framework for representing vector-valued quantities
Implemented functions for transforming vectors-valued quantities with extremely detailed specifications about how to interpret and use them (active vs. passive transformations, intrinsic vs. extrinsic rotations, homogenous coordinates, etc.)
Reduced the number of public classes, functions, and methods.
Added parameter validation to all refactored, public classes, functions, and methods.
Radically expanded geometry capabilities beyond XFLR5-style limitations:
Using the new geometry definition framework, enhanced the movement system:
Updated all solvers to work with the new geometry and motion definitions.
Updated all examples and benchmarks to use the new geometry and motion definitions.
Created CLAUDE.md with development guidelines for the expanded system
New Dependencies
None
Change Magnitude
Major: This is a fundamental architectural transformation that breaks backward compatibility while dramatically expanding Ptera Software's capabilities beyond XFLR5-style limitations. The changes affect the entire codebase and enables representation of aircraft configurations and motion patterns that were previously impossible to model.
Checklist
Contributing Code.
mainand is up to date with the upstreammainbranch.reStructuredText format.
codespell,black, andtests).updated tests in the
testspackage.docstrings.