LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
torus_mesh_builder.h
1
9#ifndef TORUS_MESH_BUILDER_H
10#define TORUS_MESH_BUILDER_H
11
12#include "lf/mesh/mesh_factory.h"
13#include "structured_mesh_builder.h"
14
15namespace lf::mesh::utils {
16
28 public:
32 explicit TorusMeshBuilder(std::unique_ptr<mesh::MeshFactory> mesh_factory)
33 : StructuredMeshBuilder(std::move(mesh_factory)) {
34 LF_ASSERT_MSG(
35 mesh_factory_->DimWorld() == 3,
36 "TorusMeshBuilder can only construct meshes with DimWorld==3");
37 }
38
42 [[nodiscard]] std::shared_ptr<mesh::Mesh> Build() override;
43
44 private:
48 [[nodiscard]] size_type VertexIndex(size_type i, size_type j) const {
49 return i + j * num_of_x_cells_;
50 }
51
52 public:
56 static std::shared_ptr<spdlog::logger>& Logger();
57}; // end class definition TorusMeshBuilder
58
59} // namespace lf::mesh::utils
60
61#endif /* TORUS_MESH_BUILDER_H */
std::unique_ptr< mesh::MeshFactory > mesh_factory_
Implements a MeshBuilder for a tensor product grid of a torus.
TorusMeshBuilder(std::unique_ptr< mesh::MeshFactory > mesh_factory)
Constructor: set factory object to be used by the builder.
size_type VertexIndex(size_type i, size_type j) const
vertex index from grid position
std::shared_ptr< mesh::Mesh > Build() override
actual construction of the mesh
static std::shared_ptr< spdlog::logger > & Logger()
logger that is used by Build() to provide additional debug info.
Contains helper functions and classes that all operate on the interface classes defined in lf::mesh.