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

Class defining a mesh with triangle elements. More...

#include <triangle_mesh.hpp>

+ Inheritance diagram for bem::TriangleMesh< dim >:

Detailed Description

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

Class defining a mesh with triangle elements.

Template Parameters
dim- The dimension of the mesh (2 or 3).

Definition at line 39 of file triangle_mesh.hpp.

Constructor & Destructor Documentation

◆ TriangleMesh() [1/3]

template<uint8_t dim>
bem::TriangleMesh< dim >::TriangleMesh ( )
inline

Constructs an empty TriangleMesh.

Definition at line 51 of file triangle_mesh.hpp.

◆ TriangleMesh() [2/3]

template<uint8_t dim>
bem::TriangleMesh< dim >::TriangleMesh ( ConstEigRef< EigMatNX< Float, dim > >  verts,
ConstEigRef< EigMatNX< Index, 3 > >  elems,
const bool  decoupled_edges = false 
)
inline

Constructs a TriangleMesh with given vertex and element data.

Parameters
[in]verts- Coordinates of the mesh vertices.
[in]elems- Element-wise triplets of vertex indices.
[in]decoupled_edges- If true, edges are unique to each element (optional).

Definition at line 60 of file triangle_mesh.hpp.

◆ TriangleMesh() [3/3]

template<uint8_t dim>
bem::TriangleMesh< dim >::TriangleMesh ( ConstEigRef< EigMatNX< Float, dim > >  verts,
ConstEigRef< EigMatNX< Index, 3 > >  elems,
ConstEigRef< EigRowVec< Index > >  elem_tags,
const bool  decoupled_edges = false 
)
inline

Constructs a TriangleMesh with given vertex and element data, and element tags.

Parameters
[in]verts- Coordinates of the mesh vertices.
[in]elems- Element-wise triplets of vertex indices.
[in]elem_tags- Element-wise tags.
[in]decoupled_edges- If true, edges are unique to each element (optional).

Elements that have the same tag are considered to be part of the same region, for the purpose of defining edges. I.e., an edge between two elements is formed only if they have the same tag.

Definition at line 83 of file triangle_mesh.hpp.

Member Function Documentation

◆ set_data()

template<uint8_t dim>
void bem::TriangleMesh< dim >::set_data ( ConstEigRef< EigMatNX< Float, dim > >  verts,
ConstEigRef< EigMatNX< Index, 3 > >  elems,
ConstEigRef< EigRowVec< Index > >  elem_tags,
const bool  decoupled_edges = false 
)

Sets the mesh data.

Parameters
[in]verts- Coordinates of the mesh vertices.
[in]elems- Element-wise triplets of vertex indices.
[in]elem_tags- Element-wise tags.
[in]decoupled_edges- If true, edges are unique to each element (optional).

Elements that have the same tag are considered to be part of the same region, for the purpose of defining edges. I.e., an edge between two elements is formed only if they have the same tag.

Definition at line 36 of file triangle_mesh.cpp.

◆ edges() [1/3]

template<uint8_t dim>
const EigMatNX< Index, 2 > & bem::TriangleMesh< dim >::edges ( ) const
inline

Returns index pairs of vertices of each edge in the mesh.

Returns
Edge-wise pairs of vertex indices.

Definition at line 118 of file triangle_mesh.hpp.

◆ edges() [2/3]

template<uint8_t dim>
EigColVecN< Index, 2 > bem::TriangleMesh< dim >::edges ( Index  idx) const
inline

Returns the vertex indices of a specific edge.

Parameters
[in]idx- Index of the edge.
Returns
Vertex indices of the specified edge.

Definition at line 127 of file triangle_mesh.hpp.

◆ edges() [3/3]

template<uint8_t dim>
Index bem::TriangleMesh< dim >::edges ( uint8_t  vert,
Index  edge 
) const
inline

Returns the index of a specific vertex of a specific edge.

Parameters
[in]vert- Vertex index (0 or 1).
[in]edge- Index of the edge.
Returns
Index of the specified vertex of the specified edge.

Definition at line 137 of file triangle_mesh.hpp.

◆ elem_edges() [1/3]

template<uint8_t dim>
const EigMatNX< Index, 3 > & bem::TriangleMesh< dim >::elem_edges ( ) const
inline

Returns the edge indices of each element in the mesh.

Returns
Element-wise triplets of edge indices.

Definition at line 145 of file triangle_mesh.hpp.

◆ elem_edges() [2/3]

template<uint8_t dim>
EigColVecN< Index, 3 > bem::TriangleMesh< dim >::elem_edges ( Index  idx) const
inline

Returns the edge indices of a specific element.

Parameters
[in]idx- Index of the element.
Returns
Edge indices of the specified element.

Definition at line 154 of file triangle_mesh.hpp.

◆ elem_edges() [3/3]

template<uint8_t dim>
Index bem::TriangleMesh< dim >::elem_edges ( uint8_t  edge,
Index  elem 
) const
inline

Returns the index of a specific edge of a specific element.

Parameters
[in]edge- Edge index (0, 1, or 2).
[in]elem- Index of the element.
Returns
Index of the specified edge of the specified element.

Definition at line 164 of file triangle_mesh.hpp.

◆ elem_edge_polarities() [1/3]

template<uint8_t dim>
const EigMatNX< Float, 3 > & bem::TriangleMesh< dim >::elem_edge_polarities ( ) const
inline

Returns the polarities of the edges of each element.

Returns
Element-wise triplets of edge polarities.

Definition at line 172 of file triangle_mesh.hpp.

◆ elem_edge_polarities() [2/3]

template<uint8_t dim>
EigColVecN< Float, 3 > bem::TriangleMesh< dim >::elem_edge_polarities ( Index  idx) const
inline

Returns the polarities of the edges of a specific element.

Parameters
[in]idx- Index of the element.
Returns
Polarities of the edges of the specified element.

Definition at line 181 of file triangle_mesh.hpp.

◆ elem_edge_polarities() [3/3]

template<uint8_t dim>
Float bem::TriangleMesh< dim >::elem_edge_polarities ( uint8_t  edge,
Index  elem 
) const
inline

Returns the polarity of a specific edge of a specific element.

Parameters
[in]edge- Edge index (0, 1, or 2).
[in]elem- Index of the element.
Returns
Polarity of the specified edge of the specified element.

Definition at line 191 of file triangle_mesh.hpp.

◆ boundary_elems()

template<uint8_t dim>
const EigRowVec< Index > & bem::TriangleMesh< dim >::boundary_elems ( ) const
inline

Returns the indices of boundary elements in the mesh.

Returns
Indices of boundary elements.

Definition at line 199 of file triangle_mesh.hpp.

◆ junction_elems()

template<uint8_t dim>
const EigRowVec< Index > & bem::TriangleMesh< dim >::junction_elems ( ) const
inline

Returns the indices of junction elements in the mesh.

Returns
Indices of junction elements.

Definition at line 207 of file triangle_mesh.hpp.

◆ internal_elems()

template<uint8_t dim>
const EigRowVec< Index > & bem::TriangleMesh< dim >::internal_elems ( ) const
inline

Returns the indices of internal elements in the mesh.

Returns
Indices of internal elements.

Definition at line 215 of file triangle_mesh.hpp.

◆ boundary_edges()

template<uint8_t dim>
const EigRowVec< Index > & bem::TriangleMesh< dim >::boundary_edges ( ) const
inline

Returns the indices of boundary edges in the mesh.

Returns
Indices of boundary edges.

Definition at line 223 of file triangle_mesh.hpp.

◆ junction_edges()

template<uint8_t dim>
const EigRowVec< Index > & bem::TriangleMesh< dim >::junction_edges ( ) const
inline

Returns the indices of junction edges in the mesh.

Returns
Indices of junction edges.

Definition at line 231 of file triangle_mesh.hpp.

◆ internal_edges()

template<uint8_t dim>
const EigRowVec< Index > & bem::TriangleMesh< dim >::internal_edges ( ) const
inline

Returns the indices of internal edges in the mesh.

Returns
Indices of internal edges.

Definition at line 239 of file triangle_mesh.hpp.

◆ num_edges()

template<uint8_t dim>
Index bem::TriangleMesh< dim >::num_edges ( ) const
inline

Returns the number of edges in the mesh.

Returns
Number of edges.

Definition at line 247 of file triangle_mesh.hpp.

◆ partition_by_elems() [1/2]

template<uint8_t dim>
void bem::TriangleMesh< dim >::partition_by_elems ( MeshBase< dim, 3 > &  partition,
ConstEigRef< EigRowVec< Index > >  elem_inds 
) const

Returns a sub-mesh that contains only specified elements of this mesh.

Parameters
[out]partition- Partitioned mesh object containing the specified elements.
[in]elem_inds- Indices of elements to keep in the sub-mesh.

Definition at line 53 of file triangle_mesh.cpp.

◆ partition_by_bbox()

template<uint8_t dim>
void bem::TriangleMesh< dim >::partition_by_bbox ( MeshBase< dim, 3 > &  partition,
ConstEigRef< EigMatMN< Float, dim, 2 > >  bbox,
const bool  strict = true 
) const

Returns a sub-mesh that contains only elements of this mesh that lie within a given bounding box.

Parameters
[out]partition- Partitioned mesh object containing elements within the given bounding box.
[in]bbox- Bounding box defined by two corners (min and max).
[in]strict- If true, only elements fully contained within the bounding box are included (optional).

Definition at line 102 of file triangle_mesh.cpp.

◆ elem_primitive()

template<uint8_t dim>
Triangle< dim > bem::TriangleMesh< dim >::elem_primitive ( Index  elem) const
inline

Returns a Triangle primitive object representing a specific element of the mesh.

Parameters
[in]elem- Index of the element.
Returns
Triangle object representing the specified element.

Definition at line 280 of file triangle_mesh.hpp.

◆ reverse_orientation()

template<uint8_t dim>
virtual void bem::TriangleMesh< dim >::reverse_orientation ( )
inlinevirtual

Reverses the orientation of each element.

Reimplemented from bem::MeshBase< dim, 3 >.

Definition at line 292 of file triangle_mesh.hpp.

◆ generate_edges()

template<uint8_t dim>
void bem::TriangleMesh< dim >::generate_edges ( )
protected

Generates edges for the mesh based on element vertices.

Edges are generated tag-wise. Tags represent distinct mesh regions, and edges cannot be associated with two elements that belong to different mesh regions. For example, if two mesh regions are in contact with one another, each region will have its own edges, rather than creating artificial junctions at the point of contact.

Definition at line 150 of file triangle_mesh.cpp.

◆ verts() [1/2]

const EigMatNX< Float, dim > & bem::MeshBase< dim, verts_per_elem >::verts ( ) const
inlineinherited

Returns the coordinates of the mesh vertices.

Returns
Vertex coordinates.

Definition at line 51 of file base.hpp.

◆ verts() [2/2]

EigColVecN< Float, dim > bem::MeshBase< dim, verts_per_elem >::verts ( Index  vert) const
inlineinherited

Returns the coordinates of a specific vertex.

Parameters
[in]vert- Vertex index.
Returns
Coordinates of the vertex.

Definition at line 60 of file base.hpp.

◆ elems() [1/3]

const EigMatNX< Index, verts_per_elem > & bem::MeshBase< dim, verts_per_elem >::elems ( ) const
inlineinherited

Returns the vertex indices of each element.

Returns
Element-wise triplets of vertex indices.

Definition at line 68 of file base.hpp.

◆ elems() [2/3]

EigColVecN< Index, 3 > bem::MeshBase< dim, verts_per_elem >::elems ( Index  elem) const
inlineinherited

Returns the vertex indices of a specific element.

Parameters
[in]elem- Element index.
Returns
Vertex indices of the element.

Definition at line 77 of file base.hpp.

◆ elems() [3/3]

Index bem::MeshBase< dim, verts_per_elem >::elems ( uint8_t  vert,
Index  elem 
) const
inlineinherited

Returns the index of a specific vertex of a specific element.

Parameters
[in]vert- Vertex index.
[in]elem- Element index.
Returns
Index of the specified vertex in the specified element.

Definition at line 87 of file base.hpp.

◆ elem_tags() [1/2]

const EigRowVec< Index > & bem::MeshBase< dim, verts_per_elem >::elem_tags ( ) const
inlineinherited

Returns the element tags.

Returns
Element-wise tags.

Elements that have the same tag are considered to be part of the same region, for the purpose of defining edges. I.e., an edge between two elements is formed only if they have the same tag.

Definition at line 99 of file base.hpp.

◆ elem_tags() [2/2]

Index bem::MeshBase< dim, verts_per_elem >::elem_tags ( Index  elem) const
inlineinherited

Returns the tag associated with a specified element.

Returns
Element tag.

Elements that have the same tag are considered to be part of the same region, for the purpose of defining edges. I.e., an edge between two elements is formed only if they have the same tag.

Definition at line 111 of file base.hpp.

◆ num_verts()

Index bem::MeshBase< dim, verts_per_elem >::num_verts ( ) const
inlineinherited

Returns the number of vertices in the mesh.

Returns
Number of vertices.

Definition at line 119 of file base.hpp.

◆ num_elems()

Index bem::MeshBase< dim, verts_per_elem >::num_elems ( ) const
inlineinherited

Returns the number of elements in the mesh.

Returns
Number of elements.

Definition at line 127 of file base.hpp.

◆ partition_by_elems() [2/2]

virtual void bem::MeshBase< dim, verts_per_elem >::partition_by_elems ( MeshBase< dim, verts_per_elem > &  partition,
ConstEigRef< EigRowVec< Index > >  elem_inds 
) const
pure virtualinherited

Returns a sub-mesh that contains only specified elements of this mesh.

Parameters
[out]partition- Partitioned mesh object containing the specified elements.
[in]elem_inds- Indices of elements to keep in the sub-mesh.

◆ elem_centroids()

EigMatNX< Float, dim > bem::MeshBase< dim, verts_per_elem >::elem_centroids ( ) const
inlineinherited

Computes and returns the centroid of each element.

Returns
Element-wise centroids.

Definition at line 146 of file base.hpp.

Member Data Documentation

◆ decoupled_edges_

template<uint8_t dim>
bool bem::TriangleMesh< dim >::decoupled_edges_ = false
protected

Definition at line 313 of file triangle_mesh.hpp.

◆ edges_

template<uint8_t dim>
EigMatNX<Index, 2> bem::TriangleMesh< dim >::edges_
protected

Definition at line 315 of file triangle_mesh.hpp.

◆ elem_edges_

template<uint8_t dim>
EigMatNX<Index, 3> bem::TriangleMesh< dim >::elem_edges_
protected

Definition at line 316 of file triangle_mesh.hpp.

◆ elem_edge_polarities_

template<uint8_t dim>
EigMatNX<Float, 3> bem::TriangleMesh< dim >::elem_edge_polarities_
protected

Definition at line 317 of file triangle_mesh.hpp.

◆ boundary_elems_

template<uint8_t dim>
EigRowVec<Index> bem::TriangleMesh< dim >::boundary_elems_
protected

Definition at line 319 of file triangle_mesh.hpp.

◆ junction_elems_

template<uint8_t dim>
EigRowVec<Index> bem::TriangleMesh< dim >::junction_elems_
protected

Definition at line 320 of file triangle_mesh.hpp.

◆ internal_elems_

template<uint8_t dim>
EigRowVec<Index> bem::TriangleMesh< dim >::internal_elems_
protected

Definition at line 321 of file triangle_mesh.hpp.

◆ boundary_edges_

template<uint8_t dim>
EigRowVec<Index> bem::TriangleMesh< dim >::boundary_edges_
protected

Definition at line 323 of file triangle_mesh.hpp.

◆ junction_edges_

template<uint8_t dim>
EigRowVec<Index> bem::TriangleMesh< dim >::junction_edges_
protected

Definition at line 324 of file triangle_mesh.hpp.

◆ internal_edges_

template<uint8_t dim>
EigRowVec<Index> bem::TriangleMesh< dim >::internal_edges_
protected

Definition at line 325 of file triangle_mesh.hpp.

◆ verts_

EigMatNX<Float, dim> bem::MeshBase< dim, verts_per_elem >::verts_
protectedinherited

Definition at line 172 of file base.hpp.

◆ elems_

EigMatNX<Index, verts_per_elem> bem::MeshBase< dim, verts_per_elem >::elems_
protectedinherited

Definition at line 173 of file base.hpp.

◆ elem_tags_

EigRowVec<Index> bem::MeshBase< dim, verts_per_elem >::elem_tags_
protectedinherited

Definition at line 174 of file base.hpp.


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