Skip to content

Commit

Permalink
More debug outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexsp32 committed Aug 16, 2023
1 parent a040b84 commit e3321be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/InitialConditions/QuantisedDiatomic/QuantisedDiatomic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ end
height=10, normal_vector=[0, 0, 1])
Quantise the vibrational and rotational degrees of freedom for the specified
positions and velocities
positions and velocities.

Check warning on line 239 in src/InitialConditions/QuantisedDiatomic/QuantisedDiatomic.jl

View check run for this annotation

Codecov / codecov/patch

src/InitialConditions/QuantisedDiatomic/QuantisedDiatomic.jl#L238-L239

Added lines #L238 - L239 were not covered by tests
If the potential can be evaluated for the diatomic only, independent of position,
supplying a `Simulation` for just the diatomic will speed up evaluation.
When evaluating the potential, the molecule is moved to `height` in direction `normal_vector`.
If the potential is independent of centre of mass position, this has no effect.
Expand Down Expand Up @@ -264,6 +267,8 @@ function quantise_diatomic(sim::Simulation, v::Matrix, r::Matrix;
v, slab_v = separate_slab_and_molecule(atom_indices, v)
environment = EvaluationEnvironment(atom_indices, size(sim), slab, austrip(height), surface_normal)

@debug "After PBC check and separation from slab, diatomic positions are:\n$(r)"

r_com = subtract_centre_of_mass(r, masses(sim)[atom_indices])
v_com = subtract_centre_of_mass(v, masses(sim)[atom_indices])
p_com = v_com .* masses(sim)[atom_indices]'
Expand Down

0 comments on commit e3321be

Please sign in to comment.