@@ -835,7 +835,7 @@ def plot_stresses(self, fontsize=6, **kwargs):
835
835
ax .set_xlabel (f"{ key1 } { s_tex } " , fontsize = fontsize )
836
836
ax .set_title (f"{ key1 } /{ key2 } MAE: { stats .MAE :.6f} " , fontsize = fontsize )
837
837
838
- if "title" not in kwargs : fig .suptitle (f"Stresses in (eV/Ang^2 ) for { self .structure .latex_formula } " )
838
+ if "title" not in kwargs : fig .suptitle (f"Stresses in (eV/Ang$^3$ ) for { self .structure .latex_formula } " )
839
839
return fig
840
840
841
841
@add_fig_kwargs
@@ -991,7 +991,7 @@ def plot_stress_traj(self, delta_mode=True, markersize=2, fontsize=6, **kwargs):
991
991
grid = True , legend = not delta_mode , legend_loc = "upper left" ,
992
992
ylabel = f"$|\Delta \sigma_{ voigt_comp_tex } |$ " if delta_mode else "$\sigma$ " )
993
993
994
- head = r"$\Delta \sigma$ (eV/Ang$^2 $)" if delta_mode else "Stress tensor (eV/Ang$^2 $)"
994
+ head = r"$\Delta \sigma$ (eV/Ang$^3 $)" if delta_mode else "Stress tensor (eV/Ang$^3 $)"
995
995
if "title" not in kwargs : fig .suptitle (f"{ head } for { self .structure .latex_formula } " )
996
996
997
997
return fig
@@ -1535,14 +1535,16 @@ class MyM3GNetCalculator(_MyCalculator, M3GNetCalculator):
1535
1535
if self .model_path is not None :
1536
1536
self ._model = matgl .load_model (self .model_path )
1537
1537
else :
1538
- model_name = "M3GNet-MP-2021.2.8-PES" if self .model_name is None else self .model_name
1538
+ #model_name = "M3GNet-MP-2021.2.8-PES" if self.model_name is None else self.model_name
1539
+ model_name = "M3GNet-MP-2021.2.8-DIRECT-PES" if self .model_name is None else self .model_name
1539
1540
self ._model = matgl .load_model (model_name )
1540
1541
1541
1542
class MyM3GNetCalculator (_MyCalculator , M3GNetCalculator ):
1542
1543
"""Add abi_forces and abi_stress"""
1543
1544
1544
1545
cls = MyM3GNetCalculator if with_delta else M3GNetCalculator
1545
- calc = cls (potential = self ._model )
1546
+ # stress_weight (float): conversion factor from GPa to eV/A^3, if it is set to 1.0, the unit is in GPa
1547
+ calc = cls (potential = self ._model , stress_weight = 1 / abu .eVA3_GPa )
1546
1548
1547
1549
elif self .nn_type == "chgnet" :
1548
1550
try :
0 commit comments