PLaSK library

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
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 LocalCoords & | getNode (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, double > | barycentric (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 TriangularMesh2D & | mesh

## 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

  p | point

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

  p | point 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
| inline noexcept

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
| inline noexcept

Get coordinates of the triangle vertex.

Parameters

  index | index 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
| inline noexcept

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

Parameters

  index | index 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:

- plask/mesh/triangular2d.hpp
- plask/mesh/triangular2d.cpp