AlmaBTE  1.3
A solver of the space- and time-dependent Boltzmann transport equation for phonons
dos.hpp
Go to the documentation of this file.
1 // Copyright 2015-2018 The ALMA Project Developers
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12 // implied. See the License for the specific language governing
13 // permissions and limitations under the License.
14 
15 #pragma once
16 
20 
21 #include <qpoint_grid.hpp>
22 #include <boost/math/distributions/normal.hpp>
23 
24 namespace alma {
29 public:
31  const double mu;
33  const double sigma;
35  const bool truncated;
38  const double lbound;
41  const double ubound;
50  std::size_t iq,
51  std::size_t im,
52  double scalebroad)
53  : mu(grid.get_spectrum_at_q(iq).omega(im)),
54  sigma(scalebroad *
55  grid.base_sigma(grid.get_spectrum_at_q(iq).vg.col(im))),
56  truncated(mu - constants::nsigma * sigma < 0.),
57  lbound(truncated ? 0. : mu - constants::nsigma * sigma),
58  ubound(mu + constants::nsigma * sigma) {
59  if ((this->mu == 0.) || (this->sigma == 0.))
60  this->dist = nullptr;
61  else
62  this->dist = make_unique<boost::math::normal>(mu, sigma);
63  }
64 
65 
71  double get_contribution(double omega) const {
72  if (this->dist)
73  return boost::math::pdf(*(this->dist), omega);
74  else
75  return 0.;
76  }
77 
78 
79 private:
81  std::unique_ptr<boost::math::normal> dist;
82 };
83 } // namespace alma
Definition: analytic1d.hpp:26
const bool truncated
True if the usual lower bound would be negative.
Definition: dos.hpp:35
const double ubound
Upper bound to the values that can be considered compatible with the average energy.
Definition: dos.hpp:41
Classes and functions used to manipulate grids in reciprocal space.
Objects of this class handle the contribution of a mode to the phonon DOS.
Definition: dos.hpp:28
const double sigma
Standard deviation.
Definition: dos.hpp:33
Objects of this class represent a regular grid with the Gamma point in one corner.
Definition: qpoint_grid.hpp:32
const double lbound
Lower bound to the values that can be considered compatible with the average energy.
Definition: dos.hpp:38
double get_contribution(double omega) const
Get the amplitude of this contribution at a given frequency.
Definition: dos.hpp:71
const double mu
Average energy.
Definition: dos.hpp:31
Gaussian_for_DOS(const Gamma_grid &grid, std::size_t iq, std::size_t im, double scalebroad)
Constructor.
Definition: dos.hpp:49