LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
|
Interface class for initialization of a mesh object. More...
#include <lf/mesh/mesh_factory.h>
Public Types | |
using | size_type = unsigned int |
using | coord_t = Eigen::VectorXd |
Coordinate type of a point. | |
using | dim_t = base::dim_t |
Public Member Functions | |
virtual dim_t | DimWorld () const =0 |
Return the Mesh::DimWorld() of the mesh that will be returned. | |
virtual dim_t | DimMesh () const =0 |
Return the Mesh::DimMesh() of the mesh that will be returned. | |
virtual size_type | AddPoint (coord_t coord)=0 |
Add a point to the mesh. | |
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 std::span< const size_type > &nodes, std::unique_ptr< geometry::Geometry > &&geometry)=0 |
Add an an entity (codim>0) to the mesh. | |
virtual std::shared_ptr< Mesh > | Build ()=0 |
Construct a mesh out of the specified nodes and elements. | |
virtual | ~MeshFactory ()=default |
Virtual destructor. | |
Protected Member Functions | |
MeshFactory ()=default | |
MeshFactory (const MeshFactory &)=default | |
MeshFactory (MeshFactory &&)=default | |
MeshFactory & | operator= (const MeshFactory &)=default |
MeshFactory & | operator= (MeshFactory &&)=default |
Interface class for initialization of a mesh object.
This class implements a factory pattern in order to make it possible for mesh builder facilities like those in the io module to generate different mesh objects. An example of a class that relies on the service of a MeshFactory object is lf::io::GmshReader, see also Example 2.7.1.13
Definition at line 25 of file mesh_factory.h.
using lf::mesh::MeshFactory::coord_t = Eigen::VectorXd |
Coordinate type of a point.
Definition at line 40 of file mesh_factory.h.
Definition at line 42 of file mesh_factory.h.
using lf::mesh::MeshFactory::size_type = unsigned int |
Auxiliary types
Definition at line 35 of file mesh_factory.h.
|
protecteddefault |
|
protecteddefault |
|
protecteddefault |
|
virtualdefault |
Virtual destructor.
Reimplemented in lf::mesh::hybrid2d::MeshFactory.
|
pure virtual |
Add an an entity (codim>0) to the mesh.
ref_el | The reference element of the entity. |
nodes | The 0-based indices of the nodes that make up this entity (as returned from AddPoint()). This range should contain exactly ref_el.NumNodes() . |
geometry | The geometric description of the mesh entity. Can be a nullptr (see below). |
Use this method to add mesh elements (codim=0) and optionally entities with codim>0
if this entity
geometry == nullptr
If the geometry object is not specified, the mesh will try to deduce the geometry from super entities (i.e. entities that contain the given entity as a sub-entity). E.g. if you add an entity with ref_el=RefEl::kSegment
to a mesh with dimMesh=2
and you don't specify a geometry
, then the geometry of the entity will be deduced from any triangle/quadrilateral that contains this entity (using the method geometry::Geometry::SubGeometry()). If the MeshFactory cannot deduce the geometry from a father entity, an error will be raised when Build()
is called.
Since the geometry object is taken from a super entity, there is no guarantee that the node order of the created entity and the one passed trough the parameter nodes
are the same!
geometry != nullptr
If you specify a geometry explicitly, the created entity will have exactly this geometry object as a reference. Hence the node ordering of the created entity object agrees with the ordering of nodes
.
nodes
must have been obtained with AddPoint() before calling this method. Implemented in lf::mesh::hybrid2d::MeshFactory.
Add a point to the mesh.
coord | The coordinate of the point (should have DimWorld() rows) |
Implemented in lf::mesh::hybrid2d::MeshFactory.
|
pure virtual |
Add a point to the mesh.
geometry | unique pointer to geometry object giving location of point |
Implemented in lf::mesh::hybrid2d::MeshFactory.
|
pure virtual |
Construct a mesh out of the specified nodes and elements.
Build()
. Implemented in lf::mesh::hybrid2d::MeshFactory.
|
pure virtual |
Return the Mesh::DimMesh() of the mesh that will be returned.
Implemented in lf::mesh::hybrid2d::MeshFactory.
|
pure virtual |
Return the Mesh::DimWorld() of the mesh that will be returned.
Implemented in lf::mesh::hybrid2d::MeshFactory.
|
protecteddefault |
|
protecteddefault |