Skip to content

Commit 0ec3ee5

Browse files
committed
Improved the convergence of the interpolation
1 parent c75f1ac commit 0ec3ee5

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

Modules/Ensemble.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,9 @@ def get_free_energy_interpolating(self, target_supercell, support_dyn_coarse = N
16251625
This is a trick to interpolate the free energy in the
16261626
infinite volume limit.
16271627
1628+
Note, this function report the free eenrgy in the primitive cell, while the method get_free_energy
1629+
returns the energy in the supercell.
1630+
16281631
Parameters
16291632
----------
16301633
target_supercell : list (N, N, N)
@@ -1659,12 +1662,14 @@ def get_free_energy_interpolating(self, target_supercell, support_dyn_coarse = N
16591662

16601663

16611664
# Interpolate the dynamical matrix
1662-
new_dyn = self.current_dyn.Interpolate( self.current_dyn.GetSupercell(),
1663-
target_supercell,
1664-
support_dyn_coarse,
1665-
support_dyn_fine)
1665+
if support_dyn_fine is not None:
1666+
new_dyn = self.current_dyn.Interpolate( self.current_dyn.GetSupercell(),
1667+
target_supercell,
1668+
support_dyn_coarse,
1669+
support_dyn_fine)
1670+
else:
1671+
new_dyn = self.current_dyn.InterpolateMesh(target_supercell)
16661672

1667-
# TODO: Allow double interpolation in case of support dyn
16681673

16691674
# Get the new harmonic free energy
16701675
harm_fe = new_dyn.GetHarmonicFreeEnergy(self.current_T,

0 commit comments

Comments
 (0)