QUGaR 0.0.4
Loading...
Searching...
No Matches
tpms_lib.hpp
Go to the documentation of this file.
1// --------------------------------------------------------------------------
2//
3// Copyright (C) 2025-present by Pablo Antolin
4//
5// This file is part of the QUGaR library.
6//
7// SPDX-License-Identifier: MIT
8//
9// --------------------------------------------------------------------------
10
11#ifndef QUGAR_IMPL_TPMS_LIB_HPP
12#define QUGAR_IMPL_TPMS_LIB_HPP
13
20
22#include <qugar/vector.hpp>
23
24#include <qugar/types.hpp>
25
29
30template<int dim> class TPMSBase : public qugar::impl::ImplicitFunc<dim>
31{
32protected:
35 explicit TPMSBase(const Vector<real, dim> &mnq);
36
39};
40
41// NOLINTNEXTLINE (cppcoreguidelines-macro-usage)
42#define declare_tpms(TPMS_NAME) \
43 template<int dim> class TPMS_NAME : public TPMSBase<dim> \
44 { \
45 template<typename T> using Gradient = qugar::impl::ImplicitFunc<dim>::template Gradient<T>; \
46 template<typename T> using Hessian = qugar::impl::ImplicitFunc<dim>::template Hessian<T>; \
47 \
48 public: \
49 explicit TPMS_NAME(const Vector<real, dim> &mnq); \
50 \
51 TPMS_NAME(); \
52 \
53 [[nodiscard]] virtual real operator()(const Point<dim> &point) const final; \
54 \
55 [[nodiscard]] virtual ::algoim::Interval<dim> operator()( \
56 const Point<dim, ::algoim::Interval<dim>> &point) const final; \
57 \
58 [[nodiscard]] virtual Gradient<real> grad(const Point<dim> &point) const final; \
59 \
60 [[nodiscard]] virtual Gradient<::algoim::Interval<dim>> grad( \
61 const Point<dim, ::algoim::Interval<dim>> &point) const final; \
62 \
63 [[nodiscard]] virtual Hessian<real> hessian(const Point<dim> &point) const final; \
64 \
65 private: \
66 template<typename T> [[nodiscard]] T eval_(const Point<dim, T> &point) const; \
67 \
68 template<typename T> [[nodiscard]] Gradient<T> grad_(const Point<dim, T> &point) const; \
69 \
70 template<typename T> [[nodiscard]] Hessian<T> hessian_(const Point<dim, T> &point) const; \
71 };
72
80
88declare_tpms(SchoenIWP);
89
97declare_tpms(SchoenFRD);
98
107declare_tpms(FischerKochS);
108
116declare_tpms(SchwarzDiamond);
117
124declare_tpms(SchwarzPrimitive);
125
126}// namespace qugar::impl::tpms
127
128
129#endif// QUGAR_IMPL_TPMS_LIB_HPP
Domain functions.
Definition domain_function.hpp:41
Definition tpms_lib.hpp:31
Vector< real, 3 > mnq_
Function periods.
Definition tpms_lib.hpp:38
TPMSBase(const Vector< real, dim > &mnq)
Declaration of a few implicit functions template class ready to be consumed by Algoim.
Definition tpms_lib.hpp:28
::algoim::uvector< T, dim > Vector
Class representing a vector.
Definition vector.hpp:31
#define declare_tpms(TPMS_NAME)
Definition tpms_lib.hpp:42
Declaration of types.