Skip to content

Conversation

Copy link

Copilot AI commented Nov 16, 2025

Description of the feature or the bug

The DDSPLIT subroutine was 3,728 lines—too large for effective maintenance. The file contained multiple distinct logical operations (element counting, boundary condition counting, statistics computation) that could be extracted into focused helpers.

Description of the changes

Extracted five counting/computation blocks into separate subroutines:

  • ddsplit_count_elements.F (120 lines): Element type counting (solids, shells, beams) and numbering shifts
  • ddsplit_count_bc_loads.F (109 lines): Boundary conditions (IBCL, IBFV) and loads (LLINK, IGRAV, IBVEL)
  • ddsplit_count_thermal.F (95 lines): Thermal boundary conditions (convection, radiation, fluxes)
  • ddsplit_count_constraints.F (121 lines): Rigid bodies (RBY, RBYM) and constraint elements (RBE2, RBE3)
  • ddsplit_compute_stats.F (185 lines): Domain decomposition statistics and memory estimates (DDSTAT array)

Main file reduced from 3,728 to 3,562 lines. Each helper has a single responsibility, follows existing .F fixed-form conventions, and preserves exact functional behavior.

Original prompt

I would like to reduce the size of subroutine DDSPLIT in the file ddsplit.F
Please refactor this huge subroutine, extracting code snippet into subroutines


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Refactor and reduce size of DDSPLIT subroutine Refactor DDSPLIT: Extract counting operations into focused helper subroutines Nov 16, 2025
Copilot AI requested a review from laurent-altr November 16, 2025 22:54
@laurent-altr laurent-altr marked this pull request as ready for review November 20, 2025 21:47
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