LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
mesh_factory.h
1
8#ifndef __5ac8f981f27e45d3b9d15fc9d52f7136
9#define __5ac8f981f27e45d3b9d15fc9d52f7136
10
11#include <lf/base/base.h>
12#include <lf/geometry/geometry.h>
13
14#include "mesh_interface.h"
15
16namespace lf::mesh {
17
26 protected:
27 MeshFactory() = default;
28 MeshFactory(const MeshFactory&) = default;
30 MeshFactory& operator=(const MeshFactory&) = default;
32
33 public:
35 using size_type = unsigned int;
36
40 using coord_t = Eigen::VectorXd;
41
43
47 [[nodiscard]] virtual dim_t DimWorld() const = 0;
48
52 [[nodiscard]] virtual dim_t DimMesh() const = 0;
53
61 // NOLINTNEXTLINE(modernize-use-nodiscard)
62 virtual size_type AddPoint(coord_t coord) = 0;
63
71 // NOLINTNEXTLINE(modernize-use-nodiscard)
73 std::unique_ptr<geometry::Geometry>&& geometry) = 0;
74
116 // NOLINTNEXTLINE(modernize-use-nodiscard)
118 base::RefEl ref_el, const nonstd::span<const size_type>& nodes,
119 std::unique_ptr<geometry::Geometry>&& geometry) = 0;
120
129 [[nodiscard]] virtual std::shared_ptr<Mesh> Build() = 0;
130
132 virtual ~MeshFactory() = default;
133};
134
135} // namespace lf::mesh
136
137#endif // __5ac8f981f27e45d3b9d15fc9d52f7136
Represents a reference element with all its properties.
Definition: ref_el.h:106
Interface class for initialization of a mesh object.
Definition: mesh_factory.h:25
Eigen::VectorXd coord_t
Coordinate type of a point.
Definition: mesh_factory.h:40
virtual size_type AddPoint(coord_t coord)=0
Add a point to the mesh.
virtual dim_t DimWorld() const =0
Return the Mesh::DimWorld() of the mesh that will be returned.
MeshFactory & operator=(const MeshFactory &)=default
MeshFactory(MeshFactory &&)=default
virtual ~MeshFactory()=default
Virtual destructor.
MeshFactory(const MeshFactory &)=default
virtual size_type AddPoint(std::unique_ptr< geometry::Geometry > &&geometry)=0
Add a point to the mesh.
virtual size_type AddEntity(base::RefEl ref_el, const nonstd::span< const size_type > &nodes, std::unique_ptr< geometry::Geometry > &&geometry)=0
Add an an entity (codim>0) to the mesh.
virtual dim_t DimMesh() const =0
Return the Mesh::DimMesh() of the mesh that will be returned.
MeshFactory & operator=(MeshFactory &&)=default
unsigned int size_type
Definition: mesh_factory.h:35
virtual std::shared_ptr< Mesh > Build()=0
Construct a mesh out of the specified nodes and elements.
unsigned int dim_t
type for dimensions and co-dimensions and numbers derived from them
Definition: base.h:36
Defines a set of interface classes that define a mesh manager and provides mesh-related tools that bu...
Definition: entity.cc:5