AlmaBTE  1.3
A solver of the space- and time-dependent Boltzmann transport equation for phonons
shengbtepp.cpp File Reference

Emulate ShengBTE using the facilities in the ALMA library. More...

#include <cstdlib>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <complex>
#include <functional>
#include <Eigen/Dense>
#include <boost/mpi.hpp>
#include <boost/format.hpp>
#include <boost/filesystem.hpp>
#include <boost/math/special_functions/pow.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/iostreams/stream_buffer.hpp>
#include <boost/iostreams/device/null.hpp>
#include <boost/math/distributions/normal.hpp>
#include <symmetry.hpp>
#include <utilities.hpp>
#include <structures.hpp>
#include <vasp_io.hpp>
#include <qpoint_grid.hpp>
#include <bulk_properties.hpp>
#include <dos.hpp>
#include <isotopic_scattering.hpp>
#include <processes.hpp>
#include <shengbte_iter.hpp>
Include dependency graph for shengbtepp.cpp:

Classes

struct  sheng_allocations
 Data structure containing the information in an allocations namelist from ShengBTE. More...
 
struct  sheng_parameters
 Data structure containing the information in a parameters namelist from ShengBTE. More...
 
struct  sheng_flags
 Data structure containing the information in a flags namelist from ShengBTE. More...
 

Functions

sheng_allocations read_sheng_allocations (void)
 Parse the allocations namelist from a CONTROL file in the current directory.
 
sheng_parameters read_sheng_parameters (void)
 Parse the flags namelist from a CONTROL file in the current directory.
 
sheng_flags read_sheng_flags (void)
 Parse the flags namelist from a CONTROL file in the current directory.
 
void read_sheng_scell (struct sheng_allocations *allocs, int *na, int *nb, int *nc)
 Read the supercell size from a CONTROL file in the current directory.
 
void read_sheng_lattvec (struct sheng_allocations *allocs, double lattvec[3][3])
 Read the lattice vectors (including lfactor) from a CONTROL file in the current directory. More...
 
void read_sheng_epsilon (struct sheng_allocations *allocs, double epsilon[3][3])
 Read the dielectric tensor from a CONTROL file in the current directory.
 
void read_sheng_types (struct sheng_allocations *allocs, int *types)
 Read the list of atom types from a CONTROL file in the current directory.
 
void read_sheng_masses (struct sheng_allocations *allocs, double *types)
 Read the list of element masses from a CONTROL file in the current directory. More...
 
void read_sheng_gfactors (struct sheng_allocations *allocs, double *types)
 Read the list of mass disorder "g" factors from a CONTROL file in the current directory. More...
 
void read_sheng_position (struct sheng_allocations *allocs, int index, double position[3])
 Read the coordinates of an atom from a CONTROL file in the current directory. More...
 
void read_sheng_born (struct sheng_allocations *allocs, int index, double born[3][3])
 Read the Born effective charge tensor of an atom from a CONTROL file in the current directory. More...
 
void read_sheng_element (struct sheng_allocations *allocs, int index, char element[4])
 Read an element name from a CONTROL file in the current directory.
 
std::unique_ptr< std::ostream > open_from_master (const std::string &filename)
 
std::string gen_subdir_name (double T)
 Create a directory name corresponding to a given temperature. More...
 
std::array< double, 2 > calc_percentiles_log (const Eigen::Ref< const Eigen::ArrayXXd > &sigma)
 Compute the 25th and 75th percentiles of log(sigma) More...
 
Eigen::ArrayXXd calc_mode_gruneisen (const alma::Crystal_structure &cell, const alma::Gamma_grid &grid, const std::vector< alma::Thirdorder_ifcs > &fc3)
 Compute the Grüneisen parameter for each mode on a grid. More...
 
double calc_total_gruneisen (const alma::Gamma_grid &grid, const Eigen::Ref< const Eigen::ArrayXXd > &modegrun, double T)
 Compute the total Grüneisen parameter as a weighted average of mode Grüneisen parameters. More...
 
int main (int argc, char **argv)
 

Variables

boost::iostreams::stream_buffer< boost::iostreams::null_sink > null_buf
 

Detailed Description

Emulate ShengBTE using the facilities in the ALMA library.

The binary generated from this file will read a ShengBTE CONTROL file, perform the same calculation as ShengBTE would, and generate a ShengBTE-compatible output. A few limitations apply: in particular, support for nanowire calculations using the method described in Phys. Rev. B 85 (2012) 195436 is not implemented.

Function Documentation

◆ calc_mode_gruneisen()

Eigen::ArrayXXd calc_mode_gruneisen ( const alma::Crystal_structure cell,
const alma::Gamma_grid grid,
const std::vector< alma::Thirdorder_ifcs > &  fc3 
)

Compute the Grüneisen parameter for each mode on a grid.

Parameters
[in]cell- description of the unit cell
[in]grid- regular grid with phonon spectrum
[in]fc3- set of third-order force constants
Returns
an array with the mode Grüneisen parameters for each q point and each branch.

◆ calc_percentiles_log()

std::array<double, 2> calc_percentiles_log ( const Eigen::Ref< const Eigen::ArrayXXd > &  sigma)

Compute the 25th and 75th percentiles of log(sigma)

Parameters
[in]sigmaan Eigen array with all broadening parameters
Returns
an array containing the 25th and 75th percentiles

◆ calc_total_gruneisen()

double calc_total_gruneisen ( const alma::Gamma_grid grid,
const Eigen::Ref< const Eigen::ArrayXXd > &  modegrun,
double  T 
)

Compute the total Grüneisen parameter as a weighted average of mode Grüneisen parameters.

Parameters
[in]grid- regular grid with phonon spectrum
[in]modegrun- Grüneisen parameters for each q point and each branch
[in]T- temperature in K
Returns
the total Grüneisen parameter at the given temperature

◆ gen_subdir_name()

std::string gen_subdir_name ( double  T)

Create a directory name corresponding to a given temperature.

Parameters
[in]T- temperature in K @

◆ read_sheng_born()

void read_sheng_born ( struct sheng_allocations allocs,
int  index,
double  born[3][3] 
)

Read the Born effective charge tensor of an atom from a CONTROL file in the current directory.

◆ read_sheng_gfactors()

void read_sheng_gfactors ( struct sheng_allocations allocs,
double *  types 
)

Read the list of mass disorder "g" factors from a CONTROL file in the current directory.

◆ read_sheng_lattvec()

void read_sheng_lattvec ( struct sheng_allocations allocs,
double  lattvec[3][3] 
)

Read the lattice vectors (including lfactor) from a CONTROL file in the current directory.

◆ read_sheng_masses()

void read_sheng_masses ( struct sheng_allocations allocs,
double *  types 
)

Read the list of element masses from a CONTROL file in the current directory.

◆ read_sheng_position()

void read_sheng_position ( struct sheng_allocations allocs,
int  index,
double  position[3] 
)

Read the coordinates of an atom from a CONTROL file in the current directory.

Variable Documentation

◆ null_buf

boost::iostreams::stream_buffer<boost::iostreams::null_sink> null_buf
Initial value:
{
boost::iostreams::null_sink()}