Skip to content

Add TDOFDFT example and kinetic energy post-processing tool - #7490

Merged
mohanchen merged 6 commits into
deepmodeling:developfrom
lyb9812:develop
Jun 19, 2026
Merged

Add TDOFDFT example and kinetic energy post-processing tool#7490
mohanchen merged 6 commits into
deepmodeling:developfrom
lyb9812:develop

Conversation

@lyb9812

@lyb9812 lyb9812 commented Jun 19, 2026

Copy link
Copy Markdown

Summary

This PR adds a new example for Time-Dependent Orbital-Free Density Functional Theory (TDOFDFT) calculations, specifically for electronic stopping power (ESP) simulations, along with a post-processing tool.

Changes

1. examples/35_tdofdft/ — New TDOFDFT Example

Follows the same structure as examples/22_rt-tddft/:

  • 01_Al_proton_ESP/01_gs/ — Ground-state OFDFT calculation for Al FCC 4×4×4 supercell (256 atoms)
    • esolver_type=ofdft, of_kinetic=tf+, out_chg=1
  • 01_Al_proton_ESP/02_td/ — TDOFDFT proton dynamics
    • esolver_type=tdofdft, of_cd=1, of_mcd_alpha=2.0
    • Proton modeled as 1/r local potential with initial velocity 1.3 a.u.
    • init_chg=file reads charge density from GS calculation

2. tools/02_postprocessing/tdofdft-tools/ — Kinetic Energy Tool

  • get_kinetic.py extracts proton kinetic energy from MD_dump output, producing a time(eV) vs kinetic energy(eV) data file.

References


lyb9812 and others added 6 commits June 1, 2026 13:43
kF_r is always real-valued (derived from std::abs), so using
std::complex<double> wastes half the memory.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When kF_r is zero (wavefunction is zero at a grid point), the
denominator 2*kF^2 becomes zero, producing inf which std::isnan()
does not catch. Also, the previous approach zeroed the entire rpot
when NaN was detected, discarding Hartree/XC/TF contributions.

Now skip the CD term when kF_r is too small, avoiding both issues.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add examples/35_tdofdft/ with Al_proton ESP calculation
  (01_gs: ground-state OFDFT, 02_td: TDOFDT proton dynamics)
- Add tools/02_postprocessing/tdofdft-tools/get_kinetic.py
  to extract proton kinetic energy curve from MD_dump

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>

@mohanchen mohanchen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mohanchen mohanchen added the Tests/Examples Issues/PR related to unit tests and integrate tests label Jun 19, 2026
@mohanchen
mohanchen merged commit 660e4d1 into deepmodeling:develop Jun 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tests/Examples Issues/PR related to unit tests and integrate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants