PLaSK library
Loading...
Searching...
No Matches
diffusion1d.cpp
Go to the documentation of this file.
1/*
2 * This file is part of PLaSK (https://plask.app) by Photonics Group at TUL
3 * Copyright (c) 2022 Lodz University of Technology
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
17#include <cmath>
18#include <plask/python.hpp>
19using namespace plask;
20using namespace plask::python;
21
22#include "../diffusion1d.hpp"
23using namespace plask::electrical::diffusion1d;
24
25template <typename GeometryT>
29
37{
38 {CLASS(DiffusionFem2DSolver<Geometry2DCylindrical>, "OldDiffusionCyl", u8"Calculates carrier pairs concentration in active region using FEM in one-dimensional cylindrical space")
39
40 METHOD(compute_initial, compute_initial, u8"Perform the initial computation");
41 METHOD(compute_threshold, compute_threshold, u8"Perform the threshold computation");
42 METHOD(compute_overthreshold, compute_overthreshold, u8"Perform the overthreshold computation");
43 solver.def_readwrite("initial", &__Class__::do_initial, u8"True if we start from initial computations");
44 solver.def_readwrite("fem_method", &__Class__::fem_method, u8"Finite-element method (linear of parabolic)");
45 solver.add_property("current_mesh", DiffusionSolver_current_mesh<Geometry2DCylindrical>, u8"Horizontal adaptive mesh)");
46 solver.def_readwrite("accuracy", &__Class__::relative_accuracy, u8"Required relative accuracy");
47 solver.def_readwrite("abs_accuracy", &__Class__::minor_concentration, u8"Required absolute minimal concentration accuracy");
48 solver.def_readwrite("interpolation", &__Class__::interpolation_method, u8"Interpolation method used for injection current");
49 solver.def_readwrite("maxrefines", &__Class__::max_mesh_changes, u8"Maximum number of allowed mesh refinements");
50 solver.def_readwrite("maxiters", &__Class__::max_iterations, u8"Maximum number of allowed iterations before attempting to refine mesh");
51 RECEIVER(inCurrentDensity, u8"");
52 RECEIVER(inTemperature, u8"");
53 RECEIVER(inGain, u8"");
54 RECEIVER(inWavelength, u8"It is required only for the overthreshold computations.");
55 RECEIVER(inLightE, u8"It is required only for the overthreshold computations.");
56 PROVIDER(outCarriersConcentration, u8"");
57 METHOD(get_total_burning, burning_integral, u8"Compute total power burned over threshold (mW).");
58 solver.def_readonly("mode_burns", &__Class__::modesP, u8"Power burned over threshold by each mode (mW).");
59// RW_FIELD(global_QW_width, "Sum of all QWs' widths" ); // read-write field
60// RO_PROPERTY(python_property_name, get_method_name, "Short documentation"); // read-only property
61// RW_PROPERTY(python_property_name, get_method_name, set_method_name, "Short documentation"); // read-write property
62// BOUNDARY_CONDITIONS(boundary_conditions_name, "Short documentation"); // boundary conditions
63
64 py::scope scope = solver;
65 (void) scope; // don't warn about unused variable scope
66
68 .value("LINEAR", __Class__::FEM_LINEAR)
69 .value("PARABOLIC", __Class__::FEM_PARABOLIC)
70 ;
71
73 .value("INITIAL", __Class__::COMPUTATION_INITIAL)
74 .value("THRESHOLD", __Class__::COMPUTATION_THRESHOLD)
75 .value("OVERTHRESHOLD", __Class__::COMPUTATION_OVERTHRESHOLD)
76 ;
77
78 }
79 {CLASS(DiffusionFem2DSolver<Geometry2DCartesian>, "OldDiffusion2D", u8"Calculates carrier pairs concentration in active region using FEM in one-dimensional cartesian space")
80
81 METHOD(compute_initial, compute_initial, u8"Perform the initial computation");
82 METHOD(compute_threshold, compute_threshold, u8"Perform the threshold computation");
83 METHOD(compute_overthreshold, compute_overthreshold, u8"Perform the overthreshold computation");
84 solver.def_readwrite("initial", &__Class__::do_initial, u8"True if we start from initial computations");
85 solver.def_readwrite("fem_method", &__Class__::fem_method, u8"Finite-element method (linear of parabolic)");
86 solver.add_property("current_mesh", DiffusionSolver_current_mesh<Geometry2DCartesian>, u8"Horizontal adaptive mesh)");
87 solver.def_readwrite("accuracy", &__Class__::relative_accuracy, u8"Required relative accuracy");
88 solver.def_readwrite("abs_accuracy", &__Class__::minor_concentration, u8"Required absolute minimal concentration accuracy");
89 solver.def_readwrite("interpolation", &__Class__::interpolation_method, u8"Interpolation method used for injection current");
90 solver.def_readwrite("maxrefines", &__Class__::max_mesh_changes, u8"Maximum number of allowed mesh refinements");
91 solver.def_readwrite("maxiters", &__Class__::max_iterations, u8"Maximum number of allowed iterations before attempting to refine mesh");
92 RECEIVER(inCurrentDensity, "");
93 RECEIVER(inTemperature, "");
94 RECEIVER(inGain, u8"It is required only for the overthreshold computations.");
95 RECEIVER(inLightE, u8"It is required only for the overthreshold computations.");
96 PROVIDER(outCarriersConcentration, u8"");
97 METHOD(get_total_burning, burning_integral, u8"Compute total power burned over threshold (mW).");
98 solver.def_readonly("mode_burns", &__Class__::modesP, u8"Power burned over threshold by each mode (mW).");
99// RW_FIELD(global_QW_width, "Sum of all QWs' widths" ); // read-write field
100// RO_PROPERTY(python_property_name, get_method_name, "Short documentation"); // read-only property
101// RW_PROPERTY(python_property_name, get_method_name, set_method_name, "Short documentation"); // read-write property
102// BOUNDARY_CONDITIONS(boundary_conditions_name, "Short documentation"); // boundary conditions
103
104 py::scope scope = solver;
105 (void) scope; // don't warn about unused variable scope
106
108 .value("LINEAR", __Class__::FEM_LINEAR)
109 .value("PARABOLIC", __Class__::FEM_PARABOLIC)
110 ;
111
113 .value("INITIAL", __Class__::COMPUTATION_INITIAL)
114 .value("THRESHOLD", __Class__::COMPUTATION_THRESHOLD)
115 .value("OVERTHRESHOLD", __Class__::COMPUTATION_OVERTHRESHOLD)
116 ;
117 }
118
119}