13 #ifndef QMCPLUSPLUS_SOA_MULTIANALYTICFUNCTOR_BUILDER_H 14 #define QMCPLUSPLUS_SOA_MULTIANALYTICFUNCTOR_BUILDER_H 45 Rnl.reserve(other.
Rnl.size());
46 for (
size_t i = 0; i < other.
Rnl.size(); ++i)
47 Rnl.push_back(std::make_unique<single_type>(*other.
Rnl[i]));
59 for (
size_t i = 0,
n =
Rnl.size(); i <
n; ++i)
80 const size_t nElec = r.
size(0);
81 const size_t Nxyz = r.
size(1);
82 assert(nElec == u.
size(0));
83 assert(Nxyz == u.
size(1));
84 const size_t nRnl = u.
size(2);
85 const size_t nR = nElec * Nxyz;
87 for (
size_t i_e = 0; i_e < nElec; i_e++)
88 for (
size_t i_xyz = 0; i_xyz < Nxyz; i_xyz++)
89 if (r(i_e, i_xyz) >= Rmax)
90 for (
size_t i = 0,
n =
Rnl.size(); i <
n; ++i)
91 u(i_e, i_xyz, i) = 0.0;
93 for (
size_t i = 0,
n =
Rnl.size(); i <
n; ++i)
94 u(i_e, i_xyz, i) =
Rnl[i]->f(r(i_e, i_xyz));
115 const size_t nElec = r.
size(0);
116 const size_t Nxyz = r.
size(1);
117 assert(3 == vgl.
size(0));
118 assert(nElec == vgl.
size(1));
119 assert(Nxyz == vgl.
size(2));
120 const size_t nRnl = vgl.
size(3);
121 const size_t nR = nElec * Nxyz;
122 assert(nRnl ==
Rnl.size());
124 auto* r_ptr = r.
data();
125 auto* u_ptr = vgl.
data_at(0, 0, 0, 0);
126 auto* du_ptr = vgl.
data_at(1, 0, 0, 0);
127 auto* d2u_ptr = vgl.
data_at(2, 0, 0, 0);
129 for (
size_t ir = 0; ir < nR; ir++)
132 if (r_ptr[ir] >= Rmax)
134 for (
size_t i = 0; i < nRnl; ++i)
136 u_ptr[ir * nRnl + i] = 0.0;
137 du_ptr[ir * nRnl + i] = 0.0;
138 d2u_ptr[ir * nRnl + i] = 0.0;
145 for (
size_t i = 0; i < nRnl; ++i)
147 Rnl[i]->evaluateAll(r, rinv);
148 u_ptr[ir * nRnl + i] =
Rnl[i]->Y;
149 du_ptr[ir * nRnl + i] =
Rnl[i]->dY;
150 d2u_ptr[ir * nRnl + i] =
Rnl[i]->d2Y;
160 for (
size_t i = 0,
n =
Rnl.size(); i <
n; ++i)
162 Rnl[i]->evaluateAll(r, rinv);
165 d2u[i] =
Rnl[i]->d2Y;
175 for (
size_t i = 0,
n =
Rnl.size(); i <
n; ++i)
177 Rnl[i]->evaluateWithThirdDeriv(r, rinv);
180 d2u[i] =
Rnl[i]->d2Y;
181 d3u[i] =
Rnl[i]->d3Y;
186 template<
typename COT>
189 template<
typename FN,
typename SH>
206 bool addGrid(xmlNodePtr cur,
const std::string& rad_type) {
return true; }
219 auto radorb = std::make_unique<single_type>(nlms[
q_l],
Normalized);
220 radorb->putBasisGroup(cur);
223 m_orbitals.MultiRnl.Rnl.push_back(std::move(radorb));
229 auto radorb = std::make_unique<single_type>(nlms[
q_l],
Normalized);
233 m_orbitals.MultiRnl.Rnl.push_back(std::move(radorb));
void evaluate(RealType r, RealType *restrict u)
MultiFunctorAdapter()=default
bool openNumericalBasisH5(xmlNodePtr cur)
std::vector< T, aligned_allocator< T > > aligned_vector
Base class for any object which needs to know about a MPI communicator.
helper functions for EinsplineSetBuilder
MultiFunctorAdapter(const MultiFunctorAdapter &other)
Type_t * data_at(const std::array< SIZET, D > &indices)
Build a set of radial orbitals at the origin.
bool addGrid(xmlNodePtr cur, const std::string &rad_type)
implement functions used by AOBasisBuilder
typename FN::real_type RealType
declaration of MPIObjectBase
generic functor that computes a set of 1D functors
void batched_evaluate(OffloadArray2D &r, OffloadArray3D &u, RealType Rmax) const
evaluate for multiple electrons and multiple pbc images
Wrapping information on parallelism.
void evaluate(RealType r, RealType *restrict u, RealType *restrict du, RealType *restrict d2u, RealType *restrict d3u)
Communicate * myComm
pointer to Communicate
std::string lowerCase(const std::string_view s)
++17
bool addGridH5(hdf_archive &hin)
bool addRadialOrbital(xmlNodePtr cur, const std::string &rad_type, const QuantumNumberType &nlms)
bool addRadialOrbitalH5(hdf_archive &hin, const std::string &rad_type, const QuantumNumberType &nlms)
aligned_vector< std::unique_ptr< single_type > > Rnl
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...
void updateFrom(size_t size=0, std::ptrdiff_t offset=0)
hdf_archive hin
hdf file only for numerical basis h5 file generated by SQD
typename RadialOrbital_t::single_type single_type
OHMMS_PRECISION real_type
void evaluate(RealType r, RealType *restrict u, RealType *restrict du, RealType *restrict d2u)
COT & m_orbitals
orbitals to build
void updateTo(size_t size=0, std::ptrdiff_t offset=0)
COT & m_orbitals
the atomic orbitals
bool Normalized
true, if the RadialOrbitalType is normalized
bool Normalized
true, if the RadialOrbitalType is normalized
RadialOrbitalSetBuilder(Communicate *comm, COT &aos)
constructor
void batched_evaluateVGL(OffloadArray2D &r, OffloadArray4D &vgl, RealType Rmax) const
evaluate value, first deriv, second deriv for multiple electrons and multiple pbc images ...