PLaSK library
Loading...
Searching...
No Matches
dynamic_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 "../femT2d.hpp"
21#include "../femT3d.hpp"
22using namespace plask::thermal::dynamic;
23
31{
33 u8"Finite element thermal solver for 2D Cartesian geometry.")
34 METHOD(compute, compute, u8"Run thermal calculations", py::arg("time"));
35 RECEIVER(inHeat, "");
36 PROVIDER(outTemperature, "");
37 PROVIDER(outHeatFlux, "");
38 PROVIDER(outThermalConductivity, "");
39 BOUNDARY_CONDITIONS(temperature_boundary, u8"Boundary conditions for the constant temperature");
40 RW_FIELD(inittemp, u8"Initial temperature (K)");
41 RW_FIELD(timestep, u8"Time step (ns)");
42 RW_FIELD(methodparam, u8"Initial parameter determining the calculation method: 0.5 - Crank-Nicolson method, 0 - explicit method, 1 - implicit method");
43 RW_FIELD(lumping, u8"Chosen mass matrix type from lumped or non-lumped (consistent)");
44 RW_FIELD(rebuildfreq, u8"Frequency of rebuild mass");
45 RW_FIELD(logfreq, u8"Frequency of iteration progress reporting");
46 RO_PROPERTY(time, getElapsTime, u8"Time of calculations performed so far since the last solver invalidation.");
47 RO_PROPERTY(elapsed_time, getElapsTime, u8"Alias for :attr:`time` (obsolete).");
49 }
50
52 u8"Finite element thermal solver for 2D cylindrical geometry.")
53 METHOD(compute, compute, u8"Run thermal calculations", py::arg("time"));
54 RECEIVER(inHeat, "");
55 PROVIDER(outTemperature, "");
56 PROVIDER(outHeatFlux, "");
57 PROVIDER(outThermalConductivity, "");
58 BOUNDARY_CONDITIONS(temperature_boundary, u8"Boundary conditions for the constant temperature");
59 RW_FIELD(inittemp, u8"Initial temperature (K)");
60 RW_FIELD(timestep, u8"Time step (ns)");
61 RW_FIELD(methodparam, u8"Initial parameter determining the calculation method: 0.5 - Crank-Nicolson method, 0 - explicit method, 1 - implicit method");
62 RW_FIELD(lumping, u8"Chosen mass matrix type from lumped or non-lumped (consistent)");
63 RW_FIELD(rebuildfreq, u8"Frequency of rebuild mass");
64 RW_FIELD(logfreq, u8"Frequency of iteration progress reporting");
65 RO_PROPERTY(time, getElapsTime, u8"Time of calculations performed so far since the last solver invalidation.");
66 RO_PROPERTY(elapsed_time, getElapsTime, u8"Alias for :attr:`time` (obsolete).");
68 }
69
70 {CLASS(DynamicThermalFem3DSolver, "Dynamic3D",
71 u8"Finite element thermal solver for 3D Cartesian geometry.")
72 METHOD(compute, compute, u8"Run thermal calculations", py::arg("time"));
73 RECEIVER(inHeat, "");
74 PROVIDER(outTemperature, "");
75 PROVIDER(outHeatFlux, "");
76 PROVIDER(outThermalConductivity, "");
77 BOUNDARY_CONDITIONS(temperature_boundary, u8"Boundary conditions for the constant temperature");
78 RW_FIELD(inittemp, u8"Initial temperature (K)");
79 RW_FIELD(timestep, u8"Time step (ns)");
80 RW_FIELD(methodparam, u8"Initial parameter determining the calculation method: 0.5 - Crank-Nicolson method, 0 - explicit method, 1 - implicit method");
81 RW_FIELD(lumping, u8"Chosen mass matrix type from lumped or non-lumped (consistent)");
82 RW_FIELD(rebuildfreq, u8"Frequency of rebuild mass");
83 solver.def_readwrite("algorithm", &__Class__::algorithm, u8"Chosen matrix factorization algorithm");
84 solver.def_readwrite("logfreq", &__Class__::logfreq, u8"Frequency of iteration progress reporting");
85 RO_PROPERTY(time, getElapsTime, u8"Time of calculations performed so far since the last solver invalidation.");
86 RO_PROPERTY(elapsed_time, getElapsTime, u8"Alias for :attr:`time` (obsolete).");
88 }
89
90}