Commit dc843811 by Dominic Kempf

### Briefly describe YaspGrids tensorproduct feature

parent 0b6a4fd1
 ... ... @@ -964,21 +964,33 @@ As already seen int he introduction, the code to construct a sequential \ YaspGrid grid(upper, n); \end{lstlisting} If you want to do the same for a sequential \lstinline!YaspGrid! the code is \begin{lstlisting} Dune::FieldVector n; n[0] = n[1] = 10; Dune::FieldVector upper; upper[0] = upper[1] = 1.0; Note that for an equidistant grid, you do not have to specify the lower left corner as \lstinline!YaspGrid! hardwires it to zero. This limitation can be overcome by using another feature of \lstinline!YaspGrid!: \lstinline!YaspGrid! can also be used a tensorproduct grid. A tensorproduct grid is defined by a set of coordinates $\{ x_{i,0}, \dots ,x_{i,n_i}\}$ for each direction $i$. The vertices of the grid are then given by the tuples \begin{displaymath} \{ (x_{0,i_0},\dots ,x_{d-1,i_{d-1}})\ \ with\ \ 0\leq i_j\leq n_j \ \ \forall j\} \end{displaymath} Such tensorproduct grid is a structured non-equidistant grid. Having a non-zero lower left corner is possible by specifying coordinates accordingly. \lstinline!YaspGrid!s tensorproduct features are enabled by using \lstinline!TensorProductCoordinates! as the second template paramter. Coordinates are given as as a \lstinline!Dune::array,dim>!. See the following example which initializes a grid is one cell, that covers $[-1,1]^2$: Dune::FieldVector periodic(false); \begin{lstlisting} Dune::array > coords; coords[0] = {-1., 1.}; coords[1] = {-1., 1.}; YaspGrid<2> grid(upper, n, periodic, 0); YaspGrid > grid(coords); \end{lstlisting} Note that you do not have to specify the lower left corner as \lstinline!YaspGrid! hardwires it to zero. The unstructured one-dimensional \lstinline!OneDGrid! also has a constructor Another unstructured is the one-dimensional \lstinline!OneDGrid!, which has a constructor \begin{lstlisting} OneDGrid grid(10, // number of elements 0.0, // left domain boundary ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!