Best Practices¶
Use AI tools as fast drafting and review assistants. Keep human control over physics, numerical methods, validation, and final code acceptance.
Recommended Workflow¶
- Start from an existing Exasim example.
- Provide the AI with exact file paths and relevant source files.
- Specify geometry, units, parameters, boundary conditions, and outputs.
- Ask for incremental changes.
- Review assumptions before accepting edits.
- Compile and run small cases frequently.
- Validate against analytical, manufactured, or benchmark results.
- Iterate with narrow follow-up prompts.
Good Habits¶
- Tell the AI what not to change.
- Ask for affected files before coding.
- Ask for explicit assumptions.
- Ask for verification commands.
- Keep a clean git diff.
- Review generated array sizes and dimensions.
- Prefer simple examples before complex multiphysics.
- Preserve existing Exasim APIs unless intentionally extending them.
Common Mistakes¶
| Mistake | Consequence |
|---|---|
| "Create a solver" without details | Underspecified physics and unusable code. |
| Missing boundary conditions | Ill-posed or incorrect PDE problem. |
| Missing units | Wrong scale, stiffness, or nondimensional parameters. |
| Too many changes at once | Hard-to-review diffs and hidden regressions. |
| No reference example | Wrong frontend style or obsolete API usage. |
| No validation criteria | Code may run but solve the wrong problem. |
| Ignoring GPU/MPI data movement | CPU-only code or stale device data bugs. |
Best Prompt Style¶
Use direct, testable instructions:
Modify only <file>. Preserve existing behavior unless <condition>. Add a small
test or example. Run <command>. Explain residual risks.
When To Stop And Ask For Human Review¶
Request expert review when a change affects:
- conservation or consistency;
- HDG static condensation;
- nonlinear or linear solver logic;
- preconditioner storage;
- MPI communication;
- CUDA/HIP memory ownership;
- production physics models;
- benchmark results.