PLaSK library
Loading...
Searching...
No Matches
rectangular_masked_spline.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__MESH_RECTANGULARMASKEDSPLINE_H
15#define PLASK__MESH_RECTANGULARMASKEDSPLINE_H
16
17#include "../math.hpp"
20#include "interpolation.hpp"
21
22namespace plask {
23
24template <typename DstT, typename SrcT>
25struct SplineMaskedRect2DLazyDataImpl: public InterpolatedLazyDataImpl<DstT, RectangularMaskedMesh2D, const SrcT>
26{
28
30
37
38 DstT at(std::size_t index) const override;
39};
40
41template <typename DstT, typename SrcT>
42struct SplineMaskedRectElement2DLazyDataImpl: public InterpolatedLazyDataImpl<DstT, RectangularMaskedMesh2D::ElementMesh, const SrcT>
43{
45
47
48 SplineMaskedRectElement2DLazyDataImpl(const shared_ptr<const RectangularMaskedMesh2D::ElementMesh>& src_mesh,
50 const shared_ptr<const MeshD<2>>& dst_mesh,
54
55 DstT at(std::size_t index) const override;
56};
57
58
59template <typename DstT, typename SrcT>
60struct SplineMaskedRect3DLazyDataImpl: public InterpolatedLazyDataImpl<DstT, RectangularMaskedMesh3D, const SrcT>
61{
63
65
72
73 DstT at(std::size_t index) const override;
74};
75
76template <typename DstT, typename SrcT>
77struct SplineMaskedRectElement3DLazyDataImpl: public InterpolatedLazyDataImpl<DstT, RectangularMaskedMesh3D::ElementMesh, const SrcT>
78{
80
82
83 SplineMaskedRectElement3DLazyDataImpl(const shared_ptr<const RectangularMaskedMesh3D::ElementMesh>& src_mesh,
85 const shared_ptr<const MeshD<3>>& dst_mesh,
89
90 DstT at(std::size_t index) const override;
91};
92
93
94template <typename DstT, typename SrcT, typename BaseT=SplineMaskedRect2DLazyDataImpl<DstT, SrcT>>
96{
98 const DataVector<const SrcT>& src_vec,
99 const shared_ptr<const MeshD<2>>& dst_mesh,
100 const InterpolationFlags& flags);
101};
102
103template <typename SrcT, typename DstT>
105 static LazyData<DstT> interpolate(const shared_ptr<const RectangularMaskedMesh2D>& src_mesh,
106 const DataVector<const SrcT>& src_vec,
107 const shared_ptr<const MeshD<2>>& dst_mesh,
108 const InterpolationFlags& flags) {
110 typename std::remove_const<SrcT>::type>
111 (src_mesh, src_vec, dst_mesh, flags);
112 }
113
114};
115
116template <typename SrcT, typename DstT>
118 static LazyData<DstT> interpolate(const shared_ptr<const RectangularMaskedMesh2D::ElementMesh>& src_mesh,
119 const DataVector<const SrcT>& src_vec,
120 const shared_ptr<const MeshD<2>>& dst_mesh,
121 const InterpolationFlags& flags) {
123 typename std::remove_const<SrcT>::type,
125 (src_mesh, src_vec, dst_mesh, flags);
126 }
127
128};
129
130
131template <typename DstT, typename SrcT, typename BaseT=SplineMaskedRect3DLazyDataImpl<DstT, SrcT>>
133
135 const DataVector<const SrcT>& src_vec,
136 const shared_ptr<const MeshD<3>>& dst_mesh,
137 const InterpolationFlags& flags);
138};
139
140template <typename SrcT, typename DstT>
142 static LazyData<DstT> interpolate(const shared_ptr<const RectangularMaskedMesh3D>& src_mesh,
143 const DataVector<const SrcT>& src_vec,
144 const shared_ptr<const MeshD<3>>& dst_mesh,
145 const InterpolationFlags& flags) {
147 typename std::remove_const<SrcT>::type>
148 (src_mesh, src_vec, dst_mesh, flags);
149 }
150
151};
152
153template <typename SrcT, typename DstT>
155 static LazyData<DstT> interpolate(const shared_ptr<const RectangularMaskedMesh3D::ElementMesh>& src_mesh,
156 const DataVector<const SrcT>& src_vec,
157 const shared_ptr<const MeshD<3>>& dst_mesh,
158 const InterpolationFlags& flags) {
160 typename std::remove_const<SrcT>::type,
162 (src_mesh, src_vec, dst_mesh, flags);
163 }
164
165};
166
167} // namespace plask
168
169#endif // PLASK__MESH_RECTANGULARMASKEDSPLINE_H