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

Describes a trilateral cell for a 2D hybrid mesh. More...

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

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

Public Member Functions

 Triangle ()=default
 default constructors, needed by std::vector
 
 Triangle (size_type index, std::unique_ptr< geometry::Geometry > &&geometry, const Point *corner0, const Point *corner1, const Point *corner2, const Segment *edge0, const Segment *edge1, const Segment *edge2)
 constructor, is called from MeshFactory
 
unsigned Codim () const override
 an edge is an entity of co-dimension 1
 
size_type index () const
 access to index of an entity
 
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 edges.
 
 ~Triangle () override=default
 
Default and disabled constructors
 Triangle (const Triangle &)=delete
 
 Triangle (Triangle &&) noexcept=default
 
Triangleoperator= (const Triangle &)=delete
 
Triangleoperator= (Triangle &&) 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 *, 3 > nodes_ {}
 
std::array< const Segment *, 3 > edges_ {}
 
std::array< lf::mesh::Orientation, 3 > edge_ori_ {}
 
Entitythis_ = nullptr
 

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

Describes a trilateral cell for a 2D hybrid mesh.

A trilateral cell is defined by ordered lists of references to its nodes and its edges; internal consistency is required

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

Definition at line 28 of file triangle.h.

Member Typedef Documentation

◆ size_type

Definition at line 29 of file triangle.h.

Constructor & Destructor Documentation

◆ Triangle() [1/4]

lf::mesh::hybrid2d::Triangle::Triangle ( )
default

default constructors, needed by std::vector

◆ Triangle() [2/4]

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

◆ Triangle() [3/4]

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

◆ Triangle() [4/4]

lf::mesh::hybrid2d::Triangle::Triangle ( size_type index,
std::unique_ptr< geometry::Geometry > && geometry,
const Point * corner0,
const Point * corner1,
const Point * corner2,
const Segment * edge0,
const Segment * edge1,
const Segment * edge2 )
explicit

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 cell
corner0pointer to first node
corner1pointer to second node
corner2pointer to third node
edge0pointer to first edge
edge1pointer to second edge
edge2pointer to third edge

The sub-entities have to be consistent according to the conventions fixed for a reference element of type kTria.

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 16 of file triangle.cc.

◆ ~Triangle()

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

Member Function Documentation

◆ Codim()

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

an edge is an entity of co-dimension 1

Implements lf::mesh::Entity.

Definition at line 68 of file triangle.h.

◆ Geometry()

const geometry::Geometry * lf::mesh::hybrid2d::Triangle::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 95 of file triangle.h.

References geometry_.

◆ index()

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

access to index of an entity

Definition at line 71 of file triangle.h.

References index_.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator==()

bool lf::mesh::hybrid2d::Triangle::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 101 of file triangle.h.

◆ RefEl()

base::RefEl lf::mesh::hybrid2d::Triangle::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 98 of file triangle.h.

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

◆ RelativeOrientations()

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

Access to relative orientations of edges.

See also
mesh::Orientation

Implements lf::mesh::Entity.

Definition at line 86 of file triangle.h.

References edge_ori_.

◆ SubEntities()

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

Access to all subentities selected by relative co-dimension.

Parameters
rel_codimif 1 select edges, if 2 select nodes, if 0 select cell itself
Returns
  • for rel_codim == 1: return 3-range covering corners
  • for rel_codim == 2: return 3-range containing the edges

Implements lf::mesh::Entity.

Definition at line 81 of file triangle.cc.

References edges_, nodes_, and this_.

Member Data Documentation

◆ edge_ori_

std::array<lf::mesh::Orientation, 3> lf::mesh::hybrid2d::Triangle::edge_ori_ {}
private

Definition at line 114 of file triangle.h.

Referenced by RelativeOrientations().

◆ edges_

std::array<const Segment*, 3> lf::mesh::hybrid2d::Triangle::edges_ {}
private

Definition at line 112 of file triangle.h.

Referenced by SubEntities().

◆ geometry_

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

Definition at line 110 of file triangle.h.

Referenced by Geometry().

◆ index_

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

Definition at line 109 of file triangle.h.

Referenced by index().

◆ nodes_

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

Definition at line 111 of file triangle.h.

Referenced by SubEntities().

◆ this_

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

Definition at line 115 of file triangle.h.

Referenced by SubEntities().


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