Geometrical Points and Iteration
In this tutorial we investigate different element iteration mechanisms. Using the function domain.get_point(vertex) we can get instances of point type such as gsse::point. The first coordinate element can be accessed by point[0]. In analogy to the vertex_ on_cell_iterator we can also use edges. The following iterators can be used for this task.
![]() | vertex_on_cell_iterator
|
![]() | vertex_on_edge_iterator
|
![]() | cell_on_vertex_iterator
|
![]() | cell_on_edge_iterator
|
![]() | edge_on_cell_iterator
|
![]() | edge_on_vertex_iterator |
A simple template file can be found in: gsse/tutorials/lesson3/
Tasks
- L1: Create a quantity scalar and assign the value
, where
and
denote the coordinates of the respective vertex. - L1: Create a quantity vector and assign the value
, where
and
denote the coordinates of the respective vertex. - L1: Create a quantity edgedir which assigns each edge its distance vector.
- L2: Calculate the perimeter of the cell complex.
- L2: Calculate the Euler characteristics of the two-dimensional cell complex. estimate the maximum number of cells which can be formed by n vertices.
- L3: Create your own geometric point class. Implement all methods to accomplish the tasks from this tutorial,
Hints
- Edges can be traversed by nested iteration of cell_iterator and edge_on_cell_iterator.
- Determine if an edge is a boundary edge.
- en.wikipedia.org/wiki/Euler characteristic
- Note that some edges are not necessarily traversed only once.
