Commit d62b0ca7 by Francois Gygi

Clean up long lines and space

parent 98000f69
......@@ -226,7 +226,8 @@ EnergyFunctional::~EnergyFunctional(void)
}
////////////////////////////////////////////////////////////////////////////////
void EnergyFunctional::update_vhxc(bool compute_stress, bool update_vh, bool update_vxc)
void EnergyFunctional::update_vhxc(bool compute_stress, bool update_vh,
bool update_vxc)
{
// called when the charge density has changed
// update Hartree and xc potentials using the charge density cd_
......
......@@ -31,7 +31,8 @@ using namespace std;
#include "FourierTransform.h"
#include "Base64Transcoder.h"
bool abs_compare(const double &a, const double &b){
bool abs_compare(const double &a, const double &b)
{
return (abs(a) < abs(b));
}
......@@ -274,8 +275,8 @@ void ExternalPotential::update(const ChargeDensity& cd)
{
cout << " ExternalPotential::update: read external potential from file: "
<< filename_ << endl;
cout << " ExternalPotential::update: grid size n0 = " << n_[0] << ", n1 = " << n_[1]
<< ", n2 = " << n_[2] << endl;
cout << " ExternalPotential::update: grid size n0 = "
<< n_[0] << ", n1 = " << n_[1] << ", n2 = " << n_[2] << endl;
cout << " ExternalPotential::update: ecut: " << ecut_ << endl;
if ( amplitude_ != 0 )
cout << " ExternalPotential::update: amplitude: " << amplitude_ << endl;
......@@ -287,13 +288,15 @@ void ExternalPotential::update(const ChargeDensity& cd)
// would be suitable. Here the amplitude is set to scale the
// magnitude of vext to be 1.0E-3 hartree
if (vext_read_loc.size() > 0)
magnitude_ = abs(*max_element( vext_read_loc.begin(), vext_read_loc.end(), abs_compare));
magnitude_ = abs(*max_element(vext_read_loc.begin(),
vext_read_loc.end(), abs_compare));
ctxt->dmax('C',1,1,&magnitude_,1);
MPI_Bcast(&magnitude_,1,MPI_DOUBLE,0,vcomm);
amplitude_ = 1.0E-3 / magnitude_;
if ( onpe0 )
cout << " ExternalPotential::update: amplitude automatically determined to be "
<< amplitude_ << " (max abs value of vext = " << magnitude_ << ")" << endl;
cout << " ExternalPotential::update: amplitude automatically"
<< " determined to be " << amplitude_
<< " (max abs value of vext = " << magnitude_ << ")" << endl;
}
time = tm_read_vext.real();
......
......@@ -46,7 +46,9 @@ class ExternalPotential
ExternalPotential(Sample& s, std::string name, std::string io="cube",
int nx=0, int ny=0, int nz=0):
s_(s), filename_(name), ecut_(0.0), amplitude_(1.0), magnitude_(0.0), io_(io){
s_(s), filename_(name), ecut_(0.0), amplitude_(1.0), magnitude_(0.0),
io_(io)
{
assert( io_ == "cube" || io == "base64_serial" || io == "base64_parallel" );
if (io != "cube")
{
......
......@@ -38,7 +38,8 @@ int ResponseCmd::action(int argc, char **argv)
{
// " syntax: response amplitude nitscf [nite]\n\n"
// " syntax: response -vext vext_file [-RPA|-IPA] [-amplitude a]
// [-io iomode -nx nx -ny ny -nz nz] [-q qx qy qz] nitscf [nite]\n\n"
// [-io iomode -nx nx -ny ny -nz nz]
// [-q qx qy qz] nitscf [nite]\n\n"
if ( s->wf.nst() == 0 )
{
......@@ -243,13 +244,15 @@ void ResponseCmd::responseEfield(double amplitude, int nitscf, int nite)
}
////////////////////////////////////////////////////////////////////////////////
void ResponseCmd::responseVext(bool rpa, bool ipa, int nitscf, int nite, string io)
void ResponseCmd::responseVext(bool rpa, bool ipa, int nitscf, int nite,
string io)
{
// if (ui->onpe0())
// {
// cout << "ResponseCmd:responseVext:\n"
// << "RPA = " << rpa << ", IPA = " << ipa << ", io = " << io
// << ", q = " << q << ", nitscf = " << nitscf << ", nite = " << nite << "\n";
// << ", q = " << q << ", nitscf = " << nitscf << ", nite = "
// << nite << "\n";
// }
s->wf.info(cout, "wavefunction");
......@@ -509,7 +512,8 @@ void ResponseCmd::responseVext(bool rpa, bool ipa, int nitscf, int nite, string
err = MPI_File_write_at_all(fh,offset,(void*) &wbuf[0],nchars,
MPI_CHAR,&status);
if ( err != 0 )
cout << myrow << ": error in MPI_File_write_at_all: err=" << err << endl;
cout << myrow << ": error in MPI_File_write_at_all: err="
<< err << endl;
err = MPI_File_close(&fh);
if ( err != 0 )
......@@ -543,8 +547,9 @@ void ResponseCmd::responseVext(bool rpa, bool ipa, int nitscf, int nite, string
for (int ispin = 0; ispin < nspin; ispin++)
{
tm_comm_drho.start();
MPI_Gatherv(&drho_r[ispin][0], ft2.np012loc(), MPI_DOUBLE, &drho_r_gathered[0],
&rcounts[0], &displs[0], MPI_DOUBLE, 0, vcomm);
MPI_Gatherv(&drho_r[ispin][0], ft2.np012loc(), MPI_DOUBLE,
&drho_r_gathered[0], &rcounts[0], &displs[0],
MPI_DOUBLE, 0, vcomm);
tm_comm_drho.stop();
if ( myrow == 0 && mycol == 0 )
......
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