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 name="carbon" xlink:href="carbon.xml"
xmlns:fpmd="http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink"
xsi:schemaLocation="http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0
species.xsd">
</fpmd:species>
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