ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
exception.hpp
Go to the documentation of this file.
1#ifndef VIENNASHE_SHE_EXCEPTION_HPP
2#define VIENNASHE_SHE_EXCEPTION_HPP
3
4/* ============================================================================
5 Copyright (c) 2011-2022, Institute for Microelectronics,
6 Institute for Analysis and Scientific Computing,
7 TU Wien.
8
9 -----------------
10 ViennaSHE - The Vienna Spherical Harmonics Expansion Boltzmann Solver
11 -----------------
12
13 http://viennashe.sourceforge.net/
14
15 License: MIT (X11), see file LICENSE in the base directory
16=============================================================================== */
17
18
19#include <iostream>
20#include <stdexcept>
21#include <sstream>
22
27namespace viennashe
28{
29 namespace she
30 {
32 class unknown_dispersion_relation_exception : public std::runtime_error {
33 public:
34 unknown_dispersion_relation_exception(std::string const & str) : std::runtime_error(str) {}
35 };
36
38 class no_init_guess_found_exception : public std::runtime_error {
39 public:
40 no_init_guess_found_exception(std::string const & str) : std::runtime_error(str) {}
41 };
42
44 class coupled_vertices_equal_exception : public std::runtime_error {
45 public:
46 coupled_vertices_equal_exception(std::string const & str) : std::runtime_error(str) {}
47 };
48
50 class division_by_zero : public std::runtime_error {
51 public:
52 division_by_zero(std::string const & str) : std::runtime_error(str) {}
53 };
54
59 class invalid_expansion_order_exception : public std::runtime_error
60 {
61 public:
62 virtual const char* what() const throw() { return msg_.c_str(); }
63
65 std::size_t l,
66 long m) : std::runtime_error(el), element_string_(el), l_(l), m_(m)
67 { this->fill_message(); }
68
70
71 private:
72 std::string element_string_;
73 std::size_t l_;
74 long m_;
75
76 std::string msg_;
77
78 void fill_message()
79 {
80 std::stringstream ss;
81 ss << "* ViennaSHE: Invalid expansion order (" << l_ << ", " << m_ << ") on " << element_string_ << " accessed!";
82 msg_ = ss.str();
83 }
84 };
85
86
91 class invalid_matrixelement_exception : public std::runtime_error
92 {
93 public:
94 virtual const char* what() const throw() { return _msg.c_str(); }
95
96 invalid_matrixelement_exception(std::string el, double value) : std::runtime_error(el), _value(value) { }
97
99
100 private:
101 double _value;
102 std::string _msg;
103
104 void fill_message()
105 {
106 std::stringstream ss;
107 ss << "* ViennaSHE: Invalid matrixelement '" << _value << "' found. ";
108 _msg = ss.str();
109 }
110 };
111
112
113
114
116 class quantity_not_yet_available_exception : public std::runtime_error {
117 public:
118 quantity_not_yet_available_exception(std::string const & str) : std::runtime_error(str) {}
119 };
120
121
123 class total_energy_too_small_exception : public std::runtime_error {
124 public:
125 total_energy_too_small_exception(std::string const & str) : std::runtime_error(str) {}
126 };
127
128
130 class no_carrier_type_id_specified_exception : public std::runtime_error {
131 public:
132 no_carrier_type_id_specified_exception(std::string const & str) : std::runtime_error(str) {}
133 };
134
135
138 public:
139 she_simulator_does_not_accept_drift_diffusion_only_exception(std::string const & str) : std::runtime_error(str) {}
140 };
141
143 class she_simulator_requires_bipolar_solution_for_traps : public std::runtime_error {
144 public:
145 she_simulator_requires_bipolar_solution_for_traps(std::string const & str) : std::runtime_error(str) {}
146 };
147
149 class negative_integration_interval_length_exception : public std::runtime_error {
150 public:
151 negative_integration_interval_length_exception(std::string const & str) : std::runtime_error(str) {}
152 };
153
156 public:
157 quantum_correction_with_newton_not_supported_exception(std::string const & str) : std::runtime_error(str) {}
158 };
159
160
162 class assembly_exception : public std::runtime_error {
163 public:
164 assembly_exception(std::string const & str) : std::runtime_error(str) {}
165 };
166
167
170 public:
171 invalid_scattering_term_exception(std::string const & str) : viennashe::she::assembly_exception(str) {}
172 };
173
174
177 public:
178 adaptive_she_not_available_for_this_configuration_exception(std::string const & str) : std::runtime_error(str) {}
179 };
180
182 class unkown_carrier_type_exception : public std::runtime_error {
183 public:
184 unkown_carrier_type_exception(std::string const & str) : std::runtime_error(str) {}
185 };
186
187 }
188}
189
190#endif
Exception for the case that adaptive SHE cannot deal with the provided configuration (currently holes...
Definition: exception.hpp:176
Exception for the case that a scattering term is Inf, NaN or causes an invalid system matrix entry.
Definition: exception.hpp:162
assembly_exception(std::string const &str)
Definition: exception.hpp:164
Exception for the case that a vertex has a coupling with itself.
Definition: exception.hpp:44
coupled_vertices_equal_exception(std::string const &str)
Definition: exception.hpp:46
Exception for the case that any component encounters a divison by 0.0.
Definition: exception.hpp:50
division_by_zero(std::string const &str)
Definition: exception.hpp:52
Exception for the case that invalid expansion order is accessed.
Definition: exception.hpp:60
invalid_expansion_order_exception(std::string el, std::size_t l, long m)
Definition: exception.hpp:64
Exception for the case that invalid expansion order is accessed.
Definition: exception.hpp:92
invalid_matrixelement_exception(std::string el, double value)
Definition: exception.hpp:96
Exception for the case that a scattering term is Inf, NaN or causes an invalid system matrix entry.
Definition: exception.hpp:169
invalid_scattering_term_exception(std::string const &str)
Definition: exception.hpp:171
Exception for the case that neither electrons nor holes are selected for the simulation.
Definition: exception.hpp:149
Exception for the case that neither electrons nor holes are selected for the simulation.
Definition: exception.hpp:130
no_carrier_type_id_specified_exception(std::string const &str)
Definition: exception.hpp:132
Exception for the case that no initial guess was/is specified.
Definition: exception.hpp:38
no_init_guess_found_exception(std::string const &str)
Definition: exception.hpp:40
Exception for the case that a macroscopic quantity is accessed, but the simulator has not yet been ru...
Definition: exception.hpp:116
quantity_not_yet_available_exception(std::string const &str)
Definition: exception.hpp:118
Exception for the case that a scattering term is Inf, NaN or causes an invalid system matrix entry.
Definition: exception.hpp:155
Exception for the case that neither electrons nor holes are selected for the simulation.
Definition: exception.hpp:137
Exception for the case that traps are enabled without a bipolar SHE simulation.
Definition: exception.hpp:143
Exception for the case that the total energy is smaller than the kinetic energy.
Definition: exception.hpp:123
total_energy_too_small_exception(std::string const &str)
Definition: exception.hpp:125
Exception for the case that an invalid dispersion relation is specified.
Definition: exception.hpp:32
unknown_dispersion_relation_exception(std::string const &str)
Definition: exception.hpp:34
Exception thrown in case an unkown or unsupported carrier type is found.
Definition: exception.hpp:182
unkown_carrier_type_exception(std::string const &str)
Definition: exception.hpp:184
The main ViennaSHE namespace. All functionality resides inside this namespace.
Definition: accessors.hpp:40