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
21
#include <
qugar/domain_function.hpp
>
22
#include <
qugar/vector.hpp
>
23
24
#include <
qugar/types.hpp
>
25
28
namespace
qugar::impl::tpms
{
29
30
template
<
int
dim>
class
TPMSBase
:
public
qugar::impl::ImplicitFunc
<dim>
31
{
32
protected
:
35
explicit
TPMSBase
(
const
Vector<real, dim>
&mnq);
36
38
Vector<real, 3>
mnq_
;
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
79
declare_tpms
(Schoen);
80
88
declare_tpms
(SchoenIWP);
89
97
declare_tpms
(SchoenFRD);
98
107
declare_tpms
(FischerKochS);
108
116
declare_tpms
(SchwarzDiamond);
117
124
declare_tpms
(SchwarzPrimitive);
125
126
}
// namespace qugar::impl::tpms
127
128
129
#endif
// QUGAR_IMPL_TPMS_LIB_HPP
qugar::impl::DomainFunc
Domain functions.
Definition
domain_function.hpp:41
qugar::impl::tpms::TPMSBase
Definition
tpms_lib.hpp:31
qugar::impl::tpms::TPMSBase::mnq_
Vector< real, 3 > mnq_
Function periods.
Definition
tpms_lib.hpp:38
qugar::impl::tpms::TPMSBase::TPMSBase
TPMSBase(const Vector< real, dim > &mnq)
domain_function.hpp
Declaration of a few implicit functions template class ready to be consumed by Algoim.
qugar::impl::tpms
Definition
tpms_lib.hpp:28
qugar::Vector
::algoim::uvector< T, dim > Vector
Class representing a vector.
Definition
vector.hpp:31
declare_tpms
#define declare_tpms(TPMS_NAME)
Definition
tpms_lib.hpp:42
types.hpp
Declaration of types.
vector.hpp
cpp
include
qugar
tpms_lib.hpp
Generated by
1.12.0