FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Functions
Fiber::RegularTopology Namespace Reference

A collection of functions to compute topological properties. More...

Functions

template<Dims_t Dims>
index_t NumberOfEdges (const MultiIndex< Dims > &NumberOfVertices) throw ()
 Compute the number of edges on a regular grid that consists of the given number of vertices.
 
template<Dims_t Dims>
int EdgeOrientation (index_t EdgeIndex, const MultiIndex< Dims > &NumberOfVertices)
 Compute the orientation of a given edge index in a regular grid, given the number of vertices in the grid.
 
template<Dims_t Dims>
void ComputeFirstEdgeVertex (MultiIndex< Dims > &FirstVertex, int &Orientation, index_t EdgeIndex, const MultiIndex< Dims > &NumberOfVertices)
 Given a linear index of an edge (the edge ID) and the multidimensional number of vertices, compute the multidimensional indices of the corresponding vertice of the edge, and the orientation of this edge.
 
template<Dims_t Dims>
MultiIndex< Dims > ComputeSecondEdgeVertex (const MultiIndex< Dims > &Vertex, int Orientation) throw ()
 Given the vertex of an edge and an orientation (0,1,2), return the second vertex of the given edge.
 
template<Dims_t Dims>
std::pair< MultiIndex< Dims >, MultiIndex< Dims > > ComputeEdgeVertices (index_t EdgeIndex, const MultiIndex< Dims > &NumberOfVertices)
 Compute the both vertices that correspond to a certain edge, where the edge is linearly numbered over all edges of a multidimensional regular grid.
 
template<Dims_t Dims>
index_t ComputeEdgeIDfromVertexAndOrientation (const MultiIndex< Dims > &Vertex, int Orientation, const MultiIndex< Dims > &NumberOfVertices)
 Given a vertex and an orientation (i.e.
 

Detailed Description

A collection of functions to compute topological properties.

Function Documentation

◆ ComputeEdgeIDfromVertexAndOrientation()

template<Dims_t Dims>
index_t Fiber::RegularTopology::ComputeEdgeIDfromVertexAndOrientation ( const MultiIndex< Dims > &  Vertex,
int  Orientation,
const MultiIndex< Dims > &  NumberOfVertices 
)
inline

Given a vertex and an orientation (i.e.

the axis in which an edge points, compute the linear ID of the corresponding edge.

Second vertex of edge is given by

index_t BitIndex() const
From this given multiindex which is supposed to have index values of either 0 or 1 in each direction,...
Definition MultiIndex.hpp:489
Convenience class to provide an input slot for selection a coordinate orientation along the X,...
Definition XYZOrientation.hpp:17

where 0 < Orientation < 3

Parameters
NumberOfVerticesThe multidimensional number of vertices.
Exceptions
Throwsan integer if the vertex does not fit into the given number of vertices, or the orientation does not match, or similar.

References Fiber::MultiIndex< Dims >::Axis().

Referenced by Fiber::ComputeInterpolationEdgeAndWeight().

◆ ComputeEdgeVertices()

template<Dims_t Dims>
std::pair< MultiIndex< Dims >, MultiIndex< Dims > > Fiber::RegularTopology::ComputeEdgeVertices ( index_t  EdgeIndex,
const MultiIndex< Dims > &  NumberOfVertices 
)
inline

Compute the both vertices that correspond to a certain edge, where the edge is linearly numbered over all edges of a multidimensional regular grid.

Parameters
EdgeIndexThe linear index of the edge, must be smaller than NumberOfEdges( NumberOfVertices )
Exceptions
Aninteger is thrown if the EdgeIndex is too large.

References ComputeFirstEdgeVertex(), and ComputeSecondEdgeVertex().

Referenced by Fiber::EvalVertexFieldOnEdges().

◆ ComputeFirstEdgeVertex()

template<Dims_t Dims>
void Fiber::RegularTopology::ComputeFirstEdgeVertex ( MultiIndex< Dims > &  FirstVertex,
int Orientation,
index_t  EdgeIndex,
const MultiIndex< Dims > &  NumberOfVertices 
)

Given a linear index of an edge (the edge ID) and the multidimensional number of vertices, compute the multidimensional indices of the corresponding vertice of the edge, and the orientation of this edge.

Parameters
EdgeIndexThe linear number of the edge, must be smaller than NumberOfEdges( NumberOfVertices )
NumberOfVerticesHow many vertices are there?
FirstVertexOutput parameter, on return will contain the first vertex
OrientationThe number of the axis along which this edge is oriented.
Exceptions
Aninteger of value -1 is thrown if the edge index is beyond the possible range of edges.

References Fiber::MultiIndex< Dims >::Axis().

Referenced by ComputeEdgeVertices().

◆ ComputeSecondEdgeVertex()

template<Dims_t Dims>
MultiIndex< Dims > Fiber::RegularTopology::ComputeSecondEdgeVertex ( const MultiIndex< Dims > &  Vertex,
int  Orientation 
)
throw (
)
inline

Given the vertex of an edge and an orientation (0,1,2), return the second vertex of the given edge.

This the second edge is computed by adding the BitIndex along the given orientation to the vertex.

Parameters
VertexThe vertex where the edge starts.
OrientationThe number of the given dimension, must be positive or null. The result will be undefined if the Orientation equals the dimension or is larger. 0 <= Orientation < Dims

References Fiber::MultiIndex< Dims >::BitIndex().

Referenced by ComputeEdgeVertices().

◆ EdgeOrientation()

template<Dims_t Dims>
int Fiber::RegularTopology::EdgeOrientation ( index_t  EdgeIndex,
const MultiIndex< Dims > &  NumberOfVertices 
)
inline

Compute the orientation of a given edge index in a regular grid, given the number of vertices in the grid.

Edges are ordered by orientation, first come all those oriented in the lowest dimension, then second, last those in the highest dimension. In a cube, all four edges in the x-direction are the first four, the second four are those aligned in y-direction, and the last four are those in z-direction.

Exceptions
Throwsan integer of value -1 if the edge index is beyond the possible vertices.

References Fiber::MultiIndex< Dims >::Axis(), and size().

Referenced by Fiber::ComputeInterpolationEdgeAndWeight().