Commit 5518896b by Francois Gygi

Added tests in VWN functional for negative charge.


git-svn-id: http://qboxcode.org/svn/qb/trunk@1843 cba15fb0-1239-40c8-b417-11db7ca47a34
parent cc341a4b
......@@ -23,8 +23,6 @@
#include <cassert>
#include <vector>
#include "VWNFunctional.h"
#include<iostream>
using namespace std;
////////////////////////////////////////////////////////////////////////////////
......@@ -81,7 +79,7 @@ void VWNFunctional::ecvwn(const double rh, double &ec, double &vc)
}
////////////////////////////////////////////////////////////////////////////////
void VWNFunctional::exvwn_sp(const double roe_up, const double roe_dn,
void VWNFunctional::exvwn_sp(double roe_up, double roe_dn,
double &ex, double &vx_up, double &vx_dn)
{
const double fz_prefac = 1.0 / ( cbrt(2.0)*2.0 - 2.0 );
......@@ -90,6 +88,8 @@ void VWNFunctional::exvwn_sp(const double roe_up, const double roe_dn,
vx_up = 0.0;
vx_dn = 0.0;
if ( roe_up < 0.0 ) roe_up = 0.0;
if ( roe_dn < 0.0 ) roe_dn = 0.0;
const double roe = roe_up + roe_dn;
if ( roe > 0.0 )
......@@ -118,7 +118,7 @@ void VWNFunctional::exvwn_sp(const double roe_up, const double roe_dn,
}
////////////////////////////////////////////////////////////////////////////////
void VWNFunctional::ecvwn_sp(const double roe_up, const double roe_dn,
void VWNFunctional::ecvwn_sp(double roe_up, double roe_dn,
double &ec, double &vc_up, double &vc_dn)
{
const double fz_prefac = 1.0 / ( cbrt(2.0)*2.0 - 2.0 );
......@@ -127,6 +127,8 @@ void VWNFunctional::ecvwn_sp(const double roe_up, const double roe_dn,
vc_up = 0.0;
vc_dn = 0.0;
if ( roe_up < 0.0 ) roe_up = 0.0;
if ( roe_dn < 0.0 ) roe_dn = 0.0;
const double roe = roe_up + roe_dn;
if ( roe > 0.0 )
......
......@@ -69,9 +69,9 @@ class VWNFunctional : public XCFunctional
static void exvwn(const double rh, double &ex, double &vx);
static void ecvwn(const double rh, double &ec, double &vc);
static void exvwn_sp(const double roe_up, const double roe_dn,
static void exvwn_sp(double roe_up, double roe_dn,
double &ex, double &vx_up, double &vx_dn);
static void ecvwn_sp(const double roe_up, const double roe_dn,
static void ecvwn_sp(double roe_up, double roe_dn,
double &ec, double &vc_up, double &vc_dn);
bool isGGA() const { return false; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment