Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
grid_fichera_oven.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_grid_fichera_oven_h
5#define lethe_grid_fichera_oven_h
6
7#include <deal.II/base/utilities.h>
8
9#include <deal.II/grid/grid_tools.h>
10
11#include <sstream>
12
13using namespace dealii;
14
15/**
16 * @brief Generates a 3D Fichera oven mesh by removing cells from a
17 * subdivided hyper-rectangle.
18 *
19 * The geometry is a staircase-shaped domain obtained from a 2x2x3 subdivided
20 * hyper-rectangle by removing three groups of cells at increasing z-levels.
21 *
22 * When @p colorize is true, boundary faces at the top of the remaining
23 * staircase (z = top_right[2]) are assigned boundary_id = 1 (e.g., inlet);
24 * all other boundary faces retain the default boundary_id = 0.
25 */
26template <int dim, int spacedim>
28{
29public:
30 /**
31 * @brief Constructor that parses geometry parameters from a colon-separated
32 * string.
33 *
34 * @param[in] grid_arguments A colon-separated string, @code
35 * "bottom_left:top_right:colorize", with the following fields (coordinates
36 * are comma-separated):
37 *
38 * | # | Field | Format | Required | Description |
39 * |----|-------------|------------|----------|-----------------------------------------------|
40 * | 0 | bottom_left | x,y,z | yes | Bottom-left corner of the bounding box |
41 * | 1 | top_right | x,y,z | yes | Top-right corner of the bounding box |
42 * | 2 | colorize | true/false | no | Assign distinct boundary IDs (default: false) |
43 *
44 * Example: @code "0,0,0 :2,2,3 : true" @endcode
45 *
46 */
47 GridFicheraOven(const std::string &grid_arguments);
48
49 /**
50 * @brief Generate the Fichera oven mesh by removing cells from a subdivided
51 * hyper-rectangle.
52 *
53 * Starting from a 2x2x3 subdivided hyper-rectangle spanning from
54 * @p bottom_left to @p top_right, three groups of cells are removed to create
55 * a staircase geometry:
56 *
57 * @verbatim
58 * Level 1 (z > 1/3 height): remove (+x, +y) quadrant
59 * Level 2 (z > 2/3 height): additionally remove (+x, -y) and (-x, +y)
60 * @endverbatim
61 *
62 * The midpoints along x and y are at (bottom_left + top_right) / 2, and the
63 * z-thresholds are at bottom_left[2] + height/3 and bottom_left[2] +
64 * 2*height/3.
65 *
66 * When @p colorize is true, boundary faces at z = top_right[2] are assigned
67 * boundary_id = 1 (e.g., inlet/outlet); all other faces keep the default
68 * boundary_id = 0.
69 *
70 * @param[out] triangulation The triangulation to fill with the oven mesh.
71 */
72 void
73 make_grid(Triangulation<dim, spacedim> &triangulation);
74
75private:
76 std::string grid_arguments;
77 Point<dim> bottom_left;
78 Point<dim> top_right;
80};
81
82
83#endif
Point< dim > bottom_left
GridFicheraOven(const std::string &grid_arguments)
Constructor that parses geometry parameters from a colon-separated string.
std::string grid_arguments
void make_grid(Triangulation< dim, spacedim > &triangulation)
Generate the Fichera oven mesh by removing cells from a subdivided hyper-rectangle.
Point< dim > top_right