Skip to content

[Core] Improve CartesianMeshGeneratorModeler#14481

Open
loumalouomega wants to merge 52 commits into
KratosMultiphysics:masterfrom
loumalouomega:core/improve-cartesian-modeler
Open

[Core] Improve CartesianMeshGeneratorModeler#14481
loumalouomega wants to merge 52 commits into
KratosMultiphysics:masterfrom
loumalouomega:core/improve-cartesian-modeler

Conversation

@loumalouomega

Copy link
Copy Markdown
Member

name: ✨ Feature
about: Improve CartesianMeshGeneratorModeler


📝 Description

This PR improves the CartesianMeshGeneratorModeler class with significant refactoring for code clarity, maintainability, and adds comprehensive test coverage (both C++ and Python).

Validation

  • Added comprehensive C++ unit tests (test_cartesian_mesh_generator_modeler.cpp) with 192 lines of test code
  • Added comprehensive Python tests (test_cartesian_mesh_generator_modeler.py) with 188 lines of test code
  • Integrated tests into the core test suite (test_KratosCore.py)

🆕 Changelog

Core Refactoring

  • Code quality improvements: Updated class documentation with detailed method and parameter descriptions
  • Modern C++ standards: Replaced traditional include guards with #pragma once for better compatibility
  • Type system improvements: Simplified type definitions using using instead of typedef
  • Enhanced constructors: Added default constructor and improved constructor definitions for better usability
  • Method refactoring: Refactored GenerateMesh method and related calculations for improved clarity and maintainability
  • Code cleanup: Improved naming conventions, code organization, and removed unused code and comments

Integration & Bindings

  • Added CartesianMeshGeneratorModeler Python bindings to enable usage from Python scripts
  • Integrated CartesianMeshGeneratorModeler into KratosApplication core module
  • Updated Kratos application headers and sources for proper registration

Files Modified

  • kratos_application.h
  • kratos_application.cpp
  • cartesian_mesh_generator_modeler.h (refactored, 548 lines removed, 787 lines changed)
  • cartesian_mesh_generator_modeler.cpp (new, 531 lines added)
  • add_modeler_to_python.cpp
  • test_KratosCore.py
  • kratos/tests/test_cartesian_mesh_generator_modeler.cpp (new test)
  • test_cartesian_mesh_generator_modeler.py (new test)

Commits

… functionality

- Updated class documentation to provide detailed descriptions of methods and parameters.
- Replaced traditional include guards with #pragma once for better compatibility.
- Simplified type definitions using 'using' instead of 'typedef'.
- Enhanced constructor definitions and added default constructor for better usability.
- Refactored GenerateMesh method and related calculations for clarity and maintainability.
- Improved naming conventions and code organization for better readability.
- Removed unused code and comments to streamline the implementation.
@loumalouomega loumalouomega requested a review from jcotela June 5, 2026 14:35
@loumalouomega loumalouomega requested a review from a team as a code owner June 5, 2026 14:35
@loumalouomega loumalouomega added Cleanup Kratos Core Python Testing Legacy Old code not maintained Refactor When code is moved or rewrote keeping the same behavior labels Jun 5, 2026
@loumalouomega loumalouomega enabled auto-merge June 5, 2026 14:35
@loumalouomega loumalouomega requested review from a team as code owners June 10, 2026 14:03
@loumalouomega loumalouomega removed request for a team June 10, 2026 14:04
@loumalouomega loumalouomega disabled auto-merge June 10, 2026 14:05
@loumalouomega loumalouomega enabled auto-merge (squash) June 10, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cleanup Kratos Core Legacy Old code not maintained Python Refactor When code is moved or rewrote keeping the same behavior Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants