LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | Static Private Attributes | List of all members
lf::mesh::hybrid2d::Segment Class Reference

An edge object for a 2D hybrid mesh. More...

#include <lf/mesh/hybrid2d/segment.h>

Inheritance diagram for lf::mesh::hybrid2d::Segment:
lf::mesh::Entity

Public Member Functions

 Segment ()=default
 default constructors, needed by std::vector
 
 Segment (size_type index, std::unique_ptr< geometry::Geometry > &&geometry, const Point *endpoint0, const Point *endpoint1)
 constructor, is called from MeshFactory
 
unsigned Codim () const override
 an edge is an entity of co-dimension 1
 
std::span< const Entity *const > SubEntities (unsigned rel_codim) const override
 Access to all subentities selected by relative co-dimension.
 
std::span< const lf::mesh::OrientationRelativeOrientations () const override
 Access to relative orientations of endpoints.
 
size_type index () const
 access to index of an entity
 
 ~Segment () override=default
 
Default and disabled constructors
 Segment (const Segment &)=delete
 
 Segment (Segment &&) noexcept=default
 
Segmentoperator= (const Segment &)=delete
 
Segmentoperator= (Segment &&) noexcept=default
 
Standard methods of an Entity object
See also
mesh::Entity
const geometry::GeometryGeometry () const override
 Describes the geometry of this entity.
 
base::RefEl RefEl () const override
 Describes the reference element type of this entity.
 
bool operator== (const mesh::Entity &rhs) const override
 Check if two entities are the same.
 
- Public Member Functions inherited from lf::mesh::Entity
bool operator!= (const Entity &rhs) const
 Check if two entities are different.
 
virtual ~Entity ()=default
 Virtual Destructor.
 

Private Types

using size_type = mesh::Mesh::size_type
 

Private Attributes

size_type index_ = -1
 
std::unique_ptr< geometry::Geometrygeometry_
 
std::array< const Point *, 2 > nodes_ {}
 
Entitythis_ = nullptr
 

Static Private Attributes

static constexpr std::array< lf::mesh::Orientation, 2 > endpoint_ori_
 

Additional Inherited Members

- Protected Member Functions inherited from lf::mesh::Entity
 Entity ()=default
 
 Entity (const Entity &)=default
 
 Entity (Entity &&)=default
 
Entityoperator= (const Entity &)=default
 
Entityoperator= (Entity &&)=default
 

Detailed Description

An edge object for a 2D hybrid mesh.

An topological edge object is define through two distinct references to node objects of the mesh. Their ordering reflects the intrinsic orientation of the mesh

Note
Every Segment object owns a smart pointer to an associated geometry object.

Definition at line 29 of file segment.h.

Member Typedef Documentation

◆ size_type

Definition at line 30 of file segment.h.

Constructor & Destructor Documentation

◆ Segment() [1/4]

lf::mesh::hybrid2d::Segment::Segment ( )
default

default constructors, needed by std::vector

◆ Segment() [2/4]

lf::mesh::hybrid2d::Segment::Segment ( const Segment & )
delete

◆ Segment() [3/4]

lf::mesh::hybrid2d::Segment::Segment ( Segment && )
defaultnoexcept

◆ Segment() [4/4]

lf::mesh::hybrid2d::Segment::Segment ( size_type index,
std::unique_ptr< geometry::Geometry > && geometry,
const Point * endpoint0,
const Point * endpoint1 )
inlineexplicit

constructor, is called from MeshFactory

Parameters
indexindex of the entity to be created; will usually be retrieved via the Index() method of Mesh
geometrypointer to a geometry object providing the shape of the edge
endpoint0pointer to the first node
endpoint1pointer to the second node
Note
Note that you need to create a suitable geometry object for the entity before you can initialize the entity object itseld.

Definition at line 56 of file segment.h.

◆ ~Segment()

lf::mesh::hybrid2d::Segment::~Segment ( )
overridedefault

Member Function Documentation

◆ Codim()

unsigned lf::mesh::hybrid2d::Segment::Codim ( ) const
inlineoverridevirtual

an edge is an entity of co-dimension 1

Implements lf::mesh::Entity.

Definition at line 74 of file segment.h.

◆ Geometry()

const geometry::Geometry * lf::mesh::hybrid2d::Segment::Geometry ( ) const
inlineoverridevirtual

Describes the geometry of this entity.

Returns
A pointer to a Geometry object that will remain valid for as long as the Mesh remains valid.

Why does this member function return a pointer instead of a reference? One reason is that entities without a geometric shape are conceivable as building block of a "mesh graph", where only topological information matters. Another reason is that during the construction of a mesh, it turns out to be convenient to build entities "without geometry" first and then endow them with geometric information. A nullptr is a good way to indicate missing geometric information.

Implements lf::mesh::Entity.

Definition at line 102 of file segment.h.

References geometry_.

◆ index()

size_type lf::mesh::hybrid2d::Segment::index ( ) const
inline

access to index of an entity

Definition at line 96 of file segment.h.

References index_.

◆ operator=() [1/2]

Segment & lf::mesh::hybrid2d::Segment::operator= ( const Segment & )
delete

◆ operator=() [2/2]

Segment & lf::mesh::hybrid2d::Segment::operator= ( Segment && )
defaultnoexcept

◆ operator==()

bool lf::mesh::hybrid2d::Segment::operator== ( const mesh::Entity & rhs) const
inlineoverridevirtual

Check if two entities are the same.

Parameters
rhsCheck if this entity is the same as the rhs entity.
Note
The behavior of this method is undefined if the rhs entity belongs to a different Mesh.

Implements lf::mesh::Entity.

Definition at line 108 of file segment.h.

◆ RefEl()

base::RefEl lf::mesh::hybrid2d::Segment::RefEl ( ) const
inlineoverridevirtual

Describes the reference element type of this entity.

Returns
An object of type lf::base::RefEl.

Implements lf::mesh::Entity.

Definition at line 105 of file segment.h.

References lf::base::RefEl::kSegment().

◆ RelativeOrientations()

std::span< const lf::mesh::Orientation > lf::mesh::hybrid2d::Segment::RelativeOrientations ( ) const
inlineoverridevirtual

Access to relative orientations of endpoints.

This method just returns {+,-}, because points always have the intrinsic orientation + and the orientation of an edge is defined through the ordering of its vertices.

Implements lf::mesh::Entity.

Definition at line 90 of file segment.h.

References endpoint_ori_.

◆ SubEntities()

std::span< const Entity *const > lf::mesh::hybrid2d::Segment::SubEntities ( unsigned rel_codim) const
overridevirtual

Access to all subentities selected by relative co-dimension.

Parameters
rel_codimif 1 select endnodes, if 0 select edge itself
Returns
  • for rel_codim == 1: return 2-range covering endnodes
  • for rel_codim == 0: return the Segment entity itself

Implements lf::mesh::Entity.

Definition at line 14 of file segment.cc.

References nodes_, and this_.

Member Data Documentation

◆ endpoint_ori_

constexpr std::array<lf::mesh::Orientation, 2> lf::mesh::hybrid2d::Segment::endpoint_ori_
staticconstexprprivate

◆ geometry_

std::unique_ptr<geometry::Geometry> lf::mesh::hybrid2d::Segment::geometry_
private

Definition at line 117 of file segment.h.

Referenced by Geometry().

◆ index_

size_type lf::mesh::hybrid2d::Segment::index_ = -1
private

Definition at line 116 of file segment.h.

Referenced by index().

◆ nodes_

std::array<const Point*, 2> lf::mesh::hybrid2d::Segment::nodes_ {}
private

Definition at line 118 of file segment.h.

Referenced by SubEntities().

◆ this_

Entity* lf::mesh::hybrid2d::Segment::this_ = nullptr
private

Definition at line 119 of file segment.h.

Referenced by SubEntities().


The documentation for this class was generated from the following files: