AlmaBTE  1.3
A solver of the space- and time-dependent Boltzmann transport equation for phonons
superlattices.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 
27 
28 #pragma GCC diagnostic push
29 #pragma GCC diagnostic ignored "-Wunused-variable"
30 #include <randutils.hpp>
31 #pragma GCC diagnostic pop
32 #include <structures.hpp>
33 #include <vc.hpp>
34 #include <dynamical_matrix.hpp>
35 
36 namespace alma {
40 public:
43  const Eigen::Vector3i normal;
45  const Eigen::ArrayXd profile;
47  const std::size_t nlayers;
50  const double average;
52  const std::unique_ptr<Crystal_structure> vc_struct;
64  const Crystal_structure& struct2,
65  const Eigen::Ref<const Eigen::Vector3i>& _normal,
66  const Eigen::Ref<const Eigen::ArrayXd>& _profile)
67  : normal(_normal), profile(_profile), nlayers(_profile.size()),
68  average(_profile.sum() / profile.size()),
69  vc_struct(
70  vc_mix_structures({struct1, struct2}, {1. - average, average})) {
71  if (struct1.is_alloy() || struct2.is_alloy())
72  throw value_error("superlattices cannot be built "
73  "out of virtual crystals");
74 
75  if (_profile.size() == 0)
76  throw value_error("empty profile");
77 
78  if ((_profile.minCoeff() < 0.) || (_profile.minCoeff() > 1.))
79  throw value_error("all atomic rations must be in "
80  "[0, 1]");
81 
82  if (_profile.minCoeff() == _profile.maxCoeff())
83  throw value_error("flat composition profile");
84  this->fill_factors(struct1, struct2);
85  }
93  Eigen::ArrayXXd calc_w0_medium(const alma::Gamma_grid& grid,
94  const boost::mpi::communicator& comm,
95  double scalebroad = 1.0) const;
96 
107  Eigen::ArrayXXd calc_w0_barriers(const alma::Gamma_grid& grid,
108  const Dynamical_matrix_builder& factory,
109  randutils::mt19937_rng& rng,
110  const boost::mpi::communicator& comm,
111  std::size_t nqline) const;
112 
113 private:
116  Eigen::MatrixXd gfactors;
118  Eigen::VectorXd vfactors;
126  void fill_factors(const Crystal_structure& struct1,
127  const Crystal_structure& struct2);
128 };
129 } // namespace alma
Definition: analytic1d.hpp:26
Superlattice_structure(const Crystal_structure &struct1, const Crystal_structure &struct2, const Eigen::Ref< const Eigen::Vector3i > &_normal, const Eigen::Ref< const Eigen::ArrayXd > &_profile)
Basic constructor.
Definition: superlattices.hpp:63
std::unique_ptr< Crystal_structure > vc_mix_structures(const std::vector< Crystal_structure > &components, const std::vector< double > &ratios)
Create an average structure out of several Crystal_structure objects containing the same atomic sites...
Definition: vc.cpp:24
Exception related to the parameters passed to a function.
Definition: exceptions.hpp:33
const std::size_t nlayers
Number of layers.
Definition: superlattices.hpp:47
Code related to the dynamical matrix.
Factory of Dynamical_matrix objects.
Definition: dynamical_matrix.hpp:108
Eigen::ArrayXXd calc_w0_barriers(const alma::Gamma_grid &grid, const Dynamical_matrix_builder &factory, randutils::mt19937_rng &rng, const boost::mpi::communicator &comm, std::size_t nqline) const
Compute the contribution to scattering from the supercell barriers.
Definition: superlattices.cpp:83
Definitions of the basic data-handling classes in ALMA.
const Eigen::Vector3i normal
Direction normal to the superlattice layers in the crystal structure.
Definition: superlattices.hpp:43
Objects of this class represent a regular grid with the Gamma point in one corner.
Definition: qpoint_grid.hpp:32
Hold information about a crystal structure.
Definition: structures.hpp:51
const Eigen::ArrayXd profile
Fraction of the second component in each layer.
Definition: superlattices.hpp:45
Eigen::ArrayXXd calc_w0_medium(const alma::Gamma_grid &grid, const boost::mpi::communicator &comm, double scalebroad=1.0) const
Compute the contribution to scattering from disorder in the effective medium.
Definition: superlattices.cpp:61
const std::unique_ptr< Crystal_structure > vc_struct
Structural description of the average virtual crystal.
Definition: superlattices.hpp:52
const double average
Average fraction of the second component in the superlattice.
Definition: superlattices.hpp:50
Code related to the virtual crystal approximation for alloys and isotopic mixtures.
POD class containing the information about a binary superlattice.
Definition: superlattices.hpp:39