Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
grid_cube_merged.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_cube_merged_grid_h
5#define lethe_cube_merged_grid_h
6
7#include <deal.II/base/utilities.h>
8
9#include <deal.II/grid/manifold_lib.h>
10
11#include <sstream>
12
13using namespace dealii;
14
15/**
16 * @brief Class that creates a custom geometry that combines an extruded plate
17 * with a hole and an inner cylinder to form a cube.
18 *
19 * @tparam dim The dimension of the mesh, must be 3.
20 * @tparam spacedim The dimension of the space where the mesh is defined, must be 3.
21 */
22
23template <int dim, int spacedim>
25{
26public:
27 /**
28 * @brief Constructor for the GridCubeMerged
29 *
30 * @param[in] grid_arguments A string with 4 parameters, `R_cylinder :
31 * L_plate : H : n_subdivisions`, separated by colons. `R_cylinder` is the
32 * radius of the cylinder mesh and of the hole in the extruded square plate;
33 * `L_plate` is the half of the edge length of the square; `H` is the height
34 * in the z direction; `n_subdivisions` is the number of subdivisions along
35 * the z direction.
36 */
37 GridCubeMerged(const std::string &grid_arguments);
38
39 /**
40 * @brief Generate the merged cube mesh.
41 *
42 * @param[out] triangulation The triangulation to fill with the mesh.
43 */
44 void
45 make_grid(Triangulation<dim, spacedim> &triangulation);
46
47private:
48 /// Arguments used to generate the grid
49 std::string grid_arguments;
50 /// Radius of the cylindrical mesh
52 /// Half edge length of the square in the extruded plate with hole mesh
54 /// Height in the extruded direction (z axis)
55 double height;
56 /// Number of subdivisions in the extruded direction (z axis)
57 unsigned int n_subdivisions;
58};
59
60#endif
unsigned int n_subdivisions
Number of subdivisions in the extruded direction (z axis).
void make_grid(Triangulation< dim, spacedim > &triangulation)
Generate the merged cube mesh.
double plate_half_length
Half edge length of the square in the extruded plate with hole mesh.
std::string grid_arguments
Arguments used to generate the grid.
GridCubeMerged(const std::string &grid_arguments)
Constructor for the GridCubeMerged.
double cylinder_radius
Radius of the cylindrical mesh.
double height
Height in the extruded direction (z axis).