jussilehtola pushed to libxc (el5). "Merge branch 'master' into el5"
notifications at fedoraproject.org
notifications at fedoraproject.org
Fri Apr 24 21:15:49 UTC 2015
>From eae00c9867c1c4086deed031df5d2b01c11a283f Mon Sep 17 00:00:00 2001
From: Susi Lehtola <jussilehtola at fedoraproject.org>
Date: Fri, 24 Apr 2015 23:24:24 +0200
Subject: Backport patch to some hybrids.
diff --git a/libxc-2.1.2-hybrids.patch b/libxc-2.1.2-hybrids.patch
new file mode 100644
index 0000000..5c136e2
--- /dev/null
+++ b/libxc-2.1.2-hybrids.patch
@@ -0,0 +1,114 @@
+diff -up libxc-2.1.2/src/hyb_gga_xc_cam_b3lyp.c.orig libxc-2.1.2/src/hyb_gga_xc_cam_b3lyp.c
+--- libxc-2.1.2/src/hyb_gga_xc_cam_b3lyp.c.orig 2015-02-19 14:35:44.000000000 +0100
++++ libxc-2.1.2/src/hyb_gga_xc_cam_b3lyp.c 2015-04-24 23:22:28.696184475 +0200
+@@ -31,32 +31,38 @@ XC(hyb_gga_xc_cam_b3lyp_init)(XC(func_ty
+ static int funcs_id [4] = {XC_GGA_X_B88, XC_GGA_X_ITYH, XC_LDA_C_VWN, XC_GGA_C_LYP};
+ static FLOAT funcs_coef[4];
+
++ /* Need temp variables since cam_ parameters are initialized in mix_init */
++ static FLOAT omega, alpha, beta;
++
+ switch(p->info->number){
+ case XC_HYB_GGA_XC_CAM_B3LYP:
+ /* N.B. The notation used in Yanai et al uses a different
+ convention for alpha and beta. In libxc, alpha is the weight
+ for HF exchange, which in Yanai et al is alpha+beta.
+ */
+- p->cam_omega = 0.33;
+- p->cam_alpha = 0.65;
+- p->cam_beta =-0.46;
++ omega = 0.33;
++ alpha = 0.65;
++ beta =-0.46;
+ break;
+ case XC_HYB_GGA_XC_TUNED_CAM_B3LYP:
+ /* The same note applies here. */
+- p->cam_omega = 0.150;
+- p->cam_alpha = 1.0000;
+- p->cam_beta =-0.9201;
++ omega = 0.150;
++ alpha = 1.0000;
++ beta =-0.9201;
+ break;
+ }
+
+- funcs_coef[0] = 1.0 - p->cam_alpha;
+- funcs_coef[1] = -p->cam_beta;
++ funcs_coef[0] = 1.0 - alpha;
++ funcs_coef[1] = -beta;
+ funcs_coef[2] = 1.0 - ac;
+ funcs_coef[3] = ac;
+
+ XC(mix_init)(p, 4, funcs_id, funcs_coef);
++ XC(gga_x_ityh_set_params)(p->func_aux[1], XC_GGA_X_B88, omega);
+
+- XC(gga_x_ityh_set_params)(p->func_aux[1], XC_GGA_X_B88, p->cam_omega);
++ p->cam_omega = omega;
++ p->cam_alpha = alpha;
++ p->cam_beta = beta;
+ }
+
+ const XC(func_info_type) XC(func_info_hyb_gga_xc_cam_b3lyp) = {
+diff -up libxc-2.1.2/src/hyb_gga_xc_camy_blyp.c.orig libxc-2.1.2/src/hyb_gga_xc_camy_blyp.c
+--- libxc-2.1.2/src/hyb_gga_xc_camy_blyp.c.orig 2015-02-19 14:35:44.000000000 +0100
++++ libxc-2.1.2/src/hyb_gga_xc_camy_blyp.c 2015-04-24 23:22:28.704184475 +0200
+@@ -29,19 +29,28 @@ XC(hyb_gga_xc_camy_blyp_init)(XC(func_ty
+ static int funcs_id [3] = {XC_GGA_X_B88, XC_GGA_X_SFAT, XC_GGA_C_LYP};
+ static FLOAT funcs_coef[3];
+
+- p->cam_alpha = 0.20;
+- p->cam_beta = 0.80;
+- p->cam_omega = 0.44; /* we use omega for gamma here, 'cause
+- both denote dampening parameters for
+- range related interactions */
+-
+- funcs_coef[0] = 1.0 - p->cam_alpha - p->cam_beta;
+- funcs_coef[1] = p->cam_beta; /* 1.0 - p->cam_alpha - p->cam_beta? */
++ /* N.B. The notation used in the original reference uses a different
++ convention for alpha and beta. In libxc, alpha is the weight for
++ HF exchange, which in the original reference is alpha+beta.
++ */
++ FLOAT alpha, beta, omega;
++
++ alpha = 1.00;
++ beta =-0.80;
++ omega = 0.44; /* we use omega for gamma here, 'cause
++ both denote dampening parameters for
++ range related interactions */
++
++ funcs_coef[0] = 1.0 - alpha;
++ funcs_coef[1] =-beta;
+ funcs_coef[2] = 1.0;
+
+ XC(mix_init)(p, 3, funcs_id, funcs_coef);
+-
+ XC(gga_x_sfat_set_params)(p->func_aux[1], XC_GGA_X_B88, p->cam_omega);
++
++ p->cam_omega=omega;
++ p->cam_alpha=alpha;
++ p->cam_beta=beta;
+ }
+
+ const XC(func_info_type) XC(func_info_hyb_gga_xc_camy_blyp) = {
+diff -up libxc-2.1.2/src/hyb_gga_xc_hse.c.orig libxc-2.1.2/src/hyb_gga_xc_hse.c
+--- libxc-2.1.2/src/hyb_gga_xc_hse.c.orig 2015-02-19 14:35:44.000000000 +0100
++++ libxc-2.1.2/src/hyb_gga_xc_hse.c 2015-04-24 23:22:28.688184475 +0200
+@@ -121,9 +121,6 @@ hyb_gga_xc_hjs_init(XC(func_type) *p)
+ static int funcs_id [3] = {-1, -1, XC_GGA_C_PBE};
+ static FLOAT funcs_coef[3] = {1.0, -0.25, 1.0};
+
+- p->cam_omega = 0.11;
+- p->cam_beta = 0.25;
+-
+ switch(p->info->number){
+ case XC_HYB_GGA_XC_HJS_PBE:
+ funcs_id[0] = funcs_id[1] = XC_GGA_X_HJS_PBE;
+@@ -143,6 +140,8 @@ hyb_gga_xc_hjs_init(XC(func_type) *p)
+ }
+
+ XC(mix_init)(p, 3, funcs_id, funcs_coef);
++ p->cam_omega = 0.11;
++ p->cam_beta = 0.25;
+ XC(gga_x_hjs_set_params)(p->func_aux[1], p->cam_omega);
+ }
+
diff --git a/libxc.spec b/libxc.spec
index f7ab1d5..655ea20 100644
--- a/libxc.spec
+++ b/libxc.spec
@@ -8,15 +8,17 @@
Name: libxc
Summary: Library of exchange and correlation functionals to be used in DFT codes
Version: 2.1.2
-Release: 2%{?dist}
+Release: 3%{?dist}
License: LGPLv3+
Group: Applications/Engineering
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Source0: http://www.tddft.org/programs/octopus/down.php?file=libxc/libxc-%{version}.tar.gz
# Workaround for BZ #1079415 causing builds to fail on ppc archs in EPEL
Patch0: libxc-2.1.0-ppc.patch
-# Fix broken makefile
+# Fix broken makefile (from upstream)
Patch1: libxc-2.1.2-build.patch
+# Fix hybrids (from upstream)
+Patch2: libxc-2.1.2-hybrids.patch
URL: http://www.tddft.org/programs/octopus/wiki/index.php/Libxc
BuildRequires: gcc-gfortran
@@ -63,6 +65,7 @@ in order to compile programs against libxc.
%endif
%patch1 -p1 -b .build
+%patch2 -p1 -b .hybrids
autoreconf -i
%build
@@ -110,6 +113,9 @@ rm -rf %{buildroot}
%{_libdir}/pkgconfig/libxc.pc
%changelog
+* Fri Apr 24 2015 Susi Lehtola <jussilehtola at fedoraproject.org> - 2.1.2-3
+- Patch some hybrids.
+
* Fri Apr 24 2015 Susi Lehtola <jussilehtola at fedoraproject.org> - 2.1.2-2
- Patch broken makefiles.
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/libxc.git/commit/?h=el5&id=941a66517805eb987c0fa15ef8073e4062fa1e7c
More information about the scm-commits
mailing list