Add TDOFDFT example and kinetic energy post-processing tool - #7490
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ExampleFollows 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=101_Al_proton_ESP/02_td/— TDOFDFT proton dynamicsesolver_type=tdofdft,of_cd=1,of_mcd_alpha=2.01/rlocal potential with initial velocity 1.3 a.u.init_chg=filereads charge density from GS calculation2.
tools/02_postprocessing/tdofdft-tools/— Kinetic Energy Toolget_kinetic.pyextracts proton kinetic energy fromMD_dumpoutput, producing atime(eV) vs kinetic energy(eV)data file.References