Phoebe developer's documentation  1.1.0
Phonon and Electron Boltzmann Equations
VectorEPA Class Reference

Class used to store a "matrix" of data. More...

#include <vector_epa.h>

Collaboration diagram for VectorEPA:

Public Member Functions

 VectorEPA (StatisticsSweep &statisticsSweep_, const int &numStates_, const int &dimensionality_=3)
 Constructor method, initializes raw buffer data and saves helper variables. More...
 
 VectorEPA (const VectorEPA &that)
 Copy constructor.
 
VectorEPAoperator= (const VectorEPA &that)
 Copy assignment operator.
 
virtual Eigen::MatrixXd dot (const VectorEPA &that)
 Computes the scalar product between two BaseVectorBTE objects. More...
 
VectorEPA operator* (VectorEPA &that)
 element wise product between two BaseVectorBTE objects x and y. More...
 
VectorEPA operator* (const double &scalar)
 Computes the product of a BaseVectorBTE with a scalar, i.e. More...
 
VectorEPA operator* (const Eigen::VectorXd &vector)
 Computes the product of a BaseVectorBTE with a vector. More...
 
VectorEPA operator* (ParallelMatrix< double > &matrix)
 Computes the product of a BaseVectorBTE with a parallel matrix. More...
 
VectorEPA operator+ (VectorEPA &that)
 element wise sum between two BaseVectorBTE objects x and y. More...
 
VectorEPA operator- (VectorEPA &that)
 element wise difference between two BaseVectorBTE objects x and y. More...
 
VectorEPA operator- ()
 Invert the sign of the BaseVectorBTE content i.e. More...
 
VectorEPA operator/ (VectorEPA &that)
 element wise division between two BaseVectorBTE objects x and y. More...
 
VectorEPA sqrt ()
 Replace the content of BaseVectorBTE with its square root (element-wise x -> sqrt(x) ).
 
VectorEPA reciprocal ()
 Replace the content of BaseVectorBTE with its reciprocal (element-wise x -> 1/x).
 
void setConst (const double &constant)
 Set the whole content (raw buffer) of BaseVectorBTE to a scalar value. More...
 
double & operator() (const int &iCalc, const int &iDim, const int &iState)
 Get and set operator.
 
const double & operator() (const int &iCalc, const int &iDim, const int &iState) const
 Const get and set operator.
 
int glob2Loc (const ChemPotIndex &imu, const TempIndex &it, const CartIndex &iDim) const
 glob2Loc and loc2Glob compress/decompress the indices on temperature, chemical potential, and cartesian direction into/from a single index. More...
 
std::tuple< ChemPotIndex, TempIndex, CartIndexloc2Glob (const int &i) const
 

Public Attributes

Eigen::MatrixXd data
 raw buffer containing the values of the vector The matrix has size (numCalculations, numStates), where numCalculations is the number of pairs of temperature and chemical potentials, and numStates is the number of Bloch states used in the Boltzmann equation.
 
StatisticsSweepstatisticsSweep
 
int numCalculations
 
int numStates
 
int numChemPots
 
int numTemps
 
int dimensionality
 
std::vector< int > excludeIndices
 List of Bloch states to be excluded from the calculation (i.e. More...
 

Protected Member Functions

VectorEPA baseOperator (VectorEPA &that, const int &operatorType)
 base class to implement +, -, / and * operations. More...
 

Protected Attributes

const int operatorSums = 0
 
const int operatorDivs = 1
 
const int operatorProd = 2
 
const int operatorDiff = 3
 

Detailed Description

The class member "data" has size data(numCalculations,numStates), where numCalculations is the number of temperatures/chemical potentials, and numStates is specified in input. Used for the EPA electron transport calculation. It is subclassed to a VectorBTE case when numStates is aligned with the Bloch states of the band structure class.

Constructor & Destructor Documentation

◆ VectorEPA()

VectorEPA::VectorEPA ( StatisticsSweep statisticsSweep_,
const int &  numStates_,
const int &  dimensionality_ = 3 
)
Parameters
statisticsSweepsaves the info on how many temperatures/chemical potentials we are evaluating.
numStatessaves the number of states on which we compute the vector.
dimensionalitydetermines the size of the vector on cartesian indices. 1 for scalar quantities like line-widths Gamma(BlochIndices), 3 for vector quantities like phonon populations f(blochIndices,cartesian).
Here is the call graph for this function:

Member Function Documentation

◆ baseOperator()

VectorEPA VectorEPA::baseOperator ( VectorEPA that,
const int &  operatorType 
)
protected

It's split separately so that subclasses can create the correct output class, and also because operations are rather similar.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dot()

Eigen::MatrixXd VectorEPA::dot ( const VectorEPA that)
virtual

The scalar product of x and y, is defined such as z(iCalc) = sum_i x(iCalc,i) y(iCalc,i), where i is an index over Bloch states, and iCalc is an index over temperatures and chemical potentials.

Parameters
thatthe second vector used in the scalar product
Here is the call graph for this function:

◆ glob2Loc()

int VectorEPA::glob2Loc ( const ChemPotIndex imu,
const TempIndex it,
const CartIndex iDim 
) const

TODO: these indices, and how they are used elsewhere, is rather messy That's because we have to work both with quantities such as line-widths, which are a scalar over the Bloch states, and phonon populations, which are cartesian vectors over the Bloch states. I should probably create two different classes for these.

Here is the caller graph for this function:

◆ operator*() [1/4]

VectorEPA VectorEPA::operator* ( const double &  scalar)

all elements of vectorBTE x -> x * scalar.

Parameters
scalara double with the constant factor to be used in the element-wise multiplication.

◆ operator*() [2/4]

VectorEPA VectorEPA::operator* ( const Eigen::VectorXd &  vector)

The vector has size equal to the number of calculations (i.e. number of temperatures times the number of chemical potentials) used in the run. Given a calculation index iCalc, the result is an element-wise x(it)*vector(it).

Parameters
vectora double vector to be used in the product, of size equal to numCalculations.

◆ operator*() [3/4]

VectorEPA VectorEPA::operator* ( ParallelMatrix< double > &  matrix)

Only works if the number of temperatures/chemical potentials (numCalculations) is equal to one. At fixed calculation index iCalc, the result is an matrix-vector multiplication x(it,i)*pMatrix(i,j).

Parameters
pMatrixa parallel distributed double matrix to be used in the product, of size equal to numStates x numStates.
Here is the call graph for this function:

◆ operator*() [4/4]

VectorEPA VectorEPA::operator* ( VectorEPA that)

If the dimensionality of the two objects is the same, we compute element-wise result = x*y. If y has dimensionality 1, we compute x(every dim)*y(0), and the result has the dimensionality of x.

Parameters
thatthe second BaseVectorBTE object y, such that result = *this*y
Here is the call graph for this function:

◆ operator+()

VectorEPA VectorEPA::operator+ ( VectorEPA that)

If the dimensionality of the two objects is the same, we compute element-wise result = x+y. If y has dimensionality 1, we compute x(every dim)+y(0), and the result has the dimensionality of x.

Parameters
thatthe second BaseVectorBTE object y, such that result = *this+y
Here is the call graph for this function:

◆ operator-() [1/2]

VectorEPA VectorEPA::operator- ( )

x -> -x

◆ operator-() [2/2]

VectorEPA VectorEPA::operator- ( VectorEPA that)

If the dimensionality of the two objects is the same, we compute element-wise result = x-y. If y has dimensionality 1, we compute x(every dim)-y(0), and the result has the dimensionality of x.

Parameters
thatthe second BaseVectorBTE object y, such that result = *this-y
Here is the call graph for this function:

◆ operator/()

VectorEPA VectorEPA::operator/ ( VectorEPA that)

If the dimensionality of the two objects is the same, we compute element-wise result = x/y. If y has dimensionality 1, we compute x(every dim)/y(0), and the result has the dimensionality of x.

Parameters
thatthe second BaseVectorBTE object y, such that result = *this/y
Here is the call graph for this function:

◆ setConst()

void VectorEPA::setConst ( const double &  constant)
Parameters
constantthe value to be used in the set.

Member Data Documentation

◆ excludeIndices

std::vector<int> VectorEPA::excludeIndices

for which vectorBTE values are 0), for example, the acoustic modes at the gamma point, whose zero frequencies may cause problems.