65 Vector<double> &values)
const
70 double flat_region_length = 5.142;
71 double left_hill = 1.929;
72 double right_hill = 7.071;
78 if (x < left_hill *
alpha)
80 else if (x >
alpha * left_hill + flat_region_length)
81 x = (x - flat_region_length -
alpha * left_hill) /
alpha + right_hill;
83 x = x - (
alpha * left_hill) + left_hill;
90 std::sqrt(std::pow((1 - 0.5), 2) - (4 * (1 / max_x) * -x))) /
92 else if (x > max_x / 2 && x < max_x)
93 x = (-(1 + 1.5) + std::sqrt(std::pow((1 + 1.5), 2) -
94 (4 * (-1 / max_x) * (-0.5 * max_x - x)))) /
106 else if (spacedim == 3)
113 double y = (np[1] - min_y) / (1 - min_y / max_y);
119 else if (y > max_y / 2 && y < max_y &&
spacing_y != 0)
122 std::sqrt(std::pow((1 + 1.5 *
spacing_y), 2) -
134 const unsigned int component)
const
137 double max_y = 3.035;
139 double flat_region_length = 5.142;
140 double left_hill = 1.929;
141 double right_hill = 7.071;
146 if (x < left_hill *
alpha)
148 else if (x >
alpha * left_hill + flat_region_length)
149 x = (x - flat_region_length -
alpha * left_hill) /
alpha + right_hill;
151 x = x - (
alpha * left_hill) + left_hill;
158 std::sqrt(std::pow((1 - 0.5), 2) - (4 * (1 / max_x) * -x))) /
160 else if (x > max_x / 2 && x <= max_x)
161 x = (-(1 + 1.5) + std::sqrt(std::pow((1 + 1.5), 2) -
162 (4 * (-1 / max_x) * (-0.5 * max_x - x)))) /
171 else if (spacedim == 3)
176 double y = (np[1] - min_y) / (1 - min_y / max_y);
182 else if (y > max_y / 2 && y < max_y &&
spacing_y != 0)
185 std::sqrt(std::pow((1 + 1.5 *
spacing_y), 2) -
192 else if (spacedim == 3)
195 return op[component];
206 double x = p[0] * H, y = p[1] * H;
207 double max_y = 3.035 * H;
208 double max_x = 9.0 * H;
209 double flat_region_length = 5.142 * H;
210 double left_hill = 1.929 * H;
211 double right_hill = 7.071 * H;
226 pos_x_left = x / -max_x + 0.5;
229 else if (x > max_x / 2 && x < max_x)
231 pos_x_right = x / max_x - 0.5;
232 x += pos_x_right * (max_x - x);
237 const double a1 = 2.800000000000E+01, b1 = 0.000000000000E+00,
238 c1 = 6.775070969851E-03, d1 = -2.124527775800E-03;
239 const double a2 = 2.507355893131E+01, b2 = 9.754803562315E-01,
240 c2 = -1.016116352781E-01, d2 = 1.889794677828E-03;
241 const double a3 = 2.579601052357E+01, b3 = +8.206693007457E-01,
242 c3 = -9.055370274339E-02, d3 = 1.626510569859E-03;
243 const double a4 = 4.046435022819E+01, b4 = -1.379581654948E+00,
244 c4 = 1.945884504128E-02, d4 = -2.070318932190E-04;
245 const double a5 = 1.792461334664E+01, b5 = +8.743920332081E-01,
246 c5 = -5.567361123058E-02, d5 = 6.277731764683E-04;
247 const double a6 = 5.639011190988E+01, b6 = -2.010520359035E+00,
248 c6 = 1.644919857549E-02, d6 = 2.674976141766E-05;
250 double new_x = (max_x - x);
253 if (y < max_y / 2 && (std::abs(
spacing_y) > 0))
255 pos_y_bottom = y / -max_y + 0.5;
258 else if (y > max_y / 2 && y < max_y && (std::abs(
spacing_y) > 0))
260 pos_y_top = y / max_y - 0.5;
261 y +=
spacing_y * pos_y_top * (max_y - y);
264 pos_y = y / -max_y + 1;
269 y += pos_y * (a1 + b1 * x + c1 * std::pow(x, 2) + d1 * std::pow(x, 3));
272 y_0 = (a1 + b1 * x + c1 * std::pow(x, 2) + d1 * std::pow(x, 3));
277 else if (x >= 9 && x < 14)
278 y += pos_y * (a2 + b2 * x + c2 * std::pow(x, 2) + d2 * std::pow(x, 3));
279 else if (x >= 14 && x < 20)
280 y += pos_y * (a3 + b3 * x + c3 * std::pow(x, 2) + d3 * std::pow(x, 3));
281 else if (x >= 20 && x < 30)
282 y += pos_y * (a4 + b4 * x + c4 * std::pow(x, 2) + d4 * std::pow(x, 3));
283 else if (x >= 30 && x < 40)
284 y += pos_y * (a5 + b5 * x + c5 * std::pow(x, 2) + d5 * std::pow(x, 3));
285 else if (x >= 40 && x < 54)
287 y += pos_y * (a6 + b6 * x + c6 * std::pow(x, 2) + d6 * std::pow(x, 3));
291 else if (x <= 252 && x > 243)
293 y += pos_y * (a1 + b1 * new_x + c1 * std::pow(new_x, 2) +
294 d1 * std::pow(new_x, 3));
295 y_0 = (a1 + b1 * x + c1 * std::pow(x, 2) + d1 * std::pow(x, 3));
300 else if (x <= 243 && x > 238)
302 (a2 + b2 * new_x + c2 * std::pow(new_x, 2) + d2 * std::pow(new_x, 3));
303 else if (x <= 238 && x > 232)
305 (a3 + b3 * new_x + c3 * std::pow(new_x, 2) + d3 * std::pow(new_x, 3));
306 else if (x <= 232 && x > 222)
308 (a4 + b4 * new_x + c4 * std::pow(new_x, 2) + d4 * std::pow(new_x, 3));
309 else if (x <= 222 && x > 212)
311 (a5 + b5 * new_x + c5 * std::pow(new_x, 2) + d5 * std::pow(new_x, 3));
312 else if (x <= 212 && x > 198)
314 y += pos_y * (a6 + b6 * new_x + c6 * std::pow(new_x, 2) +
315 d6 * std::pow(new_x, 3));
326 else if (x > right_hill)
327 x =
alpha * (x - right_hill) + flat_region_length +
alpha * left_hill;
329 x = (x - left_hill) + (
alpha * left_hill);
345 Triangulation<dim, spacedim> &triangulation)
347 std::vector<unsigned int> repetitions(2);
354 throw std::logic_error(
355 "When alpha parameter is not 1, repetition parameters should be all set to 1");
357 GridGenerator::subdivided_hyper_rectangle(triangulation,
359 Point<dim>(0.0, 0.0),
360 Point<dim>(9.0, 3.035),
367 throw std::logic_error(
368 "When alpha parameter is not 1, repetition parameters should be all set to 1");
370 GridGenerator::subdivided_hyper_rectangle(triangulation,
372 Point<dim>(0.0, 0.0, 0.0),
373 Point<dim>(9.0, 3.035, 4.5),
378 GridTools::transform(
379 [
this](
const Point<spacedim> &p) {
385 static const FunctionManifold<dim, spacedim, spacedim> manifold_func(
388 triangulation.set_manifold(1, manifold_func);
389 triangulation.set_all_manifold_ids(1);