20 #include "Numerics/Transform2GridFunctor.h" 66 if (!cutoff_str.empty())
67 RcutMax = std::stod(cutoff_str);
74 f->seekg(0, std::ios::end);
76 f->seekg(0, std::ios::beg);
102 fin =
new std::ifstream(fname.c_str());
147 xmlDocPtr m_doc = xmlReadMemory(buf.
contents(), buf.
length, NULL, NULL, 0);
155 xmlNodePtr cur = xmlDocGetRootElement(m_doc);
161 bool success =
put(cur);
170 std::vector<xmlNodePtr> semiPtr;
174 std::string cname((
const char*)cur->name);
175 if (cname ==
"header")
180 else if (cname ==
"grid")
185 else if (cname ==
"L2")
189 else if (cname ==
"semilocal")
191 semiPtr.push_back(cur);
193 else if (cname ==
"local")
202 pp_nonloc = std::make_unique<NonLocalECPComponent>();
204 pp_so = std::make_unique<SOECPComponent>();
207 for (
int i = 0; i < semiPtr.size(); i++)
216 app_log() <<
" Non-local pseudopotential parameters" << std::endl;
229 std::array<char, 12> fname;
230 std::snprintf(fname.data(), fname.size(),
"%s.pp.dat",
Species.c_str());
231 std::ofstream fout(fname.data());
232 fout.setf(std::ios::scientific, std::ios::floatfield);
239 fout <<
"# Lmax = " <<
Lmax + 1 <<
" nonlocal L channels" << nl << std::endl;
240 fout <<
"# Units = bohr hartree " << std::endl;
241 fout <<
"# r -r*V/zeff Vnl ... " << std::endl;
244 fout << rt << std::setw(25) <<
pp_loc->splint(rt);
245 for (
int l = 0; l < nl; l++)
246 fout << std::setw(25) <<
pp_nonloc->nlpp_m[l]->splint(rt);
253 fout <<
"# Units = bohr hartree " << std::endl;
254 fout <<
"# r -r*V/zeff " << std::endl;
257 fout << rt << std::setw(25) <<
pp_loc->splint(rt) << std::endl;
266 app_log() <<
" Quadrature Nrule: " << rule << std::endl;
void buildLocal(xmlNodePtr cur)
build a Local Pseudopotential
Base class for any object which needs to know about a MPI communicator.
helper functions for EinsplineSetBuilder
int rank() const
return the rank
QTBase::RealType RealType
Declaration of OutputManager class.
void SetQuadratureRule(int rule)
std::map< std::string, int > angMon
ECPComponentBuilder(const std::string &aname, Communicate *c, int nrule=-1, int llocal=-1, int srule=8)
constructor spin grid used for numerical integration.
std::unique_ptr< NonLocalECPComponent > pp_nonloc
OutputManagerClass outputManager(Verbosity::HIGH)
Wrapping information on parallelism.
void addSemiLocal(xmlNodePtr cur)
bool open_file(const std::string &fname)
std::unique_ptr< mGridType > grid_global
std::unique_ptr< SOECPComponent > pp_so
Communicate * myComm
pointer to Communicate
Declaration of a builder class for an ECP component for an ionic type.
bool io_node
true, print out file
std::unique_ptr< RadialPotentialType > pp_loc
std::string getXMLAttributeValue(const xmlNodePtr cur, const std::string_view name)
get the value string for attribute name if name is unfound in cur you get an empty string back this i...
int mpi_groups
number of mpi groups
bool parse(const std::string &fname, xmlNodePtr cur)
std::vector< PosType > xyz_m
bool read_pp_file(const std::string &fname)
std::vector< RealType > weight_m
void buildSemiLocalAndLocal(std::vector< xmlNodePtr > &semiPtr)
int get_file_length(std::ifstream *f) const
void buildL2(xmlNodePtr cur)
QMCState qmc_common
a unique QMCState during a run
void barrier_and_abort(const std::string &msg) const
bool isActive(Verbosity level) const
std::unique_ptr< mGridType > createGrid(xmlNodePtr cur, bool useLinear=false)