Commit 28bcafae by Francois Gygi

Added cell_moved() member in ExchangeOperator to resize vbasis

upon change of unit cell


git-svn-id: http://qboxcode.org/svn/qb/trunk@1354 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 6621d64b
......@@ -1024,6 +1024,9 @@ void EnergyFunctional::cell_moved(void)
for ( int ispin = 0; ispin < nlp.size(); ispin++ )
nlp[ispin][ikp]->update_twnl();
}
// Update exchange-correlation operator
xco->cell_moved();
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -366,6 +366,12 @@ void ExchangeOperator::add_stress(valarray<double>& sigma_exc)
}
////////////////////////////////////////////////////////////////////////////////
void ExchangeOperator::cell_moved(void)
{
vbasis_->resize( s_.wf.cell(),s_.wf.refcell(),4.0*s_.wf.ecut());
}
////////////////////////////////////////////////////////////////////////////////
// Exchange functions
////////////////////////////////////////////////////////////////////////////////
......
......@@ -196,6 +196,7 @@ class ExchangeOperator
double update_operator(bool compute_stress);
double apply_operator(Wavefunction& dwf);
void add_stress (std::valarray<double> & sigma_exc);
void cell_moved(void);
};
class ExchangeOperatorException
......
......@@ -871,7 +871,6 @@ Wavefunction& Wavefunction::operator=(const Wavefunction& wf)
assert(nspin_ == wf.nspin_);
assert(nrowmax_ == wf.nrowmax_);
assert(deltaspin_ == wf.deltaspin_);
//!!assert(cell_ == wf.cell_);
assert(refcell_ == wf.refcell_);
assert(ecut_ == wf.ecut_);
......
......@@ -134,3 +134,10 @@ void XCOperator::compute_stress(std::valarray<double>& sigma)
{
sigma = sigma_exc_;
}
////////////////////////////////////////////////////////////////////////////////
void XCOperator::cell_moved(void)
{
if ( hasHF() )
xop_->cell_moved();
}
......@@ -62,6 +62,7 @@ class XCOperator
void update(std::vector<std::vector<double> >& vr, bool compute_stress);
void apply_self_energy(Wavefunction &dwf);
void compute_stress(std::valarray<double>& sigma);
void cell_moved(void);
double exc(void) { return exc_ ; };
};
......
--------------------------------------------------------------------------------
rel1_57_12
--------------------------------------------------------------------------------
Added cell_moved() member in ExchangeOperator to resize vbasis
--------------------------------------------------------------------------------
rel1_57_11
--------------------------------------------------------------------------------
r1349: modified Wavefunction::operator= to allow assignment between wfs with
......
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