OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
bem::GeometryOps< dim > Class Template Reference

Geometry operations class. More...

#include <operations.hpp>

Detailed Description

template<uint8_t dim>
class bem::GeometryOps< dim >

Geometry operations class.

Template Parameters
dim- The dimension of the geometry operation class (1, 2, or 3).

Definition at line 46 of file operations.hpp.

Member Function Documentation

◆ polar_to_cartesian()

template<uint8_t dim>
EigMatNX< Float, dim > bem::GeometryOps< dim >::polar_to_cartesian ( ConstEigRef< EigMatNX< Float, dim > >  points)
static

Transforms polar (2D) or spherical (3D) coordinates to Cartesian.

Parameters
[in]points- Polar ( \(r\), \(\phi\)) or spherical ( \(r\), \(\phi\), \(\theta\)) coordinates.
Returns
Cartesian coordinates.

Definition at line 34 of file operations.cpp.

◆ cartesian_to_polar_field()

template<uint8_t dim>
EigMatNX< Complex, dim > bem::GeometryOps< dim >::cartesian_to_polar_field ( ConstEigRef< EigMatNX< Float, dim > >  points,
ConstEigRef< EigMatNX< Complex, dim > >  field 
)
static

Transforms a vector field in Cartesian space to polar (2D) or spherical (3D) space.

Parameters
[in]points- Cartesian coordinates at which the field is defined.
[in]field- Vector field values at the given coordinates.
Returns
Vector field in polar ( \(r\), \(\phi\)) or spherical ( \(r\), \(\phi\), \(\theta\)) coordinates.

Definition at line 53 of file operations.cpp.

◆ transform_coordinate_system()

template<uint8_t dim>
EigMatNX< Float, dim > bem::GeometryOps< dim >::transform_coordinate_system ( ConstEigRef< EigMatNX< Float, dim > >  v_in,
ConstEigRef< EigColVecN< Float, dim > >  new_origin,
ConstEigRef< EigMatMN< Float, dim, dim > >  new_uvw 
)
static

Transforms the given coordinates to a new coordinate system defined by a new origin and orthogonal unit vectors.

Parameters
[in]v_in- Coordinates in the original system.
[in]new_origin- Origin of the new system with respect to the original system.
[in]new_uvw- Orthogonal unit vectors for the new system with respect to the original system.
Returns
Transformed coordinates in the new system.

Definition at line 103 of file operations.cpp.

◆ angle_between_vectors()

template<uint8_t dim>
EigRowVec< Float > bem::GeometryOps< dim >::angle_between_vectors ( ConstEigRef< EigMatNX< Float, dim > >  v1,
ConstEigRef< EigMatNX< Float, dim > >  v2 
)
static

Returns the angles between pairs of vectors in radians.

Parameters
[in]v1- First set of vectors.
[in]v2- Second set of vectors.
Returns
Angles between each pair of vectors in radians.

Definition at line 114 of file operations.cpp.

◆ directed_angle_between_vectors()

template<uint8_t dim>
EigRowVec< Float > bem::GeometryOps< dim >::directed_angle_between_vectors ( ConstEigRef< EigMatNX< Float, dim > >  v1,
ConstEigRef< EigMatNX< Float, dim > >  v2 
)
static

Returns the directional angles between pairs of vectors in a right-hand system where counter-clockwise angles are positive.

Parameters
[in]v1- First set of vectors.
[in]v2- Second set of vectors.
Returns
Directed angles between each pair of vectors in radians.

Definition at line 136 of file operations.cpp.

◆ common_vertices() [1/2]

template<uint8_t dim>
uint8_t bem::GeometryOps< dim >::common_vertices ( const Triangle< dim > &  triangle1,
const Triangle< dim > &  triangle2,
const Float  tol = GEOMETRY_DEFAULT_TOL 
)
static

Returns the number of vertices common or coinciding between two Triangle objects.

Parameters
[in]triangle1- First triangle.
[in]triangle2- Second triangle.
[in]tol- Comparison tolerance to test if vertices coincide (optional).
Returns
Number of vertices common or coinciding between the two triangles.

Definition at line 173 of file operations.cpp.

◆ common_vertices() [2/2]

template<uint8_t dim>
uint8_t bem::GeometryOps< dim >::common_vertices ( EigRef< EigColVecN< Index, 3 > >  idx1,
EigRef< EigColVecN< Index, 3 > >  idx2,
const Triangle< dim > &  triangle1,
const Triangle< dim > &  triangle2,
const Float  tol = GEOMETRY_DEFAULT_TOL 
)
static

Returns the number and indices of vertices common or coinciding between two Triangle objects.

Parameters
[out]idx1- Indices of common vertices for the first triangle.
[out]idx2- Indices of common vertices for the second triangle.
[in]triangle1- First triangle.
[in]triangle2- Second triangle.
[in]tol- Comparison tolerance to test if vertices coincide (optional).
Returns
Number of vertices common or coinciding between the two triangles.

For N common vertices, the first N entries of idx1 and idx2 are populated with common indices of the vertices; the rest are dummy values filled with 10. If there are no common vertices, then idx1 and idx2 will contain 10 in each entry. In the case that one or more vertex does coincide, then the entries of idx1 and idx2 are ordered so that there is a one-to-one correspondence, e.g., the idx1[0] vertex of triangle1 coincides with the idx2[0] vertex of triangle2.

Definition at line 201 of file operations.cpp.

◆ check_parallel_triangles()

template<uint8_t dim>
int8_t bem::GeometryOps< dim >::check_parallel_triangles ( const Triangle< 3 > &  triangle1,
const Triangle< 3 > &  triangle2,
const Float  tol = GEOMETRY_DEFAULT_TOL 
)
static

Checks if the normal vectors of two triangles are (anti-)parallel.

Parameters
[in]triangle1- First Triangle.
[in]triangle2- Second Triangle.
[in]tol- Comparison tolerance (optional).
Returns
0 if not parallel, 1 if parallel, -1 if anti-parallel.

Definition at line 235 of file operations.cpp.

◆ check_perpendicular_triangles()

template<uint8_t dim>
bool bem::GeometryOps< dim >::check_perpendicular_triangles ( const Triangle< 3 > &  triangle1,
const Triangle< 3 > &  triangle2,
const Float  tol = GEOMETRY_DEFAULT_TOL 
)
static

Checks if the normal vectors of two triangles are perpendicular.

Parameters
[in]triangle1- First Triangle.
[in]triangle2- Second Triangle.
[in]tol- Comparison tolerance (optional).
Returns
True if the triangles are perpendicular, false otherwise.

Definition at line 251 of file operations.cpp.

◆ check_coplanar_triangles()

template<uint8_t dim>
bool bem::GeometryOps< dim >::check_coplanar_triangles ( const Triangle< 3 > &  triangle1,
const Triangle< 3 > &  triangle2,
const Float  tol = GEOMETRY_DEFAULT_TOL 
)
static

Checks if two triangles are coplanar.

Parameters
[in]triangle1- First Triangle.
[in]triangle2- Second Triangle.
[in]tol- Comparison tolerance (optional).
Returns
True if the triangles are coplanar, false otherwise.

Definition at line 265 of file operations.cpp.

◆ check_parallel_edges()

template<uint8_t dim>
int8_t bem::GeometryOps< dim >::check_parallel_edges ( const Edge< dim > &  edge1,
const Edge< dim > &  edge2,
const Float  tol = GEOMETRY_DEFAULT_TOL 
)
static

Checks if two edges are (anti-)parallel.

Parameters
[in]edge1- First Edge.
[in]edge2- Second Edge.
[in]tol- Comparison tolerance (optional).
Returns
0 if not parallel, 1 if parallel, -1 if anti-parallel.

Definition at line 283 of file operations.cpp.

◆ check_perpendicular_edges()

template<uint8_t dim>
bool bem::GeometryOps< dim >::check_perpendicular_edges ( const Edge< dim > &  edge1,
const Edge< dim > &  edge2,
const Float  tol = GEOMETRY_DEFAULT_TOL 
)
static

Checks if two edges are perpendicular.

Parameters
[in]edge1- First Edge.
[in]edge2- Second Edge.
[in]tol- Comparison tolerance (optional).
Returns
True if the edges are perpendicular, false otherwise.

Definition at line 298 of file operations.cpp.

◆ point_in_polygon()

template<uint8_t dim>
bool bem::GeometryOps< dim >::point_in_polygon ( ConstEigRef< EigColVecN< Float, dim > > &  point,
ConstEigRef< EigMatNX< Float, dim > > &  polygon,
const Float  tol = GEOMETRY_DEFAULT_TOL 
)
static

Checks if a point is inside a polygon using ray casting.

Parameters
[in]point- Point to test.
[in]polygon- Polygon vertices.
[in]tol- Relative tolerance for comparison (optional).

Reference: https://www.eecs.umich.edu/courses/eecs380/HANDOUTS/PROJ2/InsidePoly.html

Definition at line 311 of file operations.cpp.


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