PLaSK library
Loading...
Searching...
No Matches
femT2d.hpp
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#ifndef PLASK__MODULE_THERMAL_TFem_H
15#define PLASK__MODULE_THERMAL_TFem_H
16
17#include <plask/plask.hpp>
18
19#include <plask/common/fem.hpp>
20
21namespace plask { namespace thermal { namespace dynamic {
22
26template<typename Geometry2DType>
27struct PLASK_SOLVER_API DynamicThermalFem2DSolver: public FemSolverWithMaskedMesh<Geometry2DType, RectangularMesh<2>> {
28
29 protected:
30
31 double maxT;
32
34
36
38
42 );
43
45 void saveHeatFluxes(); // [W/m^2]
46
48 void onInitialize() override;
49
51 void onInvalidate() override;
52
53 public:
54
55 // Boundary conditions
57
59
61
63
65
66 double inittemp;
67 double methodparam;
68 double timestep;
69 double elapstime;
70 bool lumping;
71 size_t rebuildfreq;
72 size_t logfreq;
73
78 double compute(double time);
79
81 double getElapsTime() const { return elapstime; }
82
83 void loadConfiguration(XMLReader& source, Manager& manager) override; // for solver configuration (see: *.xpl file with structures)
84
85 DynamicThermalFem2DSolver(const std::string& name="");
86
87 std::string getClassName() const override;
88
90
91 protected:
92
93 struct ThermalConductivityData: public LazyDataImpl<Tensor2<double>> {
95 shared_ptr<const MeshD<2>> dest_mesh;
98 ThermalConductivityData(const DynamicThermalFem2DSolver* solver, const shared_ptr<const MeshD<2>>& dst_mesh);
99 Tensor2<double> at(std::size_t i) const override;
100 std::size_t size() const override;
101 };
102
103 const LazyData<double> getTemperatures(const shared_ptr<const MeshD<2>>& dest_mesh, InterpolationMethod method) const;
104
105 const LazyData<Vec<2>> getHeatFluxes(const shared_ptr<const MeshD<2>>& dest_mesh, InterpolationMethod method);
106
107 const LazyData<Tensor2<double>> getThermalConductivity(const shared_ptr<const MeshD<2>>& dst_mesh, InterpolationMethod method);
108
109};
110
111}} //namespaces
112
113} // namespace plask
114
115#endif