Go to the documentation of this file.
26 #ifndef COM_DAFER45_TBTK_BOUNDARY_CONDITION
27 #define COM_DAFER45_TBTK_BOUNDARY_CONDITION
62 const std::string &serializeation,
121 Index eliminationIndex;
128 if(hoppingAmplitudeList.
getSize() > 0){
131 hoppingAmplitudeList[0].getToIndex()
133 "BoundaryCondition::add()",
134 "Incompatible to-Indices. All HoppingAmplitudes in a"
135 <<
" BoundaryCondition must have the same to-Index."
136 <<
" The added HoppingAmplitude has to-Index '"
138 <<
" while a HoppingAmplitude with to-Index '"
139 << hoppingAmplitudeList[0].getToIndex().toString()
140 <<
"' already has been added.",
150 "BoundaryCondition::add()",
151 "Incompatible Indices. The HoppingAmplitude"
152 <<
" must have the same to-Index as the Index"
153 <<
" of the SourceAmplitude. The"
154 <<
" HoppingAmplitude has to-Index '"
156 <<
"' while the SourceAmplitude has Index '"
163 hoppingAmplitudeList.
add(hoppingAmplitude);
167 return hoppingAmplitudeList;
173 "BoundaryCondition::set()",
174 "Invalid Index. The SourceAmplitudes Index cannot be the empty"
178 if(hoppingAmplitudeList.
getSize() > 0){
181 hoppingAmplitudeList[0].getToIndex()
183 "BoundaryCondition::set()",
184 "Incompatible Indices. The SourceAmplitude must have"
185 <<
" the same Index as the HoppingAmplitudes"
186 <<
" to-Indices. The SourceAmplitude has Index '"
188 <<
" HoppingAmplitude with to-Index '"
189 << hoppingAmplitudeList[0].getToIndex().toString()
190 <<
"' already has been added.",
195 this->sourceAmplitude = sourceAmplitude;
199 return sourceAmplitude;
203 bool eliminationIndexFound =
false;
204 for(
unsigned int n = 0; n < hoppingAmplitudeList.
getSize(); n++){
206 hoppingAmplitudeList[n].getFromIndex().equals(
210 eliminationIndexFound =
true;
215 eliminationIndexFound,
216 "BoundaryCondition::setEliminationIndex()",
217 "Invalid elimination Index. The elimination Index must be"
218 <<
" equal to the from-Index of at least one HoppingAmplitude"
219 <<
" added to the BoundaryCondition but no such from-Index was"
221 "First add HoppingAmplitudes using BoundaryCondition::add()"
224 this->eliminationIndex = eliminationIndex;
228 return eliminationIndex;
233 + hoppingAmplitudeList.
getSizeInBytes() -
sizeof(hoppingAmplitudeList)
List of HoppingAmplitudes .
List of HoppingAmplitudes .
Definition: HoppingAmplitudeList.h:34
void setEliminationIndex(const Index &eliminationIndex)
Definition: BoundaryCondition.h:202
std::string toString() const
Definition: Index.h:349
const HoppingAmplitudeList & getHoppingAmplitudeList() const
Definition: BoundaryCondition.h:166
bool equals(const Index &index, bool allowWildcard=false) const
Definition: Index.h:411
const Index & getEliminationIndex() const
Definition: BoundaryCondition.h:227
unsigned int getSizeInBytes() const
Definition: Index.h:548
unsigned int getSizeInBytes() const
Definition: BoundaryCondition.h:231
void add(const HoppingAmplitude &hoppingAmplitude)
Definition: BoundaryCondition.h:127
unsigned int getSizeInBytes() const
Definition: HoppingAmplitudeList.h:101
Definition: Serializable.h:43
A set of HoppingAmplitudes , a SourceAmplitude, and an elimination Index, which together form a singl...
Definition: BoundaryCondition.h:49
Source amplitude for equations with a source term.
void add(const HoppingAmplitude &hoppingAmplitude)
Definition: HoppingAmplitudeList.h:85
Source amplitude for equations with a source term.
Definition: SourceAmplitude.h:40
const Index & getToIndex() const
Definition: HoppingAmplitude.h:264
Abstract base class for serializable objects.
std::string serialize(Serializable::Mode mode) const
unsigned int getSizeInBytes() const
Definition: SourceAmplitude.h:161
Hopping amplitude from state 'from' to state 'to'.
Definition: HoppingAmplitude.h:53
BoundaryCondition()
Definition: BoundaryCondition.h:124
Hopping amplitude from state 'from' to state 'to'.
Mode
Definition: Serializable.h:47
const Index & getIndex() const
Definition: SourceAmplitude.h:146
void set(const SourceAmplitude &sourceAmplitude)
Definition: BoundaryCondition.h:170
unsigned int getSize() const
Definition: HoppingAmplitudeList.h:91
Physical index.
Definition: Index.h:44
const SourceAmplitude & getSourceAmplitude() const
Definition: BoundaryCondition.h:198