suanPan
BSplineVolume.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2024 Theodore Chang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
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 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
30#ifndef BSPLINEVOLUME_H
31#define BSPLINEVOLUME_H
32
33#include "BSpline.h"
34
36protected:
37 const uword dimension;
38
39 field<vec> net;
40
42
43public:
44 explicit BSplineVolume(vec, vec, vec, uword, field<vec>&& = {});
45 BSplineVolume(const BSplineVolume&) = default;
49 virtual ~BSplineVolume() = default;
50
51 void set_control_polygon(field<vec>&&);
52 void set_control_polygon(const field<vec>&);
53
54 [[nodiscard]] field<uvec> get_all_element_span() const;
55 [[nodiscard]] uvec get_number_of_control_points() const;
56
57 [[nodiscard]] vec evaluate_point(double, double, double) const;
58 [[nodiscard]] field<vec> evaluate_point_derivative(double, double, double, sword = -1) const;
59
60 [[nodiscard]] cube evaluate_shape_function(double, double, double) const;
61 [[nodiscard]] field<cube> evaluate_shape_function_derivative(double, double, double, sword = -1, sword = -1, sword = -1) const;
62
63 [[nodiscard]] virtual vec evaluate_point(double, double, double, const field<vec>&) const;
64 [[nodiscard]] virtual field<vec> evaluate_point_derivative(double, double, double, const field<vec>&, sword = -1) const;
65
66 [[nodiscard]] virtual cube evaluate_shape_function(double, double, double, const field<vec>&) const;
67 [[nodiscard]] virtual field<cube> evaluate_shape_function_derivative(double, double, double, const field<vec>&, sword = -1, sword = -1, sword = -1) const;
68};
69
70class BSplineVolume3D final : public BSplineVolume {
71public:
72 explicit BSplineVolume3D(vec, vec, vec, field<vec>&& = {});
73};
74
75class BSplineVolume4D final : public BSplineVolume {
76public:
77 explicit BSplineVolume4D(vec, vec, vec, field<vec>&& = {});
78};
79
80#endif
81
Definition: BSpline.h:44
Definition: BSplineVolume.h:70
BSplineVolume3D(vec, vec, vec, field< vec > &&={})
Definition: BSplineVolume.cpp:182
Definition: BSplineVolume.h:75
BSplineVolume4D(vec, vec, vec, field< vec > &&={})
Definition: BSplineVolume.cpp:185
Definition: BSplineVolume.h:35
field< cube > evaluate_shape_function_derivative(double, double, double, sword=-1, sword=-1, sword=-1) const
Definition: BSplineVolume.cpp:49
vec evaluate_point(double, double, double) const
Definition: BSplineVolume.cpp:43
BSpline line_u
Definition: BSplineVolume.h:41
BSpline line_v
Definition: BSplineVolume.h:41
BSplineVolume(BSplineVolume &&)=default
BSplineVolume(vec, vec, vec, uword, field< vec > &&={})
Definition: BSplineVolume.cpp:20
cube evaluate_shape_function(double, double, double) const
Definition: BSplineVolume.cpp:47
BSplineVolume(const BSplineVolume &)=default
void set_control_polygon(field< vec > &&)
Definition: BSplineVolume.cpp:27
BSplineVolume & operator=(const BSplineVolume &)=delete
const uword dimension
Definition: BSplineVolume.h:37
BSpline line_w
Definition: BSplineVolume.h:41
uvec get_number_of_control_points() const
Definition: BSplineVolume.cpp:41
field< vec > net
Definition: BSplineVolume.h:39
field< vec > evaluate_point_derivative(double, double, double, sword=-1) const
Definition: BSplineVolume.cpp:45
virtual ~BSplineVolume()=default
field< uvec > get_all_element_span() const
Definition: BSplineVolume.cpp:31
BSplineVolume & operator=(BSplineVolume &&)=delete
Mat< T > cube(const Mat< T > &int_pts, unsigned order, unsigned num_node=8)
Definition: shape.h:320