ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
libviennashe.cpp
Go to the documentation of this file.
1/* ============================================================================
2 Copyright (c) 2011-2022, Institute for Microelectronics,
3 Institute for Analysis and Scientific Computing,
4 TU Wien.
5
6 -----------------
7 ViennaSHE - The Vienna Spherical Harmonics Expansion Boltzmann Solver
8 -----------------
9
10 http://viennashe.sourceforge.net/
11
12 License: MIT (X11), see file LICENSE in the base directory
13=============================================================================== */
14
15// C++ includes
17
18// C includes
21
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
32{
33 try
34 {
35 viennashe::log::info() << viennashe::preamble() << std::endl;
36 //
37 // If you are using MPI: Initialize MPI here!
38 //
39
40 return 0;
41 }
42 catch(...)
43 {
44 return -1;
45 }
46}
47
53{
54 //
55 // If you are using MPI: Finalize MPI here!
56 //
57
58 viennashe::log::info() << std::endl;
59 viennashe::log::info() << "*********************************************************" << std::endl;
60 viennashe::log::info() << "* ViennaSHE finished *" << std::endl;
61 viennashe::log::info() << "*********************************************************" << std::endl;
62 return 0;
63}
64
71{
72 if (ecode != 0)
73 {
74 if(ecode > 0) viennashe::log::error() << "Found error in the last routine. Error is likely to be due to argument number " << ecode << std::endl;
75 else viennashe::log::error() << "Encountered a severe internal error in the last routine. " << std::endl;
76
77 return ecode;
78 }
79
80 return 0;
81}
82
83#ifdef __cplusplus
84}
85#endif
VIENNASHE_EXPORT viennasheErrorCode viennashe_error(viennasheErrorCode ecode)
Error code interpretation function.
int viennasheErrorCode
Definition: error.h:25
VIENNASHE_EXPORT viennasheErrorCode viennashe_finalize(void)
Finalizes ViennaSHE.
VIENNASHE_EXPORT viennasheErrorCode viennashe_initalize(void)
Initializes ViennaSHE. To be called before ViennaSHE is used.
logger< true > error()
Used to log errors. The logging level is logERROR.
Definition: log.hpp:301
logger< true > info()
Used to log infos. The logging level is logINFO.
Definition: log.hpp:307
std::string preamble()
Prints the ViennaSHE preamble (header). Used in all the examples as well as the standalone-applicatio...
Definition: version.hpp:63
Contains all viennashe includes and most of the C++/C-wrappers. Contains macros.