LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
tp_quad_mesh_builder.h
1#ifndef TP_QUAD_MESH_BUILDER_H
2#define TP_QUAD_MESH_BUILDER_H
3
4#include "lf/mesh/mesh_factory.h"
5#include "structured_mesh_builder.h"
6
7namespace lf::mesh::utils {
8
19 public:
24 explicit TPQuadMeshBuilder(std::unique_ptr<mesh::MeshFactory> mesh_factory)
25 : StructuredMeshBuilder(std::move(mesh_factory)) {
26 LF_ASSERT_MSG(
27 mesh_factory_->DimWorld() == 2,
28 "TPQuadMeshBuilder can only construct meshes with DimWorld==2");
29 }
30
35 [[nodiscard]] std::shared_ptr<mesh::Mesh> Build() override;
36
37 private:
41 [[nodiscard]] size_type VertexIndex(size_type i, size_type j) const {
42 return (i + j * (num_of_x_cells_ + 1));
43 }
44
45 public:
49 static std::shared_ptr<spdlog::logger>& Logger();
50}; // end class definition TPQuadMeshBuilder
51
52} // namespace lf::mesh::utils
53
54#endif /* TP_QUAD_MESH_BUILDER_H */
std::unique_ptr< mesh::MeshFactory > mesh_factory_
Implements a Builder for a tensor product grid (with rectangular cells)
TPQuadMeshBuilder(std::unique_ptr< mesh::MeshFactory > mesh_factory)
Constructor: set factory object to be used by the builder.
std::shared_ptr< mesh::Mesh > Build() override
actual construction of the mesh
size_type VertexIndex(size_type i, size_type j) const
vertex index from grid position
static std::shared_ptr< spdlog::logger > & Logger()
is used by the Build() method to output additional information.
Contains helper functions and classes that all operate on the interface classes defined in lf::mesh.