PLaSK library
Loading...
Searching...
No Matches
plask::TriangularMesh2D::Element Struct Reference

Represent FEM-like element (triangle) in TriangularMesh2D. More...

#include <plask/mesh/triangular2d.hpp>

Collaboration diagram for plask::TriangularMesh2D::Element:
[legend]

Public Member Functions

 Element (const TriangularMesh2D &mesh, TriangleNodeIndexes triangleNodes)
 
std::size_t getNodeIndex (std::size_t index) const noexcept
 Get index of the triangle vertex in mesh (nodes vector).
 
const LocalCoordsgetNode (std::size_t index) const noexcept
 Get coordinates of the triangle vertex.
 
std::array< LocalCoords, 3 > getNodes () const
 Get coordinates of the triangle vertices.
 
LocalCoords getMidpoint () const
 Get centroid of the triangle corresponded to this element.
 
double getArea () const noexcept
 Get area of the triangle represented by this element.
 
Vec< 3, doublebarycentric (Vec< 2, double > p) const
 Calculate barycentric (area) coordinates of the point p with respect to the triangle represented by this.
 
bool contains (Vec< 2, double > p) const
 Check if point p is included in triangle represented by this element.
 
Box2D getBoundingBox () const
 Calculate minimal rectangle which contains the triangle represented by the element.
 

Public Attributes

TriangleNodeIndexes triangleNodes
 
const TriangularMesh2Dmesh
 

Detailed Description

Represent FEM-like element (triangle) in TriangularMesh2D.

Definition at line 53 of file triangular2d.hpp.

Constructor & Destructor Documentation

◆ Element()

plask::TriangularMesh2D::Element::Element ( const TriangularMesh2D mesh,
TriangleNodeIndexes  triangleNodes 
)
inline

Definition at line 57 of file triangular2d.hpp.

Member Function Documentation

◆ barycentric()

Vec< 3, double > plask::TriangularMesh2D::Element::barycentric ( Vec< 2, double p) const

Calculate barycentric (area) coordinates of the point p with respect to the triangle represented by this.

Parameters
ppoint
Returns
the barycentric (area) coordinates of p

Definition at line 25 of file triangular2d.cpp.

◆ contains()

bool plask::TriangularMesh2D::Element::contains ( Vec< 2, double p) const
inline

Check if point p is included in triangle represented by this element.

Parameters
ppoint to check
Returns
true only if p is included in this

Definition at line 120 of file triangular2d.hpp.

◆ getArea()

double plask::TriangularMesh2D::Element::getArea ( ) const
inlinenoexcept

Get area of the triangle represented by this element.

Returns
the area of the triangle

Definition at line 99 of file triangular2d.hpp.

◆ getBoundingBox()

Box2D plask::TriangularMesh2D::Element::getBoundingBox ( ) const

Calculate minimal rectangle which contains the triangle represented by the element.

Returns
calculated rectangle

Definition at line 40 of file triangular2d.cpp.

◆ getMidpoint()

LocalCoords plask::TriangularMesh2D::Element::getMidpoint ( ) const
inline

Get centroid of the triangle corresponded to this element.

Returns
centroid of the triangle corresponded to this element

Definition at line 91 of file triangular2d.hpp.

◆ getNode()

const LocalCoords & plask::TriangularMesh2D::Element::getNode ( std::size_t  index) const
inlinenoexcept

Get coordinates of the triangle vertex.

Parameters
indexindex of vertex in the triangle corresponded to this element; equals to 0, 1 or 2
Returns
coordinates of the triangle vertex

Definition at line 75 of file triangular2d.hpp.

◆ getNodeIndex()

std::size_t plask::TriangularMesh2D::Element::getNodeIndex ( std::size_t  index) const
inlinenoexcept

Get index of the triangle vertex in mesh (nodes vector).

Parameters
indexindex of vertex in the triangle corresponded to this element; equals to 0, 1 or 2
Returns
index of the triangle vertex in mesh (nodes vector)

Definition at line 65 of file triangular2d.hpp.

◆ getNodes()

std::array< LocalCoords, 3 > plask::TriangularMesh2D::Element::getNodes ( ) const
inline

Get coordinates of the triangle vertices.

Returns
coordinates of the triangle vertices

Definition at line 83 of file triangular2d.hpp.

Member Data Documentation

◆ mesh

const TriangularMesh2D& plask::TriangularMesh2D::Element::mesh

Definition at line 55 of file triangular2d.hpp.

◆ triangleNodes

TriangleNodeIndexes plask::TriangularMesh2D::Element::triangleNodes

Definition at line 54 of file triangular2d.hpp.


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