17#include <boost/preprocessor/seq/for_each.hpp>
26using namespace literals;
27using utils::operator+;
36#define IGANET_FUNCTIONSPACE_DEFAULT_OPS(FunctionSpace) \
37 FunctionSpace() = default; \
38 FunctionSpace(FunctionSpace &&) = default; \
39 FunctionSpace(const FunctionSpace &) = default;
44template <
typename,
typename>
class FunctionSpace;
55 "Splines must be valid SplineTypes");
57 "Boundaries must be valid BoundaryTypes");
61 using value_type = std::common_type_t<
typename Splines::value_type...>;
103 Splines::parDim()> &...
kv,
109 static_assert((Splines::is_nonuniform() && ... &&
true),
110 "Constructor is only available for non-uniform splines");
125 const std::tuple<Boundaries...> &
boundary)
130 std::tuple<Boundaries...> &&
boundary)
137 return sizeof...(Splines);
142 return sizeof...(Boundaries);
176 static_assert(((
s >= 0 &&
s <
nspaces()) && ... &&
true));
179 std::tuple<std::tuple_element_t<s, boundary_type>...>>(
180 std::make_tuple(std::get<s>(
spline_)...), std::make_tuple(std::get<s>(
boundary_)...));
186 template <std::size_t...
Is>
189 return torch::cat({std::get<Is>(
spline_).as_tensor()...});
196 return spaces_as_tensor_(
197 std::make_index_sequence<FunctionSpace::nspaces()>{});
203 template <std::size_t...
Is>
206 return torch::cat({std::get<Is>(
boundary_).as_tensor()...});
213 return boundary_as_tensor_(
214 std::make_index_sequence<FunctionSpace::nboundaries()>{});
229 template <std::size_t...
Is>
233 [](
auto...
v) {
return (
v + ...); },
241 return spaces_as_tensor_size_(
242 std::make_index_sequence<FunctionSpace::nspaces()>{});
248 template <std::size_t...
Is>
252 [](
auto...
v) {
return (
v + ...); },
260 return boundary_as_tensor_size_(
261 std::make_index_sequence<FunctionSpace::nboundaries()>{});
275 template <std::size_t...
Is>
277 const torch::Tensor &
tensor) {
282 this]<std::size_t...
Js>(std::index_sequence<
Js...>) {
287 partial_sums(std::make_index_sequence<FunctionSpace::nspaces() - 1>{});
291 {torch::indexing::Slice(partialSums[Is],
293 std::get<Is>(spline_).as_tensor_size()),
304 return spaces_from_tensor_(
305 std::make_index_sequence<FunctionSpace::nspaces()>{},
tensor);
311 template <std::size_t...
Is>
313 const torch::Tensor &
tensor) {
325 return boundary_from_tensor_(
326 std::make_index_sequence<FunctionSpace::nboundaries()>{},
tensor);
331 template <std::size_t...
Is>
334 const torch::Tensor &
tensor) {
335 (std::get<Is>(
boundary_).from_full_tensor(
346 return boundary_from_full_tensor_(
347 std::make_index_sequence<FunctionSpace::nboundaries()>{},
tensor);
352 spaces_from_tensor_(std::make_index_sequence<FunctionSpace::nspaces()>{},
354 boundary_from_full_tensor_(
355 std::make_index_sequence<FunctionSpace::nboundaries()>{},
tensor);
361 template <std::size_t...
Is>
362 inline pugi::xml_node &
to_xml_(std::index_sequence<Is...>,
363 pugi::xml_node &
root,
int id = 0,
364 std::string
label =
"")
const {
372 inline pugi::xml_document
to_xml(
int id = 0, std::string
label =
"")
const {
373 pugi::xml_document
doc;
374 pugi::xml_node
root =
doc.append_child(
"xml");
381 inline pugi::xml_node &
to_xml(pugi::xml_node &
root,
int id = 0,
382 std::string
label =
"")
const {
383 return to_xml_(std::make_index_sequence<FunctionSpace::nspaces()>{},
root,
389 template <std::size_t...
Is>
391 const pugi::xml_node &
root,
int id = 0,
392 std::string
label =
"") {
401 std::string
label =
"") {
407 std::string
label =
"") {
408 return from_xml_(std::make_index_sequence<FunctionSpace::nspaces()>{},
root,
414 template <std::size_t...
Is>
415 nlohmann::json
to_json_(std::index_sequence<Is...>)
const {
416 auto json_this = nlohmann::json::array();
421 auto json = nlohmann::json::array();
435 return to_json_(std::make_index_sequence<FunctionSpace::nspaces()>{});
443 std::size_t...
Is,
typename...
Xi>
444 inline auto eval_(std::index_sequence<Is...>,
445 const std::tuple<Xi...> &
xi)
const {
449 std::get<Is>(
xi))...);
453 std::get<Is>(
xi))...);
459 inline auto eval_(std::index_sequence<Is...>,
const std::tuple<Xi...> &
xi,
460 const std::tuple<Knot_Indices...> &
knot_indices)
const {
475 inline auto eval_(std::index_sequence<Is...>,
const std::tuple<Xi...> &
xi,
497 inline auto eval(
const std::tuple<Xi...> &
xi)
const {
498 static_assert(FunctionSpace::nspaces() ==
sizeof...(Xi),
499 "Size of Xi mismatches functionspace dimension");
501 std::make_index_sequence<FunctionSpace::nspaces()>{},
xi);
507 inline auto eval(
const std::tuple<Xi...> &
xi,
508 const std::tuple<Knot_Indices...> &
knot_indices)
const {
510 (FunctionSpace::nspaces() ==
sizeof...(Xi)) &&
511 (FunctionSpace::nspaces() ==
sizeof...(Knot_Indices)),
512 "Sizes of Xi and Knot_Indices mismatch functionspace dimension");
514 std::make_index_sequence<FunctionSpace::nspaces()>{},
xi,
knot_indices);
520 inline auto eval(
const std::tuple<Xi...> &
xi,
523 static_assert((FunctionSpace::nspaces() ==
sizeof...(Xi)) &&
524 (FunctionSpace::nspaces() ==
sizeof...(Knot_Indices)) &&
525 (FunctionSpace::nspaces() ==
sizeof...(Coeff_Indices)),
526 "Sizes of Xi, Knot_Indices and Coeff_Indices mismatch "
527 "functionspace dimension");
529 std::make_index_sequence<FunctionSpace::nspaces()>{},
xi,
knot_indices,
543 const std::tuple<Basfunc...> &
basfunc,
545 const std::tuple<Numeval...> &
numeval,
546 const std::tuple<Sizes...> &
sizes)
const {
548 return std::tuple(std::get<Is>(
spline_).eval_from_precomputed(
552 return std::tuple(std::get<Is>(
boundary_).eval_from_precomputed(
561 const std::tuple<Basfunc...> &
basfunc,
563 const std::tuple<Xi...> &
xi)
const {
565 return std::tuple(std::get<Is>(
spline_).eval_from_precomputed(
569 return std::tuple(std::get<Is>(
boundary_).eval_from_precomputed(
571 std::get<Is>(
xi))...);
584 const std::tuple<Numeval...> &
numeval,
585 const std::tuple<Sizes...> &
sizes)
const {
587 std::make_index_sequence<FunctionSpace::nspaces()>{},
basfunc,
596 const std::tuple<Xi...> &
xi)
const {
598 std::make_index_sequence<FunctionSpace::nspaces()>{},
basfunc,
611 std::get<Is>(
spline_).find_knot_indices(
xi)...);
620 const std::tuple<Xi...> &
xi)
const {
623 std::get<Is>(
spline_).find_knot_indices(std::get<Is>(
xi))...);
626 std::get<Is>(
boundary_).find_knot_indices(std::get<Is>(
xi))...);
633 template <functionspace comp = functionspace::
interior>
636 std::make_index_sequence<FunctionSpace::nspaces()>{},
xi);
642 std::make_index_sequence<FunctionSpace::nspaces()>{},
xi);
652 std::size_t...
Is,
typename...
Xi>
654 const std::tuple<Xi...> &
xi)
const {
658 std::get<Is>(
xi))...);
660 return std::tuple(std::get<Is>(
boundary_)
662 std::get<Is>(
xi))...);
670 const std::tuple<Knot_Indices...> &
knot_indices)
const {
691 std::make_index_sequence<FunctionSpace::nspaces()>{},
xi);
699 const std::tuple<Knot_Indices...> &
knot_indices)
const {
701 std::make_index_sequence<FunctionSpace::nspaces()>{},
xi,
knot_indices);
713 const std::tuple<Knot_Indices...> &
knot_indices)
const {
732 std::make_index_sequence<FunctionSpace::nspaces()>{},
knot_indices);
738 template <std::size_t...
Is, std::size_t...
Js>
740 std::index_sequence<Js...>,
int numRefine = 1,
751 return uniform_refine_(
752 std::make_index_sequence<FunctionSpace::nspaces()>{},
753 std::make_index_sequence<FunctionSpace::nboundaries()>{},
numRefine,
760 template <
typename real_t, std::size_t...
Is, std::size_t...
Js>
761 inline auto to_(std::index_sequence<Is...>, std::index_sequence<Js...>,
766 std::get<Is>(
spline_).to(options)...,
774 return to_(std::make_index_sequence<FunctionSpace::nspaces()>{},
775 std::make_index_sequence<FunctionSpace::nboundaries()>{},
782 template <std::size_t...
Is, std::size_t...
Js>
783 inline auto to_(std::index_sequence<Is...>, std::index_sequence<Js...>,
784 torch::Device device)
const {
792 inline auto to(torch::Device device)
const {
793 return to_(std::make_index_sequence<FunctionSpace::nspaces()>{},
794 std::make_index_sequence<FunctionSpace::nboundaries()>{},
800 template <
typename real_t, std::size_t...
Is, std::size_t...
Js>
801 inline auto to_(std::index_sequence<Is...>,
802 std::index_sequence<Js...>)
const {
812 template <
typename real_t>
inline auto to()
const {
814 std::make_index_sequence<FunctionSpace::nspaces()>{},
815 std::make_index_sequence<FunctionSpace::nboundaries()>{});
820 template <std::size_t...
Is>
822 (std::get<Is>(
spline_).scale(
s, dim), ...);
830 return scale_(std::make_index_sequence<FunctionSpace::nspaces()>{},
s, dim);
835 template <std::size_t
N, std::size_t...
Is>
836 inline auto scale_(std::index_sequence<Is...>, std::array<value_type, N>
v) {
837 (std::get<Is>(
spline_).scale(
v), ...);
838 (std::get<Is>(
boundary_).from_full_tensor(
846 template <
size_t N>
inline auto scale(std::array<value_type, N>
v) {
847 return scale_(std::make_index_sequence<FunctionSpace::nspaces()>{},
v);
852 template <std::size_t
N, std::size_t...
Is>
854 std::array<value_type, N>
v) {
855 (std::get<Is>(
spline_).translate(
v), ...);
856 (std::get<Is>(
boundary_).from_full_tensor(
864 template <
size_t N>
inline auto translate(std::array<value_type, N>
v) {
865 return translate_(std::make_index_sequence<FunctionSpace::nspaces()>{},
v);
870 template <std::size_t...
Is>
872 (std::get<Is>(
spline_).rotate(angle), ...);
873 (std::get<Is>(
boundary_).from_full_tensor(
882 return rotate_(std::make_index_sequence<FunctionSpace::nspaces()>{}, angle);
887 template <std::size_t...
Is>
888 inline auto rotate_(std::index_sequence<Is...>,
889 std::array<value_type, 3> angle) {
890 (std::get<Is>(
spline_).rotate(angle), ...);
891 (std::get<Is>(
boundary_).from_full_tensor(
899 inline auto rotate(std::array<value_type, 3> angle) {
900 return rotate_(std::make_index_sequence<FunctionSpace::nspaces()>{}, angle);
905 template <std::size_t...
Is>
907 return std::tuple(std::get<Is>(
spline_).boundingBox()...);
913 return boundingBox_(std::make_index_sequence<FunctionSpace::nspaces()>{});
919 template <std::size_t...
Is>
920 inline torch::serialize::OutputArchive &
921 write_(std::index_sequence<Is...>, torch::serialize::OutputArchive &
archive,
922 const std::string &
key =
"functionspace")
const {
924 archive,
key +
".fspace[" + std::to_string(
Is) +
"].interior"),
927 archive,
key +
".fspace[" + std::to_string(
Is) +
"].boundary"),
935 inline torch::serialize::OutputArchive &
937 const std::string &
key =
"functionspace")
const {
938 write_(std::make_index_sequence<FunctionSpace::nspaces()>{},
archive,
key);
945 template <std::size_t...
Is>
946 inline torch::serialize::InputArchive &
947 read_(std::index_sequence<Is...>, torch::serialize::InputArchive &
archive,
948 const std::string &
key =
"functionspace") {
953 archive,
key +
".fspace[" + std::to_string(
Is) +
"].boundary"),
961 inline torch::serialize::InputArchive &
963 const std::string &
key =
"functionspace") {
964 read_(std::make_index_sequence<FunctionSpace::nspaces()>{},
archive,
key);
973 &
os]<std::size_t...
Is>(std::index_sequence<
Is...>) {
974 ((
os <<
"\ninterior = ", std::get<Is>(
spline_).pretty_print(
os),
975 os <<
"\nboundary = ", std::get<Is>(
boundary_).pretty_print(
os)),
1013 const std::tuple<TensorArrays...> &
knot_indices)
const {
1026 throw std::runtime_error(
"Unsupported parametric/geometric dimension");
1035 const std::tuple<utils::TensorArray2, utils::TensorArray2> &
knot_indices,
1036 const std::tuple<torch::Tensor, torch::Tensor> &
coeff_indices)
const {
1059 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor>
1091 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor,
1101 throw std::runtime_error(
"Unsupported parametric/geometric dimension");
1141 const std::tuple<TensorArrays...> &
knot_indices)
const {
1155 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1,
1156 "div(.) for vector-valued spaces requires 1D variables");
1168 const std::tuple<utils::TensorArray2, utils::TensorArray2> &
knot_indices,
1169 const std::tuple<torch::Tensor, torch::Tensor> &
coeff_indices)
const {
1176 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1177 std::tuple_element_t<1, spline_type>::geoDim() == 1,
1178 "div(.) for vector-valued spaces requires 1D variables");
1193 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor>
1202 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1203 std::tuple_element_t<1, spline_type>::geoDim() == 1 &&
1204 std::tuple_element_t<2, spline_type>::geoDim() == 1,
1205 "div(.) for vector-valued spaces requires 1D variables");
1223 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor,
1234 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1235 std::tuple_element_t<1, spline_type>::geoDim() == 1 &&
1236 std::tuple_element_t<2, spline_type>::geoDim() == 1 &&
1237 std::tuple_element_t<3, spline_type>::geoDim() == 1,
1238 "div(.) for vector-valued spaces requires 1D variables");
1280 const std::tuple<TensorArrays...> &
knot_indices)
const {
1294 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1,
1295 "grad(.) for vector-valued spaces requires 1D variables");
1307 const std::tuple<utils::TensorArray2, utils::TensorArray2> &
knot_indices,
1308 const std::tuple<torch::Tensor, torch::Tensor> &
coeff_indices)
const {
1315 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1316 std::tuple_element_t<1, spline_type>::geoDim() == 1,
1317 "grad(.) for vector-valued spaces requires 1D variables");
1332 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor>
1341 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1342 std::tuple_element_t<1, spline_type>::geoDim() == 1 &&
1343 std::tuple_element_t<2, spline_type>::geoDim() == 1,
1344 "div(.) for vector-valued spaces requires 1D variables");
1362 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor,
1373 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1374 std::tuple_element_t<1, spline_type>::geoDim() == 1 &&
1375 std::tuple_element_t<2, spline_type>::geoDim() == 1 &&
1376 std::tuple_element_t<3, spline_type>::geoDim() == 1,
1377 "grad(.) for vector-valued spaces requires 1D variables");
1438 const std::tuple<TensorArrays...> &
knot_indices)
const {
1452 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1,
1453 "hess(.) for vector-valued spaces requires 1D variables");
1465 const std::tuple<utils::TensorArray2, utils::TensorArray2> &
knot_indices,
1466 const std::tuple<torch::Tensor, torch::Tensor> &
coeff_indices)
const {
1473 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1474 std::tuple_element_t<1, spline_type>::geoDim() == 1,
1475 "hess(.) for vector-valued spaces requires 1D variables");
1507 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor>
1516 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1517 std::tuple_element_t<1, spline_type>::geoDim() == 1 &&
1518 std::tuple_element_t<2, spline_type>::geoDim() == 1,
1519 "hess(.) for vector-valued spaces requires 1D variables");
1605 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor,
1616 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1617 std::tuple_element_t<1, spline_type>::geoDim() == 1 &&
1618 std::tuple_element_t<2, spline_type>::geoDim() == 1 &&
1619 std::tuple_element_t<3, spline_type>::geoDim() == 1,
1620 "hess(.) for vector-valued spaces requires 1D variables");
1852 const std::tuple<TensorArrays...> &
knot_indices)
const {
1866 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1,
1867 "jac(.) for vector-valued spaces requires 1D variables");
1879 const std::tuple<utils::TensorArray2, utils::TensorArray2> &
knot_indices,
1880 const std::tuple<torch::Tensor, torch::Tensor> &
coeff_indices)
const {
1887 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1888 std::tuple_element_t<1, spline_type>::geoDim() == 1,
1889 "jac(.) for vector-valued spaces requires 1D variables");
1909 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor>
1918 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1919 std::tuple_element_t<1, spline_type>::geoDim() == 1 &&
1920 std::tuple_element_t<2, spline_type>::geoDim() == 1,
1921 "jac(.) for vector-valued spaces requires 1D variables");
1953 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor,
1964 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
1965 std::tuple_element_t<1, spline_type>::geoDim() == 1 &&
1966 std::tuple_element_t<2, spline_type>::geoDim() == 1,
1967 "jac(.) for vector-valued spaces requires 1D variables");
2039 const std::tuple<TensorArrays...> &
knot_indices)
const {
2053 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1,
2054 "lapl(.) for vector-valued spaces requires 1D variables");
2066 const std::tuple<utils::TensorArray2, utils::TensorArray2> &
knot_indices,
2067 const std::tuple<torch::Tensor, torch::Tensor> &
coeff_indices)
const {
2074 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
2075 std::tuple_element_t<1, spline_type>::geoDim() == 1,
2076 "lapl(.) for vector-valued spaces requires 1D variables");
2091 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor>
2100 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
2101 std::tuple_element_t<1, spline_type>::geoDim() == 1 &&
2102 std::tuple_element_t<2, spline_type>::geoDim() == 1,
2103 "div(.) for vector-valued spaces requires 1D variables");
2121 const std::tuple<torch::Tensor, torch::Tensor, torch::Tensor,
2132 static_assert(std::tuple_element_t<0, spline_type>::geoDim() == 1 &&
2133 std::tuple_element_t<1, spline_type>::geoDim() == 1 &&
2134 std::tuple_element_t<2, spline_type>::geoDim() == 1 &&
2135 std::tuple_element_t<3, spline_type>::geoDim() == 1,
2136 "div(.) for vector-valued spaces requires 1D variables");
2151#define GENERATE_EXPR_MACRO(r, data, name) \
2153 template <functionspace comp = functionspace::interior, \
2154 bool memory_optimized = false, std::size_t... Is, typename... Xi> \
2155 inline auto BOOST_PP_CAT(name, _all_)(std::index_sequence<Is...>, \
2156 const std::tuple<Xi...> &xi) const { \
2157 if constexpr (comp == functionspace::interior) \
2158 return std::tuple(std::get<Is>(spline_).template name<memory_optimized>( \
2159 std::get<Is>(xi))...); \
2160 else if constexpr (comp == functionspace::boundary) \
2161 return std::tuple( \
2162 std::get<Is>(boundary_).template name<memory_optimized>( \
2163 std::get<Is>(xi))...); \
2166 template <functionspace comp = functionspace::interior, \
2167 bool memory_optimized = false, std::size_t... Is, typename... Xi, \
2168 typename... Knot_Indices> \
2169 inline auto BOOST_PP_CAT(name, _all_)( \
2170 std::index_sequence<Is...>, const std::tuple<Xi...> &xi, \
2171 const std::tuple<Knot_Indices...> &knot_indices) const { \
2172 if constexpr (comp == functionspace::interior) \
2173 return std::tuple(std::get<Is>(spline_).template name<memory_optimized>( \
2174 std::get<Is>(xi), std::get<Is>(knot_indices))...); \
2175 else if constexpr (comp == functionspace::boundary) \
2176 return std::tuple( \
2177 std::get<Is>(boundary_).template name<memory_optimized>( \
2178 std::get<Is>(xi), std::get<Is>(knot_indices))...); \
2181 template <functionspace comp = functionspace::interior, \
2182 bool memory_optimized = false, std::size_t... Is, typename... Xi, \
2183 typename... Knot_Indices, typename... Coeff_Indices> \
2184 inline auto BOOST_PP_CAT(name, _all_)( \
2185 std::index_sequence<Is...>, const std::tuple<Xi...> &xi, \
2186 const std::tuple<Knot_Indices...> &knot_indices, \
2187 const std::tuple<Coeff_Indices...> &coeff_indices) const { \
2188 if constexpr (comp == functionspace::interior) \
2189 return std::tuple(std::get<Is>(spline_).template name<memory_optimized>( \
2190 std::get<Is>(xi), std::get<Is>(knot_indices), \
2191 std::get<Is>(coeff_indices))...); \
2192 else if constexpr (comp == functionspace::boundary) \
2193 return std::tuple( \
2194 std::get<Is>(boundary_).template name<memory_optimized>( \
2195 std::get<Is>(xi), std::get<Is>(knot_indices), \
2196 std::get<Is>(coeff_indices))...); \
2199 template <functionspace comp = functionspace::interior, \
2200 bool memory_optimized = false, std::size_t... Is, std::size_t N> \
2201 inline auto BOOST_PP_CAT(name, _)(std::index_sequence<Is...>, \
2202 const utils::TensorArray<N> &xi) const { \
2203 if constexpr (comp == functionspace::interior) \
2204 return name<comp, memory_optimized>( \
2205 xi, std::tuple(std::get<Is>(spline_).find_knot_indices(xi)...)); \
2206 else if constexpr (comp == functionspace::boundary) \
2207 return name<comp, memory_optimized>( \
2208 xi, std::tuple(std::get<Is>(boundary_).find_knot_indices(xi)...)); \
2211 template <functionspace comp = functionspace::interior, \
2212 bool memory_optimized = false, std::size_t... Is, std::size_t N, \
2213 typename... Knot_Indices> \
2214 inline auto BOOST_PP_CAT(name, _)( \
2215 std::index_sequence<Is...>, const utils::TensorArray<N> &xi, \
2216 const std::tuple<Knot_Indices...> &knot_indices) const { \
2217 if constexpr (comp == functionspace::interior) \
2218 return name<comp, memory_optimized>( \
2220 std::tuple(std::get<Is>(spline_).find_coeff_indices( \
2221 std::get<Is>(knot_indices))...)); \
2222 else if constexpr (comp == functionspace::boundary) \
2223 return name<comp, memory_optimized>( \
2225 std::tuple(std::get<Is>(boundary_).find_coeff_indices( \
2226 std::get<Is>(knot_indices))...)); \
2230 template <functionspace comp = functionspace::interior, \
2231 bool memory_optimized = false, typename... Args> \
2232 inline auto BOOST_PP_CAT(name, _all)(const Args &...args) const { \
2233 return BOOST_PP_CAT(name, _all_)<comp, memory_optimized>( \
2234 std::make_index_sequence<FunctionSpace::nspaces()>{}, args...); \
2237 template <functionspace comp = functionspace::interior, \
2238 bool memory_optimized = false> \
2239 inline auto name(const torch::Tensor &xi) const { \
2240 return name<comp, memory_optimized>(utils::TensorArray1({xi})); \
2243 template <functionspace comp = functionspace::interior, \
2244 bool memory_optimized = false, std::size_t N> \
2245 inline auto name(const utils::TensorArray<N> &xi) const { \
2246 return BOOST_PP_CAT(name, _)<comp, memory_optimized>( \
2247 std::make_index_sequence<FunctionSpace::nspaces()>{}, xi); \
2250 template <functionspace comp = functionspace::interior, \
2251 bool memory_optimized = false, std::size_t N, \
2252 typename... Knot_Indices> \
2253 inline auto name(const utils::TensorArray<N> &xi, \
2254 const std::tuple<Knot_Indices...> &knot_indices) const { \
2255 return BOOST_PP_CAT(name, _)<comp, memory_optimized>( \
2256 std::make_index_sequence<FunctionSpace::nspaces()>{}, xi, \
2264#undef GENERATE_EXPR_MACRO
2266#define GENERATE_IEXPR_MACRO(r, data, name) \
2268 template <functionspace comp = functionspace::interior, \
2269 bool memory_optimized = false, std::size_t... Is, \
2270 typename Geometry, typename... Xi> \
2271 inline auto BOOST_PP_CAT(name, _all_)(std::index_sequence<Is...>, \
2272 const Geometry &G, \
2273 const std::tuple<Xi...> &xi) const { \
2274 if constexpr (comp == functionspace::interior) { \
2275 if constexpr (Geometry::nspaces() == 1) \
2276 return std::tuple( \
2277 std::get<Is>(spline_).template name<memory_optimized>( \
2278 G.space(), std::get<Is>(xi))...); \
2279 else if constexpr (Geometry::nspaces() == nspaces()) \
2280 return std::tuple( \
2281 std::get<Is>(spline_).template name<memory_optimized>( \
2282 G.template space<Is>(), std::get<Is>(xi))...); \
2283 } else if constexpr (comp == functionspace::boundary) { \
2284 if constexpr (Geometry::nboundaries() == 1) \
2285 return std::tuple( \
2286 std::get<Is>(boundary_).template name<memory_optimized>( \
2287 static_cast<typename Geometry::boundary_type::boundary_type>( \
2288 G.boundary().coeffs()), \
2289 std::get<Is>(xi))...); \
2290 else if constexpr (Geometry::nboundaries() == nboundaries()) \
2291 return std::tuple( \
2292 std::get<Is>(boundary_).template name<memory_optimized>( \
2293 G.template boundary<Is>().coeffs(), std::get<Is>(xi))...); \
2297 template <functionspace comp = functionspace::interior, \
2298 bool memory_optimized = false, std::size_t... Is, \
2299 typename Geometry, typename... Xi, typename... Knot_Indices, \
2300 typename... Knot_Indices_G> \
2301 inline auto BOOST_PP_CAT(name, _all_)( \
2302 std::index_sequence<Is...>, const Geometry &G, \
2303 const std::tuple<Xi...> &xi, \
2304 const std::tuple<Knot_Indices...> &knot_indices, \
2305 const std::tuple<Knot_Indices_G...> &knot_indices_G) const { \
2306 if constexpr (comp == functionspace::interior) { \
2307 if constexpr (Geometry::nspaces() == 1) \
2308 return std::tuple( \
2309 std::get<Is>(spline_).template name<memory_optimized>( \
2310 G.space(), std::get<Is>(xi), std::get<Is>(knot_indices), \
2311 std::get<Is>(knot_indices_G))...); \
2313 return std::tuple( \
2314 std::get<Is>(spline_).template name<memory_optimized>( \
2315 std::get<Is>(G), std::get<Is>(xi), std::get<Is>(knot_indices), \
2316 std::get<Is>(knot_indices_G))...); \
2317 } else if constexpr (comp == functionspace::boundary) { \
2318 if constexpr (Geometry::nspaces() == 1) \
2319 return std::tuple( \
2320 std::get<Is>(boundary_).template name<memory_optimized>( \
2321 static_cast<typename Geometry::boundary_type::boundary_type>( \
2322 G.boundary().coeffs()), \
2323 std::get<Is>(xi), std::get<Is>(knot_indices), \
2324 std::get<Is>(knot_indices_G))...); \
2326 return std::tuple( \
2327 std::get<Is>(boundary_).template name<memory_optimized>( \
2328 std::get<Is>(G).boundary().coeffs(), std::get<Is>(xi), \
2329 std::get<Is>(knot_indices), std::get<Is>(knot_indices_G))...); \
2333 template <functionspace comp = functionspace::interior, \
2334 bool memory_optimized = false, std::size_t... Is, \
2335 typename Geometry, typename... Xi, typename... Knot_Indices, \
2336 typename... Coeff_Indices, typename... Knot_Indices_G, \
2337 typename... Coeff_Indices_G> \
2338 inline auto BOOST_PP_CAT(name, _all_)( \
2339 std::index_sequence<Is...>, const Geometry &G, \
2340 const std::tuple<Xi...> &xi, \
2341 const std::tuple<Knot_Indices...> &knot_indices, \
2342 const std::tuple<Coeff_Indices...> &coeff_indices, \
2343 const std::tuple<Knot_Indices_G...> &knot_indices_G, \
2344 const std::tuple<Coeff_Indices_G...> &coeff_indices_G) const { \
2345 if constexpr (comp == functionspace::interior) { \
2346 if constexpr (Geometry::nspaces() == 1) \
2347 return std::tuple( \
2348 std::get<Is>(spline_).template name<memory_optimized>( \
2349 G.space(), std::get<Is>(xi), std::get<Is>(knot_indices), \
2350 std::get<Is>(coeff_indices), std::get<Is>(knot_indices_G), \
2351 std::get<Is>(coeff_indices_G))...); \
2353 return std::tuple( \
2354 std::get<Is>(spline_).template name<memory_optimized>( \
2355 std::get<Is>(G), std::get<Is>(xi), std::get<Is>(knot_indices), \
2356 std::get<Is>(coeff_indices), std::get<Is>(knot_indices_G), \
2357 std::get<Is>(coeff_indices_G))...); \
2358 } else if constexpr (comp == functionspace::boundary) { \
2359 if constexpr (Geometry::nspaces() == 1) \
2360 return std::tuple( \
2361 std::get<Is>(boundary_).template name<memory_optimized>( \
2362 static_cast<typename Geometry::boundary_type::boundary_type>( \
2363 G.boundary().coeffs()), \
2364 std::get<Is>(xi), std::get<Is>(knot_indices), \
2365 std::get<Is>(coeff_indices), std::get<Is>(knot_indices_G), \
2366 std::get<Is>(coeff_indices_G))...); \
2368 return std::tuple( \
2369 std::get<Is>(boundary_).template name<memory_optimized>( \
2370 std::get<Is>(G).boundary().coeffs(), std::get<Is>(xi), \
2371 std::get<Is>(knot_indices), std::get<Is>(coeff_indices), \
2372 std::get<Is>(knot_indices_G), \
2373 std::get<Is>(coeff_indices_G))...); \
2378 template <functionspace comp = functionspace::interior, \
2379 bool memory_optimized = false, typename... Args> \
2380 inline auto BOOST_PP_CAT(name, _all)(const Args &...args) const { \
2381 return BOOST_PP_CAT(name, _all_)<comp, memory_optimized>( \
2382 std::make_index_sequence<FunctionSpace::nspaces()>{}, args...); \
2389#undef GENERATE_IEXPR_MACRO
2396 obj.pretty_print(
os);
2404template <
typename Spline,
typename Boundary>
2410 "Boundary must be a valid BoundaryType");
2459 static_assert(Spline::is_nonuniform(),
2460 "Constructor is only available for non-uniform splines");
2484 template <
short_t s = 0>
2497 template <
short_t s = 0>
2518 static_assert(((
s >= 0 &&
s <
nspaces()) && ... &&
true));
2520 if constexpr (
sizeof...(s) == 1)
2524 std::tuple<std::tuple_element_t<s, std::tuple<spline_type>>...>,
2525 std::tuple<std::tuple_element_t<s, std::tuple<boundary_type>>...>>(
2526 std::get<s>(std::make_tuple(
spline_))...,
2527 std::get<s>(std::make_tuple(
boundary_))...);
2552 return spline_.as_tensor_size();
2600 inline pugi::xml_document
to_xml(
int id = 0, std::string
label =
"")
const {
2601 pugi::xml_document
doc;
2602 pugi::xml_node
root =
doc.append_child(
"xml");
2610 std::string
label =
"")
const {
2616 std::string
label =
"") {
2622 std::string
label =
"") {
2629 auto json = nlohmann::json::array();
2637 const std::function<std::array<
typename Spline::value_type,
2639 const std::array<
typename Spline::value_type, Spline::parDim()> &)>
2650 std::size_t...
Is,
typename...
Xi>
2651 inline auto eval_(std::index_sequence<Is...>,
2652 const std::tuple<Xi...> &
xi)
const {
2658 std::get<Is>(
xi))...);
2664 inline auto eval_(std::index_sequence<Is...>,
const std::tuple<Xi...> &
xi,
2665 const std::tuple<Knot_Indices...> &
knot_indices)
const {
2678 inline auto eval_(std::index_sequence<Is...>,
const std::tuple<Xi...> &
xi,
2696 typename Arg,
typename...
Args>
2699 if constexpr (utils::is_tuple_v<Arg>)
2701 std::make_index_sequence<std::tuple_size_v<Arg>>{},
arg,
args...);
2705 if constexpr (utils::is_tuple_of_tuples_v<Arg>)
2707 std::make_index_sequence<std::tuple_size_v<Arg>>{},
arg,
args...);
2728 const Xi &
xi)
const {
2730 return std::tuple(
spline_.find_knot_indices(std::get<Is>(
xi))...);
2737 template <functionspace comp = functionspace::
interior,
typename Xi>
2740 if constexpr (utils::is_tuple_v<Xi>)
2742 std::make_index_sequence<std::tuple_size_v<Xi>>{},
xi);
2746 if constexpr (utils::is_tuple_of_tuples_v<Xi>)
2748 std::make_index_sequence<std::tuple_size_v<Xi>>{},
xi);
2789 if constexpr (utils::is_tuple_v<Knot_Indices>)
2791 std::make_index_sequence<std::tuple_size_v<Knot_Indices>>{},
2797 if constexpr (utils::is_tuple_of_tuples_v<Knot_Indices>)
2799 std::make_index_sequence<std::tuple_size_v<Knot_Indices>>{},
2826 inline auto to(torch::Device device)
const {
2831 template <
typename real_t>
inline auto to()
const {
2846 template <
size_t N>
inline auto scale(std::array<value_type, N>
v) {
2853 template <
size_t N>
inline auto translate(std::array<value_type, N>
v) {
2867 inline auto rotate(std::array<value_type, 3> angle) {
2875 inline torch::serialize::OutputArchive &
2877 const std::string &
key =
"functionspace")
const {
2885 inline torch::serialize::InputArchive &
2887 const std::string &
key =
"functionspace") {
2896 os <<
name() <<
"(\nspline = ";
2898 os <<
"\nboundary = ";
2903#define GENERATE_EXPR_MACRO(r, data, name) \
2905 template <functionspace comp = functionspace::interior, \
2906 bool memory_optimized = false, std::size_t... Is, typename... Xi> \
2907 inline auto BOOST_PP_CAT(name, _all_)(std::index_sequence<Is...>, \
2908 const std::tuple<Xi...> &xi) const { \
2909 if constexpr (comp == functionspace::interior) \
2910 return std::tuple( \
2911 spline_.template name<memory_optimized>(std::get<Is>(xi))...); \
2912 else if constexpr (comp == functionspace::boundary) \
2913 return std::tuple( \
2914 boundary_.template name<memory_optimized>(std::get<Is>(xi))...); \
2917 template <functionspace comp = functionspace::interior, \
2918 bool memory_optimized = false, std::size_t... Is, typename... Xi, \
2919 typename... Knot_Indices> \
2920 inline auto BOOST_PP_CAT(name, _all_)( \
2921 std::index_sequence<Is...>, const std::tuple<Xi...> &xi, \
2922 const std::tuple<Knot_Indices...> &knot_indices) const { \
2923 if constexpr (comp == functionspace::interior) \
2924 return std::tuple(spline_.template name<memory_optimized>( \
2925 std::get<Is>(xi), std::get<Is>(knot_indices))...); \
2926 else if constexpr (comp == functionspace::boundary) \
2927 return std::tuple(boundary_.template name<memory_optimized>( \
2928 std::get<Is>(xi), std::get<Is>(knot_indices))...); \
2931 template <functionspace comp = functionspace::interior, \
2932 bool memory_optimized = false, std::size_t... Is, typename... Xi, \
2933 typename... Knot_Indices, typename... Coeff_Indices> \
2934 inline auto BOOST_PP_CAT(name, _all_)( \
2935 std::index_sequence<Is...>, const std::tuple<Xi...> &xi, \
2936 const std::tuple<Knot_Indices...> &knot_indices, \
2937 const std::tuple<Coeff_Indices...> &coeff_indices) const { \
2938 if constexpr (comp == functionspace::interior) \
2939 return std::tuple(spline_.template name<memory_optimized>( \
2940 std::get<Is>(xi), std::get<Is>(knot_indices), \
2941 std::get<Is>(coeff_indices))...); \
2942 else if constexpr (comp == functionspace::boundary) \
2943 return std::tuple(boundary_.template name<memory_optimized>( \
2944 std::get<Is>(xi), std::get<Is>(knot_indices), \
2945 std::get<Is>(coeff_indices))...); \
2949 template <functionspace comp = functionspace::interior, \
2950 bool memory_optimized = false, typename Arg, typename... Args> \
2951 inline auto name(const Arg &arg, const Args &...args) const { \
2952 if constexpr (comp == functionspace::interior) \
2953 if constexpr (utils::is_tuple_v<Arg>) \
2954 return BOOST_PP_CAT(name, _all_)<comp, memory_optimized>( \
2955 std::make_index_sequence<std::tuple_size_v<Arg>>{}, arg, args...); \
2957 return spline_.template name<memory_optimized>(arg, args...); \
2958 else if constexpr (comp == functionspace::boundary) { \
2959 if constexpr (utils::is_tuple_of_tuples_v<Arg>) \
2960 return BOOST_PP_CAT(name, _all_)<comp, memory_optimized>( \
2961 std::make_index_sequence<std::tuple_size_v<Arg>>{}, arg, args...); \
2963 return boundary_.template name<memory_optimized>(arg, args...); \
2971#undef GENERATE_EXPR_MACRO
2973#define GENERATE_IEXPR_MACRO(r, data, name) \
2975 template <functionspace comp = functionspace::interior, \
2976 bool memory_optimized = false, std::size_t... Is, \
2977 typename Geometry, typename... Xi> \
2978 inline auto BOOST_PP_CAT(name, _all_)(std::index_sequence<Is...>, \
2979 const Geometry &G, \
2980 const std::tuple<Xi...> &xi) const { \
2981 if constexpr (comp == functionspace::interior) \
2982 return std::tuple(spline_.template name<memory_optimized>( \
2983 G.space(), std::get<Is>(xi))...); \
2984 else if constexpr (comp == functionspace::boundary) \
2985 return std::tuple(boundary_.template name<memory_optimized>( \
2986 static_cast<typename Geometry::boundary_type::boundary_type>( \
2987 G.boundary().coeffs()), \
2988 std::get<Is>(xi))...); \
2991 template <functionspace comp = functionspace::interior, \
2992 bool memory_optimized = false, std::size_t... Is, \
2993 typename Geometry, typename... Xi, typename... Knot_Indices, \
2994 typename... Knot_Indices_G> \
2995 inline auto BOOST_PP_CAT(name, _all_)( \
2996 std::index_sequence<Is...>, const Geometry &G, \
2997 const std::tuple<Xi...> &xi, \
2998 const std::tuple<Knot_Indices...> &knot_indices, \
2999 const std::tuple<Knot_Indices_G...> &knot_indices_G) const { \
3000 if constexpr (comp == functionspace::interior) \
3001 return std::tuple(spline_.template name<memory_optimized>( \
3002 G.space(), std::get<Is>(xi), std::get<Is>(knot_indices), \
3003 std::get<Is>(knot_indices_G))...); \
3004 else if constexpr (comp == functionspace::boundary) \
3005 return std::tuple(boundary_.template name<memory_optimized>( \
3006 static_cast<typename Geometry::boundary_type::boundary_type>( \
3007 G.boundary().coeffs()), \
3008 std::get<Is>(xi), std::get<Is>(knot_indices), \
3009 std::get<Is>(knot_indices_G))...); \
3012 template <functionspace comp = functionspace::interior, \
3013 bool memory_optimized = false, std::size_t... Is, \
3014 typename Geometry, typename... Xi, typename... Knot_Indices, \
3015 typename... Coeff_Indices, typename... Knot_Indices_G, \
3016 typename... Coeff_Indices_G> \
3017 inline auto BOOST_PP_CAT(name, _all_)( \
3018 std::index_sequence<Is...>, const Geometry &G, \
3019 const std::tuple<Xi...> &xi, \
3020 const std::tuple<Knot_Indices...> &knot_indices, \
3021 const std::tuple<Coeff_Indices...> &coeff_indices, \
3022 const std::tuple<Knot_Indices_G...> &knot_indices_G, \
3023 const std::tuple<Coeff_Indices_G...> &coeff_indices_G) const { \
3024 if constexpr (comp == functionspace::interior) \
3025 return std::tuple(spline_.template name<memory_optimized>( \
3026 G.space(), std::get<Is>(xi), std::get<Is>(knot_indices), \
3027 std::get<Is>(coeff_indices), std::get<Is>(knot_indices_G), \
3028 std::get<Is>(coeff_indices_G))...); \
3029 else if constexpr (comp == functionspace::boundary) \
3030 return std::tuple(boundary_.template name<memory_optimized>( \
3031 static_cast<typename Geometry::boundary_type::boundary_type>( \
3032 G.boundary().coeffs()), \
3033 std::get<Is>(xi), std::get<Is>(knot_indices), \
3034 std::get<Is>(coeff_indices), std::get<Is>(knot_indices_G), \
3035 std::get<Is>(coeff_indices_G))...); \
3039 template <functionspace comp = functionspace::interior, \
3040 bool memory_optimized = false, typename Geometry, typename Arg, \
3042 inline auto name(const Geometry &G, const Arg &arg, const Args &...args) \
3044 if constexpr (comp == functionspace::interior) { \
3045 if constexpr (utils::is_tuple_v<Arg>) \
3046 return BOOST_PP_CAT(name, _all_)<comp, memory_optimized>( \
3047 std::make_index_sequence<std::tuple_size_v<Arg>>{}, G, arg, \
3050 return spline_.template name<memory_optimized>(G.space(), arg, \
3052 } else if constexpr (comp == functionspace::boundary) { \
3053 if constexpr (utils::is_tuple_of_tuples_v<Arg>) \
3054 return BOOST_PP_CAT(name, _all_)<comp, memory_optimized>( \
3055 std::make_index_sequence<std::tuple_size_v<Arg>>{}, G, arg, \
3058 return boundary_.template name<memory_optimized>( \
3059 static_cast<typename Geometry::boundary_type::boundary_type>( \
3060 G.boundary().coeffs()), \
3069#undef GENERATE_IEXPR_MACRO
3081template <
typename Spline,
typename Boundary>
3101template <
typename Spline,
typename Boundary>
3117template <
typename...
Args>
3121template <
typename Splines,
typename Boundaries>
3124 obj.pretty_print(
os);
3148template <
typename Spline,
short_t = Spline::parDim()>
class TH;
3159template <
typename Spline>
3162 std::tuple<typename Spline::template derived_self_type<
3163 typename Spline::value_type, Spline::geoDim(),
3164 Spline::degree(0) + 1>,
3165 typename Spline::template derived_self_type<
3166 typename Spline::value_type, Spline::geoDim(),
3167 Spline::degree(0)>>> {
3171 typename Spline::template derived_self_type<
3172 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1>,
3173 typename Spline::template derived_self_type<
3174 typename Spline::value_type, Spline::geoDim(), Spline::degree(0)>>>;
3181 : Base(ncoeffs + utils::to_array(1
_i64), ncoeffs,
init, options) {
3182 static_assert(Spline::is_nonuniform(),
3183 "TH function space requires non-uniform splines");
3184 Base::template
space<0>().reduce_continuity();
3187 TH(
const std::array<std::vector<typename Spline::value_type>, 1> &
kv,
3191 : Base({{
kv[0].front +
kv[0] +
kv[0].back(),
kv[1]}},
kv,
init, options) {
3192 static_assert(Spline::is_nonuniform(),
3193 "TH function space requires non-uniform splines");
3194 Base::template
space<0>().reduce_continuity();
3212template <
typename Spline>
3215 std::tuple<typename Spline::template derived_self_type<
3216 typename Spline::value_type, Spline::geoDim(),
3217 Spline::degree(0) + 1, Spline::degree(1) + 1>,
3218 typename Spline::template derived_self_type<
3219 typename Spline::value_type, Spline::geoDim(),
3220 Spline::degree(0) + 1, Spline::degree(1) + 1>,
3221 typename Spline::template derived_self_type<
3222 typename Spline::value_type, Spline::geoDim(),
3223 Spline::degree(0), Spline::degree(1)>>> {
3227 std::tuple<
typename Spline::template derived_self_type<
3228 typename Spline::value_type, Spline::geoDim(),
3229 Spline::degree(0) + 1, Spline::degree(1) + 1>,
3230 typename Spline::template derived_self_type<
3231 typename Spline::value_type, Spline::geoDim(),
3232 Spline::degree(0) + 1, Spline::degree(1) + 1>,
3233 typename Spline::template derived_self_type<
3234 typename Spline::value_type, Spline::geoDim(),
3235 Spline::degree(0), Spline::degree(1)>>>;
3242 : Base(ncoeffs + utils::to_array(1
_i64, 1
_i64),
3243 ncoeffs + utils::to_array(1
_i64, 1
_i64), ncoeffs,
init, options) {
3244 static_assert(Spline::is_nonuniform(),
3245 "TH function space requires non-uniform splines");
3246 Base::template
space<0>().reduce_continuity();
3247 Base::template
space<1>().reduce_continuity();
3250 TH(
const std::array<std::vector<typename Spline::value_type>, 2> &
kv,
3254 : Base({{
kv[0].front() +
kv[0] +
kv[0].back(),
3255 kv[1].front() +
kv[1] +
kv[1].back()}},
3256 {{
kv[0].front() +
kv[0] +
kv[0].back(),
3257 kv[1].front() +
kv[1] +
kv[1].back()}},
3259 static_assert(Spline::is_nonuniform(),
3260 "TH function space requires non-uniform splines");
3261 Base::template
space<0>().reduce_continuity();
3262 Base::template
space<1>().reduce_continuity();
3281template <
typename Spline>
3284 typename Spline::template derived_self_type<
3285 typename Spline::value_type, Spline::geoDim(),
3286 Spline::degree(0) + 1, Spline::degree(1) + 1,
3287 Spline::degree(2) + 1>,
3288 typename Spline::template derived_self_type<
3289 typename Spline::value_type, Spline::geoDim(),
3290 Spline::degree(0) + 1, Spline::degree(1) + 1,
3291 Spline::degree(2) + 1>,
3292 typename Spline::template derived_self_type<
3293 typename Spline::value_type, Spline::geoDim(),
3294 Spline::degree(0) + 1, Spline::degree(1) + 1,
3295 Spline::degree(2) + 1>,
3296 typename Spline::template derived_self_type<
3297 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3298 Spline::degree(1), Spline::degree(2)>>> {
3302 typename Spline::template derived_self_type<
3303 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3304 Spline::degree(1) + 1, Spline::degree(2) + 1>,
3305 typename Spline::template derived_self_type<
3306 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3307 Spline::degree(1) + 1, Spline::degree(2) + 1>,
3308 typename Spline::template derived_self_type<
3309 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3310 Spline::degree(1) + 1, Spline::degree(2) + 1>,
3311 typename Spline::template derived_self_type<
3312 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3313 Spline::degree(1), Spline::degree(2)>>>;
3324 static_assert(Spline::is_nonuniform(),
3325 "TH function space requires non-uniform splines");
3326 Base::template
space<0>().reduce_continuity();
3327 Base::template
space<1>().reduce_continuity();
3328 Base::template
space<2>().reduce_continuity();
3331 TH(
const std::array<std::vector<typename Spline::value_type>, 3> &
kv,
3335 : Base({{
kv[0].front() +
kv[0] +
kv[0].back(),
3336 kv[1].front() +
kv[1] +
kv[1].back(),
3337 kv[2].front() +
kv[2] +
kv[2].back()}},
3338 {{
kv[0].front() +
kv[0] +
kv[0].back(),
3339 kv[1].front() +
kv[1] +
kv[1].back(),
3340 kv[2].front() +
kv[2] +
kv[2].back()}},
3341 {{
kv[0].front() +
kv[0] +
kv[0].back(),
3342 kv[1].front() +
kv[1] +
kv[1].back(),
3343 kv[2].front() +
kv[2] +
kv[2].back()}},
3345 static_assert(Spline::is_nonuniform(),
3346 "TH function space requires non-uniform splines");
3347 Base::template
space<0>().reduce_continuity();
3348 Base::template
space<1>().reduce_continuity();
3349 Base::template
space<2>().reduce_continuity();
3369template <
typename Spline>
3372 typename Spline::template derived_self_type<
3373 typename Spline::value_type, Spline::geoDim(),
3374 Spline::degree(0) + 1, Spline::degree(1) + 1,
3375 Spline::degree(2) + 1, Spline::degree(3) + 1>,
3376 typename Spline::template derived_self_type<
3377 typename Spline::value_type, Spline::geoDim(),
3378 Spline::degree(0) + 1, Spline::degree(1) + 1,
3379 Spline::degree(2) + 1, Spline::degree(3) + 1>,
3380 typename Spline::template derived_self_type<
3381 typename Spline::value_type, Spline::geoDim(),
3382 Spline::degree(0) + 1, Spline::degree(1) + 1,
3383 Spline::degree(2) + 1, Spline::degree(3) + 1>,
3384 typename Spline::template derived_self_type<
3385 typename Spline::value_type, Spline::geoDim(),
3386 Spline::degree(0) + 1, Spline::degree(1) + 1,
3387 Spline::degree(2) + 1, Spline::degree(3) + 1>,
3388 typename Spline::template derived_self_type<
3389 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3390 Spline::degree(1), Spline::degree(2), Spline::degree(3)>>> {
3394 typename Spline::template derived_self_type<
3395 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3396 Spline::degree(1) + 1, Spline::degree(2) + 1, Spline::degree(3) + 1>,
3397 typename Spline::template derived_self_type<
3398 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3399 Spline::degree(1) + 1, Spline::degree(2) + 1, Spline::degree(3) + 1>,
3400 typename Spline::template derived_self_type<
3401 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3402 Spline::degree(1) + 1, Spline::degree(2) + 1, Spline::degree(3) + 1>,
3403 typename Spline::template derived_self_type<
3404 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3405 Spline::degree(1) + 1, Spline::degree(2) + 1, Spline::degree(3) + 1>,
3406 typename Spline::template derived_self_type<
3407 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3408 Spline::degree(1), Spline::degree(2), Spline::degree(3)>>>;
3420 static_assert(Spline::is_nonuniform(),
3421 "TH function space requires non-uniform splines");
3422 Base::template
space<0>().reduce_continuity();
3423 Base::template
space<1>().reduce_continuity();
3424 Base::template
space<2>().reduce_continuity();
3425 Base::template
space<3>().reduce_continuity();
3428 TH(
const std::array<std::vector<typename Spline::value_type>, 4> &
kv,
3432 : Base({{
kv[0].front() +
kv[0] +
kv[0].back(),
3433 kv[1].front() +
kv[1] +
kv[1].back(),
3434 kv[2].front() +
kv[2] +
kv[2].back(),
3435 kv[3].front() +
kv[3] +
kv[3].back()}},
3436 {{
kv[0].front() +
kv[0] +
kv[0].back(),
3437 kv[1].front() +
kv[1] +
kv[1].back(),
3438 kv[2].front() +
kv[2] +
kv[2].back(),
3439 kv[3].front() +
kv[3] +
kv[3].back()}},
3440 {{
kv[0].front() +
kv[0] +
kv[0].back(),
3441 kv[1].front() +
kv[1] +
kv[1].back(),
3442 kv[2].front() +
kv[2] +
kv[2].back(),
3443 kv[3].front() +
kv[3] +
kv[3].back()}},
3444 {{
kv[0].front() +
kv[0] +
kv[0].back(),
3445 kv[1].front() +
kv[1] +
kv[1].back(),
3446 kv[2].front() +
kv[2] +
kv[2].back(),
3447 kv[3].front() +
kv[3] +
kv[3].back()}},
3449 static_assert(Spline::is_nonuniform(),
3450 "TH function space requires non-uniform splines");
3451 Base::template
space<0>().reduce_continuity();
3452 Base::template
space<1>().reduce_continuity();
3453 Base::template
space<2>().reduce_continuity();
3454 Base::template
space<3>().reduce_continuity();
3464template <
typename Spline,
short_t = Spline::parDim()>
class NE;
3475template <
typename Spline>
3478 std::tuple<typename Spline::template derived_self_type<
3479 typename Spline::value_type, Spline::geoDim(),
3480 Spline::degree(0) + 1>,
3481 typename Spline::template derived_self_type<
3482 typename Spline::value_type, Spline::geoDim(),
3483 Spline::degree(0)>>> {
3487 typename Spline::template derived_self_type<
3488 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1>,
3489 typename Spline::template derived_self_type<
3490 typename Spline::value_type, Spline::geoDim(), Spline::degree(0)>>>;
3497 : Base(ncoeffs + utils::to_array(1
_i64), ncoeffs,
init, options) {}
3499 NE(
const std::array<std::vector<typename Spline::value_type>, 1> &
kv,
3504 static_assert(Spline::is_nonuniform(),
3505 "Constructor only available for non-uniform splines");
3522template <
typename Spline>
3525 std::tuple<typename Spline::template derived_self_type<
3526 typename Spline::value_type, Spline::geoDim(),
3527 Spline::degree(0) + 1, Spline::degree(1) + 1>,
3528 typename Spline::template derived_self_type<
3529 typename Spline::value_type, Spline::geoDim(),
3530 Spline::degree(0) + 1, Spline::degree(1) + 1>,
3531 typename Spline::template derived_self_type<
3532 typename Spline::value_type, Spline::geoDim(),
3533 Spline::degree(0), Spline::degree(1)>>> {
3537 std::tuple<
typename Spline::template derived_self_type<
3538 typename Spline::value_type, Spline::geoDim(),
3539 Spline::degree(0) + 1, Spline::degree(1) + 1>,
3540 typename Spline::template derived_self_type<
3541 typename Spline::value_type, Spline::geoDim(),
3542 Spline::degree(0) + 1, Spline::degree(1) + 1>,
3543 typename Spline::template derived_self_type<
3544 typename Spline::value_type, Spline::geoDim(),
3545 Spline::degree(0), Spline::degree(1)>>>;
3552 : Base(ncoeffs + utils::to_array(1
_i64, 1
_i64),
3553 ncoeffs + utils::to_array(1
_i64, 1
_i64), ncoeffs,
init, options) {
3554 static_assert(Spline::is_nonuniform(),
3555 "NE function space requires non-uniform splines");
3556 Base::template
space<0>().reduce_continuity(1, 1);
3557 Base::template
space<1>().reduce_continuity(1, 0);
3560 NE(
const std::array<std::vector<typename Spline::value_type>, 2> &
kv,
3565 static_assert(Spline::is_nonuniform(),
3566 "NE function space requires non-uniform splines");
3567 Base::template
space<0>().reduce_continuity(1, 1);
3568 Base::template
space<1>().reduce_continuity(1, 0);
3587template <
typename Spline>
3590 typename Spline::template derived_self_type<
3591 typename Spline::value_type, Spline::geoDim(),
3592 Spline::degree(0) + 1, Spline::degree(1) + 1,
3593 Spline::degree(2) + 1>,
3594 typename Spline::template derived_self_type<
3595 typename Spline::value_type, Spline::geoDim(),
3596 Spline::degree(0) + 1, Spline::degree(1) + 1,
3597 Spline::degree(2) + 1>,
3598 typename Spline::template derived_self_type<
3599 typename Spline::value_type, Spline::geoDim(),
3600 Spline::degree(0) + 1, Spline::degree(1) + 1,
3601 Spline::degree(2) + 1>,
3602 typename Spline::template derived_self_type<
3603 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3604 Spline::degree(1), Spline::degree(2)>>> {
3608 typename Spline::template derived_self_type<
3609 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3610 Spline::degree(1) + 1, Spline::degree(2) + 1>,
3611 typename Spline::template derived_self_type<
3612 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3613 Spline::degree(1) + 1, Spline::degree(2) + 1>,
3614 typename Spline::template derived_self_type<
3615 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3616 Spline::degree(1) + 1, Spline::degree(2) + 1>,
3617 typename Spline::template derived_self_type<
3618 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3619 Spline::degree(1), Spline::degree(2)>>>;
3630 static_assert(Spline::is_nonuniform(),
3631 "NE function space requires non-uniform splines");
3632 Base::template
space<0>().reduce_continuity(1, 1).reduce_continuity(1, 2);
3633 Base::template
space<1>().reduce_continuity(1, 0).reduce_continuity(1, 2);
3634 Base::template
space<2>().reduce_continuity(1, 0).reduce_continuity(1, 1);
3637 NE(
const std::array<std::vector<typename Spline::value_type>, 3> &
kv,
3642 static_assert(Spline::is_nonuniform(),
3643 "NE function space requires non-uniform splines");
3644 Base::template
space<0>().reduce_continuity(1, 1).reduce_continuity(1, 2);
3645 Base::template
space<1>().reduce_continuity(1, 0).reduce_continuity(1, 2);
3646 Base::template
space<2>().reduce_continuity(1, 0).reduce_continuity(1, 1);
3666template <
typename Spline>
3669 typename Spline::template derived_self_type<
3670 typename Spline::value_type, Spline::geoDim(),
3671 Spline::degree(0) + 1, Spline::degree(1) + 1,
3672 Spline::degree(2) + 1, Spline::degree(3) + 1>,
3673 typename Spline::template derived_self_type<
3674 typename Spline::value_type, Spline::geoDim(),
3675 Spline::degree(0) + 1, Spline::degree(1) + 1,
3676 Spline::degree(2) + 1, Spline::degree(3) + 1>,
3677 typename Spline::template derived_self_type<
3678 typename Spline::value_type, Spline::geoDim(),
3679 Spline::degree(0) + 1, Spline::degree(1) + 1,
3680 Spline::degree(2) + 1, Spline::degree(3) + 1>,
3681 typename Spline::template derived_self_type<
3682 typename Spline::value_type, Spline::geoDim(),
3683 Spline::degree(0) + 1, Spline::degree(1) + 1,
3684 Spline::degree(2) + 1, Spline::degree(3) + 1>,
3685 typename Spline::template derived_self_type<
3686 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3687 Spline::degree(1), Spline::degree(2), Spline::degree(3)>>> {
3691 typename Spline::template derived_self_type<
3692 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3693 Spline::degree(1) + 1, Spline::degree(2) + 1, Spline::degree(3) + 1>,
3694 typename Spline::template derived_self_type<
3695 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3696 Spline::degree(1) + 1, Spline::degree(2) + 1, Spline::degree(3) + 1>,
3697 typename Spline::template derived_self_type<
3698 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3699 Spline::degree(1) + 1, Spline::degree(2) + 1, Spline::degree(3) + 1>,
3700 typename Spline::template derived_self_type<
3701 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3702 Spline::degree(1) + 1, Spline::degree(2) + 1, Spline::degree(3) + 1>,
3703 typename Spline::template derived_self_type<
3704 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3705 Spline::degree(1), Spline::degree(2), Spline::degree(3)>>>;
3717 static_assert(Spline::is_nonuniform(),
3718 "NE function space requires non-uniform splines");
3720 .reduce_continuity(1, 1)
3721 .reduce_continuity(1, 2)
3722 .reduce_continuity(1, 3);
3724 .reduce_continuity(1, 0)
3725 .reduce_continuity(1, 2)
3726 .reduce_continuity(1, 3);
3728 .reduce_continuity(1, 0)
3729 .reduce_continuity(1, 1)
3730 .reduce_continuity(1, 3);
3732 .reduce_continuity(1, 0)
3733 .reduce_continuity(1, 1)
3734 .reduce_continuity(1, 2);
3737 NE(
const std::array<std::vector<typename Spline::value_type>,
3738 Spline::parDim()> &
kv,
3743 static_assert(Spline::is_nonuniform(),
3744 "NE function space requires non-uniform splines");
3746 .reduce_continuity(1, 1)
3747 .reduce_continuity(1, 2)
3748 .reduce_continuity(1, 3);
3750 .reduce_continuity(1, 0)
3751 .reduce_continuity(1, 2)
3752 .reduce_continuity(1, 3);
3754 .reduce_continuity(1, 0)
3755 .reduce_continuity(1, 1)
3756 .reduce_continuity(1, 3);
3758 .reduce_continuity(1, 0)
3759 .reduce_continuity(1, 1)
3760 .reduce_continuity(1, 2);
3770template <
typename Spline,
short_t = Spline::parDim()>
class RT;
3781template <
typename Spline>
3784 std::tuple<typename Spline::template derived_self_type<
3785 typename Spline::value_type, Spline::geoDim(),
3786 Spline::degree(0) + 1>,
3787 typename Spline::template derived_self_type<
3788 typename Spline::value_type, Spline::geoDim(),
3789 Spline::degree(0)>>> {
3793 typename Spline::template derived_self_type<
3794 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1>,
3795 typename Spline::template derived_self_type<
3796 typename Spline::value_type, Spline::geoDim(), Spline::degree(0)>>>;
3803 : Base(ncoeffs + utils::to_array(1
_i64), ncoeffs,
init, options) {}
3805 RT(
const std::array<std::vector<typename Spline::value_type>, 1> &
kv,
3809 : Base({{
kv[0].front() +
kv[0] +
kv[0].back(),
kv[1]}},
kv,
init,
3811 static_assert(Spline::is_nonuniform(),
3812 "Constructor only available for non-uniform splines");
3830template <
typename Spline>
3833 std::tuple<typename Spline::template derived_self_type<
3834 typename Spline::value_type, Spline::geoDim(),
3835 Spline::degree(0) + 1, Spline::degree(1)>,
3836 typename Spline::template derived_self_type<
3837 typename Spline::value_type, Spline::geoDim(),
3838 Spline::degree(0), Spline::degree(1) + 1>,
3839 typename Spline::template derived_self_type<
3840 typename Spline::value_type, Spline::geoDim(),
3841 Spline::degree(0), Spline::degree(1)>>> {
3844 std::tuple<
typename Spline::template derived_self_type<
3845 typename Spline::value_type, Spline::geoDim(),
3846 Spline::degree(0) + 1, Spline::degree(1)>,
3847 typename Spline::template derived_self_type<
3848 typename Spline::value_type, Spline::geoDim(),
3849 Spline::degree(0), Spline::degree(1) + 1>,
3850 typename Spline::template derived_self_type<
3851 typename Spline::value_type, Spline::geoDim(),
3852 Spline::degree(0), Spline::degree(1)>>>;
3859 : Base(ncoeffs + utils::to_array(1
_i64, 0
_i64),
3860 ncoeffs + utils::to_array(0
_i64, 1
_i64), ncoeffs,
init, options) {}
3862 RT(
const std::array<std::vector<typename Spline::value_type>, 2> &
kv,
3866 : Base({{
kv[0].front() +
kv[0] +
kv[0].back(),
kv[1]}},
3869 static_assert(Spline::is_nonuniform(),
3870 "Constructor only available for non-uniform splines");
3888template <
typename Spline>
3891 typename Spline::template derived_self_type<
3892 typename Spline::value_type, Spline::geoDim(),
3893 Spline::degree(0) + 1, Spline::degree(1), Spline::degree(2)>,
3894 typename Spline::template derived_self_type<
3895 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3896 Spline::degree(1) + 1, Spline::degree(2)>,
3897 typename Spline::template derived_self_type<
3898 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3899 Spline::degree(1), Spline::degree(2) + 1>,
3900 typename Spline::template derived_self_type<
3901 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3902 Spline::degree(1), Spline::degree(2)>>> {
3906 typename Spline::template derived_self_type<
3907 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3908 Spline::degree(1), Spline::degree(2)>,
3909 typename Spline::template derived_self_type<
3910 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3911 Spline::degree(1) + 1, Spline::degree(2)>,
3912 typename Spline::template derived_self_type<
3913 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3914 Spline::degree(1), Spline::degree(2) + 1>,
3915 typename Spline::template derived_self_type<
3916 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3917 Spline::degree(1), Spline::degree(2)>>>;
3929 RT(
const std::array<std::vector<typename Spline::value_type>, 3> &
kv,
3933 : Base({{
kv[0].front() +
kv[0] +
kv[0].back(),
kv[1],
kv[2]}},
3934 {{
kv[0],
kv[1].front() +
kv[1] +
kv[1].back(),
kv[2]}},
3937 static_assert(Spline::is_nonuniform(),
3938 "Constructor only available for non-uniform splines");
3958template <
typename Spline>
3961 typename Spline::template derived_self_type<
3962 typename Spline::value_type, Spline::geoDim(),
3963 Spline::degree(0) + 1, Spline::degree(1), Spline::degree(2),
3965 typename Spline::template derived_self_type<
3966 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3967 Spline::degree(1) + 1, Spline::degree(2), Spline::degree(3)>,
3968 typename Spline::template derived_self_type<
3969 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3970 Spline::degree(1), Spline::degree(2) + 1, Spline::degree(3)>,
3971 typename Spline::template derived_self_type<
3972 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3973 Spline::degree(1), Spline::degree(2), Spline::degree(3) + 1>,
3974 typename Spline::template derived_self_type<
3975 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3976 Spline::degree(1), Spline::degree(2), Spline::degree(3)>>> {
3980 typename Spline::template derived_self_type<
3981 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
3982 Spline::degree(1), Spline::degree(2), Spline::degree(3)>,
3983 typename Spline::template derived_self_type<
3984 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3985 Spline::degree(1) + 1, Spline::degree(2), Spline::degree(3)>,
3986 typename Spline::template derived_self_type<
3987 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3988 Spline::degree(1), Spline::degree(2) + 1, Spline::degree(3)>,
3989 typename Spline::template derived_self_type<
3990 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3991 Spline::degree(1), Spline::degree(2), Spline::degree(3) + 1>,
3992 typename Spline::template derived_self_type<
3993 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
3994 Spline::degree(1), Spline::degree(2), Spline::degree(3)>>>;
4007 RT(
const std::array<std::vector<typename Spline::value_type>, 4> &
kv,
4011 : Base({{
kv[0].front() +
kv[0] +
kv[0].back(),
kv[1],
kv[2],
kv[3]}},
4012 {{
kv[0],
kv[1].front() +
kv[1] +
kv[1].back(),
kv[2],
kv[3]}},
4013 {{
kv[0],
kv[1],
kv[2].front() +
kv[2] +
kv[2].back(),
kv[3]}},
4014 {{
kv[0],
kv[1],
kv[2],
kv[3].front() +
kv[3] +
kv[3].back()}},
kv,
4016 static_assert(Spline::is_nonuniform(),
4017 "Constructor only available for non-uniform splines");
4027template <
typename Spline,
short_t = Spline::parDim()>
class Hcurl;
4040template <
typename Spline>
4043 typename Spline::template derived_self_type<
4044 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
4045 Spline::degree(1) + 1, Spline::degree(2) + 1>,
4046 typename Spline::template derived_self_type<
4047 typename Spline::value_type, Spline::geoDim(),
4048 Spline::degree(0) + 1, Spline::degree(1), Spline::degree(2) + 1>,
4049 typename Spline::template derived_self_type<
4050 typename Spline::value_type, Spline::geoDim(),
4051 Spline::degree(0) + 1, Spline::degree(1) + 1,
4052 Spline::degree(2)>>> {
4057 typename Spline::template derived_self_type<
4058 typename Spline::value_type, Spline::geoDim(), Spline::degree(0),
4059 Spline::degree(1) + 1, Spline::degree(2) + 1>,
4060 typename Spline::template derived_self_type<
4061 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
4062 Spline::degree(1), Spline::degree(2) + 1>,
4063 typename Spline::template derived_self_type<
4064 typename Spline::value_type, Spline::geoDim(), Spline::degree(0) + 1,
4065 Spline::degree(1) + 1, Spline::degree(2)>>>;
4076 Hcurl(
const std::array<std::vector<typename Spline::value_type>, 3> &
kv,
4080 : Base({{
kv[0].front() +
kv[0] +
kv[0].back(),
kv[1],
kv[2]}},
4081 {{
kv[0],
kv[1].front() +
kv[1] +
kv[1].back(),
kv[2]}},
4084 static_assert(Spline::is_nonuniform(),
4085 "Constructor only available for non-uniform splines");
4094#undef IGANET_FUNCTIONSPACE_DEFAULT_OPS
#define GENERATE_IEXPR_MACRO(r, data, name)
Auto-generated functions.
Definition boundary.hpp:1794
#define GENERATE_EXPR_MACRO(r, data, name)
Definition boundary.hpp:1748
#define GENERATE_EXPR_SEQ
Sequence of expression (parametric coordinates)
Definition bspline.hpp:41
#define GENERATE_IEXPR_SEQ
Sequence of expression (physical coordinates)
Definition bspline.hpp:47
Boundary (common high-level functionality)
Definition boundary.hpp:1141
auto find_knot_indices(const std::tuple< Xi... > &xi) const
Returns the knot indicies of knot spans containing xi
Definition boundary.hpp:1367
auto eval_from_precomputed(const std::tuple< Basfunc... > &basfunc, const std::tuple< Coeff_Indices... > &coeff_indices, const std::tuple< Numeval... > &numeval, const std::tuple< Sizes... > &sizes) const
Returns the value of the spline objects from precomputed basis function.
Definition boundary.hpp:1329
torch::serialize::InputArchive & read(torch::serialize::InputArchive &archive, const std::string &key="boundary")
Loads the boundary spline object from a torch::serialize::InputArchive object.
Definition boundary.hpp:1618
auto to(Options< real_t > options) const
Returns a copy of the boundary object with settings from options.
Definition boundary.hpp:1937
auto & from_tensor(const torch::Tensor &tensor)
Sets the coefficients of all spline objects from a single tensor.
Definition boundary.hpp:1219
torch::Tensor as_tensor() const
Returns all coefficients of all spline objects as a single tensor.
Definition boundary.hpp:1164
auto & uniform_refine(int numRefine=1, int dim=-1)
Returns the spline objects with uniformly refined knot and coefficient vectors.
Definition boundary.hpp:1449
int64_t as_tensor_size() const
Returns the size of the single tensor representation of all spline objects.
Definition boundary.hpp:1185
torch::serialize::OutputArchive & write(torch::serialize::OutputArchive &archive, const std::string &key="boundary") const
Writes the boundary spline object into a torch::serialize::OutputArchive object.
Definition boundary.hpp:1587
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1)+1, Spline::degree(2)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1), Spline::degree(2)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)> > > Base
Base type.
Definition functionspace.hpp:4065
Hcurl(const std::array< int64_t, 3 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:4069
Hcurl(const std::array< std::vector< typename Spline::value_type >, 3 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:4076
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)> > > Base
Base type.
Definition functionspace.hpp:3490
NE(const std::array< int64_t, 1 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3494
NE(const std::array< std::vector< typename Spline::value_type >, 1 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3499
NE(const std::array< int64_t, 2 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3549
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1)> > > Base
Base type.
Definition functionspace.hpp:3545
NE(const std::array< std::vector< typename Spline::value_type >, 2 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3560
NE(const std::array< int64_t, 3 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3623
NE(const std::array< std::vector< typename Spline::value_type >, 3 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3637
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1), Spline::degree(2)> > > Base
Base type.
Definition functionspace.hpp:3619
NE(const std::array< int64_t, 4 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3709
NE(const std::array< std::vector< typename Spline::value_type >, Spline::parDim()> &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3737
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1, Spline::degree(3)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1, Spline::degree(3)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1, Spline::degree(3)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1, Spline::degree(3)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1), Spline::degree(2), Spline::degree(3)> > > Base
Base type.
Definition functionspace.hpp:3705
The Options class handles the automated determination of dtype from the template argument and the sel...
Definition options.hpp:90
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)> > > Base
Base type.
Definition functionspace.hpp:3796
RT(const std::array< int64_t, 1 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3800
RT(const std::array< std::vector< typename Spline::value_type >, 1 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3805
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)>, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1)> > > Base
Definition functionspace.hpp:3852
RT(const std::array< int64_t, 2 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3856
RT(const std::array< std::vector< typename Spline::value_type >, 2 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3862
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1), Spline::degree(2)>, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1)+1, Spline::degree(2)>, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1), Spline::degree(2)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1), Spline::degree(2)> > > Base
Base type.
Definition functionspace.hpp:3917
RT(const std::array< int64_t, 3 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3921
RT(const std::array< std::vector< typename Spline::value_type >, 3 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3929
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1), Spline::degree(2), Spline::degree(3)>, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1)+1, Spline::degree(2), Spline::degree(3)>, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1), Spline::degree(2)+1, Spline::degree(3)>, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1), Spline::degree(2), Spline::degree(3)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1), Spline::degree(2), Spline::degree(3)> > > Base
Base type.
Definition functionspace.hpp:3994
RT(const std::array< int64_t, 4 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3998
RT(const std::array< std::vector< typename Spline::value_type >, 4 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:4007
TH(const std::array< int64_t, 1 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3178
TH(const std::array< std::vector< typename Spline::value_type >, 1 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3187
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)> > > Base
Base type.
Definition functionspace.hpp:3174
TH(const std::array< std::vector< typename Spline::value_type >, 2 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3250
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1)> > > Base
Base type.
Definition functionspace.hpp:3235
TH(const std::array< int64_t, 2 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3239
TH(const std::array< int64_t, 3 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3317
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1), Spline::degree(2)> > > Base
Base type.
Definition functionspace.hpp:3313
TH(const std::array< std::vector< typename Spline::value_type >, 3 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3331
TH(const std::array< std::vector< typename Spline::value_type >, 4 > &kv, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3428
TH(const std::array< int64_t, 4 > &ncoeffs, enum init init=init::greville, Options< typename Spline::value_type > options=iganet::Options< typename Spline::value_type >{})
Constructor.
Definition functionspace.hpp:3412
FunctionSpace< std::tuple< typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1, Spline::degree(3)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1, Spline::degree(3)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1, Spline::degree(3)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0)+1, Spline::degree(1)+1, Spline::degree(2)+1, Spline::degree(3)+1 >, typename Spline::template derived_self_type< typename Spline::value_type, Spline::geoDim(), Spline::degree(0), Spline::degree(1), Spline::degree(2), Spline::degree(3)> > > Base
Base type.
Definition functionspace.hpp:3408
auto to() const
Returns a copy of the function space object with real_t type.
Definition functionspace.hpp:812
auto find_knot_indices(const utils::TensorArray< nspaces()> &xi) const
Returns the knot indicies of knot spans containing xi
Definition functionspace.hpp:634
auto eval_basfunc_(std::index_sequence< Is... >, const std::tuple< Xi... > &xi) const
Returns the values of the spline objects' basis functions in the points xi
Definition functionspace.hpp:653
auto eval_from_precomputed(const std::tuple< Basfunc... > &basfunc, const std::tuple< Coeff_Indices... > &coeff_indices, const std::tuple< Numeval... > &numeval, const std::tuple< Sizes... > &sizes) const
Returns the value of the spline objects from precomputed basis function.
Definition functionspace.hpp:582
virtual int64_t boundary_as_tensor_size() const noexcept
Returns the size of the single-tensor representation of the tuple of boundaries.
Definition functionspace.hpp:259
auto hess(const utils::TensorArray< nspaces()> &xi) const
Returns a block-tensor with the Hessian of the function space object in the points xi with respect to...
Definition functionspace.hpp:1430
nlohmann::json to_json() const override
Serialization to JSON.
Definition functionspace.hpp:434
auto jac(const utils::TensorArray1 &xi, const std::tuple< utils::TensorArray1 > &knot_indices, const std::tuple< torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Jacobian of the function space object in the points xi with respect t...
Definition functionspace.hpp:1859
auto to(torch::Device device) const
Returns a copy of the function space object with settings from device.
Definition functionspace.hpp:792
auto rotate_(std::index_sequence< Is... >, std::array< value_type, 3 > angle)
Rotates the function space object by three angles in 3d.
Definition functionspace.hpp:888
torch::serialize::InputArchive & read(torch::serialize::InputArchive &archive, const std::string &key="functionspace")
Loads the function space object from a torch::serialize::InputArchive object.
Definition functionspace.hpp:962
int64_t boundary_as_tensor_size_(std::index_sequence< Is... >) const noexcept
Returns the size of the single-tensor representation of the tuple of boundaries.
Definition functionspace.hpp:250
pugi::xml_document to_xml(int id=0, std::string label="") const
Returns the function space object as XML object.
Definition functionspace.hpp:372
auto & boundary() noexcept
Returns a non-constant reference to the -th boundary object.
Definition functionspace.hpp:165
auto boundingBox() const
Computes the bounding boxes of the function space object.
Definition functionspace.hpp:912
FunctionSpace clone() const noexcept
Returns a clone of the function space.
Definition functionspace.hpp:171
auto div(const utils::TensorArray< nspaces()> &xi, const std::tuple< TensorArrays... > &knot_indices) const
Returns a block-tensor with the divergence of the function space object with respect to the parametri...
Definition functionspace.hpp:1140
auto curl(const utils::TensorArray1 &xi, const std::tuple< utils::TensorArray1 > &knot_indices, const std::tuple< torch::Tensor > &coeff_indices) const
Returns a block-tensor with the curl of the function space object with respect to the parametric vari...
Definition functionspace.hpp:1020
auto to_(std::index_sequence< Is... >, std::index_sequence< Js... >, Options< real_t > options) const
Returns a copy of the function space object with settings from options.
Definition functionspace.hpp:761
auto jac(const utils::TensorArray3 &xi, const std::tuple< utils::TensorArray3, utils::TensorArray3, utils::TensorArray3 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Jacobian of the function space object in the points xi with respect t...
Definition functionspace.hpp:1906
auto jac(const utils::TensorArray< nspaces()> &xi) const
Returns a block-tensor with the Jacobian of the function space object in the points xi with respect t...
Definition functionspace.hpp:1844
FunctionSpace(FunctionSpace &&)=default
Move constructor.
virtual torch::Tensor spaces_as_tensor() const noexcept
Returns a single-tensor representation of the tuple of spaces.
Definition functionspace.hpp:195
torch::Tensor boundary_as_tensor_(std::index_sequence< Is... >) const noexcept
Returns a single-tensor representation of the tuple of boundaries.
Definition functionspace.hpp:205
auto & space() noexcept
Returns a non-constant reference to the -th space.
Definition functionspace.hpp:152
auto & uniform_refine_(std::index_sequence< Is... >, std::index_sequence< Js... >, int numRefine=1, int dimRefine=-1)
Returns the spline objects with uniformly refined knot and coefficient vectors.
Definition functionspace.hpp:739
auto translate(std::array< value_type, N > v)
Translates the function space object by a vector.
Definition functionspace.hpp:864
std::tuple< Boundaries... > boundary_type
Boundary type.
Definition functionspace.hpp:70
FunctionSpace(std::tuple< Splines... > &&spline, std::tuple< Boundaries... > &&boundary)
Constructor.
Definition functionspace.hpp:129
std::common_type_t< typename Splines::value_type... > value_type
Value type.
Definition functionspace.hpp:61
auto eval_from_precomputed_(std::index_sequence< Is... >, const std::tuple< Basfunc... > &basfunc, const std::tuple< Coeff_Indices... > &coeff_indices, const std::tuple< Xi... > &xi) const
Returns the value of the spline objects from precomputed basis function.
Definition functionspace.hpp:560
virtual FunctionSpace & from_tensor(const torch::Tensor &tensor)
Sets the function space object from a single-tensor representation.
Definition functionspace.hpp:351
auto clone() const noexcept
Returns a clone of a subset of the function space.
Definition functionspace.hpp:174
auto div(const utils::TensorArray< nspaces()> &xi) const
Returns a block-tensor with the divergence of the function space object with respect to the parametri...
Definition functionspace.hpp:1133
auto rotate(value_type angle)
Rotates the function space object by an angle in 2d.
Definition functionspace.hpp:881
auto & uniform_refine(int numRefine=1, int dimRefine=-1)
Returns the spline objects with uniformly refined knot and coefficient vectors.
Definition functionspace.hpp:750
FunctionSpace & boundary_from_tensor_(std::index_sequence< Is... >, const torch::Tensor &tensor)
Sets the tuple of boundaries from a single-tensor representation of the boundaries only.
Definition functionspace.hpp:312
auto eval_basfunc(const std::tuple< Xi... > &xi) const
Returns the values of the spline objects' basis functions in the points xi
Definition functionspace.hpp:689
FunctionSpace(const FunctionSpace &)=default
Copy constructor.
auto hess(const utils::TensorArray4 &xi, const std::tuple< utils::TensorArray4, utils::TensorArray4, utils::TensorArray4, utils::TensorArray4 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Hessian of the function space object in the points xi with respect to...
Definition functionspace.hpp:1602
spline_type spline_
Splines.
Definition functionspace.hpp:77
virtual FunctionSpace & boundary_from_tensor(const torch::Tensor &tensor)
Sets the tuple of boundaries from a single-tensor representation of the boundaries only.
Definition functionspace.hpp:324
auto eval_(std::index_sequence< Is... >, const std::tuple< Xi... > &xi, const std::tuple< Knot_Indices... > &knot_indices, const std::tuple< Coeff_Indices... > &coeff_indices) const
Returns the values of the spline objects in the points xi
Definition functionspace.hpp:475
auto curl(const utils::TensorArray< nspaces()> &xi) const
Returns a block-tensor with the curl of the function space object with respect to the parametric vari...
Definition functionspace.hpp:1005
auto lapl(const utils::TensorArray2 &xi, const std::tuple< utils::TensorArray2, utils::TensorArray2 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Laplacian of the function space object in the points xi with respect ...
Definition functionspace.hpp:2065
FunctionSpace & boundary_from_full_tensor_(std::index_sequence< Is... >, const torch::Tensor &tensor)
Sets the tuple of boundaries from a single-tensor representation.
Definition functionspace.hpp:333
auto find_coeff_indices(const std::tuple< Knot_Indices... > &knot_indices) const
Returns the indices of the spline objects' coefficients corresponding to the knot indices indices
Definition functionspace.hpp:730
auto scale_(std::index_sequence< Is... >, value_type s, int dim=-1)
Scales the function space object by a scalar.
Definition functionspace.hpp:821
auto eval_basfunc_(std::index_sequence< Is... >, const std::tuple< Xi... > &xi, const std::tuple< Knot_Indices... > &knot_indices) const
Returns the values of the spline objects' basis functions in the points xi
Definition functionspace.hpp:669
pugi::xml_node & to_xml_(std::index_sequence< Is... >, pugi::xml_node &root, int id=0, std::string label="") const
Returns the function space object as XML node.
Definition functionspace.hpp:362
auto boundingBox_(std::index_sequence< Is... >) const
Computes the bounding boxes of the function space object.
Definition functionspace.hpp:906
std::tuple< typename Boundaries::eval_type... > boundary_eval_type
Boundary evaluation type.
Definition functionspace.hpp:73
FunctionSpace & from_xml(const pugi::xml_node &root, int id=0, std::string label="")
Updates the function space object from XML node.
Definition functionspace.hpp:406
auto grad(const utils::TensorArray2 &xi, const std::tuple< utils::TensorArray2, utils::TensorArray2 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the gradient of the function space object in the points xi with respect t...
Definition functionspace.hpp:1306
auto eval(const std::tuple< Xi... > &xi, const std::tuple< Knot_Indices... > &knot_indices, const std::tuple< Coeff_Indices... > &coeff_indices) const
Returns the values of the spline objects in the points xi
Definition functionspace.hpp:520
auto scale(std::array< value_type, N > v)
Scales the function space object by a vector.
Definition functionspace.hpp:846
auto lapl(const utils::TensorArray1 &xi, const std::tuple< utils::TensorArray1 > &knot_indices, const std::tuple< torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Laplacian of the function space object in the points xi with respect ...
Definition functionspace.hpp:2046
auto eval(const std::tuple< Xi... > &xi) const
Returns the values of the spline objects in the points xi
Definition functionspace.hpp:497
auto curl(const utils::TensorArray4 &xi, const std::tuple< utils::TensorArray4, utils::TensorArray4, utils::TensorArray4, utils::TensorArray4 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the curl of the function space object with respect to the parametric vari...
Definition functionspace.hpp:1088
auto lapl(const utils::TensorArray< nspaces()> &xi, const std::tuple< TensorArrays... > &knot_indices) const
Returns a block-tensor with the Laplacian of the function space object in the points xi with respect ...
Definition functionspace.hpp:2038
auto hess(const utils::TensorArray2 &xi, const std::tuple< utils::TensorArray2, utils::TensorArray2 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Hessian of the function space object in the points xi with respect to...
Definition functionspace.hpp:1464
auto div(const utils::TensorArray3 &xi, const std::tuple< utils::TensorArray3, utils::TensorArray3, utils::TensorArray3 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the divergence of the function space object with respect to the parametri...
Definition functionspace.hpp:1190
FunctionSpace(const std::array< std::vector< typename Splines::value_type >, Splines::parDim()> &...kv, enum init init=init::greville, Options< value_type > options=iganet::Options< value_type >{})
Constructor.
Definition functionspace.hpp:102
auto to(Options< real_t > options) const
Returns a copy of the function space object with settings from options.
Definition functionspace.hpp:773
FunctionSpace(std::tuple< Splines... > &&spline)
Constructor.
Definition functionspace.hpp:119
auto grad(const utils::TensorArray< nspaces()> &xi) const
Returns a block-tensor with the gradient of the function space object in the points xi with respect t...
Definition functionspace.hpp:1272
FunctionSpace()=default
Default constructor.
int64_t spaces_as_tensor_size_(std::index_sequence< Is... >) const noexcept
Returns the size of the single-tensor representation of the tuple of function spaces.
Definition functionspace.hpp:231
static constexpr short_t nboundaries() noexcept
Returns the number of boundaries.
Definition functionspace.hpp:141
auto to_(std::index_sequence< Is... >, std::index_sequence< Js... >, torch::Device device) const
Returns a copy of the function space object with settings from device.
Definition functionspace.hpp:783
std::tuple< utils::TensorArray< Splines::parDim()>... > eval_type
Spline evaluation type.
Definition functionspace.hpp:67
auto hess(const utils::TensorArray< nspaces()> &xi, const std::tuple< TensorArrays... > &knot_indices) const
Returns a block-tensor with the Hessian of the function space object in the points xi with respect to...
Definition functionspace.hpp:1437
static constexpr short_t nspaces() noexcept
Returns the number of function spaces.
Definition functionspace.hpp:136
auto eval_from_precomputed_(std::index_sequence< Is... >, const std::tuple< Basfunc... > &basfunc, const std::tuple< Coeff_Indices... > &coeff_indices, const std::tuple< Numeval... > &numeval, const std::tuple< Sizes... > &sizes) const
Returns the value of the spline objects from precomputed basis function.
Definition functionspace.hpp:542
auto to_(std::index_sequence< Is... >, std::index_sequence< Js... >) const
Returns a copy of the function space object with real_t type.
Definition functionspace.hpp:801
nlohmann::json to_json_(std::index_sequence< Is... >) const
Serialization to JSON.
Definition functionspace.hpp:415
auto eval_basfunc(const std::tuple< Xi... > &xi, const std::tuple< Knot_Indices... > &knot_indices) const
Returns the values of the spline objects' basis functions in the points xi
Definition functionspace.hpp:698
virtual int64_t spaces_as_tensor_size() const noexcept
Returns the size of the single-tensor representation of the tuple of function spaces.
Definition functionspace.hpp:240
auto rotate(std::array< value_type, 3 > angle)
Rotates the function space object by three angles in 3d.
Definition functionspace.hpp:899
auto div(const utils::TensorArray2 &xi, const std::tuple< utils::TensorArray2, utils::TensorArray2 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the divergence of the function space object with respect to the parametri...
Definition functionspace.hpp:1167
auto find_coeff_indices_(std::index_sequence< Is... >, const std::tuple< Knot_Indices... > &knot_indices) const
Returns the indices of the spline objects' coefficients corresponding to the knot indices indices
Definition functionspace.hpp:712
auto lapl(const utils::TensorArray3 &xi, const std::tuple< utils::TensorArray3, utils::TensorArray3, utils::TensorArray3 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Laplacian of the function space object in the points xi with respect ...
Definition functionspace.hpp:2088
const auto & boundary() const noexcept
Returns a constant reference to the -th boundary object.
Definition functionspace.hpp:158
FunctionSpace(const std::array< int64_t, Splines::parDim()> &...ncoeffs, enum init init=init::greville, Options< value_type > options=iganet::Options< value_type >{})
Constructor.
Definition functionspace.hpp:94
pugi::xml_node & to_xml(pugi::xml_node &root, int id=0, std::string label="") const
Returns the function space object as XML node.
Definition functionspace.hpp:381
auto jac(const utils::TensorArray< nspaces()> &xi, const std::tuple< TensorArrays... > &knot_indices) const
Returns a block-tensor with the Jacobian of the function space object in the points xi with respect t...
Definition functionspace.hpp:1851
auto curl(const utils::TensorArray2 &xi, const std::tuple< utils::TensorArray2, utils::TensorArray2 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor > &coeff_indices) const
Definition functionspace.hpp:1034
virtual torch::Tensor as_tensor() const noexcept
Returns a single-tensor representation of the function space object.
Definition functionspace.hpp:222
auto jac(const utils::TensorArray2 &xi, const std::tuple< utils::TensorArray2, utils::TensorArray2 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Jacobian of the function space object in the points xi with respect t...
Definition functionspace.hpp:1878
boundary_type boundary_
Boundaries.
Definition functionspace.hpp:80
auto div(const utils::TensorArray4 &xi, const std::tuple< utils::TensorArray4, utils::TensorArray4, utils::TensorArray4, utils::TensorArray4 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the divergence of the function space object with respect to the parametri...
Definition functionspace.hpp:1220
auto hess(const utils::TensorArray1 &xi, const std::tuple< utils::TensorArray1 > &knot_indices, const std::tuple< torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Hessian of the function space object in the points xi with respect to...
Definition functionspace.hpp:1445
const auto & space() const noexcept
Returns a constant reference to the -th function space.
Definition functionspace.hpp:146
auto jac(const utils::TensorArray4 &xi, const std::tuple< utils::TensorArray4, utils::TensorArray4, utils::TensorArray4, utils::TensorArray4 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Jacobian of the function space object in the points xi with respect t...
Definition functionspace.hpp:1950
torch::serialize::OutputArchive & write(torch::serialize::OutputArchive &archive, const std::string &key="functionspace") const
Writes the function space object into a torch::serialize::OutputArchive object.
Definition functionspace.hpp:936
auto eval_(std::index_sequence< Is... >, const std::tuple< Xi... > &xi, const std::tuple< Knot_Indices... > &knot_indices) const
Returns the values of the spline objects in the points xi
Definition functionspace.hpp:459
auto find_knot_indices(const std::tuple< Xi... > &xi) const
Returns the knot indicies of knot spans containing xi
Definition functionspace.hpp:640
auto grad(const utils::TensorArray4 &xi, const std::tuple< utils::TensorArray4, utils::TensorArray4, utils::TensorArray4, utils::TensorArray4 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the gradient of the function space object in the points xi with respect t...
Definition functionspace.hpp:1359
FunctionSpace & spaces_from_tensor_(std::index_sequence< Is... >, const torch::Tensor &tensor)
Sets the tuple of spaces from a single-tensor representation.
Definition functionspace.hpp:276
FunctionSpace & from_xml_(std::index_sequence< Is... >, const pugi::xml_node &root, int id=0, std::string label="")
Updates the function space object from XML object.
Definition functionspace.hpp:390
auto scale(value_type s, int dim=-1)
Scales the function space object by a scalar.
Definition functionspace.hpp:829
auto find_knot_indices_(std::index_sequence< Is... >, const std::tuple< Xi... > &xi) const
Returns the knot indicies of knot spans containing xi
Definition functionspace.hpp:619
auto eval(const std::tuple< Xi... > &xi, const std::tuple< Knot_Indices... > &knot_indices) const
Returns the values of the spline objects in the points xi
Definition functionspace.hpp:507
auto div(const utils::TensorArray1 &xi, const std::tuple< utils::TensorArray1 > &knot_indices, const std::tuple< torch::Tensor > &coeff_indices) const
Returns a block-tensor with the divergence of the function space object with respect to the parametri...
Definition functionspace.hpp:1148
FunctionSpace(const std::tuple< Splines... > &spline)
Constructor.
Definition functionspace.hpp:114
torch::serialize::InputArchive & read_(std::index_sequence< Is... >, torch::serialize::InputArchive &archive, const std::string &key="functionspace")
Loads the function space object from a torch::serialize::InputArchive object.
Definition functionspace.hpp:947
virtual FunctionSpace & boundary_from_full_tensor(const torch::Tensor &tensor)
Sets the tuple of boundaries from a single-tensor representation.
Definition functionspace.hpp:345
torch::Tensor spaces_as_tensor_(std::index_sequence< Is... >) const noexcept
Returns a single-tensor representation of the tuple of spaces.
Definition functionspace.hpp:188
virtual FunctionSpace & spaces_from_tensor(const torch::Tensor &tensor)
Sets the tuple of spaces from a single-tensor representation.
Definition functionspace.hpp:303
auto curl(const utils::TensorArray< nspaces()> &xi, const std::tuple< TensorArrays... > &knot_indices) const
Returns a block-tensor with the curl of the function space object with respect to the parametric vari...
Definition functionspace.hpp:1012
FunctionSpace & from_xml(const pugi::xml_document &doc, int id=0, std::string label="")
Updates the function space object from XML object.
Definition functionspace.hpp:400
auto scale_(std::index_sequence< Is... >, std::array< value_type, N > v)
Scales the function space object by a vector.
Definition functionspace.hpp:836
auto hess(const utils::TensorArray3 &xi, const std::tuple< utils::TensorArray3, utils::TensorArray3, utils::TensorArray3 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Hessian of the function space object in the points xi with respect to...
Definition functionspace.hpp:1504
auto lapl(const utils::TensorArray< nspaces()> &xi) const
Returns a block-tensor with the Laplacian of the function space object in the points xi with respect ...
Definition functionspace.hpp:2031
auto curl(const utils::TensorArray3 &xi, const std::tuple< utils::TensorArray3, utils::TensorArray3, utils::TensorArray3 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Definition functionspace.hpp:1056
auto translate_(std::index_sequence< Is... >, std::array< value_type, N > v)
Translates the function space object by a vector.
Definition functionspace.hpp:853
auto find_knot_indices_(std::index_sequence< Is... >, const utils::TensorArray< nspaces()> &xi) const
Returns the knot indicies of knot spans containing xi
Definition functionspace.hpp:607
auto eval_(std::index_sequence< Is... >, const std::tuple< Xi... > &xi) const
Returns the values of the spline objects in the points xi
Definition functionspace.hpp:444
std::tuple< Splines... > spline_type
Spline type.
Definition functionspace.hpp:64
auto lapl(const utils::TensorArray4 &xi, const std::tuple< utils::TensorArray4, utils::TensorArray4, utils::TensorArray4, utils::TensorArray4 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the Laplacian of the function space object in the points xi with respect ...
Definition functionspace.hpp:2118
FunctionSpace(const std::tuple< Splines... > &spline, const std::tuple< Boundaries... > &boundary)
Constructor.
Definition functionspace.hpp:124
auto grad(const utils::TensorArray1 &xi, const std::tuple< utils::TensorArray1 > &knot_indices, const std::tuple< torch::Tensor > &coeff_indices) const
Returns a block-tensor with the gradient of the function space object in the points xi with respect t...
Definition functionspace.hpp:1287
auto rotate_(std::index_sequence< Is... >, value_type angle)
Rotates the function space object by an angle in 2d.
Definition functionspace.hpp:871
virtual torch::Tensor boundary_as_tensor() const noexcept
Returns a single-tensor representation of the tuple of boundaries.
Definition functionspace.hpp:212
auto grad(const utils::TensorArray< nspaces()> &xi, const std::tuple< TensorArrays... > &knot_indices) const
Returns a block-tensor with the gradient of the function space object in the points xi with respect t...
Definition functionspace.hpp:1279
torch::serialize::OutputArchive & write_(std::index_sequence< Is... >, torch::serialize::OutputArchive &archive, const std::string &key="functionspace") const
Writes the function space object into a torch::serialize::OutputArchive object.
Definition functionspace.hpp:921
auto grad(const utils::TensorArray3 &xi, const std::tuple< utils::TensorArray3, utils::TensorArray3, utils::TensorArray3 > &knot_indices, const std::tuple< torch::Tensor, torch::Tensor, torch::Tensor > &coeff_indices) const
Returns a block-tensor with the gradient of the function space object in the points xi with respect t...
Definition functionspace.hpp:1329
virtual void pretty_print(std::ostream &os=Log(log::info)) const noexcept override
Returns a string representation of the function space object.
Definition functionspace.hpp:970
auto eval_from_precomputed(const std::tuple< Basfunc... > &basfunc, const std::tuple< Coeff_Indices... > &coeff_indices, const std::tuple< Xi... > &xi) const
Returns the value of the spline objects from precomputed basis function.
Definition functionspace.hpp:594
virtual int64_t as_tensor_size() const noexcept
Returns the size of the single-tensor representation of the function space object.
Definition functionspace.hpp:269
Function space.
Definition functionspace.hpp:2406
auto & uniform_refine(int numRefine=1, int dimRefine=-1)
Returns the spline objects with uniformly refined knot and coefficient vectors.
Definition functionspace.hpp:2809
auto find_coeff_indices(const Knot_Indices &knot_indices) const
Returns the indices of the spline objects' coefficients corresponding to the knot indices indices
Definition functionspace.hpp:2787
FunctionSpace(const Spline &spline)
Constructor.
Definition functionspace.hpp:2464
auto scale(std::array< value_type, N > v)
Scales the function space object by a vector.
Definition functionspace.hpp:2846
FunctionSpace(const std::array< int64_t, Spline::parDim()> &ncoeffs, enum init init=init::greville, Options< value_type > options=iganet::Options< value_type >{})
Constructor.
Definition functionspace.hpp:2447
auto eval_basfunc(const Args &...args) const
Returns the values of the spline objects' basis functions in the points xi
Definition functionspace.hpp:2759
static constexpr short_t nspaces() noexcept
Returns the number of function spaces.
Definition functionspace.hpp:2478
virtual int64_t as_tensor_size() const noexcept
Returns the size of the single-tensor representation of the function space object.
Definition functionspace.hpp:2566
auto find_coeff_indices_(std::index_sequence< Is... >, const Knot_Indices &knot_indices) const
Returns the indices of the spline objects' coefficients corresponding to the knot indices indices
Definition functionspace.hpp:2772
constexpr const boundary_type & boundary() const noexcept
Returns a constant reference to the -th boundary object.
Definition functionspace.hpp:2498
virtual torch::Tensor spaces_as_tensor() const noexcept
Returns a single-tensor representation of the space.
Definition functionspace.hpp:2531
typename Boundary::eval_type boundary_eval_type
Boundary evaluation type.
Definition functionspace.hpp:2426
FunctionSpace()=default
Default constructor.
torch::serialize::InputArchive & read(torch::serialize::InputArchive &archive, const std::string &key="functionspace")
Loads the function space object from a torch::serialize::InputArchive object.
Definition functionspace.hpp:2886
virtual int64_t boundary_as_tensor_size() const noexcept
Returns the size of the single-tensor representation of the boundary.
Definition functionspace.hpp:2557
virtual torch::Tensor boundary_as_tensor() const noexcept
Returns a single-tensor representation of the boundary.
Definition functionspace.hpp:2536
constexpr boundary_type & boundary() noexcept
Returns a non-constant reference to the -th boundary object object.
Definition functionspace.hpp:2505
auto scale(value_type s, int dim=-1)
Scales the function space object by a scalar.
Definition functionspace.hpp:2839
Spline spline_type
Spline type.
Definition functionspace.hpp:2417
virtual int64_t spaces_as_tensor_size() const noexcept
Returns the size of the single-tensor representation of the space.
Definition functionspace.hpp:2551
virtual void pretty_print(std::ostream &os=Log(log::info)) const noexcept override
Returns a string representation of the function space object.
Definition functionspace.hpp:2895
auto find_knot_indices(const Xi &xi) const
Returns the knot indicies of knot spans containing xi
Definition functionspace.hpp:2738
auto eval_(std::index_sequence< Is... >, const std::tuple< Xi... > &xi) const
Returns the values of the spline object in the points xi
Definition functionspace.hpp:2651
torch::serialize::OutputArchive & write(torch::serialize::OutputArchive &archive, const std::string &key="functionspace") const
Writes the function space object into a torch::serialize::OutputArchive object.
Definition functionspace.hpp:2876
FunctionSpace(Spline &&spline)
Constructor.
Definition functionspace.hpp:2470
constexpr spline_type & space() noexcept
Returns a non-constant reference to the -th function space.
Definition functionspace.hpp:2491
auto to(torch::Device device) const
Returns a copy of the function space object with settings from device.
Definition functionspace.hpp:2826
FunctionSpace & from_xml(const pugi::xml_document &doc, int id=0, std::string label="")
Updates the function space object from XML object.
Definition functionspace.hpp:2615
auto eval(const Arg &arg, const Args &...args) const
Returns the values of the spline object in the points xi
Definition functionspace.hpp:2697
auto eval_(std::index_sequence< Is... >, const std::tuple< Xi... > &xi, const std::tuple< Knot_Indices... > &knot_indices, const std::tuple< Coeff_Indices... > &coeff_indices) const
Returns the values of the spline object in the points xi
Definition functionspace.hpp:2678
FunctionSpace & from_xml(const pugi::xml_node &root, int id=0, std::string label="")
Updates the function space object from XML node.
Definition functionspace.hpp:2621
auto rotate(std::array< value_type, 3 > angle)
Rotates the function space object by three angles in 3d.
Definition functionspace.hpp:2867
pugi::xml_node & to_xml(pugi::xml_node &root, int id=0, std::string label="") const
Returns the function space object as XML node.
Definition functionspace.hpp:2609
constexpr FunctionSpace clone() const noexcept
Returns a clone of the function space.
Definition functionspace.hpp:2511
auto find_knot_indices_(std::index_sequence< Is... >, const Xi &xi) const
Returns the knot indicies of knot spans containing xi
Definition functionspace.hpp:2727
auto rotate(value_type angle)
Rotates the function space object by an angle in 2d.
Definition functionspace.hpp:2860
auto translate(std::array< value_type, N > v)
Translates the function space object by a vector.
Definition functionspace.hpp:2853
auto to(Options< real_t > options) const
Returns a copy of the function space object with settings from options.
Definition functionspace.hpp:2817
auto eval_(std::index_sequence< Is... >, const std::tuple< Xi... > &xi, const std::tuple< Knot_Indices... > &knot_indices) const
Returns the values of the spline object in the points xi
Definition functionspace.hpp:2664
virtual FunctionSpace & boundary_from_tensor(const torch::Tensor &coeffs) noexcept
Sets the boundary from a single-tensor representation of the boundary only.
Definition functionspace.hpp:2580
pugi::xml_document to_xml(int id=0, std::string label="") const
Returns the function space object as XML object.
Definition functionspace.hpp:2600
FunctionSpace(FunctionSpace &&)=default
Move constructor.
typename Spline::value_type value_type
Value type.
Definition functionspace.hpp:2414
boundary_type boundary_
Boundary.
Definition functionspace.hpp:2433
utils::TensorArray< Spline::parDim()> eval_type
Spline evaluation type.
Definition functionspace.hpp:2420
virtual FunctionSpace & spaces_from_tensor(const torch::Tensor &coeffs) noexcept
Sets the space from a single-tensor representation.
Definition functionspace.hpp:2572
virtual FunctionSpace & boundary_from_full_tensor(const torch::Tensor &coeffs) noexcept
Sets the boundary from a single-tensor representation.
Definition functionspace.hpp:2587
FunctionSpace & transform(const std::function< std::array< typename Spline::value_type, Spline::geoDim()>(const std::array< typename Spline::value_type, Spline::parDim()> &)> transformation)
Transforms the coefficients based on the given mapping.
Definition functionspace.hpp:2636
virtual torch::Tensor as_tensor() const noexcept
Returns a single-tensor representation of the function space object.
Definition functionspace.hpp:2545
FunctionSpace(const FunctionSpace &)=default
Copy constructor.
spline_type spline_
Spline.
Definition functionspace.hpp:2430
static constexpr short_t nboundaries() noexcept
Returns the number of boundaries.
Definition functionspace.hpp:2481
auto eval_from_precomputed(const Args &...args) const
Returns the value of the spline object from precomputed basis function.
Definition functionspace.hpp:2716
nlohmann::json to_json() const override
Serialization to JSON.
Definition functionspace.hpp:2628
FunctionSpace & from_tensor(const torch::Tensor &coeffs) noexcept
Sets the function space object from a single-tensor representation.
Definition functionspace.hpp:2593
FunctionSpace(std::array< std::vector< value_type >, Spline::parDim()> kv, enum init init=init::greville, Options< value_type > options=iganet::Options< value_type >{})
Constructor.
Definition functionspace.hpp:2455
constexpr const spline_type & space() const noexcept
Returns a constant reference to the -th function space.
Definition functionspace.hpp:2485
auto to() const
Returns a copy of the function space object with real_t type.
Definition functionspace.hpp:2831
constexpr auto clone() const noexcept
Returns a subset of the tuple of function spaces.
Definition functionspace.hpp:2516
Full qualified name descriptor.
Definition fqn.hpp:26
virtual const std::string & name() const noexcept
Returns the full qualified name of the object.
Definition fqn.hpp:31
Container utility functions.
#define IGANET_FUNCTIONSPACE_DEFAULT_OPS(FunctionSpace)
Macro: Implements the default methods of a function space.
Definition functionspace.hpp:36
typename FunctionSpace_trait< utils::tuple_cat_t< Splines... >, utils::tuple_cat_t< Boundaries... > >::type type
Definition functionspace.hpp:3111
typename FunctionSpace_trait< Spline, Boundary >::type type
Definition functionspace.hpp:3103
std::ostream & operator<<(std::ostream &os, const FunctionSpace< Splines... > &obj)
Print (as string) a function space object.
Definition functionspace.hpp:2394
Forward declaration.
Definition functionspace.hpp:3073
TensorArray< 4 > TensorArray4
Definition tensorarray.hpp:34
std::array< torch::Tensor, N > TensorArray
Definition tensorarray.hpp:28
auto zip(T &&...seqs)
Definition zip.hpp:97
TensorArray< 3 > TensorArray3
Definition tensorarray.hpp:33
typename tuple_cat< Tuples... >::type tuple_cat_t
Alias for tuple_cat::type.
Definition type_traits.hpp:72
TensorArray< 1 > TensorArray1
Definition tensorarray.hpp:31
TensorArray< 2 > TensorArray2
Definition tensorarray.hpp:32
Forward declaration of BlockTensor.
Definition blocktensor.hpp:46
Definition boundary.hpp:22
deriv
Enumerator for specifying the derivative of B-spline evaluation.
Definition bspline.hpp:74
BoundaryCommon< BoundaryCore< Spline, Spline::parDim()> > Boundary
Boundary.
Definition boundary.hpp:1974
constexpr bool is_SplineType_v
Alias to the value of is_SplineType.
Definition bspline.hpp:3243
std::ostream & operator<<(std::ostream &os, const Boundary< Spline > &obj)
Print (as string) a Boundary object.
Definition boundary.hpp:1978
struct iganet::@0 Log
Logger.
init
Enumerator for specifying the initialization of B-spline coefficients.
Definition bspline.hpp:55
FunctionSpace< Spline > S
Spline function space .
Definition functionspace.hpp:3145
functionspace
Enumerator for the function space component.
Definition functionspace.hpp:30
constexpr bool is_BoundaryType_v
Alias to the value of is_BoundaryType.
Definition boundary.hpp:1137
@ none
Definition boundary.hpp:38
short int short_t
Definition core.hpp:74
typename detail::FunctionSpace_trait< Args... >::type FunctionSpace
Function space alias.
Definition functionspace.hpp:3118
IGANET_FUNCTIONSPACE_TUPLE_WRAPPER(RT);.
Definition functionspace.hpp:4027
IGANET_FUNCTIONSPACE_TUPLE_WRAPPER(TH);.
Definition functionspace.hpp:3464
IGANET_FUNCTIONSPACE_TUPLE_WRAPPER(NE);.
Definition functionspace.hpp:3770
Taylor-Hood like function space.
Definition functionspace.hpp:3148
Serialization prototype.
Definition serialize.hpp:31