QMCPACK
SplineSetReader.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2023 QMCPACK developers.
6 //
7 // File developed by: Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
9 // Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
11 // Jeongnim Kim, jeongnim.kim@inte.com, Intel Corp.
12 //
13 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
14 //////////////////////////////////////////////////////////////////////////////////////
15 
16 
17 /** @file
18  *
19  * The most general reader class for the following classes using the full single grid for the supercell
20  * - SplineR2R
21  * - SplineC2C
22  * - SplineC2R
23  * Each band is initialized with UBspline_3d_d and both real and imaginary parts are passed to the objects
24  * which will convert the data type to their internal precision.
25  */
26 #ifndef QMCPLUSPLUS_SPLINESET_READER_H
27 #define QMCPLUSPLUS_SPLINESET_READER_H
28 
29 #include "BsplineReader.h"
30 
31 namespace qmcplusplus
32 {
33 
34 // forward declaration
35 #if defined(QMC_COMPLEX)
36 template<typename ST>
37 class SplineC2C;
38 template<typename ST>
39 class SplineC2COMPTarget;
40 #else
41 template<typename ST>
42 class SplineR2R;
43 template<typename ST>
44 class SplineC2R;
45 template<typename ST>
46 class SplineC2ROMPTarget;
47 #endif
48 
49 /** General SplineSetReader to handle any unitcell
50  */
51 template<typename SA>
53 {
54 public:
56 
57  std::unique_ptr<SPOSet> create_spline_set(const std::string& my_name,
58  int spin,
59  const BandInfoGroup& bandgroup) override;
60 
61  /** create data space in the spline object and try open spline dump files.
62  * @param bandgroup band info
63  * @param bspline the spline object being worked on
64  * @return true if dumpfile pass class name and data type size check
65  */
66  bool createSplineDataSpaceLookforDumpFile(const BandInfoGroup& bandgroup, SA& bspline) const;
67 
68  /** read planewave coefficients from h5 file
69  * @param s data set full path in h5
70  * @param h5f hdf5 file handle
71  * @param cG vector to store coefficients
72  */
73  void readOneOrbitalCoefs(const std::string& s, hdf_archive& h5f, Vector<std::complex<double>>& cG) const;
74 
75  /** transforming planewave orbitals to 3D B-spline orbitals in real space.
76  * @param spin orbital dataset spin index
77  * @param bandgroup band info
78  * @param bspline the spline object being worked on
79  */
80  void initialize_spline_pio_gather(const int spin, const BandInfoGroup& bandgroup, SA& bspline) const;
81 };
82 
83 #if defined(QMC_COMPLEX)
84 extern template class SplineSetReader<SplineC2C<float>>;
85 extern template class SplineSetReader<SplineC2COMPTarget<float>>;
86 #if !defined(QMC_MIXED_PRECISION)
87 extern template class SplineSetReader<SplineC2C<double>>;
88 extern template class SplineSetReader<SplineC2COMPTarget<double>>;
89 #endif
90 #else
91 extern template class SplineSetReader<SplineR2R<float>>;
92 extern template class SplineSetReader<SplineC2R<float>>;
93 extern template class SplineSetReader<SplineC2ROMPTarget<float>>;
94 #if !defined(QMC_MIXED_PRECISION)
95 extern template class SplineSetReader<SplineR2R<double>>;
96 extern template class SplineSetReader<SplineC2R<double>>;
97 extern template class SplineSetReader<SplineC2ROMPTarget<double>>;
98 #endif
99 #endif
100 
101 } // namespace qmcplusplus
102 #endif
double bspline(double x, const std::vector< double > &t, const std::vector< double > &c, int k)
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
bool createSplineDataSpaceLookforDumpFile(const BandInfoGroup &bandgroup, SA &bspline) const
create data space in the spline object and try open spline dump files.
class to handle hdf file
Definition: hdf_archive.h:51
void readOneOrbitalCoefs(const std::string &s, hdf_archive &h5f, Vector< std::complex< double >> &cG) const
read planewave coefficients from h5 file
Each SplineC2X needs a reader derived from BsplineReader.
Definition: BsplineReader.h:39
General SplineSetReader to handle any unitcell.
a group of bands
Definition: BandInfo.h:66
SplineSetReader(EinsplineSetBuilder *e)
void initialize_spline_pio_gather(const int spin, const BandInfoGroup &bandgroup, SA &bspline) const
transforming planewave orbitals to 3D B-spline orbitals in real space.
base class to read data and manage spline tables
std::unique_ptr< SPOSet > create_spline_set(const std::string &my_name, int spin, const BandInfoGroup &bandgroup) override
create the actual spline sets