Documentation 6b54b78464
Loading...
Searching...
No Matches
su2_lut Namespace Reference

Classes

struct  TrapezoidalMap
 

Typedefs

using IntT = int32_t
 
using RealT = su2double
 
template<size_t N>
using MatrixNi = C2DContainer< unsigned long, IntT, StorageType::RowMajor, 64, DynamicSize, N >
 
using Matrix2i = MatrixNi< 2 >
 
using Matrix3i = MatrixNi< 3 >
 
using VectorInt = std::vector< IntT >
 
using VectorReal = std::vector< RealT >
 

Functions

void ReorderPoints (Matrix3i &triangles, VectorReal &x, VectorReal &y)
 Orders points by ascending x coordinates and updates triangle indices.
 
void ExtractEdges (const Matrix3i &triangles, Matrix2i &edge_pts, Matrix2i &edge_faces)
 Extracts unique edges from triangles. Edges are defined by two point IDs and up to two adjacent triangles (boundary edges have the second triangle ID < 0).
 
auto DetectBands (const VectorReal &x, IntT max_bands=0)
 Detects the x bands of the map. One band per unique x coordinate is used unless that would exceed max_bands, in which case equal-width bands are used to limit memory.
 
void BuildTrapezoidalMap (const Matrix2i &edge_pts, const VectorReal &x, const VectorReal &y, TrapezoidalMap &map)
 Builds the trapezoidal map for a set of edges (points must be ordered by x).
 
auto QueryTrapezoidalMap (const TrapezoidalMap &map, const Matrix2i &edge_pts, const VectorReal &x_coords, const VectorReal &y_coords, const RealT &x, const RealT &y)
 Returns the IDs of the edges directly below and above a query point (either ID can be -1 if the point is at a boundary).
 
auto AdjacentTriangles (const IntT edge_0, const IntT edge_1, const Matrix2i &edge_faces)
 Returns the IDs of the triangles adjacent to two query edges (up to 3 triangles).
 
auto TriangleCoords (const IntT i_tri, const Matrix3i &triangles, const VectorReal &x, const VectorReal &y, const RealT x_q, const RealT y_q)
 Computes the barycentric coordinates of point (x_q, y_q) in a triangle.
 
bool InTriangle (const std::array< RealT, 3 > &coords, const RealT tol=0.0)
 Checks if a point is inside a triangle based on its barycentric coordinates.
 
IntT FindTriangle (const TrapezoidalMap &map, const Matrix3i &triangles, const Matrix2i &edge_pts, const Matrix2i &edge_faces, const VectorReal &x, const VectorReal &y, const RealT x_q, const RealT y_q, std::array< RealT, 3 > &bary_out)
 Finds the triangle containing a point using the trapezoidal map.
 

Typedef Documentation

◆ IntT

using su2_lut::IntT = typedef int32_t

◆ Matrix2i

using su2_lut::Matrix2i = typedef MatrixNi<2>

◆ Matrix3i

using su2_lut::Matrix3i = typedef MatrixNi<3>

◆ MatrixNi

template<size_t N>
using su2_lut::MatrixNi = typedef C2DContainer<unsigned long, IntT, StorageType::RowMajor, 64, DynamicSize, N>

◆ RealT

using su2_lut::RealT = typedef su2double

◆ VectorInt

using su2_lut::VectorInt = typedef std::vector<IntT>

◆ VectorReal

using su2_lut::VectorReal = typedef std::vector<RealT>

Function Documentation

◆ AdjacentTriangles()

auto su2_lut::AdjacentTriangles ( const IntT  edge_0,
const IntT  edge_1,
const Matrix2i &  edge_faces 
)
inline

Returns the IDs of the triangles adjacent to two query edges (up to 3 triangles).

◆ BuildTrapezoidalMap()

void su2_lut::BuildTrapezoidalMap ( const Matrix2i &  edge_pts,
const VectorReal &  x,
const VectorReal &  y,
TrapezoidalMap &  map 
)
inline

Builds the trapezoidal map for a set of edges (points must be ordered by x).

◆ DetectBands()

auto su2_lut::DetectBands ( const VectorReal &  x,
IntT  max_bands = 0 
)
inline

Detects the x bands of the map. One band per unique x coordinate is used unless that would exceed max_bands, in which case equal-width bands are used to limit memory.

Returns
Tuple of (n_bands, x_bands).

◆ ExtractEdges()

void su2_lut::ExtractEdges ( const Matrix3i &  triangles,
Matrix2i &  edge_pts,
Matrix2i &  edge_faces 
)
inline

Extracts unique edges from triangles. Edges are defined by two point IDs and up to two adjacent triangles (boundary edges have the second triangle ID < 0).

◆ FindTriangle()

IntT su2_lut::FindTriangle ( const TrapezoidalMap &  map,
const Matrix3i &  triangles,
const Matrix2i &  edge_pts,
const Matrix2i &  edge_faces,
const VectorReal &  x,
const VectorReal &  y,
const RealT  x_q,
const RealT  y_q,
std::array< RealT, 3 > &  bary_out 
)
inline

Finds the triangle containing a point using the trapezoidal map.

◆ InTriangle()

bool su2_lut::InTriangle ( const std::array< RealT, 3 > &  coords,
const RealT  tol = 0.0 
)
inline

Checks if a point is inside a triangle based on its barycentric coordinates.

◆ QueryTrapezoidalMap()

auto su2_lut::QueryTrapezoidalMap ( const TrapezoidalMap &  map,
const Matrix2i &  edge_pts,
const VectorReal &  x_coords,
const VectorReal &  y_coords,
const RealT &  x,
const RealT &  y 
)
inline

Returns the IDs of the edges directly below and above a query point (either ID can be -1 if the point is at a boundary).

◆ ReorderPoints()

void su2_lut::ReorderPoints ( Matrix3i &  triangles,
VectorReal &  x,
VectorReal &  y 
)
inline

Orders points by ascending x coordinates and updates triangle indices.

◆ TriangleCoords()

auto su2_lut::TriangleCoords ( const IntT  i_tri,
const Matrix3i &  triangles,
const VectorReal &  x,
const VectorReal &  y,
const RealT  x_q,
const RealT  y_q 
)
inline

Computes the barycentric coordinates of point (x_q, y_q) in a triangle.