PLaSK library
Loading...
Searching...
No Matches
femT3d.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_TFem3D_H
15#define PLASK__MODULE_THERMAL_TFem3D_H
16
17#include <plask/plask.hpp>
18#include <plask/common/fem.hpp>
19
20namespace plask { namespace thermal { namespace dynamic {
21
25struct PLASK_SOLVER_API DynamicThermalFem3DSolver: public FemSolverWithMaskedMesh<Geometry3D, RectangularMesh<3>> {
26
27 protected:
28
29 double maxT;
30
32
34
36
38 void setMatrix(FemMatrix& A, FemMatrix& B, DataVector<double>& F,
40 );
41
43 void saveHeatFluxes(); // [W/m^2]
44
46 void onInitialize() override;
47
49 void onInvalidate() override;
50
51 public:
52
53 // Boundary conditions
55
57
59
61
63
64 double inittemp;
65 double methodparam;
66 double timestep;
67 double elapstime;
68 bool lumping;
69 size_t rebuildfreq;
70 size_t logfreq;
71
76 double compute(double time);
77
79 double getElapsTime() const { return elapstime; }
80
81 void loadConfiguration(XMLReader& source, Manager& manager) override; // for solver configuration (see: *.xpl file with structures)
82
83 DynamicThermalFem3DSolver(const std::string& name="");
84
85 std::string getClassName() const override { return "thermal.Dynamic3D"; }
86
88
89 protected:
90
91 struct ThermalConductivityData: public LazyDataImpl<Tensor2<double>> {
93 shared_ptr<const MeshD<3>> dest_mesh;
96 ThermalConductivityData(const DynamicThermalFem3DSolver* solver, const shared_ptr<const MeshD<3>>& dst_mesh);
97 Tensor2<double> at(std::size_t i) const override;
98 std::size_t size() const override;
99 };
100
101 const LazyData<double> getTemperatures(const shared_ptr<const MeshD<3>>& dst_mesh, InterpolationMethod method) const;
102
103 const LazyData<Vec<3>> getHeatFluxes(const shared_ptr<const MeshD<3>>& dst_mesh, InterpolationMethod method);
104
105 const LazyData<Tensor2<double>> getThermalConductivity(const shared_ptr<const MeshD<3>>& dst_mesh, InterpolationMethod method);
106};
107
108}} //namespaces
109
110} // namespace plask
111
112#endif