LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
test_meshes.cc
1
8#include "test_meshes.h"
9
10#include <iostream>
11
12namespace lf::mesh::test_utils {
13
14std::shared_ptr<lf::mesh::Mesh> GenerateHybrid2DTestMesh(int selector,
15 double scale) {
16 using coord_t = Eigen::Vector2d;
17 using size_type = lf::mesh::Mesh::size_type;
18 using quad_coord_t = Eigen::Matrix<double, 2, 4>;
19 using tria_coord_t = Eigen::Matrix<double, 2, 3>;
20
21 // Obtain mesh factory
22 std::unique_ptr<lf::mesh::hybrid2d::MeshFactory> mesh_factory_ptr =
23 std::make_unique<lf::mesh::hybrid2d::MeshFactory>(2);
24
25 switch (selector) {
26 case 0: {
27 // Setting point coordinate
28 mesh_factory_ptr->AddPoint(coord_t({1.5 * scale, 2 * scale}));
29 mesh_factory_ptr->AddPoint(coord_t({1 * scale, 1 * scale}));
30 mesh_factory_ptr->AddPoint(coord_t({2 * scale, 1 * scale}));
31 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 0 * scale}));
32 mesh_factory_ptr->AddPoint(coord_t({1.5 * scale, 0 * scale}));
33 mesh_factory_ptr->AddPoint(coord_t({3 * scale, 0 * scale}));
34 mesh_factory_ptr->AddPoint(coord_t({3 * scale, 2 * scale}));
35 mesh_factory_ptr->AddPoint(coord_t({3 * scale, 3 * scale}));
36 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 3 * scale}));
37 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 1 * scale}));
38
39 // Setting vertices of cells but not their geometry
40 mesh_factory_ptr->AddEntity(
41 lf::base::RefEl::kTria(), std::array<size_type, 3>{{0, 8, 9}},
42 std::unique_ptr<lf::geometry::Geometry>(nullptr));
43 mesh_factory_ptr->AddEntity(
44 lf::base::RefEl::kTria(), std::array<size_type, 3>{{3, 4, 1}},
45 std::unique_ptr<lf::geometry::Geometry>(nullptr));
46 mesh_factory_ptr->AddEntity(
47 lf::base::RefEl::kTria(), std::array<size_type, 3>{{4, 2, 1}},
48 std::unique_ptr<lf::geometry::Geometry>(nullptr));
49 mesh_factory_ptr->AddEntity(
50 lf::base::RefEl::kTria(), std::array<size_type, 3>{{4, 5, 2}},
51 std::unique_ptr<lf::geometry::Geometry>(nullptr));
52 mesh_factory_ptr->AddEntity(
53 lf::base::RefEl::kTria(), std::array<size_type, 3>{{5, 6, 2}},
54 std::unique_ptr<lf::geometry::Geometry>(nullptr));
55 mesh_factory_ptr->AddEntity(
56 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{3, 1, 0, 9}},
57 std::unique_ptr<lf::geometry::Geometry>(nullptr));
58 mesh_factory_ptr->AddEntity(
59 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{2, 6, 7, 0}},
60 std::unique_ptr<lf::geometry::Geometry>(nullptr));
61 mesh_factory_ptr->AddEntity(
62 lf::base::RefEl::kTria(), std::array<size_type, 3>{{0, 7, 8}},
63 std::unique_ptr<lf::geometry::Geometry>(nullptr));
64 mesh_factory_ptr->AddEntity(
65 lf::base::RefEl::kTria(), std::array<size_type, 3>{{0, 1, 2}},
66 std::unique_ptr<lf::geometry::Geometry>(nullptr));
67 break;
68 }
69 case 1: {
70 // Set coordinates of nodes
71 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 0 * scale})); // 0
72 mesh_factory_ptr->AddPoint(coord_t({2 * scale, 0 * scale})); // 1
73 mesh_factory_ptr->AddPoint(coord_t({4 * scale, 0 * scale})); // 2
74 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 2 * scale})); // 3
75 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 3 * scale})); // 4
76 mesh_factory_ptr->AddPoint(coord_t({2 * scale, 4 * scale})); // 5
77 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 4 * scale})); // 6
78 mesh_factory_ptr->AddPoint(coord_t({4 * scale, 4 * scale})); // 7
79 mesh_factory_ptr->AddPoint(coord_t({4 * scale, 2 * scale})); // 8
80 mesh_factory_ptr->AddPoint(coord_t({1 * scale, 1 * scale})); // 9
81 mesh_factory_ptr->AddPoint(coord_t({3 * scale, 1 * scale})); // 10
82 mesh_factory_ptr->AddPoint(coord_t({3 * scale, 2 * scale})); // 11
83 mesh_factory_ptr->AddPoint(coord_t({2 * scale, 3 * scale})); // 12
84 mesh_factory_ptr->AddPoint(coord_t({1 * scale, 2 * scale})); // 13
85 mesh_factory_ptr->AddPoint(coord_t({2 * scale, 2 * scale})); // 14
86
87 quad_coord_t quad_coord(2, 4);
88 // First cell: a parallelogram
89 quad_coord << 0.0, 2.0, 3.0, 1.0, 0.0, 0.0, 1.0, 1.0;
90 quad_coord *= scale;
91 mesh_factory_ptr->AddEntity(
92 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{0, 1, 10, 9}},
93 std::make_unique<lf::geometry::Parallelogram>(quad_coord));
94 // Second cell: a triangle
95 mesh_factory_ptr->AddEntity(
96 lf::base::RefEl::kTria(), std::array<size_type, 3>{{1, 2, 10}},
97 std::unique_ptr<lf::geometry::Geometry>(nullptr));
98 // Third cell: a quadrilateral
99 mesh_factory_ptr->AddEntity(
100 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{2, 8, 11, 10}},
101 std::unique_ptr<lf::geometry::Geometry>(nullptr));
102 // Fourth cell: a triangle
103 mesh_factory_ptr->AddEntity(
104 lf::base::RefEl::kTria(), std::array<size_type, 3>{{11, 8, 7}},
105 std::unique_ptr<lf::geometry::Geometry>(nullptr));
106 // Fifth cell: a quadrilateral
107 mesh_factory_ptr->AddEntity(
108 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{5, 12, 11, 7}},
109 std::unique_ptr<lf::geometry::Geometry>(nullptr));
110 // Sixth cell: A parallelogram
111 quad_coord << 0, 2, 2, 0, 3, 3, 4, 4;
112 quad_coord *= scale;
113 mesh_factory_ptr->AddEntity(
114 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{4, 12, 5, 6}},
115 std::make_unique<lf::geometry::Parallelogram>(quad_coord));
116 // Seventh cell: a quadrilateral
117 mesh_factory_ptr->AddEntity(
118 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{4, 3, 13, 12}},
119 std::unique_ptr<lf::geometry::Geometry>(nullptr));
120 // Eigth cell: a quadrilateral
121 mesh_factory_ptr->AddEntity(
122 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{3, 0, 9, 13}},
123 std::unique_ptr<lf::geometry::Geometry>(nullptr));
124 // Ninth cell: a triangle
125 mesh_factory_ptr->AddEntity(
126 lf::base::RefEl::kTria(), std::array<size_type, 3>({9, 10, 14}),
127 std::unique_ptr<lf::geometry::Geometry>(nullptr));
128 // Tenth cell: a parallelogram
129 quad_coord << 2, 3, 3, 2, 2, 1, 2, 3;
130 quad_coord *= scale;
131 mesh_factory_ptr->AddEntity(
132 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{14, 10, 11, 12}},
133 std::make_unique<lf::geometry::Parallelogram>(quad_coord));
134 // 11th cell: a parallelogram
135 quad_coord << 1, 1, 2, 2, 2, 1, 2, 3;
136 quad_coord *= scale;
137 mesh_factory_ptr->AddEntity(
138 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{13, 9, 14, 12}},
139 std::make_unique<lf::geometry::Parallelogram>(quad_coord));
140 break;
141 }
142 case 2: {
143 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 0 * scale})); // 0
144 mesh_factory_ptr->AddPoint(coord_t({1 * scale, 0 * scale})); // 1
145 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 1 * scale})); // 2
146 mesh_factory_ptr->AddPoint(coord_t({1 * scale, 1 * scale})); // 3
147 mesh_factory_ptr->AddPoint(coord_t({1.5 * scale, 0.5 * scale})); // 4
148 quad_coord_t quad_coord(2, 4);
149 // First cell: the unit square
150 quad_coord << 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0;
151 mesh_factory_ptr->AddEntity(
152 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{0, 1, 3, 2}},
153 std::make_unique<lf::geometry::Parallelogram>(quad_coord));
154 // Second cell: an affine triangle
155 mesh_factory_ptr->AddEntity(
156 lf::base::RefEl::kTria(), std::array<size_type, 3>{{1, 3, 4}},
157 std::unique_ptr<lf::geometry::Geometry>(nullptr));
158 break;
159 }
160 case 3: {
161 // Triangular mesh
162 // Set coordinates of nodes
163 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 0 * scale})); // 0
164 mesh_factory_ptr->AddPoint(coord_t({1.5 * scale, 0 * scale})); // 1
165 mesh_factory_ptr->AddPoint(coord_t({3 * scale, 0 * scale})); // 2
166 mesh_factory_ptr->AddPoint(coord_t({1 * scale, 1 * scale})); // 3
167 mesh_factory_ptr->AddPoint(coord_t({2 * scale, 1 * scale})); // 4
168 mesh_factory_ptr->AddPoint(coord_t({3 * scale, 1 * scale})); // 5
169 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 1.5 * scale})); // 6
170 mesh_factory_ptr->AddPoint(coord_t({2 * scale, 1.5 * scale})); // 7
171 mesh_factory_ptr->AddPoint(coord_t({1 * scale, 2 * scale})); // 8
172 mesh_factory_ptr->AddPoint(coord_t({3 * scale, 2 * scale})); // 9
173 mesh_factory_ptr->AddPoint(coord_t({0 * scale, 3 * scale})); // 10
174 mesh_factory_ptr->AddPoint(coord_t({1.5 * scale, 3 * scale})); // 11
175 mesh_factory_ptr->AddPoint(coord_t({3 * scale, 3 * scale})); // 12
176
177 // Setting vertices of triangular cells but not their geometry
178 mesh_factory_ptr->AddEntity(
179 lf::base::RefEl::kTria(), std::array<size_type, 3>{{0, 1, 3}},
180 std::unique_ptr<lf::geometry::Geometry>(nullptr));
181 mesh_factory_ptr->AddEntity(
182 lf::base::RefEl::kTria(), std::array<size_type, 3>{{1, 2, 4}},
183 std::unique_ptr<lf::geometry::Geometry>(nullptr));
184 mesh_factory_ptr->AddEntity(
185 lf::base::RefEl::kTria(), std::array<size_type, 3>{{0, 3, 6}},
186 std::unique_ptr<lf::geometry::Geometry>(nullptr));
187 mesh_factory_ptr->AddEntity(
188 lf::base::RefEl::kTria(), std::array<size_type, 3>{{1, 3, 4}},
189 std::unique_ptr<lf::geometry::Geometry>(nullptr));
190 mesh_factory_ptr->AddEntity(
191 lf::base::RefEl::kTria(), std::array<size_type, 3>{{4, 2, 5}},
192 std::unique_ptr<lf::geometry::Geometry>(nullptr));
193 mesh_factory_ptr->AddEntity(
194 lf::base::RefEl::kTria(), std::array<size_type, 3>{{3, 4, 7}},
195 std::unique_ptr<lf::geometry::Geometry>(nullptr));
196 mesh_factory_ptr->AddEntity(
197 lf::base::RefEl::kTria(), std::array<size_type, 3>{{4, 5, 7}},
198 std::unique_ptr<lf::geometry::Geometry>(nullptr));
199 mesh_factory_ptr->AddEntity(
200 lf::base::RefEl::kTria(), std::array<size_type, 3>{{3, 6, 8}},
201 std::unique_ptr<lf::geometry::Geometry>(nullptr));
202 mesh_factory_ptr->AddEntity(
203 lf::base::RefEl::kTria(), std::array<size_type, 3>{{7, 8, 3}},
204 std::unique_ptr<lf::geometry::Geometry>(nullptr));
205 mesh_factory_ptr->AddEntity(
206 lf::base::RefEl::kTria(), std::array<size_type, 3>{{5, 7, 9}},
207 std::unique_ptr<lf::geometry::Geometry>(nullptr));
208 mesh_factory_ptr->AddEntity(
209 lf::base::RefEl::kTria(), std::array<size_type, 3>{{6, 8, 10}},
210 std::unique_ptr<lf::geometry::Geometry>(nullptr));
211 mesh_factory_ptr->AddEntity(
212 lf::base::RefEl::kTria(), std::array<size_type, 3>{{8, 7, 11}},
213 std::unique_ptr<lf::geometry::Geometry>(nullptr));
214 mesh_factory_ptr->AddEntity(
215 lf::base::RefEl::kTria(), std::array<size_type, 3>{{7, 9, 12}},
216 std::unique_ptr<lf::geometry::Geometry>(nullptr));
217 mesh_factory_ptr->AddEntity(
218 lf::base::RefEl::kTria(), std::array<size_type, 3>{{10, 8, 11}},
219 std::unique_ptr<lf::geometry::Geometry>(nullptr));
220 mesh_factory_ptr->AddEntity(
221 lf::base::RefEl::kTria(), std::array<size_type, 3>{{7, 12, 11}},
222 std::unique_ptr<lf::geometry::Geometry>(nullptr));
223 break;
224 }
225 case 4: {
226 // Triangular tensor product mesh
227 // Construct a structured mesh with 18 triangles
228 utils::TPTriagMeshBuilder builder(std::move(mesh_factory_ptr));
229 // Set mesh parameters following the Builder pattern
230 // Domain is the unit square
231 builder.setBottomLeftCorner(Eigen::Vector2d{0 * scale, 0 * scale})
232 .setTopRightCorner(Eigen::Vector2d{1 * scale, 1 * scale})
233 .setNumXCells(3)
234 .setNumYCells(3);
235 return builder.Build();
236 break;
237 }
238 case 5: {
239 // Hybrid mesh of [0,3]^2 with only affine cells
240 // Set coordinates of nodes
241 std::array<std::array<double, 2>, 16> node_coord{
242 std::array<double, 2>({0, 0}), std::array<double, 2>({1, 0}),
243 std::array<double, 2>({2, 0}), std::array<double, 2>({3, 0}),
244 std::array<double, 2>({0, 1}), std::array<double, 2>({1, 1}),
245 std::array<double, 2>({2, 1}), std::array<double, 2>({3, 1}),
246 std::array<double, 2>({0, 2}), std::array<double, 2>({1, 2}),
247 std::array<double, 2>({2, 2}), std::array<double, 2>({3, 2}),
248 std::array<double, 2>({0, 3}), std::array<double, 2>({1, 3}),
249 std::array<double, 2>({2, 3}), std::array<double, 2>({3, 3})};
250
251 // Create nodes
252 for (const auto &node : node_coord) {
253 mesh_factory_ptr->AddPoint(coord_t({node[0] * scale, node[1] * scale}));
254 }
255
256 // Specify triangles
257 std::array<std::array<size_type, 3>, 4> tria_nodes{
258 std::array<size_type, 3>({0, 4, 5}),
259 std::array<size_type, 3>({2, 3, 7}),
260 std::array<size_type, 3>({8, 9, 12}),
261 std::array<size_type, 3>({11, 15, 14}),
262 };
263
264 // Specify parallelograms
265 std::array<std::array<size_type, 4>, 7> quad_nodes{
266 std::array<size_type, 4>({0, 1, 6, 5}),
267 std::array<size_type, 4>({1, 2, 7, 6}),
268 std::array<size_type, 4>({5, 6, 10, 9}),
269 std::array<size_type, 4>({6, 7, 11, 10}),
270 std::array<size_type, 4>({9, 10, 13, 12}),
271 std::array<size_type, 4>({10, 11, 14, 13}),
272 std::array<size_type, 4>({4, 5, 9, 8})};
273
274 // generate triangles
275 for (const auto &node : tria_nodes) {
276 mesh_factory_ptr->AddEntity(
278 std::array<size_type, 3>{{node[0], node[1], node[2]}},
279 std::unique_ptr<lf::geometry::Geometry>(nullptr));
280 }
281
282 // generate Parallelograms
283 for (const auto &node : quad_nodes) {
284 quad_coord_t quad_coord(2, 4);
285 for (int n_pt = 0; n_pt < 4; ++n_pt) {
286 quad_coord(0, n_pt) = node_coord[node[n_pt]][0];
287 quad_coord(1, n_pt) = node_coord[node[n_pt]][1];
288 }
289 mesh_factory_ptr->AddEntity(
291 std::array<size_type, 4>{{node[0], node[1], node[2], node[3]}},
292 std::make_unique<lf::geometry::Parallelogram>(quad_coord));
293 }
294 break;
295 }
296 case 6: {
297 // Hybrid mesh for triangle domain with vertices [0,0],[1,0],[0.2,1]
298 // Set coordinates of nodes
299 // clang-format off
300 std::array<std::array<double, 2>, 8> node_coord{
301 std::array<double, 2>({0 , 0 }),
302 std::array<double, 2>({1 , 0 }),
303 std::array<double, 2>({0.2 , 1.0 }),
304 std::array<double, 2>({0.5 , 0.0 }),
305 std::array<double, 2>({0.6 , 0.5 }),
306 std::array<double, 2>({0.1 , 0.5 }),
307 std::array<double, 2>({0.15, 0.75 }),
308 std::array<double, 2>({0.4 , 0.75 })};
309 // clang-format on
310
311 // Specify triangles (two)
312 std::array<std::array<size_type, 3>, 2> tria_nodes{
313 std::array<size_type, 3>({3, 1, 4}),
314 std::array<size_type, 3>({7, 6, 2})};
315
316 // Specify general quadrilateral
317 std::array<std::array<size_type, 4>, 1> quad_nodes{
318 std::array<size_type, 4>({5, 4, 7, 6})};
319
320 // Specify parallelogram
321 std::array<std::array<size_type, 4>, 1> parg_nodes{
322 std::array<size_type, 4>({0, 3, 4, 5})};
323
324 // Create nodes
325 for (const auto &node : node_coord) {
326 mesh_factory_ptr->AddPoint(coord_t({node[0] * scale, node[1] * scale}));
327 }
328
329 // generate triangles
330 for (const auto &node : tria_nodes) {
331 mesh_factory_ptr->AddEntity(
333 std::array<size_type, 3>{{node[0], node[1], node[2]}},
334 std::unique_ptr<lf::geometry::Geometry>(nullptr));
335 }
336
337 // generate quadrilaterals
338 for (const auto &node : quad_nodes) {
339 quad_coord_t quad_coord(2, 4);
340 for (int n_pt = 0; n_pt < 4; ++n_pt) {
341 quad_coord(0, n_pt) = node_coord[node[n_pt]][0];
342 quad_coord(1, n_pt) = node_coord[node[n_pt]][1];
343 }
344 mesh_factory_ptr->AddEntity(
346 std::array<size_type, 4>{{node[0], node[1], node[2], node[3]}},
347 std::make_unique<lf::geometry::QuadO1>(quad_coord));
348 }
349
350 // generate Parallelograms
351 for (const auto &node : parg_nodes) {
352 quad_coord_t quad_coord(2, 4);
353 for (int n_pt = 0; n_pt < 4; ++n_pt) {
354 quad_coord(0, n_pt) = node_coord[node[n_pt]][0];
355 quad_coord(1, n_pt) = node_coord[node[n_pt]][1];
356 }
357 mesh_factory_ptr->AddEntity(
359 std::array<size_type, 4>{{node[0], node[1], node[2], node[3]}},
360 std::make_unique<lf::geometry::Parallelogram>(quad_coord));
361 }
362
363 break;
364 }
365 case 7: {
366 // Hybrid mesh of the unit square comprising one quadrilateral and one
367 // triangle
368 // clang-format off
369 std::array<std::array<double, 2>, 5> node_coord{
370 std::array<double, 2>({0 , 0 }),
371 std::array<double, 2>({1 , 0 }),
372 std::array<double, 2>({1 , 1 }),
373 std::array<double, 2>({0 , 1 }),
374 std::array<double, 2>({0.5 , 1 })};
375 // clang-format on
376
377 // Create nodes
378 for (const auto &node : node_coord) {
379 mesh_factory_ptr->AddPoint(coord_t({node[0] * scale, node[1] * scale}));
380 }
381 // Register triangle
382 mesh_factory_ptr->AddEntity(
383 lf::base::RefEl::kTria(), std::array<size_type, 3>{{1, 2, 4}},
384 std::unique_ptr<lf::geometry::Geometry>(nullptr));
385 // Register quadrilateral
386 mesh_factory_ptr->AddEntity(
387 lf::base::RefEl::kQuad(), std::array<size_type, 4>{{0, 1, 4, 3}},
388 std::unique_ptr<lf::geometry::Geometry>(nullptr));
389 break;
390 }
391 case 8: {
392 // Hybrid mesh of square [0,3]^2 with only triangles and rectangles
393 // Set coordinates of nodes
394 // clang-format off
395 std::array<std::array<double, 2>, 10> node_coord{
396 std::array<double, 2>({0, 0 }),
397 std::array<double, 2>({1, 0 }),
398 std::array<double, 2>({2, 0 }),
399 std::array<double, 2>({3, 0 }),
400 std::array<double, 2>({0 ,2 }),
401 std::array<double, 2>({1 ,2 }),
402 std::array<double, 2>({3 ,2 }),
403 std::array<double, 2>({0 ,3 }),
404 std::array<double, 2>({1 ,3 }),
405 std::array<double, 2>({3 ,3 })};
406 // clang-format on
407
408 // Specify triangles (five)
409 std::array<std::array<size_type, 3>, 5> tria_nodes{
410 std::array<size_type, 3>({1, 2, 5}),
411 std::array<size_type, 3>({2, 3, 6}),
412 std::array<size_type, 3>({5, 2, 6}),
413 std::array<size_type, 3>({4, 5, 7}),
414 std::array<size_type, 3>({5, 8, 7})};
415
416 // Specify parallelograms (two)
417 std::array<std::array<size_type, 4>, 2> parg_nodes{
418 std::array<size_type, 4>({0, 1, 5, 4}),
419 std::array<size_type, 4>({5, 6, 9, 8})};
420
421 // Create nodes
422 for (const auto &node : node_coord) {
423 mesh_factory_ptr->AddPoint(coord_t({node[0] * scale, node[1] * scale}));
424 }
425
426 // generate triangles
427 for (const auto &node : tria_nodes) {
428 mesh_factory_ptr->AddEntity(
430 std::array<size_type, 3>{{node[0], node[1], node[2]}},
431 std::unique_ptr<lf::geometry::Geometry>(nullptr));
432 }
433
434 // generate Parallelograms
435 for (const auto &node : parg_nodes) {
436 quad_coord_t quad_coord(2, 4);
437 for (int n_pt = 0; n_pt < 4; ++n_pt) {
438 quad_coord(0, n_pt) = node_coord[node[n_pt]][0];
439 quad_coord(1, n_pt) = node_coord[node[n_pt]][1];
440 }
441 mesh_factory_ptr->AddEntity(
443 std::array<size_type, 4>{{node[0], node[1], node[2], node[3]}},
444 std::make_unique<lf::geometry::Parallelogram>(quad_coord));
445 }
446 break;
447 }
448 default: {
449 LF_VERIFY_MSG(false, "Illegal selector for test meshes");
450 break;
451 }
452 } // end switch
453 // Optional: Inspect data
454 // mesh_factory_ptr->PrintLists(std::cout);
455 return mesh_factory_ptr->Build();
456} // namespace lf::mesh::test_utils
457
458} // namespace lf::mesh::test_utils
static constexpr RefEl kTria()
Returns the reference triangle.
Definition ref_el.h:161
static constexpr RefEl kQuad()
Returns the reference quadrilateral.
Definition ref_el.h:169
lf::base::size_type size_type
StructuredMeshBuilder & setBottomLeftCorner(const VECTOR &blc)
StructuredMeshBuilder & setNumYCells(size_type nyc)
Implements a MeshBuilder that generates a triangular structured mesh.
std::shared_ptr< mesh::Mesh > Build() override
actual construction of the mesh
Utilities for testing sanity of mesh data structures and tests involving meshes.
std::shared_ptr< lf::mesh::Mesh > GenerateHybrid2DTestMesh(int selector, double scale)
Generates a simple 2D hybrid test mesh.