42 viennashe::log::error() <<
"ERROR! viennashe_create_quantity_register(): The simulator (sim) must be valid!" << std::endl;
64 viennashe::log::error() <<
"ERROR! viennashe_create_quantity_register(): Malconfigured simulator!" << std::endl;
124 for (std::size_t i = 0; i < vnames.size(); ++i)
127 names[i] = (
char*) malloc(
sizeof(
char) * (vnames[i].size()+1));
128 std::strncpy(names[i], vnames[i].c_str(), vnames[i].size()+1);
133 viennashe::log::error() <<
"ERROR: viennashe_get_vertex_based_quantity_list(): UNKOWN ERROR!" << std::endl;
158 viennashe::log::error() <<
"ERROR: viennashe_get_vertex_based_quantity(): UNKOWN ERROR!" << std::endl;
177 viennashe::log::error() <<
"ERROR: viennashe_get_vertex_based_quantity(): The quantity '" << name <<
"' does not exist." << std::endl;
186 viennashe::log::error() <<
"ERROR: viennashe_get_vertex_based_quantity(): UNKOWN ERROR!" << std::endl;
208 viennashe::log::error() <<
"ERROR! viennashe_get_she_edf(): The simulator (sim) must be valid!" << std::endl;
247 viennashe::log::error() <<
"ERROR: viennashe_get_she_dos(): The register pointer (reg) must not be NULL." << std::endl;
250 if (len == NULL) {
return 5; }
251 if (energies == NULL) {
return 3; }
252 if (values == NULL) {
return 4; }
258 viennashe::log::error() <<
"ERROR! viennashe_get_she_dos(): The simulator (sim) must be valid!" << std::endl;
305 viennashe::log::error() <<
"ERROR! viennashe_get_she_group_velocity(): The simulator (sim) must be valid!" << std::endl;
323 viennashe::log::error() <<
"ERROR! viennashe_get_she_group_velocity(): Malconfigured simulator!" << std::endl;
347 viennashe::log::error() <<
"ERROR: viennashe_prealloc_vertex_based_quantity(): The mesh is malconfigured." << std::endl;
351 if ( *uarray == NULL )
354 *uarray =
new double*[num_vertices];
356 for (
size_t i = 0; i < num_vertices; ++i)
363 viennashe::log::error() <<
"ERROR: viennashe_prealloc_vertex_based_quantity(): The user array (uarray) is already preallocated (uarray != NULL)." << std::endl;
372 for (
size_t i = 0; i < num_vertices; ++i)
379 viennashe::log::error() <<
"ERROR: viennashe_prealloc_vertex_based_quantity(): The user array (len) is already preallocated (len != NULL)." << std::endl;
387 viennashe::log::error() <<
"ERROR: viennashe_prealloc_vertex_based_quantity(): UNKOWN ERROR!" << std::endl;
403 viennashe::log::error() <<
"ERROR: viennashe_free_vertex_based_quantity(): The mesh is malconfigured." << std::endl;
407 if ((*uarray) != NULL)
409 for (
size_t i = 0; i < num_vertices; ++i)
411 if ((*uarray)[i] != NULL)
429 viennashe::log::error() <<
"ERROR: viennashe_free_vertex_based_quantity(): UNKOWN ERROR!" << std::endl;
quantity_wrapper const & get(std::string const &name) const
Returns a single const reference to a quantitiy wrapper.
bool has_quan(std::string const &name) const
Returns true if a quantity is registered.
std::size_t size() const
Returns the number of registered quantities.
std::vector< std::string > get_names() const
Returns all names of the registered quantities.
virtual void fill(double **values, viennashe_index_type *len) const =0
Interface. Fills values with all quantity values, where the length of values[i] is to be found in len...
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_num_vertices(viennashe_device dev, viennashe_index_type *num)
void she_fill_dos(SimulatorT const &sim, viennashe::carrier_type_id ctype, double **ekin, double **dos, viennashe_index_type *len)
Fills the given C-arrays ekin and dos with the DOS for every vertex.
void she_fill_group_velocity(SimulatorT const &sim, viennashe::carrier_type_id ctype, double **ekin, double **vg, viennashe_index_type *len)
Fills the given C-arrays ekin and vg with the group velocity for every vertex.
void register_quans(SimulatorT const &sim, quan_register_internal ®)
Main quantity regsiter function. Add your simulator quantities here.
void she_fill_edf(SimulatorT const &sim, viennashe::carrier_type_id ctype, double **ekin, double **edf, viennashe_index_type *len)
Fills the given C-arrays with the complete EDF.
reg
This is DD, so we do not need to give any inital guess.
logger< true > error()
Used to log errors. The logging level is logERROR.
carrier_type_id
Enumeration type for selecting the carrier type.
viennashe_quan_register_impl * viennashe_quan_register
VIENNASHE_EXPORT viennasheErrorCode viennashe_free_quantity_register(viennashe_quan_register reg)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_she_dos(viennashe_quan_register reg, viennashe_carrier_ids ctype, double **energies, double **values, viennashe_index_type *len)
VIENNASHE_EXPORT viennasheErrorCode viennashe_has_cell_based_quantity(viennashe_quan_register reg, char const *name, libviennashe_bool *exists)
VIENNASHE_EXPORT viennasheErrorCode viennashe_create_quantity_register(viennashe_quan_register *reg, viennashe_simulator sim)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_cell_based_quantity_list(viennashe_quan_register reg, char **names)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_cell_based_quantity(viennashe_quan_register reg, char const *name, double **values, viennashe_index_type *len)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_she_group_velocity(viennashe_quan_register reg, viennashe_carrier_ids ctype, double **energies, double **values, viennashe_index_type *len)
VIENNASHE_EXPORT viennasheErrorCode viennashe_prealloc_cell_based_quantity(viennashe_device dev, double ***uarray, viennashe_index_type **len)
viennashe_carrier_ids
Enum of available charge carrier types.
VIENNASHE_EXPORT viennasheErrorCode viennashe_free_cell_based_quantity(viennashe_device dev, double ***uarray, viennashe_index_type **len)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_num_cell_based(viennashe_quan_register reg, viennashe_index_type *num)
VIENNASHE_EXPORT viennasheErrorCode viennashe_get_she_edf(viennashe_quan_register reg, viennashe_carrier_ids ctype, double **energies, double **values, viennashe_index_type *len)
Common routines for the registry of simulator dependent quantities.
Routines to wrap ViennaSHE quantities (doping, potential, distribution functions, ....
C++ to C wrapper of the quantity registry.
libviennashe::quantity::quantitiy_register cell_based
viennashe_simulator_impl * int_sim
Register for vertex based quantities.
Internal C++ to C wrapper for the device. Has typedefs and destructor.
Internal C++ to C wrapper for the simulator. Has typedefs and destructor.
unsigned long viennashe_index_type
Contains all viennashe includes and most of the C++/C-wrappers. Contains macros.
#define CHECK_ARGUMENT_FOR_NULL(arg, pos, name)