Skip to content

Commit

Permalink
Final changes to the print statements. Added units to energy.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsambit committed Mar 22, 2018
1 parent 7ab758a commit 67daf8d
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
set -o pipefail
#script to setup and build DFT-FE
#Provide paths for external libraries and optimization flag (0 for Debug, 1 for Release)
dealiiPetscRealDir="/home/vikramg/DFT-FE-softwares/softwareCentos/dealiiDev/intel_18.0.1_petscReal_noavx_64bit"
dealiiPetscRealDir="/home/vikramg/DFT-FE-softwares/softwareCentos/dealiiDev/intel_18.0.1_petscReal_noavx_64bit_thread"
dealiiPetscComplexDir="/home/vikramg/DFT-FE-softwares/softwareCentos/dealiiDev/intel_18.0.1_petscComplex_noavx_64bit_thread"
alglibDir="/nfs/mcfs_comp/home/rudraa/software/alglib/cpp/src"
libxcDir="/home/vikramg/DFT-FE-softwares/softwareCentos/libxcNew/install_intel18"
Expand Down
12 changes: 7 additions & 5 deletions src/dft/dft.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,6 @@ void dftClass<FEOrder>::set()
//estimate total number of wave functions
determineOrbitalFilling();

pcout << "number of eigen values: " << numEigenValues << std::endl;

#ifdef ENABLE_PERIODIC_BC
if (dftParameters::isIonForce || dftParameters::isCellStress)
AssertThrow(!dftParameters::useSymm,ExcMessage("USE GROUP SYMMETRY must be set to false if either ION FORCE or CELL STRESS is set to true. This functionality will be added in a future release"));
Expand Down Expand Up @@ -286,7 +284,7 @@ void dftClass<FEOrder>::set()
template<unsigned int FEOrder>
void dftClass<FEOrder>::initPseudoPotentialAll()
{

pcout<<std::endl<<"Pseuodopotential initalization...."<<std::endl;
if(isPseudopotential)
{
initLocalPseudoPotential();
Expand Down Expand Up @@ -512,7 +510,11 @@ void dftClass<FEOrder>::solve()
//
unsigned int scfIter=0;
double norm = 1.0;


pcout<<std::endl;
if (dftParameters::verbosity==0)
pcout<<"Starting SCF iteration...."<<std::endl;
while ((norm > dftParameters::selfConsistentSolverTolerance) && (scfIter < dftParameters::numSCFIterations))
{
if (dftParameters::verbosity>=1)
Expand Down Expand Up @@ -689,9 +691,9 @@ void dftClass<FEOrder>::solve()
}

if(scfIter==dftParameters::numSCFIterations)
pcout<< "SCF did not converge to the specified tolerance after: "<<scfIter<<" iterations."<<std::endl;
pcout<< "SCF iteration did not converge to the specified tolerance after: "<<scfIter<<" iterations."<<std::endl;
else
pcout<< "SCF converged to the specified tolerance after: "<<scfIter<<" iterations."<<std::endl;
pcout<< "SCF iteration converged to the specified tolerance after: "<<scfIter<<" iterations."<<std::endl;

// compute and print ground state energy or energy after max scf iterations
if (spinPolarized==1)
Expand Down
4 changes: 2 additions & 2 deletions src/dft/energy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ double dftClass<FEOrder>::compute_energy(const bool print)
{
pcout<<std::endl;
char bufferEnergy[200];
pcout << "Energy computations\n";
pcout << "Energy computations (Hartree)\n";
pcout << "-------------------\n";
sprintf(bufferEnergy, "%-24s:%25.16e\n", "Band energy", bandEnergy); pcout << bufferEnergy;
sprintf(bufferEnergy, "%-24s:%25.16e\n", "Kinetic energy", totalkineticEnergy); pcout << bufferEnergy;
Expand Down Expand Up @@ -725,7 +725,7 @@ double dftClass<FEOrder>::compute_energy_spinPolarized(const bool print)
{
pcout<<std::endl;
char bufferEnergy[200];
pcout << "Energy computations\n";
pcout << "Energy computations (Hartree)\n";
pcout << "-------------------\n";
sprintf(bufferEnergy, "%-24s:%25.16e\n", "Band energy", bandEnergy); pcout << bufferEnergy;
sprintf(bufferEnergy, "%-24s:%25.16e\n", "Kinetic energy", totalkineticEnergy); pcout << bufferEnergy;
Expand Down
2 changes: 1 addition & 1 deletion src/dft/initElectronicFields.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void dftClass<FEOrder>::initElectronicFields(){
//
//initialize PSI
//
pcout << "reading initial guess for PSI\n";
pcout <<std::endl<< "Reading initial guess for PSI...."<<std::endl;
readPSI();
computing_timer.exit_section("moved setup");
}
2 changes: 1 addition & 1 deletion src/dft/initRho.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void dftClass<FEOrder>::initRho()
computing_timer.enter_section("initialize density");

//Reading single atom rho initial guess
pcout << "reading initial guess for rho\n";
pcout <<std::endl<< "Reading initial guess for rho....."<<std::endl;
std::map<unsigned int, alglib::spline1dinterpolant> denSpline;
std::map<unsigned int, std::vector<std::vector<double> > > singleAtomElectronDensity;
std::map<unsigned int, double> outerMostPointDen;
Expand Down
7 changes: 4 additions & 3 deletions src/dft/initUnmovedTriangulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,21 @@ void dftClass<FEOrder>::initUnmovedTriangulation(parallel::distributed::Triangul
else
{
local_dof_indicesImag.push_back(local_dof_indices[i]);
localProc_dof_indicesImag.push_back(i);
localProc_dof_indicesImag.push_back(i);
}
}
#endif



pcout << std::endl<<"Finite element mesh information"<<std::endl;
pcout<<"-------------------------------------------------"<<std::endl;
pcout << "number of elements: "
<< triangulation.n_global_active_cells()
<< std::endl
<< "number of degrees of freedom: "
<< dofHandler.n_dofs()
<< std::endl;

pcout<<"-------------------------------------------------"<<std::endl;
//std::cout<< " procId: "<< this_mpi_process << " ,locallly_owned_dofs: "<<dofHandler.n_locally_owned_dofs()<<std::endl;

//
Expand Down
4 changes: 3 additions & 1 deletion src/dft/moveMeshToAtoms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ void dftClass<FEOrder>::moveMeshToAtoms(Triangulation<3,3> & triangulationMove,b
gaussianConstant);

AssertThrow(!meshQualityMetrics.first,ExcMessage("Negative jacobian created after moving closest nodes to atoms. Suggestion: increase refinement near atoms"));
pcout<< " Mesh quality check: maximum jacobian ratio: "<< meshQualityMetrics.second<<std::endl;

if (dftParameters::verbosity>=1)
pcout<< "Mesh quality check after mesh movement, maximum jacobian ratio: "<< meshQualityMetrics.second<<std::endl;
}


Expand Down
4 changes: 2 additions & 2 deletions src/dft/psiInitialGuess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ void dftClass<FEOrder>::determineOrbitalFilling()

pcout<<"============================================================================================================================="<<std::endl;
pcout<<"number of electrons: "<<numElectrons<<std::endl;
pcout << "number of eigen values: " << numEigenValues << std::endl;
pcout<<"number of wavefunctions computed using single atom data to be used as initial guess for starting the SCF: " <<waveFunctionCount<<std::endl;
pcout<<"============================================================================================================================="<<std::endl;
}
Expand Down Expand Up @@ -351,8 +352,7 @@ void dftClass<FEOrder>::readPSIRadialValues(){
{

unsigned int nonAtomicWaveFunctions = numEigenValues - waveFunctionsVector.size();
pcout << " "<<std::endl;
pcout << "number of wavefunctions generated randomly to be used as initial guess for starting the SCF : " << nonAtomicWaveFunctions << std::endl;
pcout << "Number of wavefunctions generated randomly to be used as initial guess for starting the SCF : " << nonAtomicWaveFunctions << std::endl;

//
// assign the rest of the wavefunctions using a standard normal distribution
Expand Down
2 changes: 1 addition & 1 deletion src/force/configurationalStressCompute/stress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ template<unsigned int FEOrder>
void forceClass<FEOrder>::printStress()
{
pcout<<std::endl;
pcout<<"Cell stress (Hartree/Bohr^3)"<<std::endl
pcout<<"Cell stress (Hartree/Bohr^3)"<<std::endl;
pcout<< "------------------------------------------------------------------------"<< std::endl;
for (unsigned int idim=0; idim< 3; idim++)
pcout<< d_stress[idim][0]<<" "<<d_stress[idim][1]<<" "<<d_stress[idim][2]<< std::endl;
Expand Down
7 changes: 3 additions & 4 deletions src/mesh/meshMovement/meshMovement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,9 @@ std::pair<bool,double> meshMovementClass::movedMeshCheck()
}
}
minElemLength=Utilities::MPI::min(minElemLength, mpi_communicator);
char buffer[100];
//if (dftParameters::verbosity==2)
sprintf(buffer, "Mesh movement quality metric, h_min: %5.2e\n", minElemLength);
pcout << buffer;

if (dftParameters::verbosity==2)
pcout<< "Mesh movement quality metric, h_min: "<<minElemLength<<std::endl;

std::pair<bool,double> meshQualityMetrics;
QGauss<3> quadrature(2);
Expand Down

0 comments on commit 67daf8d

Please sign in to comment.