PLaSK library
Loading...
Searching...
No Matches
capacitance_python.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 */
14#include <cmath>
15#include <plask/python.hpp>
16#include <plask/common/fem/python.hpp>
17using namespace plask;
18using namespace plask::python;
19
20#include "../capacitance2d.hpp"
21using namespace plask::electrical::capacitance;
22
23template <typename __Class__>
24inline static ExportSolver<__Class__> register_capacitance_solver(const char* name, const char* geoname) {
26 format(u8"{0}(name=\"\")\n\n"
27 u8"Finite element AC electric solver for {1} geometry.",
28 name, geoname)
29 .c_str(),
30 py::init<std::string>(py::arg("name") = ""));
31 METHOD(compute, compute, u8"Run calculations");
32 METHOD(get_ac_current, getAcCurrent,
33 u8"Get total current flowing through active region (mA)\n\n"
34 u8"Args:\n"
35 u8" nact (int): number of the active region\n"
36 u8" active (bool): if true, the active current (in phase with the voltage)\n"
37 u8" is returned, otherwise the total current is returned\n\n"
38 u8"Returns:\n"
39 u8" complex: computed total current (mA)",
40 (py::arg("nact") = 0, py::arg("active") = false));
41 RECEIVER(inTemperature, u8"");
42 RECEIVER(inDifferentialConductivity, u8"");
43 PROVIDER(outAcVoltage, u8"");
44 PROVIDER(outAcCurrentDensity, u8"");
45 BOUNDARY_CONDITIONS(voltage_boundary, u8"Boundary conditions of the first kind (constant potential)");
46 RW_PROPERTY(frequency, getFrequency, setFrequency, u8"AC modulation frequency (MHz)");
47 METHOD(get_impedance, getImpedance, u8"Get the impedance at the current frequency");
48 METHOD(get_S11, getS11, u8"Get scattering parameter <i>S</i><sub>11</sub> at the current frequency\n\n"
49 u8"Args:\n"
50 u8" Z0 (complex): reference impedance (default 50 Ω)\n\n"
51 u8"Returns:\n"
52 u8" complex: computed S11 parameter",
53 (py::arg("Z0") = 50.));
54
55 // solver.def_readwrite("algorithm", &__Class__::algorithm, "Chosen matrix factorization algorithm");
56 solver.add_property("empty_elements", &__Class__::getEmptyElements, &__Class__::setEmptyElements,
57 "Should empty regions (e.g. air) be included into computation domain?");
58
59
60 return solver;
61}
62