Skip to content

Commit 9ae42e1

Browse files
committed
add dftfe::Int and dftfe::uInt
1 parent da345fa commit 9ae42e1

File tree

329 files changed

+17760
-17428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

329 files changed

+17760
-17428
lines changed

include/AtomCenteredPseudoWavefunctionSpline.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ namespace dftfe
5050
* @param[in] truncationTol the minimum function value after which the
5151
* function is truncated.
5252
*/
53-
AtomCenteredPseudoWavefunctionSpline(std::string filename,
54-
unsigned int l,
55-
double cutoff,
56-
double truncationTol = 1E-10);
53+
AtomCenteredPseudoWavefunctionSpline(std::string filename,
54+
dftfe::uInt l,
55+
double cutoff,
56+
double truncationTol = 1E-10);
5757
};
5858

5959
} // end of namespace dftfe

include/AtomCenteredSphericalFunctionBase.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#include <vector>
2424
#include <boost/math/quadrature/gauss_kronrod.hpp>
25+
#include <TypeConfig.h>
26+
2527
namespace dftfe
2628
{
2729
class AtomCenteredSphericalFunctionBase
@@ -41,7 +43,7 @@ namespace dftfe
4143
* @brief returns the l-quantum number associated with the spherical function
4244
* @return Quantum number l
4345
*/
44-
unsigned int
46+
dftfe::uInt
4547
getQuantumNumberl() const;
4648

4749
/**
@@ -72,9 +74,9 @@ namespace dftfe
7274
getDerivativeValue(double r) const = 0;
7375

7476
protected:
75-
double d_cutOff;
76-
unsigned int d_lQuantumNumber;
77-
bool d_DataPresent;
77+
double d_cutOff;
78+
dftfe::uInt d_lQuantumNumber;
79+
bool d_DataPresent;
7880

7981

8082
}; // end of class AtomCenteredSphericalFunctionBase

include/AtomCenteredSphericalFunctionBessel.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ namespace dftfe
3838
* @param[in] RcParameter coefficent for the bessel function
3939
* @param[in] RmaxParameter the maximum R afterwhich the function returns 0.
4040
*/
41-
AtomCenteredSphericalFunctionBessel(double RcParameter,
42-
double RmaxParameter,
43-
unsigned int lParameter);
41+
AtomCenteredSphericalFunctionBessel(double RcParameter,
42+
double RmaxParameter,
43+
dftfe::uInt lParameter);
4444

4545
double
4646
getRadialValue(double r) const override;
4747

48-
unsigned int
48+
dftfe::uInt
4949
getQuantumNumbern() const;
5050

5151
double

include/AtomCenteredSphericalFunctionContainer.h

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ namespace dftfe
4444
* sphericalFUnction class shared pointer.
4545
*/
4646
void
47-
init(const std::vector<unsigned int> &atomicNumbers,
48-
const std::map<std::pair<unsigned int, unsigned int>,
47+
init(const std::vector<dftfe::uInt> &atomicNumbers,
48+
const std::map<std::pair<dftfe::uInt, dftfe::uInt>,
4949
std::shared_ptr<AtomCenteredSphericalFunctionBase>>
5050
&listOfSphericalFunctions);
5151
/**
@@ -59,12 +59,12 @@ namespace dftfe
5959
void
6060
initaliseCoordinates(const std::vector<double> &atomCoords,
6161
const std::vector<std::vector<double>> &periodicCoords,
62-
const std::vector<int> &imageIds);
62+
const std::vector<dftfe::Int> &imageIds);
6363
/**
6464
* @brief Returns the number of atoms present in domain
6565
* @return Returns size of atomicNumbers vector
6666
*/
67-
unsigned int
67+
dftfe::uInt
6868
getNumAtomCentersSize();
6969

7070

@@ -78,7 +78,7 @@ namespace dftfe
7878
* @brief Returns the map of atomId vs vector of image coordinates
7979
* @return Returns d_periodicImageCoord
8080
*/
81-
const std::map<unsigned int, std::vector<double>> &
81+
const std::map<dftfe::uInt, std::vector<double>> &
8282
getPeriodicImageCoordinatesList() const;
8383

8484
// This functions returns the number of spherical functions associated with
@@ -88,24 +88,24 @@ namespace dftfe
8888
* @brief Returns the he number of total spherical functions indexed by {ilm} associated with an atomic number. If the atomic number does not exist, it returns a zero.
8989
* @return d_numSphericalFunctions.find(atomicNumber)->size()
9090
*/
91-
unsigned int
92-
getTotalNumberOfSphericalFunctionsPerAtom(unsigned int atomicNumber);
91+
dftfe::uInt
92+
getTotalNumberOfSphericalFunctionsPerAtom(dftfe::uInt atomicNumber);
9393

9494
/**
9595
* @brief Returns the he number of radial spherical functions indexed by {i} associated with an atomic number. If the atomic number does not exist, it returns a zero.
9696
* @return d_numRadialSphericalFunctions.find(atomicNumber)->size()
9797
*/
98-
unsigned int
99-
getTotalNumberOfRadialSphericalFunctionsPerAtom(unsigned int atomicNumber);
98+
dftfe::uInt
99+
getTotalNumberOfRadialSphericalFunctionsPerAtom(dftfe::uInt atomicNumber);
100100
/**
101101
* @brief Returns the total number of total spherical functions indexed by {ilm} present in the current processor. If the atomic number does not exist, it returns a zero.
102102
*/
103-
unsigned int
103+
dftfe::uInt
104104
getTotalNumberOfSphericalFunctionsInCurrentProcessor();
105105
/**
106106
* @brief Returns the maximum number of total spherical functions indexed by {ilm} across all atom Types present in atomNumbers vector
107107
*/
108-
unsigned int
108+
dftfe::uInt
109109
getMaximumNumberOfSphericalFunctions();
110110
/**
111111
* @brief
@@ -121,39 +121,39 @@ namespace dftfe
121121
*/
122122
void
123123
getTotalAtomsAndNonLocalElementsInCurrentProcessor(
124-
unsigned int &totalAtomsInCurrentProcessor,
125-
unsigned int &totalNonLocalElements,
126-
std::vector<unsigned int> &numberCellsForEachAtom,
127-
std::vector<unsigned int> &numberCellsAccumNonLocalAtoms,
128-
std::vector<unsigned int> &iElemNonLocalToElemIndexMap);
124+
dftfe::uInt &totalAtomsInCurrentProcessor,
125+
dftfe::uInt &totalNonLocalElements,
126+
std::vector<dftfe::uInt> &numberCellsForEachAtom,
127+
std::vector<dftfe::uInt> &numberCellsAccumNonLocalAtoms,
128+
std::vector<dftfe::uInt> &iElemNonLocalToElemIndexMap);
129129

130130
/**
131131
* @brief Returns the total number of total radial-spherical functions indexed by {i} present in atomicNumbers list.
132132
*/
133-
unsigned int
133+
dftfe::uInt
134134
getTotalNumberOfRadialSphericalFunctions();
135135

136136
/**
137137
* @brief Returns the shared_ptr of AtomCenteredSphericalFunctionBase associated with std::pair(atomic Number and lQuantumNo)
138138
*/
139-
const std::map<std::pair<unsigned int, unsigned int>,
139+
const std::map<std::pair<dftfe::uInt, dftfe::uInt>,
140140
std::shared_ptr<AtomCenteredSphericalFunctionBase>> &
141141
getSphericalFunctions() const;
142142
/**
143143
* @brief Returns the vector of size Natoms of all atoms in system
144144
*/
145-
const std::vector<unsigned int> &
145+
const std::vector<dftfe::uInt> &
146146
getAtomicNumbers() const;
147147
/**
148148
* @brief Returns the atomIds of atoms present in current processor
149149
*/
150-
const std::vector<unsigned int> &
150+
const std::vector<dftfe::uInt> &
151151
getAtomIdsInCurrentProcess() const;
152152
/**
153153
* @brief Returns the startIndex of spherical Function alpha associated with atomic number Znum
154154
*/
155-
const unsigned int
156-
getTotalSphericalFunctionIndexStart(unsigned int Znum, unsigned int alpha);
155+
const dftfe::uInt
156+
getTotalSphericalFunctionIndexStart(dftfe::uInt Znum, dftfe::uInt alpha);
157157
// COmputes the sparsity Pattern for the compact support Fn
158158
// cutOffVal the max/min value to consider to be part of copact support
159159
// cutOffType = 0 based on Fn Value, cutOffType = 1 based on Distance from
@@ -165,40 +165,40 @@ namespace dftfe
165165
dftfe::basis::FEBasisOperations<NumberType,
166166
double,
167167
dftfe::utils::MemorySpace::HOST>>
168-
&basisOperationsPtr,
169-
const unsigned int quadratureIndex,
170-
const double cutOffVal = 1.0E-8,
171-
const unsigned int cutOffType = 0);
168+
&basisOperationsPtr,
169+
const dftfe::uInt quadratureIndex,
170+
const double cutOffVal = 1.0E-8,
171+
const dftfe::uInt cutOffType = 0);
172172

173173

174-
std::vector<std::vector<unsigned int>> d_elementIndexesInAtomCompactSupport;
174+
std::vector<std::vector<dftfe::uInt>> d_elementIndexesInAtomCompactSupport;
175175
void
176-
setImageCoordinates(const std::vector<int> &imageIds,
176+
setImageCoordinates(const std::vector<dftfe::Int> &imageIds,
177177
const std::vector<std::vector<double>> &periodicCoords);
178178

179179

180180

181-
const std::vector<int> &
182-
getAtomIdsInElement(unsigned int iElem);
181+
const std::vector<dftfe::Int> &
182+
getAtomIdsInElement(dftfe::uInt iElem);
183183

184-
const std::map<unsigned int, std::vector<int>> &
184+
const std::map<dftfe::uInt, std::vector<dftfe::Int>> &
185185
getSparsityPattern();
186186

187187
bool
188-
atomSupportInElement(unsigned int iElem);
188+
atomSupportInElement(dftfe::uInt iElem);
189189

190190
void
191191
getDataForSparseStructure(
192-
const std::map<unsigned int, std::vector<int>> &sparsityPattern,
192+
const std::map<dftfe::uInt, std::vector<dftfe::Int>> &sparsityPattern,
193193
const std::vector<std::vector<dealii::CellId>>
194194
&elementIdsInAtomCompactSupport,
195-
const std::vector<std::vector<unsigned int>>
196-
&elementIndexesInAtomCompactSupport,
197-
const std::vector<unsigned int> &atomIdsInCurrentProcess,
198-
unsigned int numberElements);
195+
const std::vector<std::vector<dftfe::uInt>>
196+
&elementIndexesInAtomCompactSupport,
197+
const std::vector<dftfe::uInt> &atomIdsInCurrentProcess,
198+
dftfe::uInt numberElements);
199199

200-
const unsigned int
201-
getOffsetLocation(const unsigned int iAtom);
200+
const dftfe::uInt
201+
getOffsetLocation(const dftfe::uInt iAtom);
202202

203203
private:
204204
// A flattened vector that stores the coordinates of the atoms of interest
@@ -210,37 +210,37 @@ namespace dftfe
210210
// A vector of size = number of atoms of interest
211211
// the Ith atom in d_atomicNumbers has its coordinates
212212
// in d_atomCoords[3*I+0], d_atomCoords[3*I+1], d_atomCoords[3*I+2]
213-
std::vector<unsigned int> d_atomicNumbers;
213+
std::vector<dftfe::uInt> d_atomicNumbers;
214214

215215
// This maps the atom I in the unit cell to all its image atoms.
216216
// number of image atoms of Ith atom = d_periodicImageCoord[I].size()/ dim
217217
// with dim=3 The coordinates are stored as a flattened vector
218-
std::map<unsigned int, std::vector<double>> d_periodicImageCoord;
218+
std::map<dftfe::uInt, std::vector<double>> d_periodicImageCoord;
219219

220220

221221
// This maps, from std::pair<atomic number, \alpha> to S_{z,\alpha},
222222
// where \alpha is the index for unique radial function
223-
std::map<std::pair<unsigned int, unsigned int>,
223+
std::map<std::pair<dftfe::uInt, dftfe::uInt>,
224224
std::shared_ptr<AtomCenteredSphericalFunctionBase>>
225225
d_sphericalFunctionsContainer;
226226
// Stores the number of distinct Radial Functions for a particular AtomType
227-
std::map<unsigned int, unsigned int> d_numRadialSphericalFunctions;
227+
std::map<dftfe::uInt, dftfe::uInt> d_numRadialSphericalFunctions;
228228
// Stores the number of distinct Functions include m for a particular
229229
// AtomType
230-
std::map<unsigned int, unsigned int> d_numSphericalFunctions;
230+
std::map<dftfe::uInt, dftfe::uInt> d_numSphericalFunctions;
231231
// This maps is between atomId in unit cell and the sparsity pattern of the
232232
// atom and its images in the unitcell domain.
233-
std::map<unsigned int, std::vector<int>> d_sparsityPattern;
233+
std::map<dftfe::uInt, std::vector<dftfe::Int>> d_sparsityPattern;
234234
//
235235
std::vector<std::vector<dealii::CellId>> d_elementIdsInAtomCompactSupport;
236-
// std::vector<std::vector<unsigned int>>
236+
// std::vector<std::vector<dftfe::uInt>>
237237
// d_elementIndexesInAtomCompactSupport;
238238
std::vector<std::vector<dealii::DoFHandler<3>::active_cell_iterator>>
239-
d_elementOneFieldIteratorsInAtomCompactSupport;
240-
std::vector<unsigned int> d_AtomIdsInCurrentProcess;
241-
std::vector<unsigned int> d_offsetLocation;
242-
std::vector<std::vector<int>> d_AtomIdsInElement;
243-
std::map<unsigned int, std::vector<unsigned int>>
239+
d_elementOneFieldIteratorsInAtomCompactSupport;
240+
std::vector<dftfe::uInt> d_AtomIdsInCurrentProcess;
241+
std::vector<dftfe::uInt> d_offsetLocation;
242+
std::vector<std::vector<dftfe::Int>> d_AtomIdsInElement;
243+
std::map<dftfe::uInt, std::vector<dftfe::uInt>>
244244
d_totalSphericalFunctionIndexStart;
245245

246246
}; // end of class AtomCenteredSphericalFunctionContainerBase

include/AtomCenteredSphericalFunctionGaussian.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ namespace dftfe
3333
: public AtomCenteredSphericalFunctionBase
3434
{
3535
public:
36-
AtomCenteredSphericalFunctionGaussian(double RcParameter,
37-
double RmaxParameter,
38-
unsigned int lParameter);
36+
AtomCenteredSphericalFunctionGaussian(double RcParameter,
37+
double RmaxParameter,
38+
dftfe::uInt lParameter);
3939

4040
double
4141
getRadialValue(double r) const override;
4242

43-
unsigned int
43+
dftfe::uInt
4444
getQuantumNumbern() const;
4545

4646
double

include/AtomCenteredSphericalFunctionProjectorSpline.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ namespace dftfe
5252
* @param[in] consider0thEntry whether to replace the 0th fn value with the
5353
* 1st value in the data.
5454
*/
55-
AtomCenteredSphericalFunctionProjectorSpline(std::string filename,
56-
unsigned int l,
57-
int radialPower,
58-
int colIndex,
59-
int totalColSize,
55+
AtomCenteredSphericalFunctionProjectorSpline(std::string filename,
56+
dftfe::uInt l,
57+
dftfe::Int radialPower,
58+
dftfe::Int colIndex,
59+
dftfe::Int totalColSize,
6060
double truncationTol = 1E-10,
6161
bool consider0thEntry = true);
6262
};

include/AtomCenteredSphericalFunctionSinc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ namespace dftfe
3333
: public AtomCenteredSphericalFunctionBase
3434
{
3535
public:
36-
AtomCenteredSphericalFunctionSinc(double RcParameter,
37-
double RmaxParameter,
38-
unsigned int lParameter);
36+
AtomCenteredSphericalFunctionSinc(double RcParameter,
37+
double RmaxParameter,
38+
dftfe::uInt lParameter);
3939

4040
double
4141
getRadialValue(double r) const override;
4242

43-
unsigned int
43+
dftfe::uInt
4444
getQuantumNumbern() const;
4545

4646
double

include/AtomCenteredSphericalFunctionZOverR.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ namespace dftfe
3636
: public AtomCenteredSphericalFunctionBase
3737
{
3838
public:
39-
AtomCenteredSphericalFunctionOneOverR(double Z,
40-
double Rtail,
41-
unsigned int l);
39+
AtomCenteredSphericalFunctionOneOverR(double Z,
40+
double Rtail,
41+
dftfe::uInt l);
4242

4343

4444

include/AtomPseudoWavefunctions.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,21 @@ namespace dftfe
4545
class AtomPseudoWavefunctions : public AtomCenteredSphericalFunctionBase
4646
{
4747
public:
48-
AtomPseudoWavefunctions(std::string filename,
49-
unsigned int n,
50-
unsigned int l);
48+
AtomPseudoWavefunctions(std::string filename, dftfe::uInt n, dftfe::uInt l);
5149

5250
double
5351
getRadialValue(double r) const override;
5452

55-
unsigned int
53+
dftfe::uInt
5654
getQuantumNumbern() const;
5755

5856
double
5957
getrMinVal() const;
6058

6159
private:
62-
unsigned int d_nQuantumNumber;
63-
unsigned int d_lQuantumNumber;
64-
double d_rMin;
60+
dftfe::uInt d_nQuantumNumber;
61+
dftfe::uInt d_lQuantumNumber;
62+
double d_rMin;
6563

6664
alglib::spline1dinterpolant d_radialSplineObject;
6765
};

0 commit comments

Comments
 (0)