48 std::srand(std::time(0));
55 std::srand(std::time(0));
58 template <
typename Spline>
60 auto &
next(Spline &obj)
const {
61 static_assert(Spline::parDim() == 1 && Spline::geoDim() == 1,
62 "Interval creator requires parDim=1 and geoDim=1");
66 T xmin = std::min(x0, x1);
67 T xmax = std::max(x0, x1);
69 obj.transform([xmin, xmax](
const std::array<T, 1> X) {
70 return std::array<T, 1>{
71 static_cast<T
>(xmax * X[0] + xmin * (X[0] - T(1)))};
79 os << CreatorCore<T>::name() <<
"\n"
81 <<
"; x1min = " <<
x1min_ <<
", x1max = " <<
x1max_ <<
")";
98 std::srand(std::time(0));
103 const T &x1max,
const T &y0min,
const T &y0max,
104 const T &y1min,
const T &y1max)
107 std::srand(std::time(0));
110 template <
typename Spline>
112 auto &
next(Spline &obj)
const {
113 static_assert(Spline::parDim() == 2 && Spline::geoDim() == 2,
114 "Rectangle creator requires parDim=2 and geoDim=2");
118 T xmin = std::min(x0, x1);
119 T xmax = std::max(x0, x1);
123 T ymin = std::min(y0, y1);
124 T ymax = std::max(y0, y1);
126 obj.transform([xmin, xmax, ymin, ymax](
const std::array<T, 2> X) {
127 return std::array<T, 2>{
128 static_cast<T
>(xmax * X[0] + xmin * (X[0] - T(1))),
129 static_cast<T
>(ymax * X[1] + ymin * (X[1] - T(1)))};
137 os << CreatorCore<T>::name() <<
"\n"
141 <<
"; y1min = " <<
y1min_ <<
", y1max = " <<
y1max_ <<
")";
159 std::srand(std::time(0));
163 CuboidCreator(
const T &x0min,
const T &x0max,
const T &x1min,
const T &x1max,
164 const T &y0min,
const T &y0max,
const T &y1min,
const T &y1max,
165 const T &z0min,
const T &z0max,
const T &z1min,
const T &z1max)
169 std::srand(std::time(0));
172 template <
typename Spline>
174 auto &
next(Spline &obj)
const {
175 static_assert(Spline::parDim() == 3 && Spline::geoDim() == 3,
176 "Cuboid creator requires parDim=3 and geoDim=3");
180 T xmin = std::min(x0, x1);
181 T xmax = std::max(x0, x1);
185 T ymin = std::min(y0, y1);
186 T ymax = std::max(y0, y1);
190 T zmin = std::min(z0, z1);
191 T zmax = std::max(z0, z1);
194 [xmin, xmax, ymin, ymax, zmin, zmax](
const std::array<T, 3> X) {
195 return std::array<T, 3>{
196 static_cast<T
>(xmax * X[0] + xmin * (X[0] - T(1))),
197 static_cast<T
>(ymax * X[1] + ymin * (X[1] - T(1))),
198 static_cast<T
>(zmax * X[2] + zmin * (X[2] - T(1)))};
206 os << CreatorCore<T>::name() <<
"\n"
212 <<
"; z1min = " <<
z1min_ <<
", z1max = " <<
z1max_ <<
")";
Abstract creator class.
Definition creator.hpp:27
void pretty_print(std::ostream &os) const noexcept override=0
Returns a string representation of the CreatorCore object.
Cuboid creator class.
Definition creator.hpp:152
T z0min_
Definition creator.hpp:216
T z1min_
Definition creator.hpp:217
T y0max_
Definition creator.hpp:216
T z0max_
Definition creator.hpp:217
void pretty_print(std::ostream &os) const noexcept override
Returns a string representation of the RectangleCreator object.
Definition creator.hpp:205
CuboidCreator()
Default constructor.
Definition creator.hpp:155
T y0min_
Definition creator.hpp:216
T z1max_
Definition creator.hpp:217
T y1min_
Definition creator.hpp:216
T x1max_
Definition creator.hpp:216
T x1min_
Definition creator.hpp:216
T x0max_
Definition creator.hpp:216
T y1max_
Definition creator.hpp:216
auto & next(Spline &obj) const
Definition creator.hpp:174
CuboidCreator(const T &x0min, const T &x0max, const T &x1min, const T &x1max, const T &y0min, const T &y0max, const T &y1min, const T &y1max, const T &z0min, const T &z0max, const T &z1min, const T &z1max)
Bounds constructor.
Definition creator.hpp:163
T x0min_
Definition creator.hpp:216
Interval creator class.
Definition creator.hpp:44
T x1max_
Definition creator.hpp:85
IntervalCreator()
Default constructor.
Definition creator.hpp:47
T x0min_
Definition creator.hpp:85
void pretty_print(std::ostream &os) const noexcept override
Returns a string representation of the IntervalCreator object.
Definition creator.hpp:78
auto & next(Spline &obj) const
Definition creator.hpp:60
T x1min_
Definition creator.hpp:85
IntervalCreator(const T &x0min, const T &x0max, const T &x1min, const T &x1max)
Bounds constructor.
Definition creator.hpp:52
T x0max_
Definition creator.hpp:85
Rectangle creator class.
Definition creator.hpp:92
T y0min_
Definition creator.hpp:145
T y0max_
Definition creator.hpp:145
T x1min_
Definition creator.hpp:145
RectangleCreator(const T &x0min, const T &x0max, const T &x1min, const T &x1max, const T &y0min, const T &y0max, const T &y1min, const T &y1max)
Bounds constructor.
Definition creator.hpp:102
T y1min_
Definition creator.hpp:145
T x0min_
Definition creator.hpp:145
auto & next(Spline &obj) const
Definition creator.hpp:112
T x1max_
Definition creator.hpp:145
RectangleCreator()
Default constructor.
Definition creator.hpp:95
T y1max_
Definition creator.hpp:145
T x0max_
Definition creator.hpp:145
void pretty_print(std::ostream &os) const noexcept override
Returns a string representation of the RectangleCreator object.
Definition creator.hpp:136
Full qualified name descriptor.
Definition fqn.hpp:22
Concept to identify template parameters that are derived from iganet::Spline_.
Definition bspline.hpp:3582
Full qualified name utility functions.
std::ostream & operator<<(std::ostream &os, const MemoryDebugger< id > &obj)
Print (as string) a memory debugger object.
Definition memory.hpp:125