# lammps-analysis-and-output > This skill should be used when users ask about analysis and output in lammps; it prioritizes documentation references and then source inspection only for unresolved details. - Author: Tao E. Li - Repository: TEL-Research-Group/lammps - Version: 20260207223556 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-08 - Source: https://github.com/TEL-Research-Group/lammps - Web: https://mule.run/skillshub/@@TEL-Research-Group/lammps~lammps-analysis-and-output:20260207223556 --- --- name: lammps-analysis-and-output description: This skill should be used when users ask about analysis and output in lammps; it prioritizes documentation references and then source inspection only for unresolved details. --- # lammps: Analysis and Output ## High-Signal Playbook ### Route the request - Use `lammps-simulation-workflows` to decide equilibration vs production segmentation first. - Use `lammps-troubleshooting` if output reveals instability (lost atoms, NaN, exploding pressure). - Use `lammps-api-and-scripting` for Python-native extraction and programmatic control. ### Triage questions - Which observables are required: thermo, per-atom trajectories, chunk averages, restart state? - Is downstream parsing done in OVITO/VMD, shell tools, or Python/pandas? - Is compact structured output (YAML/JSON) preferred over plain text? - What output cadence balances statistical resolution and I/O cost? ### Canonical workflow - Define thermo fields with `thermo_style custom` (or `yaml`) (`doc/src/thermo_style.rst`). - Apply `thermo_modify` only after `thermo_style` (it resets defaults) (`doc/src/thermo_modify.rst`). - Define dump schema with atom IDs (or explicit sorting) (`doc/src/dump.rst`, `doc/src/dump_modify.rst`). - Add averaged channels via `fix ave/time` or `fix ave/chunk` when needed (`doc/src/Howto_output.rst`). - For machine parsing, use YAML thermo/dump outputs (`doc/src/Howto_structured_data.rst`). ### Minimal working examples - Thermo + trajectory baseline (`doc/src/thermo_style.rst`, `doc/src/dump.rst`): ```LAMMPS thermo 100 thermo_style custom step temp press pe ke etotal vol nbuild ndanger thermo_modify flush yes dump trj all custom 500 dump.lammpstrj id type x y z vx vy vz dump_modify trj sort id pbc yes ``` - YAML thermo for scripting pipelines (`doc/src/thermo_style.rst`): ```LAMMPS thermo_style yaml thermo 200 ``` ### Pitfalls - Setting `thermo_modify` before `thermo_style` and expecting it to persist (`doc/src/thermo_style.rst`). - Dumping without `id` and without sorting, breaking per-atom frame tracking (`doc/src/dump.rst`). - Assuming dumped coordinates are always wrapped inside box without `pbc yes` (`doc/src/dump.rst`, `doc/src/dump_modify.rst`). - Writing output too frequently and bottlenecking performance. - Ignoring warning trends (`ndanger`, missing topology warnings) in thermo/log outputs. ### Convergence and validation checklist - Include at least `step`, `temp`, `press`, `pe`, `etotal`, and neighbor diagnostics in thermo. - Validate at least one dump frame in the intended visualization/analysis tool. - Check time-windowed averages (not just instantaneous values) for reported observables. - Confirm output cadence is sufficient for target correlation/transport analyses. ## Scope - Handle questions about output formats, analysis, and post-processing. - Keep responses abstract and architectural for large codebases; avoid exhaustive per-function documentation unless requested. ## Primary documentation references - `doc/src/Howto_output.rst` - `doc/src/Howto_structured_data.rst` - `doc/src/Run_output.rst` - `doc/src/thermo_style.rst` - `doc/src/thermo_modify.rst` - `doc/src/dump.rst` - `doc/src/dump_modify.rst` - `examples/peptide/in.peptide` ## Workflow - Start with the primary references above. - If details are missing, inspect `references/doc_map.md` for additional topic documents (generated inventory plus curated anchors). - Use tutorials/examples as executable usage patterns when available. - Use tests as behavior or regression references when available. - If ambiguity remains after docs, inspect `references/source_map.md` and start with the ranked source entry points. - Cite exact documentation file paths in responses. ## Tutorials and examples - `examples` ## Test references - None discovered. ## Optional deeper inspection - `fortran` - `lib` - `python` - `src` ## Source entry points for unresolved issues - `src/write_dump.h` - `src/write_dump.cpp` - `src/thermo.h` - `src/thermo.cpp` - `src/read_dump.h` - `src/read_dump.cpp` - `src/output.h` - `src/output.cpp` - Prefer targeted source search (for example: `rg -n "" fortran lib python src`).