-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit tests for diatomic analysis functions for desorption
- Loading branch information
Showing
5 changed files
with
157,845 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Test | ||
using NQCDynamics | ||
using Unitful, UnitfulAtomic | ||
using PyCall | ||
using NQCDynamics, NQCModels | ||
using JLD2 | ||
|
||
@testset "Desorption Analysis" begin | ||
ase_io=pyimport("ase.io") | ||
desorption_trajectory_ase=ase_io.read("artifacts/desorption_test.xyz", index=":") | ||
desorption_dynamicsvariables=jldopen("artifacts/desorption_dynamics.jld2")["trajectory"] | ||
# Make a dummmy simulation out of the first structure (we don't need a working potential to test. ) | ||
atoms, initial_positions, cell=NQCDynamics.NQCBase.convert_from_ase_atoms(desorption_trajectory_ase[1]) | ||
simulation=Simulation(atoms, AdiabaticASEModel(desorption_trajectory_ase[1]), cell=cell) | ||
diatomic_indices=[55,56] | ||
@test @time "DesorptionFrame - No views" get_desorption_frame_noviews(desorption_dynamicsvariables, diatomic_indices, simulation; surface_distance_threshold=2.4u"Å") == 2675 | ||
@test @time "DesorptionFrame - With views" get_desorption_frame_views(desorption_dynamicsvariables, diatomic_indices, simulation; surface_distance_threshold=2.4u"Å") == 2675 | ||
@test @time "DesorptionAngle - No views" get_desorption_angle(desorption_dynamicsvariables, diatomic_indices, simulation; surface_distance_threshold=2.4u"Å", evaluation_function=get_desorption_frame_noviews) ≈ 28.05088202518 | ||
@test @time "DesorptionAngle - With views" get_desorption_angle(desorption_dynamicsvariables, diatomic_indices, simulation; surface_distance_threshold=2.4u"Å", evaluation_function=get_desorption_frame_views) ≈ 28.05088202518 | ||
end | ||
|
Binary file not shown.
Oops, something went wrong.