preCICE v3.1.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
precice::mesh::Edge Class Reference

Linear edge of a mesh, defined by two Vertex objects. More...

#include <Edge.hpp>

Collaboration diagram for precice::mesh::Edge:
[legend]

Public Member Functions

 Edge (Vertex &vertexOne, Vertex &vertexTwo)
 Constructor.
 
int getDimensions () const
 Returns number of spatial dimensions (2 or 3) the edge is embedded to.
 
Vertexvertex (int i)
 Returns the edge's vertex with index 0 or 1.
 
const Vertexvertex (int i) const
 Returns the edge's vertex as const object with index 0 or 1.
 
double getLength () const
 Returns the length of the edge.
 
const Eigen::VectorXd getCenter () const
 Returns the center of the edge.
 
double getEnclosingRadius () const
 Returns the radius of the enclosing circle of the edge.
 
bool connectedTo (const Edge &other) const
 Checks whether both edges share a vertex.
 
bool operator== (const Edge &other) const
 Compares two Edges for equality.
 
bool operator!= (const Edge &other) const
 Not equal, implemented in terms of equal.
 
bool operator< (const Edge &other) const
 Weak ordering based on vertex ids.
 

Static Public Attributes

static constexpr int vertexCount {2}
 Amount of vertices.
 

Private Attributes

std::array< Vertex *, 2 > _vertices
 Pointers to Vertex objects defining the edge, ordered by Vertex::getID().
 

Detailed Description

Linear edge of a mesh, defined by two Vertex objects.

Definition at line 16 of file Edge.hpp.

Constructor & Destructor Documentation

◆ Edge()

precice::mesh::Edge::Edge ( Vertex & vertexOne,
Vertex & vertexTwo )

Constructor.

Parameters
[in]vertexOneFirst Vertex object defining the edge.
[in]vertexTwoSecond Vertex object defining the edge.

Definition at line 11 of file Edge.cpp.

Member Function Documentation

◆ connectedTo()

bool precice::mesh::Edge::connectedTo ( const Edge & other) const

Checks whether both edges share a vertex.

Definition at line 39 of file Edge.cpp.

◆ getCenter()

const Eigen::VectorXd precice::mesh::Edge::getCenter ( ) const

Returns the center of the edge.

Definition at line 29 of file Edge.cpp.

◆ getDimensions()

int precice::mesh::Edge::getDimensions ( ) const
inline

Returns number of spatial dimensions (2 or 3) the edge is embedded to.

Definition at line 91 of file Edge.hpp.

◆ getEnclosingRadius()

double precice::mesh::Edge::getEnclosingRadius ( ) const

Returns the radius of the enclosing circle of the edge.

Definition at line 34 of file Edge.cpp.

Here is the call graph for this function:

◆ getLength()

double precice::mesh::Edge::getLength ( ) const

Returns the length of the edge.

Definition at line 23 of file Edge.cpp.

◆ operator!=()

bool precice::mesh::Edge::operator!= ( const Edge & other) const

Not equal, implemented in terms of equal.

Definition at line 49 of file Edge.cpp.

◆ operator<()

bool precice::mesh::Edge::operator< ( const Edge & other) const
inline

Weak ordering based on vertex ids.

Definition at line 64 of file Edge.hpp.

Here is the call graph for this function:

◆ operator==()

bool precice::mesh::Edge::operator== ( const Edge & other) const

Compares two Edges for equality.

Two Edges are equal if the two vertices are equal, whereas the order of vertices is NOT important.

Definition at line 44 of file Edge.cpp.

Here is the call graph for this function:

◆ vertex() [1/2]

Vertex & precice::mesh::Edge::vertex ( int i)
inline

Returns the edge's vertex with index 0 or 1.

Definition at line 77 of file Edge.hpp.

◆ vertex() [2/2]

const Vertex & precice::mesh::Edge::vertex ( int i) const
inline

Returns the edge's vertex as const object with index 0 or 1.

Definition at line 84 of file Edge.hpp.

Member Data Documentation

◆ _vertices

std::array<Vertex *, 2> precice::mesh::Edge::_vertices
private

Pointers to Vertex objects defining the edge, ordered by Vertex::getID().

Definition at line 72 of file Edge.hpp.

◆ vertexCount

constexpr int precice::mesh::Edge::vertexCount {2}
staticconstexpr

Amount of vertices.

Definition at line 19 of file Edge.hpp.


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