Airfoil field output#238
Conversation
Extends simulate() with a field_output flag that additionally returns surface pressure and velocity fields (shape 6×N) from the post-simulation slice file alongside the aerodynamic performance array. - utils.py: add reorder_coords_fields(), mirroring reorder_coords() but carrying VelocityX/Y/Z and CoefPressure through the reordering pipeline - v0.py: extend simulator_output_to_design() and simulate() with field_output=False parameter; simulate returns tuple[NDArray, NDArray] when field_output=True - simulation_jobs.py: propagate field_output through simulate_slurm(), adding surface_fields key to the result dict when requested - dataset_slurm_airfoil.py: add --field_output CLI flag and forward it to each job config Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Brings the command line argument descriptions up to date with all current arguments, including the previously undocumented -account, -type, -minutes_per_sim, -n_slurm_array, and the new --field_output flag. Adds defaults to each entry for clarity. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Looks good to me @fgvangessel-umd. I think you can go ahead and merge. |
…set generation usage
Replace the standalone simulate_field method with an AirfoilSimulationResult subclass of SimulationResult returned from simulate_verbose, carrying the (6, N) surface field array alongside the [drag, lift] objective values. Route simulate_slurm through a verbose flag (simulate_verbose vs simulate) instead of field_output, and rename the dataset generation CLI flag to --verbose. Document the airfoil/slurm workflow in CLAUDE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@g-braeunlich can you review my implementation in problems/airfoil/v0.py, specifically the AirfoilSimulationResult derived class and the simulate_verbose implementation. Specifically, that I implemented this in accordance with the approach you had in mind. I've verified that my implementation works with slurm and appropriately returns different data structures based on whether the verbose flag is passed or not. |
g-braeunlich
left a comment
There was a problem hiding this comment.
@fgvangessel-umd Yes, thats exactly how I imagined the use of the new result class.
I have some minor suggestion.
On top of that:
Would not it be more consistent, to also unpack the surface field values into the dict, you are returning in the job result? I.e. position (2d), velocity (3d) and coef_pressure (scalar)?
Slice surface_fields by row (axis 0) to match its (6, N) layout when splitting into coords, velocity, and pressure_coeff; update the docstring Returns section accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CLAUDE.md was accidentally committed; keep it locally as Claude Code guidance but stop tracking it in the repo. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Description
Created optional capability to output airfoil fields
Type of change
Please delete options that are not relevant.
Checklist:
pre-commitchecks withpre-commit run --all-filesruff check .andruff formatmypy .Reviewer Checklist: