TBTK
Need a break? Support the development by playing Polarity Puzzles
MomentumSpaceContext.h
1 /* Copyright 2017 Kristofer Björnson
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 implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
17 
24 #ifndef COM_DAFER45_TBTK_MOMENTUM_SPACE_CONTEXT
25 #define COM_DAFER45_TBTK_MOMENTUM_SPACE_CONTEXT
26 
27 #include "TBTK/BrillouinZone.h"
28 
29 #include <vector>
30 
31 namespace TBTK{
32 
33 class MomentumSpaceContext{
34 public:
36  MomentumSpaceContext(
37  const BrillouinZone &brillouinZone,
38  const std::vector<unsigned int> &numMeshPoints
39  );
40 
42  const BrillouinZone& getBrillouinZone() const;
43 
45  const std::vector<unsigned int>& getNumMeshPoints() const;
46 
48  const std::vector<std::vector<double>>& getMesh() const;
49 
51  Index getKIndex(const std::vector<double> &k) const;
52 private:
54  const BrillouinZone *brillouinZone;
55 
57  std::vector<unsigned int> numMeshPoints;
58 
60  std::vector<std::vector<double>> mesh;
61 };
62 
63 inline const BrillouinZone& MomentumSpaceContext::getBrillouinZone() const{
64  return *brillouinZone;
65 }
66 
67 inline const std::vector<unsigned int>& MomentumSpaceContext::getNumMeshPoints(
68 ) const{
69  return numMeshPoints;
70 }
71 
72 inline const std::vector<std::vector<double>>& MomentumSpaceContext::getMesh(
73 ) const{
74  return mesh;
75 }
76 
77 inline Index MomentumSpaceContext::getKIndex(
78  const std::vector<double> &k
79 ) const{
80  return brillouinZone->getMinorCellIndex(
81  k,
82  numMeshPoints
83  );
84 }
85 
86 }; //End of namespace TBTK
87 
88 #endif
89 
Definition: Boolean.h:32