PLaSK library

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
plask::TriangularMesh2D::Builder Struct Reference

Instance of this class allows for adding triangles to the mesh effectively. More...

`#include <plask/mesh/triangular2d.hpp>`

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

## Public Member Functions
| Builder (TriangularMesh2D &mesh)
| Construct builder which will add triangles to the given `mesh`.
| Builder (TriangularMesh2D &mesh, std::size_t predicted_number_of_elements, std::size_t predicted_number_of_nodes)
| Construct builder which will add triangles to the given `mesh`.
| Builder (TriangularMesh2D &mesh, std::size_t predicted_number_of_elements)
| Construct builder which will add triangles to the given `mesh`.
| ~Builder ()
| Shrink to fit both: elements and nodes vectors of destination mesh.
Builder & | add (LocalCoords p1, LocalCoords p2, LocalCoords p3)
| Add a triangle to the mesh.
Builder & | add (const Element &e)
| Add a triangle to the mesh.
Builder & | add (const std::array< LocalCoords, 3 > &points)
| Add a triangle to the mesh.

## Public Attributes
std::map< LocalCoords, std::size_t > | indexOfNode
| map nodes to their indexes in mesh.nodes vector
TriangularMesh2D & | mesh
| destination mesh

## Detailed Description

Instance of this class allows for adding triangles to the mesh effectively.

Definition at line 192 of file triangular2d.hpp.

## Constructor & Destructor Documentation

## ◆ Builder() [1/3]

plask::TriangularMesh2D::Builder::Builder | ( | TriangularMesh2D & | mesh | ) |
| explicit

Construct builder which will add triangles to the given `mesh`.

Parameters

  mesh | triangles destination

Definition at line 52 of file triangular2d.cpp.

## ◆ Builder() [2/3]

plask::TriangularMesh2D::Builder::Builder | ( | TriangularMesh2D & | mesh,
|  | std::size_t | predicted_number_of_elements,
|  | std::size_t | predicted_number_of_nodes
| ) |  |
| explicit

Construct builder which will add triangles to the given `mesh`.

This constructor preallocate extra space for elements and nodes in `mesh`, which usually improves performance.

Parameters

  mesh | triangles destination
  predicted_number_of_elements | predicted (maximal) number of elements (triangles) to be added
  predicted_number_of_elements | predicted (maximal) number of nodes to be added

Definition at line 57 of file triangular2d.cpp.

## ◆ Builder() [3/3]

plask::TriangularMesh2D::Builder::Builder | ( | TriangularMesh2D & | mesh,
|  | std::size_t | predicted_number_of_elements
| ) |  |
| inline explicit

Construct builder which will add triangles to the given `mesh`.

This constructor preallocate extra space for elements and nodes (3*predicted_number_of_elements) in `mesh`, which usually improves performance.

Parameters

  mesh | triangles destination
  predicted_number_of_elements | predicted (maximal) number of elements to be added

Definition at line 221 of file triangular2d.hpp.

## ◆ ~Builder()

plask::TriangularMesh2D::Builder::~Builder | ( |  | ) |

Shrink to fit both: elements and nodes vectors of destination mesh.

Definition at line 64 of file triangular2d.cpp.

## Member Function Documentation

## ◆ add() [1/3]

Builder & plask::TriangularMesh2D::Builder::add | ( | const Element & | e | ) |
| inline

Add a triangle to the mesh.

Parameters

  e | a triangular element (from another mesh) which defines the triangle to add

Returns
  `*this`

Definition at line 239 of file triangular2d.hpp.

## ◆ add() [2/3]

Builder & plask::TriangularMesh2D::Builder::add | ( | const std::array< LocalCoords, 3 > & | points | ) |
| inline

Add a triangle to the mesh.

Parameters

  points | a coordinates of vertices of the triangle to add

Returns
  `*this`

Definition at line 246 of file triangular2d.hpp.

## ◆ add() [3/3]

Builder & plask::TriangularMesh2D::Builder::add | ( | LocalCoords | p1,
|  | LocalCoords | p2,
|  | LocalCoords | p3
| ) |  |

Add a triangle to the mesh.

Parameters

  p1,p2,p3 | coordinates of vertices of the triangle to add

Returns
  `*this`

## Member Data Documentation

## ◆ indexOfNode

std::map<LocalCoords, std::size_t> plask::TriangularMesh2D::Builder::indexOfNode

map nodes to their indexes in mesh.nodes vector

Definition at line 193 of file triangular2d.hpp.

## ◆ mesh

TriangularMesh2D& plask::TriangularMesh2D::Builder::mesh

destination mesh

Definition at line 194 of file triangular2d.hpp.

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

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