Classes for constructing a geometrical and topological entity, the Grid object. More...
Chart objects represent coordinate systems and spatial domains where they are valid.
Classes for constructing a geometrical and topological entity, the Grid object.
typedef WeakPtr<BaseSpace> Representer |
index_t Fiber::RegularTopology::ComputeEdgeIDfromVertexAndOrientation | ( | const MultiIndex< Dims > & | Vertex, | |
int | Orientation, | |||
const MultiIndex< Dims > & | NumberOfVertices | |||
) | throw (int) [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
Vertex + MultiIndex<3>::BitIndex( 1 << Orientation )
where 0 < Orientation < 3
NumberOfVertices | The multidimensional number of vertices. |
Throws | an 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 >::size().
std::pair<MultiIndex<Dims>, MultiIndex<Dims> > Fiber::RegularTopology::ComputeEdgeVertices | ( | index_t | EdgeIndex, | |
const MultiIndex< Dims > & | NumberOfVertices | |||
) | throw (int) [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.
EdgeIndex | The linear index of the edge, must be smaller than NumberOfEdges( NumberOfVertices ) |
An | integer is thrown if the EdgeIndex is too large. |
References Fiber::RegularTopology::ComputeFirstEdgeVertex(), and Fiber::RegularTopology::ComputeSecondEdgeVertex().
void Fiber::RegularTopology::ComputeFirstEdgeVertex | ( | MultiIndex< Dims > & | FirstVertex, | |
int & | Orientation, | |||
index_t | EdgeIndex, | |||
const MultiIndex< Dims > & | NumberOfVertices | |||
) | throw (int) [inline] |
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.
EdgeIndex | The linear number of the edge, must be smaller than NumberOfEdges( NumberOfVertices ) | |
NumberOfVertices | How many vertices are there? | |
FirstVertex | Output parameter, on return will contain the first vertex | |
Orientation | The number of the axis along which this edge is oriented. |
An | integer of value -1 is thrown if the edge index is beyond the possible range of edges. |
References Fiber::MultiIndex< Dims >::size().
Referenced by Fiber::RegularTopology::ComputeEdgeVertices().
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.
Vertex | The vertex where the edge starts. | |
Orientation | The 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 |
Referenced by Fiber::RegularTopology::ComputeEdgeVertices().
int Fiber::RegularTopology::EdgeOrientation | ( | index_t | EdgeIndex, | |
const MultiIndex< Dims > & | NumberOfVertices | |||
) | throw (int) [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.
Throws | an integer of value -1 if the edge index is beyond the possible vertices. |