DFT-EFE
 
Loading...
Searching...
No Matches
AtomSphericalDataPSP.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2021. *
3 * The Regents of the University of Michigan and DFT-EFE developers. *
4 * *
5 * This file is part of the DFT-EFE code. *
6 * *
7 * DFT-EFE is free software: you can redistribute it and/or modify *
8 * it under the terms of the Lesser GNU General Public License as *
9 * published by the Free Software Foundation, either version 3 of *
10 * the License, or (at your option) any later version. *
11 * *
12 * DFT-EFE is distributed in the hope that it will be useful, but *
13 * WITHOUT ANY WARRANTY; without even the implied warranty *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
15 * See the Lesser GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License at the top level of DFT-EFE distribution. If not, see *
19 * <https://www.gnu.org/licenses/>. *
20 ******************************************************************************/
21
22/*
23 * @author Avirup Sircar
24 */
25
26#ifndef dftefeAtomSphericalDataPSP_h
27#define dftefeAtomSphericalDataPSP_h
28
29#include <utils/TypeConfig.h>
30#include <atoms/SphericalData.h>
35#include <memory>
36#include <unordered_map>
37#include <map>
38#include <libxml/parser.h>
39#include <libxml/xpath.h>
40#include <libxml/tree.h>
41#include <libxml/xpathInternals.h>
42#include <vector>
43#include <string>
44namespace dftefe
45{
46 namespace atoms
47 {
63 class AtomSphericalDataPSP : public AtomSphericalData
64 {
65 public:
66 struct XPathInfo
67 {
68 xmlDocPtr doc;
69 std::string fileName;
70 std::string xpath;
71 std::string ns;
72 std::string nsHRef;
73 };
74
75 public:
76 AtomSphericalDataPSP(
77 const std::string fileName,
78 const std::vector<std::string> & fieldNames,
79 const std::vector<std::string> & metadataNames,
80 const SphericalHarmonicFunctions &sphericalHarmonicFunc);
81
82 ~AtomSphericalDataPSP() = default;
83
84 void
85 addFieldName(const std::string fieldName) override;
86
87 std::string
88 getFileName() const override;
89
90 std::vector<std::string>
91 getFieldNames() const override;
92
93 std::vector<std::string>
94 getMetadataNames() const override;
95
96 const std::vector<std::shared_ptr<SphericalData>> &
97 getSphericalData(const std::string fieldName) const override;
98
99 const std::shared_ptr<SphericalData>
100 getSphericalData(const std::string fieldName,
101 const std::vector<int> &qNumbers) const override;
102
103 std::string
104 getMetadata(const std::string metadataName) const override;
105
107 getQNumberID(const std::string fieldName,
108 const std::vector<int> &qNumbers) const override;
109
111 nSphericalData(std::string fieldName) const override;
112
113 private:
114 void
115 getSphericalDataFromXMLNode(
116 std::vector<std::shared_ptr<SphericalData>> &sphericalDataVec,
117 const std::vector<double> & radialPoints,
118 XPathInfo & xPathInfo,
119 const std::string & fieldName,
120 const SphericalHarmonicFunctions & sphericalHarmonicFunc);
121
122 std::string d_fileName, d_rootElementName;
123 std::vector<std::string> d_fieldNames;
124 std::vector<std::string> d_metadataNames;
125 std::unordered_map<std::string,
126 std::vector<std::shared_ptr<SphericalData>>>
127 d_sphericalData;
128 std::unordered_map<std::string, std::map<std::vector<int>, size_type>>
129 d_qNumbersToIdMap;
130 std::unordered_map<std::string, std::string> d_metadata;
131 double d_zvalance;
132 const double d_PSPVLocalCutoff;
133 int d_lmax;
134 int d_numProj;
135 std::shared_ptr<utils::ScalarSpatialFunctionReal>
136 d_scalarSpatialFnAfterRadialGrid;
137
138 std::vector<double> d_radialPoints;
139 const SphericalHarmonicFunctions &d_sphericalHarmonicFunc;
140 };
141 } // end of namespace atoms
142} // end of namespace dftefe
143#endif // dftefeAtomSphericalDataPSP_h
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8