Commit 14e9be36 by Francois Gygi

rel1_33_4


git-svn-id: http://qboxcode.org/svn/qb/trunk@513 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 64d715d5
......@@ -3,7 +3,7 @@
// AtomSet.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: AtomSet.C,v 1.15 2007-08-14 04:11:19 fgygi Exp $
// $Id: AtomSet.C,v 1.16 2007-10-16 18:23:20 fgygi Exp $
#include "AtomSet.h"
#include "Species.h"
......@@ -350,7 +350,6 @@ D3vector AtomSet::vcm(void) const
for ( int is = 0; is < atom_list.size(); is++ )
{
double mass = species_list[is]->mass();
int i = 0;
for ( int ia = 0; ia < atom_list[is].size(); ia++ )
{
D3vector v = atom_list[is][ia]->velocity();
......@@ -389,7 +388,6 @@ D3vector AtomSet::dipole(void) const
for ( int is = 0; is < atom_list.size(); is++ )
{
double charge = species_list[is]->zval();
int i = 0;
for ( int ia = 0; ia < atom_list[is].size(); ia++ )
{
D3vector p = atom_list[is][ia]->position();
......
......@@ -3,7 +3,7 @@
// BOSampleStepper.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: BOSampleStepper.C,v 1.31 2007-09-30 04:45:52 fgygi Exp $
// $Id: BOSampleStepper.C,v 1.32 2007-10-16 18:23:20 fgygi Exp $
#include "BOSampleStepper.h"
#include "EnergyFunctional.h"
......@@ -57,6 +57,10 @@ BOSampleStepper::~BOSampleStepper()
void BOSampleStepper::step(int niter)
{
const bool onpe0 = s_.ctxt_.onpe0();
const bool anderson_charge_mixing =
( s_.ctrl.debug.find("AND_CHMIX") != string::npos );
// determine whether eigenvectors must be computed
// eigenvectors are computed if explicitly requested with wf_diag==T
// or if the SlaterDet has fractionally occupied states
......@@ -64,6 +68,8 @@ void BOSampleStepper::step(int niter)
const bool compute_eigvec = fractional_occ || s_.ctrl.wf_diag == "T";
enum ortho_type { GRAM, LOWDIN, ORTHO_ALIGN, RICCATI };
const bool extrapolate_wf = !fractional_occ;
AtomSet& atoms = s_.atoms;
Wavefunction& wf = s_.wf;
const int nspin = wf.nspin();
......@@ -78,9 +84,6 @@ void BOSampleStepper::step(int niter)
const string atoms_dyn = s_.ctrl.atoms_dyn;
const string cell_dyn = s_.ctrl.cell_dyn;
const bool extrapolate_wf = true;
//const bool extrapolate_wf = !fractional_occ;
if ( onpe0 ) cout << " extrapolate_wf=" << extrapolate_wf << endl;
const bool ntc_extrapolation =
s_.ctrl.debug.find("NTC_EXTRAPOLATION") != string::npos;
......@@ -88,7 +91,8 @@ void BOSampleStepper::step(int niter)
s_.ctrl.debug.find("ASP_EXTRAPOLATION") != string::npos;
Wavefunction* wfmm;
if ( ntc_extrapolation || asp_extrapolation ) wfmm = new Wavefunction(wf);
if ( extrapolate_wf && ( ntc_extrapolation || asp_extrapolation ) )
wfmm = new Wavefunction(wf);
const bool compute_hpsi = ( wf_dyn != "LOCKED" );
const bool compute_forces = ( atoms_dyn != "LOCKED" );
......@@ -143,7 +147,7 @@ void BOSampleStepper::step(int niter)
cell_stepper = new SDCellStepper(s_);
// Allocate wavefunction velocity if not available
if ( atoms_dyn != "LOCKED" )
if ( atoms_dyn != "LOCKED" && extrapolate_wf )
{
if ( s_.wfv == 0 )
{
......@@ -529,7 +533,6 @@ void BOSampleStepper::step(int niter)
vector<complex<double> > drhog_bar(rhog_current.size());
AndersonMixer mixer(2*rhog_current.size(),&cd_.vcontext());
mixer.set_theta_max(2.0);
//mixer.set_theta_nc(1.0);
wf_stepper->preprocess();
for ( int itscf = 0; itscf < nitscf_; itscf++ )
......@@ -548,6 +551,7 @@ void BOSampleStepper::step(int niter)
if ( itscf == 0 )
{
rhog_current = cd_.rhog[0];
rhog_last = cd_.rhog[0];
}
// compute correction drhog
......@@ -587,7 +591,6 @@ void BOSampleStepper::step(int niter)
drhog_bar[i] = drhog[i];
}
const bool anderson_charge_mixing = true;
if ( anderson_charge_mixing )
{
mixer.update((double*)&drhog[0],&theta,(double*)&drhog_bar[0]);
......@@ -753,7 +756,7 @@ void BOSampleStepper::step(int niter)
s_.constraints.update_constraints(dt);
} // for iter
if ( compute_forces )
if ( compute_forces && extrapolate_wf )
{
// compute wavefunction velocity after last iteration
// s_.wfv contains the previous wavefunction
......
......@@ -3,7 +3,7 @@
// ComputeMLWFCmd.C:
//
////////////////////////////////////////////////////////////////////////////////
// $Id: ComputeMLWFCmd.C,v 1.3 2007-10-12 19:37:44 fgygi Exp $
// $Id: ComputeMLWFCmd.C,v 1.4 2007-10-16 18:23:20 fgygi Exp $
#include "ComputeMLWFCmd.h"
#include<iostream>
......@@ -50,4 +50,5 @@ int ComputeMLWFCmd::action(int argc, char **argv)
<< " </total_dipole_length>" << endl;
}
delete mlwft;
return 0;
}
......@@ -3,7 +3,7 @@
// EnergyFunctional.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: EnergyFunctional.C,v 1.23 2007-01-27 23:46:31 fgygi Exp $
// $Id: EnergyFunctional.C,v 1.24 2007-10-16 18:23:20 fgygi Exp $
#include "EnergyFunctional.h"
#include "Sample.h"
......@@ -711,7 +711,6 @@ double EnergyFunctional::energy(bool compute_hpsi, Wavefunction& dwf,
sigma_ehart + sigma_exc + sigma_esr;
if ( debug_stress && s_.ctxt_.onpe0() )
{
const double gpa = 29421.5;
cout.setf(ios::fixed,ios::floatfield);
cout.setf(ios::right,ios::adjustfield);
cout << setprecision(8);
......
......@@ -3,7 +3,7 @@
// BLAS Header file
//
////////////////////////////////////////////////////////////////////////////////
// $Id: blas.h,v 1.4 2007-03-17 01:14:00 fgygi Exp $
// $Id: blas.h,v 1.5 2007-10-16 18:23:20 fgygi Exp $
#ifndef BLAS_H
#define BLAS_H
......@@ -18,6 +18,7 @@
#define zcopy zcopy_
#define daxpy daxpy_
#define ddot ddot_
#define dnrm2 dnrm2_
#define drot drot_
#define dasum dasum_
#define dsbmv dsbmv_
......@@ -32,6 +33,7 @@
#define dyax dyax_
#define dnaxpy dnaxpy_
#define dger dger_
#define zgemm zgemm_
#endif
#ifdef __cplusplus
......@@ -46,10 +48,15 @@ void daxpy(int *n, double *alpha, double *x, int *incx,
double *y, int *incy );
double ddot(const int *n, const double *a, const int *inca,
const double *b, const int *incb);
double dnrm2(const int *n, const double *a, const int *inca);
void drot(int*, double*, int*, double*, int*, double*, double*);
void dgemm(char *ta, char *tb, int *m, int *n, int *k,
double *alpha, double *a, int *lda, double *b, int *ldb,
double *beta, double *c, int *ldc);
double *alpha, double *a, int *lda, double *b, int *ldb,
double *beta, double *c, int *ldc);
void zgemm(char *ta, char *tb, int *m, int *n, int *k,
std::complex<double> *alpha, std::complex<double> *a, int *lda,
std::complex<double> *b, int *ldb,
std::complex<double> *beta, std::complex<double> *c, int *ldc);
void dgemv( char *ta, int *m, int *n,
double *alpha, double *a, int *tda,
double *x, int *incx,
......
......@@ -33,6 +33,13 @@ with srand48(ctxt.myproc()).
Could reinitialize the seed in MDIonicsStepper.C using a common value identical
on all processors.
--------------------------------------------------------------------------------
rel1_33_4
ComputeMLWFCmd.C: fixed memory leak.
blas.h: added zgemm, dnrm2.
BOSampleStepper.C: disabled Anderson acceleration of charge mixing by default,
can be enabled with debug="AND_CHMIX"
AtomSet.C: removed unused variables.
--------------------------------------------------------------------------------
rel1_33_3
BOSampleStepper.C: extrapolation: restored alignment before extrapolation
ChargeMixCoeff.h: changed default value back to 0.5
......
......@@ -3,7 +3,7 @@
// qb.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: qb.C,v 1.53 2007-08-13 21:26:04 fgygi Exp $
// $Id: qb.C,v 1.54 2007-10-16 18:23:20 fgygi Exp $
#include <iostream>
#include <string>
......@@ -129,8 +129,8 @@ int main(int argc, char **argv, char **envp)
cout << " I I\n";
cout << " I I\n";
cout << " I I\n";
cout << " I F.Gygi, UC Davis I\n";
cout << " I Copyright (c) 2005-2006 I\n";
cout << " I I\n";
cout << " I http://eslab.ucdavis.edu I\n";
cout << " ============================\n\n";
cout << "-->\n";
cout << "<fpmd:simulation xmlns:fpmd=\"" << qbox_xmlns() << "\">" << endl;
......
......@@ -3,10 +3,10 @@
// release.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: release.C,v 1.36 2007-09-30 04:49:29 fgygi Exp $
// $Id: release.C,v 1.37 2007-10-16 18:23:21 fgygi Exp $
#include "release.h"
std::string release(void)
{
return std::string("1.33.3");
return std::string("1.33.4");
}
<?xml version="1.0" encoding="UTF-8"?>
<fpmd:species xmlns:fpmd="http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0
species.xsd">
<description>Hamann carbon PBE</description>
<symbol>C</symbol>
<atomic_number> 6 </atomic_number>
<mass>12.0</mass>
<norm_conserving_pseudopotential>
<valence_charge> 4 </valence_charge>
<lmax> 1 </lmax>
<llocal> 1 </llocal>
<nquad> 0 </nquad>
<rquad> 0.0 </rquad>
<mesh_spacing> 0.01 </mesh_spacing>
<projector l="0" size="600">
<radial_potential>
-0.33768940E+00
-0.33360430E+00
-0.32578676E+00
-0.31610384E+00
-0.30524592E+00
-0.29367672E+00
-0.28175347E+00
-0.26977251E+00
-0.25799115E+00
-0.24663970E+00
-0.23592854E+00
-0.22605258E+00
-0.21719419E+00
-0.20952521E+00
-0.20320839E+00
-0.19839843E+00
-0.19524272E+00
-0.19388193E+00
-0.19445036E+00
-0.19707620E+00
-0.20188170E+00
-0.20898313E+00
-0.21849081E+00
-0.23050894E+00
-0.24513541E+00
-0.26246156E+00
-0.28257190E+00
-0.30554379E+00
-0.33144710E+00
-0.36034379E+00
-0.39228763E+00
-0.42732372E+00
-0.46548820E+00
-0.50680781E+00
-0.55129959E+00
-0.59897047E+00
-0.64981703E+00
-0.70382517E+00
-0.76096984E+00
-0.82121481E+00
-0.88451245E+00
-0.95080354E+00
-0.10200171E+01
-0.10920704E+01
-0.11668686E+01
-0.12443049E+01
-0.13242603E+01
-0.14066037E+01
-0.14911919E+01
-0.15778697E+01
-0.16664698E+01
-0.17568133E+01
-0.18487094E+01
-0.19419562E+01
-0.20363411E+01
-0.21316411E+01
-0.22276235E+01
-0.23240467E+01
-0.24206615E+01
-0.25172116E+01
-0.26134351E+01
-0.27090657E+01
-0.28038345E+01
-0.28974710E+01
-0.29897050E+01
-0.30802681E+01
-0.31688958E+01
-0.32553288E+01
-0.33393146E+01
-0.34206104E+01
-0.34989821E+01
-0.35742101E+01
-0.36460862E+01
-0.37144161E+01
-0.37790283E+01
-0.38397704E+01
-0.38965006E+01
-0.39490887E+01
-0.39974393E+01
-0.40414747E+01
-0.40811419E+01
-0.41164025E+01
-0.41472484E+01
-0.41736863E+01
-0.41957520E+01
-0.42134952E+01
-0.42269942E+01
-0.42363395E+01
-0.42416481E+01
-0.42430481E+01
-0.42406894E+01
-0.42347338E+01
-0.42253573E+01
-0.42127491E+01
-0.41971053E+01
-0.41786338E+01
-0.41575453E+01
-0.41340570E+01
-0.41083879E+01
-0.40807565E+01
-0.40513811E+01
-0.40204769E+01
-0.39882520E+01
-0.39549124E+01
-0.39206520E+01
-0.38856571E+01
-0.38501074E+01
-0.38141641E+01
-0.37779843E+01
-0.37417096E+01
-0.37054652E+01
-0.36693727E+01
-0.36335318E+01
-0.35980320E+01
-0.35629567E+01
-0.35283671E+01
-0.34943191E+01
-0.34608605E+01
-0.34280207E+01
-0.33958268E+01
-0.33642974E+01
-0.33334382E+01
-0.33032535E+01
-0.32737414E+01
-0.32448917E+01
-0.32166930E+01
-0.31891310E+01
-0.31621863E+01
-0.31358392E+01
-0.31100689E+01
-0.30848528E+01
-0.30601683E+01
-0.30359926E+01
-0.30123038E+01
-0.29890801E+01
-0.29663000E+01
-0.29439438E+01
-0.29219930E+01
-0.29004290E+01
-0.28792348E+01
-0.28583956E+01
-0.28378967E+01
-0.28177240E+01
-0.27978656E+01
-0.27783105E+01
-0.27590477E+01
-0.27400672E+01
-0.27213608E+01
-0.27029201E+01
-0.26847370E+01
-0.26668048E+01
-0.26491171E+01
-0.26316677E+01
-0.26144505E+01
-0.25974603E+01
-0.25806923E+01
-0.25641414E+01
-0.25478028E+01
-0.25316724E+01
-0.25157460E+01
-0.25000195E+01
-0.24844888E+01
-0.24691504E+01
-0.24540006E+01
-0.24390358E+01
-0.24242525E+01
-0.24096476E+01
-0.23952178E+01
-0.23809598E+01
-0.23668706E+01
-0.23529472E+01
-0.23391868E+01
-0.23255865E+01
-0.23121433E+01
-0.22988548E+01
-0.22857181E+01
-0.22727308E+01
-0.22598902E+01
-0.22471939E+01
-0.22346395E+01
-0.22222247E+01
-0.22099470E+01
-0.21978042E+01
-0.21857942E+01
-0.21739147E+01
-0.21621637E+01
-0.21505390E+01
-0.21390387E+01
-0.21276607E+01
-0.21164032E+01
-0.21052641E+01
-0.20942417E+01
-0.20833341E+01
-0.20725395E+01
-0.20618563E+01
-0.20512826E+01
-0.20408168E+01
-0.20304572E+01
-0.20202024E+01
-0.20100506E+01
-0.20000003E+01
-0.19900499E+01
-0.19801982E+01
-0.19704435E+01
-0.19607844E+01
-0.19512196E+01
-0.19417476E+01
-0.19323671E+01
-0.19230769E+01
-0.19138756E+01
-0.19047619E+01
-0.18957345E+01
-0.18867923E+01
-0.18779342E+01
-0.18691588E+01
-0.18604650E+01
-0.18518517E+01
-0.18433178E+01
-0.18348622E+01
-0.18264839E+01
-0.18181817E+01
-0.18099546E+01
-0.18018016E+01
-0.17937218E+01
-0.17857141E+01
-0.17777776E+01
-0.17699113E+01
-0.17621143E+01
-0.17543857E+01
-0.17467246E+01
-0.17391302E+01
-0.17316015E+01
-0.17241377E+01
-0.17167379E+01
-0.17094014E+01
-0.17021274E+01
-0.16949150E+01
-0.16877635E+01
-0.16806720E+01
-0.16736399E+01
-0.16666664E+01
-0.16597508E+01
-0.16528923E+01
-0.16460903E+01
-0.16393440E+01
-0.16326528E+01
-0.16260160E+01
-0.16194329E+01
-0.16129030E+01
-0.16064255E+01
-0.15999998E+01
-0.15936252E+01
-0.15873013E+01
-0.15810274E+01
-0.15748029E+01
-0.15686272E+01
-0.15624998E+01
-0.15564200E+01
-0.15503873E+01
-0.15444013E+01
-0.15384613E+01
-0.15325668E+01
-0.15267173E+01
-0.15209123E+01
-0.15151513E+01
-0.15094337E+01
-0.15037591E+01
-0.14981271E+01
-0.14925371E+01
-0.14869886E+01
-0.14814812E+01
-0.14760145E+01
-0.14705880E+01
-0.14652012E+01
-0.14598538E+01
-0.14545452E+01
-0.14492751E+01
-0.14440431E+01
-0.14388487E+01
-0.14336915E+01
-0.14285712E+01
-0.14234873E+01
-0.14184395E+01
-0.14134273E+01
-0.14084505E+01
-0.14035085E+01
-0.13986012E+01
-0.13937280E+01
-0.13888887E+01
-0.13840828E+01
-0.13793101E+01
-0.13745702E+01
-0.13698628E+01
-0.13651875E+01
-0.13605440E+01
-0.13559320E+01
-0.13513512E+01
-0.13468012E+01
-0.13422817E+01
-0.13377924E+01
-0.13333331E+01
-0.13289035E+01
-0.13245031E+01
-0.13201318E+01
-0.13157893E+01
-0.13114752E+01
-0.13071893E+01
-0.13029314E+01
-0.12987011E+01
-0.12944982E+01
-0.12903224E+01
-0.12861735E+01
-0.12820511E+01
-0.12779551E+01
-0.12738852E+01
-0.12698411E+01
-0.12658226E+01
-0.12618295E+01
-0.12578615E+01
-0.12539183E+01
-0.12499998E+01
-0.12461057E+01
-0.12422358E+01
-0.12383899E+01
-0.12345677E+01
-0.12307691E+01
-0.12269937E+01
-0.12232414E+01
-0.12195120E+01
-0.12158053E+01
-0.12121210E+01
-0.12084590E+01
-0.12048191E+01
-0.12012011E+01
-0.11976047E+01
-0.11940297E+01
-0.11904761E+01
-0.11869435E+01
-0.11834318E+01
-0.11799408E+01
-0.11764704E+01
-0.11730204E+01
-0.11695905E+01
-0.11661806E+01
-0.11627906E+01
-0.11594202E+01
-0.11560692E+01
-0.11527376E+01
-0.11494251E+01
-0.11461317E+01
-0.11428570E+01
-0.11396010E+01
-0.11363635E+01
-0.11331444E+01
-0.11299434E+01
-0.11267604E+01
-0.11235954E+01
-0.11204480E+01
-0.11173183E+01
-0.11142060E+01
-0.11111110E+01
-0.11080331E+01
-0.11049723E+01
-0.11019283E+01
-0.10989010E+01
-0.10958903E+01
-0.10928960E+01
-0.10899181E+01
-0.10869564E+01
-0.10840107E+01
-0.10810810E+01
-0.10781670E+01
-0.10752687E+01
-0.10723859E+01
-0.10695186E+01
-0.10666665E+01
-0.10638297E+01
-0.10610079E+01
-0.10582010E+01
-0.10554089E+01
-0.10526315E+01
-0.10498687E+01
-0.10471203E+01
-0.10443863E+01
-0.10416666E+01
-0.10389609E+01
-0.10362693E+01
-0.10335916E+01
-0.10309278E+01
-0.10282776E+01
-0.10256409E+01
-0.10230178E+01
-0.10204081E+01
-0.10178116E+01
-0.10152283E+01
-0.10126581E+01
-0.10101009E+01
-0.10075566E+01
-0.10050250E+01
-0.10025062E+01
-0.99999992E+00
-0.99750614E+00
-0.99502478E+00
-0.99255574E+00
-0.99009892E+00
-0.98765423E+00
-0.98522159E+00
-0.98280091E+00
-0.98039209E+00
-0.97799504E+00
-0.97560968E+00
-0.97323593E+00
-0.97087370E+00
-0.96852291E+00
-0.96618349E+00
-0.96385534E+00
-0.96153839E+00
-0.95923255E+00
-0.95693774E+00
-0.95465387E+00
-0.95238088E+00
-0.95011869E+00
-0.94786722E+00
-0.94562640E+00
-0.94339615E+00
-0.94117639E+00
-0.93896707E+00
-0.93676809E+00
-0.93457938E+00
-0.93240088E+00
-0.93023250E+00
-0.92807418E+00
-0.92592585E+00
-0.92378745E+00
-0.92165891E+00
-0.91954016E+00
-0.91743112E+00
-0.91533175E+00
-0.91324195E+00
-0.91116168E+00
-0.90909086E+00
-0.90702942E+00
-0.90497731E+00
-0.90293447E+00
-0.90090083E+00
-0.89887634E+00
-0.89686092E+00
-0.89485452E+00
-0.89285709E+00
-0.89086855E+00
-0.88888884E+00
-0.88691791E+00
-0.88495570E+00
-0.88300215E+00
-0.88105721E+00
-0.87912082E+00
-0.87719292E+00
-0.87527346E+00
-0.87336239E+00
-0.87145964E+00
-0.86956517E+00
-0.86767892E+00
-0.86580083E+00
-0.86393084E+00
-0.86206892E+00
-0.86021500E+00
-0.85836904E+00
-0.85653099E+00
-0.85470080E+00
-0.85287841E+00
-0.85106378E+00
-0.84925686E+00
-0.84745759E+00
-0.84566593E+00
-0.84388182E+00
-0.84210522E+00
-0.84033609E+00
-0.83857437E+00
-0.83682003E+00
-0.83507302E+00
-0.83333328E+00
-0.83160078E+00
-0.82987548E+00
-0.82815731E+00
-0.82644625E+00
-0.82474224E+00
-0.82304523E+00
-0.82135520E+00
-0.81967209E+00
-0.81799587E+00
-0.81632648E+00
-0.81466390E+00
-0.81300808E+00
-0.81135898E+00
-0.80971656E+00
-0.80808077E+00
-0.80645158E+00
-0.80482895E+00
-0.80321282E+00
-0.80160318E+00
-0.79999996E+00
-0.79840315E+00
-0.79681271E+00
-0.79522858E+00
-0.79365075E+00
-0.79207917E+00
-0.79051380E+00
-0.78895460E+00
-0.78740155E+00
-0.78585459E+00
-0.78431370E+00
-0.78277884E+00
-0.78124997E+00
-0.77972706E+00
-0.77821008E+00
-0.77669899E+00
-0.77519376E+00
-0.77369435E+00
-0.77220074E+00
-0.77071288E+00
-0.76923074E+00
-0.76775430E+00
-0.76628351E+00
-0.76481834E+00
-0.76335876E+00
-0.76190474E+00
-0.76045624E+00
-0.75901325E+00
-0.75757572E+00
-0.75614363E+00
-0.75471695E+00
-0.75329564E+00
-0.75187967E+00
-0.75046902E+00