Skip to content

Namespace ae108::meshing

Namespace List > ae108 > meshing

Create / manipulate mesh geometries. More...

Namespaces

Type Name
namespace cppgmsh

Classes

Type Name
struct BoundaryRepresentation <class SizeType_, class ValueType_, Dimension_>
struct BoundingBox <class Point>
struct MeshGeometry <class Point_, class Cell_>
Very light weight mesh class.

Public Functions

Type Name
BoundingBox< Point > bounding_box_of (const std::vector< Point > & points) noexcept
Returns the bounding box of points.
std::vector< std::array< double, Dimension > > construct_periodic_point_cloud (const std::array< std::array< double, Dimension >, Dimension > & translations, std::array< double, Dimension > origin, const std::vector< double > & set={-1, 0, 1}) noexcept
Returns a vector of points that is spanned by a set of discrete translations around the origin. It is also known as Bravais lattice.
std::tuple< std::vector< std::array< double, Dimension > >, std::vector< std::array< std::size_t, 2 > > > construct_rectilinear_grid (const std::array< std::vector< double >, Dimension > & coordinates) noexcept
Constructs a d-dimensional rectilinear grid based on the (non-)uniform input coordinates. Returns points and edges.
BoundaryRepresentation< SizeType, ValueType, Dimension > construct_voronoi_cell (const std::vector< std::array< ValueType, Dimension > > & point_cloud, std::vector< std::pair< SizeType, SizeType > > * periodic_faces=nullptr) noexcept
Returns the boundary representation of the Voronoi cell spanned by a point cloud around the origin. The Voronoi cell is defined as the locus of all points closer to the origin than to any other point in the point cloud.
MeshGeometry< std::array< double, 3 >, std::array< std::size_t, 8 > > generate_cuboid_mesh (const std::array< double, 3 > & size, const std::array< std::size_t, 3 > & granularity) noexcept
Creates a simple mesh of cuboid shape by splitting into smaller cuboids as defined by granularity .
MeshGeometry< std::array< double, 3 >, std::array< std::size_t, 10 > > generate_quadratic_tetrahedron_mesh (const std::array< double, 3 > & size, const std::array< std::size_t, 3 > & granularity) noexcept
Creates a simple mesh of cuboid shape. First the cuboid is split into smaller cuboids as defined by granularity . Each of these smaller cuboids is then split into 5 quadratic tetrehedra.
MeshGeometry< std::array< double, 2 >, std::array< std::size_t, 6 > > generate_quadratic_triangle_mesh (const std::array< double, 2 > & size, const std::array< std::size_t, 2 > & granularity) noexcept
Creates a simple triangulation of a rectangle. For instance, it creates the following triangulation for granularity [2, 1]:
MeshGeometry< std::array< double, 3 >, std::array< std::size_t, 4 > > generate_tetrahedron_mesh (const std::array< double, 3 > & size, const std::array< std::size_t, 3 > & granularity) noexcept
Creates a simple mesh of cuboid shape. First the cuboid is split into smaller cuboids as defined by granularity . Each of these smaller cuboids is then split into 5 tetrehedra.
MeshGeometry< std::array< double, 2 >, std::array< std::size_t, 3 > > generate_triangle_mesh (const std::array< double, 2 > & size, const std::array< std::size_t, 2 > & granularity) noexcept
Creates a simple triangulation of a rectangle. For instance, it creates the following triangulation for granularity [2, 1]:
MeshGeometry< Point_, Cell_ > refine_segment_mesh (const MeshGeometry< Point_, Cell_ > & mesh, const double max_segment_length) noexcept
Refines a given mesh of segments. Each segment is refined into smaller segments of equal length such that no segment is longer than max_segment_length .
MeshGeometry< Point_, Cell_ > refine_segment_mesh_by_n_divisions (const MeshGeometry< Point_, Cell_ > & mesh, std::size_t max_divisions) noexcept
Refines a given mesh of segments. Each segment is refined into smaller segments of equal length such that the longest original segment gets divided into max_divisions subsegments (of lengthmin_length ). Shorter segments will be refined inton <= max_divisions subsegments of equal length>= min_length forn as large as possible.
MeshGeometry< Point_, Cell_ > tessellate_mesh (const MeshGeometry< Point_, Cell_ > & mesh, const std::array< std::size_t, std::tuple_size< Point_ >{}> & grid_size, const double spatial_tolerance=1e-3)
Tessellate a unit cell of a mesh given by node positions and connectivity.

Detailed Description

Library for drafting mesh geometries to be fed into ae108::cpppetsc::Mesh.

Public Functions Documentation

function bounding_box_of

Returns the bounding box of points.

template<class Point>
BoundingBox < Point > ae108::meshing::bounding_box_of (
    const std::vector< Point > & points
) noexcept

Parameters:

  • points A vector of points.

function construct_periodic_point_cloud

Returns a vector of points that is spanned by a set of discrete translations around the origin. It is also known as Bravais lattice.

template<std::size_t Dimension>
std::vector< std::array< double, Dimension > > ae108::meshing::construct_periodic_point_cloud (
    const std::array< std::array< double, Dimension >, Dimension > & translations,
    std::array< double, Dimension > origin,
    const std::vector< double > & set={-1, 0, 1}
) noexcept

In 3D, each point is defined by where ai is a translation vector and ni assumes any of the integers in set.

Parameters:

  • translations An array containing the translation vectors.
  • origin Location of the origin.
  • set A set of integer permutations

Note:

https://en.wikipedia.org/wiki/Bravais_lattice


function construct_rectilinear_grid

Constructs a d-dimensional rectilinear grid based on the (non-)uniform input coordinates. Returns points and edges.

template<std::size_t Dimension>
std::tuple< std::vector< std::array< double, Dimension > >, std::vector< std::array< std::size_t, 2 > > > ae108::meshing::construct_rectilinear_grid (
    const std::array< std::vector< double >, Dimension > & coordinates
) noexcept

Parameters:

  • coordinates d sets of coordinates that span the grid.

Note:

https://en.wikipedia.org/wiki/Regular_grid


function construct_voronoi_cell

Returns the boundary representation of the Voronoi cell spanned by a point cloud around the origin. The Voronoi cell is defined as the locus of all points closer to the origin than to any other point in the point cloud.

template<class SizeType, class ValueType, SizeType Dimension>
BoundaryRepresentation < SizeType, ValueType, Dimension > ae108::meshing::construct_voronoi_cell (
    const std::vector< std::array< ValueType, Dimension > > & point_cloud,
    std::vector< std::pair< SizeType, SizeType > > * periodic_faces=nullptr
) noexcept

Parameters:

  • point_cloud A vector of points, a.k.a. sites, forming the point cloud.
  • periodic_faces A vector containing all periodic face pairs.

Note:

https://en.wikipedia.org/wiki/Voronoi_diagram


function generate_cuboid_mesh

Creates a simple mesh of cuboid shape by splitting into smaller cuboids as defined by granularity .

MeshGeometry < std::array< double, 3 >, std::array< std::size_t, 8 > > ae108::meshing::generate_cuboid_mesh (
    const std::array< double, 3 > & size,
    const std::array< std::size_t, 3 > & granularity
) noexcept

Parameters:

  • size The vertex of the cuboid that is opposite to [0., 0., 0.].
  • granularity The number of cuboids along the three axes.

function generate_quadratic_tetrahedron_mesh

Creates a simple mesh of cuboid shape. First the cuboid is split into smaller cuboids as defined by granularity . Each of these smaller cuboids is then split into 5 quadratic tetrehedra.

MeshGeometry < std::array< double, 3 >, std::array< std::size_t, 10 > > ae108::meshing::generate_quadratic_tetrahedron_mesh (
    const std::array< double, 3 > & size,
    const std::array< std::size_t, 3 > & granularity
) noexcept

Parameters:

  • size The vertex of the cuboid that is opposite to [0., 0., 0.].
  • granularity The number of quintets of tetrahedra along the three axes.

function generate_quadratic_triangle_mesh

Creates a simple triangulation of a rectangle. For instance, it creates the following triangulation for granularity [2, 1]:

MeshGeometry < std::array< double, 2 >, std::array< std::size_t, 6 > > ae108::meshing::generate_quadratic_triangle_mesh (
    const std::array< double, 2 > & size,
    const std::array< std::size_t, 2 > & granularity
) noexcept

----* * \ | \ | ----*

The function generates quadratic triangles. In particular, it uses the following order for the nodes:

2 | \ 5 4 | \ 031

Parameters:

  • size The top-right coordinate of the rectangle. The bottom-left coordinate of the rectangle is [0., 0.].
  • granularity The number of pairs of triangles along the two axes.

function generate_tetrahedron_mesh

Creates a simple mesh of cuboid shape. First the cuboid is split into smaller cuboids as defined by granularity . Each of these smaller cuboids is then split into 5 tetrehedra.

MeshGeometry < std::array< double, 3 >, std::array< std::size_t, 4 > > ae108::meshing::generate_tetrahedron_mesh (
    const std::array< double, 3 > & size,
    const std::array< std::size_t, 3 > & granularity
) noexcept

Parameters:

  • size The vertex of the cuboid that is opposite to [0., 0., 0.].
  • granularity The number of quintets of tetrahedra along the three axes.

function generate_triangle_mesh

Creates a simple triangulation of a rectangle. For instance, it creates the following triangulation for granularity [2, 1]:

MeshGeometry < std::array< double, 2 >, std::array< std::size_t, 3 > > ae108::meshing::generate_triangle_mesh (
    const std::array< double, 2 > & size,
    const std::array< std::size_t, 2 > & granularity
) noexcept

----* * \ | \ | ----*

Parameters:

  • size The top-right coordinate of the rectangle. The bottom-left coordinate of the rectangle is [0., 0.].
  • granularity The number of pairs of triangles along the two axes.

function refine_segment_mesh

Refines a given mesh of segments. Each segment is refined into smaller segments of equal length such that no segment is longer than max_segment_length .

template<class Point_, class Cell_>
MeshGeometry < Point_, Cell_ > ae108::meshing::refine_segment_mesh (
    const MeshGeometry < Point_, Cell_ > & mesh,
    const double max_segment_length
) noexcept

Parameters:

  • mesh The unrefined segment mesh.
  • max_segment_length The maximum allowed segment length.

function refine_segment_mesh_by_n_divisions

Refines a given mesh of segments. Each segment is refined into smaller segments of equal length such that the longest original segment gets divided into max_divisions subsegments (of lengthmin_length ). Shorter segments will be refined inton <= max_divisions subsegments of equal length>= min_length forn as large as possible.

template<class Point_, class Cell_>
MeshGeometry < Point_, Cell_ > ae108::meshing::refine_segment_mesh_by_n_divisions (
    const MeshGeometry < Point_, Cell_ > & mesh,
    std::size_t max_divisions
) noexcept

Parameters:

  • mesh The unrefined segment mesh.
  • max_divisions The maximum allowed number of subsegments.

function tessellate_mesh

Tessellate a unit cell of a mesh given by node positions and connectivity.

template<class Point_, class Cell_>
MeshGeometry < Point_, Cell_ > ae108::meshing::tessellate_mesh (
    const MeshGeometry < Point_, Cell_ > & mesh,
    const std::array< std::size_t, std::tuple_size< Point_ >{}> & grid_size,
    const double spatial_tolerance=1e-3
) 



The documentation for this class was generated from the following file meshing/src/include/ae108/meshing/BoundaryRepresentation.h