Phoebe developer's documentation  1.1.0
Phonon and Electron Boltzmann Equations
vector_epa.h
1 #ifndef VECTOR_EPA_H
2 #define VECTOR_EPA_H
3 
4 #include "Matrix.h"
5 #include "PMatrix.h"
6 #include "active_bandstructure.h"
7 #include "context.h"
8 #include "eigen.h"
9 
17 class VectorEPA {
18  public:
29  VectorEPA(StatisticsSweep &statisticsSweep_, const int &numStates_,
30  const int &dimensionality_ = 3);
31 
34  VectorEPA(const VectorEPA &that);
35 
38  VectorEPA &operator=(const VectorEPA &that);
39 
46  virtual Eigen::MatrixXd dot(const VectorEPA &that);
47 
56 
62  VectorEPA operator*(const double &scalar);
63 
71  VectorEPA operator*(const Eigen::VectorXd &vector);
72 
81 
90 
99 
103 
112 
116  VectorEPA sqrt();
121 
125  void setConst(const double &constant);
126 
129  double &operator()(const int &iCalc, const int &iDim, const int &iState);
130 
133  const double &operator()(const int &iCalc, const int &iDim,
134  const int &iState) const;
135 
141  Eigen::MatrixXd data;
142 
143  // we store auxiliary objects and parameters
144  StatisticsSweep &statisticsSweep;
145  int numCalculations;
146  int numStates;
147  int numChemPots;
148  int numTemps;
149  int dimensionality;
150 
159  int glob2Loc(const ChemPotIndex &imu, const TempIndex &it,
160  const CartIndex &iDim) const;
161  std::tuple<ChemPotIndex, TempIndex, CartIndex> loc2Glob(const int &i) const;
162 
167  std::vector<int> excludeIndices;
168 
169  protected:
174  VectorEPA baseOperator(VectorEPA &that, const int &operatorType);
175  const int operatorSums = 0;
176  const int operatorDivs = 1;
177  const int operatorProd = 2;
178  const int operatorDiff = 3;
179 };
180 
181 #endif
Class for implementing strong typing.
Definition: utilities.h:51
Class for managing a (serial) matrix stored in memory.
Definition: SMatrix.h:20
Object for controlling the loop over temperatures and chemical potentials.
Definition: statistics_sweep.h:26
Class used to store a "matrix" of data.
Definition: vector_epa.h:17
VectorEPA sqrt()
Replace the content of BaseVectorBTE with its square root (element-wise x -> sqrt(x) ).
Definition: vector_epa.cpp:192
std::vector< int > excludeIndices
List of Bloch states to be excluded from the calculation (i.e.
Definition: vector_epa.h:167
VectorEPA operator/(VectorEPA &that)
element wise division between two BaseVectorBTE objects x and y.
Definition: vector_epa.cpp:188
Eigen::MatrixXd data
raw buffer containing the values of the vector The matrix has size (numCalculations,...
Definition: vector_epa.h:141
void setConst(const double &constant)
Set the whole content (raw buffer) of BaseVectorBTE to a scalar value.
Definition: vector_epa.cpp:204
VectorEPA(StatisticsSweep &statisticsSweep_, const int &numStates_, const int &dimensionality_=3)
Constructor method, initializes raw buffer data and saves helper variables.
Definition: vector_epa.cpp:4
double & operator()(const int &iCalc, const int &iDim, const int &iState)
Get and set operator.
Definition: vector_epa.cpp:226
VectorEPA operator-()
Invert the sign of the BaseVectorBTE content i.e.
Definition: vector_epa.cpp:181
VectorEPA reciprocal()
Replace the content of BaseVectorBTE with its reciprocal (element-wise x -> 1/x).
Definition: vector_epa.cpp:198
VectorEPA baseOperator(VectorEPA &that, const int &operatorType)
base class to implement +, -, / and * operations.
Definition: vector_epa.cpp:76
VectorEPA operator+(VectorEPA &that)
element wise sum between two BaseVectorBTE objects x and y.
Definition: vector_epa.cpp:171
virtual Eigen::MatrixXd dot(const VectorEPA &that)
Computes the scalar product between two BaseVectorBTE objects.
Definition: vector_epa.cpp:56
VectorEPA operator*(VectorEPA &that)
element wise product between two BaseVectorBTE objects x and y.
Definition: vector_epa.cpp:126
VectorEPA & operator=(const VectorEPA &that)
Copy assignment operator.
Definition: vector_epa.cpp:41
int glob2Loc(const ChemPotIndex &imu, const TempIndex &it, const CartIndex &iDim) const
glob2Loc and loc2Glob compress/decompress the indices on temperature, chemical potential,...
Definition: vector_epa.cpp:208