Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 2.22 KB

File metadata and controls

49 lines (33 loc) · 2.22 KB

Based on my analysis of the codebase, here are my thoughts on what could be simplified/removed:

  1. Redundant Flux Schemes

The +flux/ directory contains 16 different numerical flux schemes. Many share similar structures:

  • Rusanov/LF - Lax-Friedrichs and Rusanov are essentially the same (local vs global wave speed)
  • HLL/HLLE/HLLC - These are variations of the same family, could be unified with options
  • AUSM/AUSMDV/SLAU - Related schemes that could share more code
  • Consolidation opportunity: Create a base HLL-family implementation with variants as options
  1. Similar Limiter Functions

The limiters in +reconstruct/+limiters/ have very similar structures:

  • Most follow pattern: check sign, apply formula, return limited slope
  • Consolidation opportunity: Create a generic limiter framework where specific formulas are plugged in
  1. Time Integration Redundancy

Multiple RK schemes with similar patterns:

  • integrate_euler_adaptive.m, integrate_ssp2_adaptive.m, integrate_ssp3_adaptive.m, integrate_rk4_adaptive.m
  • All share: adaptive stepping logic, output interpolation, progress reporting
  • Consolidation opportunity: Single adaptive RK framework with method-specific coefficients
  1. Progress Bar Utilities

Two different progress bar implementations:

  • textprogressbar.m - Text-based progress bar
  • odetpbar.m - ODE-specific progress display
  • Could be unified into one flexible progress reporting system
  1. Repeated Validation Patterns

In +cfg/validate_config.m, there's repetitive validation code for each section that could be abstracted.

  1. Reconstruction Methods

Some reconstruction methods like eno2.m and uno2.m likely share significant code that could be factored out.

  1. Boundary Condition Simplifications

The BC implementations have similar padding logic that could be abstracted into a base function.

Most significant simplification opportunities:

  1. Consolidate the 16 flux schemes into ~5-6 base implementations with variants
  2. Unify the adaptive time stepping code
  3. Create a single limiter framework
  4. Merge the two progress bar utilities

This would reduce the codebase size by roughly 30-40% while maintaining all functionality and actually improving maintainability.