Phoebe developer's documentation  1.1.0
Phonon and Electron Boltzmann Equations
vector_bte.h
1 #ifndef VECTOR_BTE_H
2 #define VECTOR_BTE_H
3 
4 #include "Matrix.h"
5 #include "PMatrix.h"
6 #include "active_bandstructure.h"
7 #include "context.h"
8 #include "eigen.h"
9 
16 class VectorBTE {
17 public:
28  VectorBTE(StatisticsSweep &statisticsSweep_,
29  BaseBandStructure &bandStructure_, const int &dimensionality_ = 3);
30 
33  VectorBTE(const VectorBTE &that);
34 
37  VectorBTE &operator=(const VectorBTE &that);
38 
41  double &operator()(const int &iCalc, const int &iDim, const int &iState);
42 
45  const double &operator()(const int &iCalc, const int &iDim,
46  const int &iState) const;
47 
54  Eigen::MatrixXd dot(const VectorBTE &that);
55 
64 
70  VectorBTE operator*(const double &scalar);
71 
79  VectorBTE operator*(const Eigen::MatrixXd &vector);
80 
89 
98 
107 
111 
120 
124  VectorBTE sqrt();
125 
129  VectorBTE reciprocal() const;
130 
134  void canonical2Population();
135 
139  void population2Canonical();
140 
143  void outputToJSON(const std::string &outFileName, BaseBandStructure& outerBandStructure);
144 
150  Eigen::MatrixXd data;
151 
160  int glob2Loc(const ChemPotIndex &imu, const TempIndex &it,
161  const CartIndex &iDim) const;
162  std::tuple<ChemPotIndex, TempIndex, CartIndex> loc2Glob(const int &i) const;
163 
168  std::vector<int> excludeIndices;
169  int dimensionality;
170 
174  void setConst(const double &constant);
175 
179  int getNumStates();
180 
181  protected:
182  // we store auxiliary objects and parameters
183  StatisticsSweep &statisticsSweep;
184  int numCalculations;
185  int numStates;
186  int numChemPots;
187  int numTemps;
188 
189  // we store auxiliary objects and parameters
190  BaseBandStructure &bandStructure;
191 
192  friend class ScatteringMatrix; // this is also to remember that
193  // if we change the index order of this class, we should check the
194  // ScatteringMatrix implementations: they are high efficiency methods
195  // so they need low-level access to the raw buffer
196 
201  VectorBTE baseOperator(VectorBTE &that, const int &operatorType);
202  const int operatorSums = 0;
203  const int operatorDivs = 1;
204  const int operatorProd = 2;
205  const int operatorDiff = 3;
206 };
207 
208 #endif
Base class for describing objects containing the band structure, i.e.
Definition: bandstructure.h:15
Class for implementing strong typing.
Definition: utilities.h:51
Base class of the scattering matrix.
Definition: scattering_matrix.h:22
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 the "vector" of out-of-equilibrium populations.
Definition: vector_bte.h:16
Eigen::MatrixXd data
raw buffer containing the values of the vector The matrix has size (numCalculations,...
Definition: vector_bte.h:150
VectorBTE operator-()
Invert the sign of the VectorBTE content i.e.
Definition: vector_bte.cpp:255
void setConst(const double &constant)
Set the whole content (raw buffer) of BaseVectorBTE to a scalar value.
Definition: vector_bte.cpp:486
VectorBTE & operator=(const VectorBTE &that)
Copy assignment operator.
Definition: vector_bte.cpp:51
VectorBTE(StatisticsSweep &statisticsSweep_, BaseBandStructure &bandStructure_, const int &dimensionality_=3)
Constructor method, initializes raw buffer data and saves helper variables.
Definition: vector_bte.cpp:6
VectorBTE operator*(VectorBTE &that)
element wise product between two VectorBTE objects x and y.
Definition: vector_bte.cpp:177
void canonical2Population()
Convert an out-of-equilibrium population from the canonical form f to the absolute value n,...
Definition: vector_bte.cpp:413
void population2Canonical()
Convert an out-of-equilibrium population from the absolute value n to the canonical value n,...
Definition: vector_bte.cpp:431
VectorBTE reciprocal() const
Return a new VectorBTE object containing the reciprocal of this one (element-wise x -> 1/x).
Definition: vector_bte.cpp:272
VectorBTE operator/(VectorBTE &that)
element wise division between two VectorBTE objects x and y.
Definition: vector_bte.cpp:262
VectorBTE operator+(VectorBTE &that)
element wise sum between two VectorBTE objects x and y.
Definition: vector_bte.cpp:245
VectorBTE sqrt()
Return a new VectorBTE object containing the square root of this one (element-wise x -> sqrt(x) ).
Definition: vector_bte.cpp:266
VectorBTE baseOperator(VectorBTE &that, const int &operatorType)
base class to implement +, -, / and * operations.
Definition: vector_bte.cpp:114
std::vector< int > excludeIndices
List of Bloch states to be excluded from the calculation (i.e.
Definition: vector_bte.h:168
double & operator()(const int &iCalc, const int &iDim, const int &iState)
Get and set operator.
Definition: vector_bte.cpp:454
void outputToJSON(const std::string &outFileName, BaseBandStructure &outerBandStructure)
Output the contents of a vector BTE object to a JSON file.
Definition: vector_bte.cpp:289
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_bte.cpp:472
Eigen::MatrixXd dot(const VectorBTE &that)
Computes the scalar product between two VectorBTE objects.
Definition: vector_bte.cpp:67
int getNumStates()
return the number of states in this vector BTE object
Definition: vector_bte.cpp:490