<div dir="ltr"><div>I had a look into it and I have found a lot more places that need fixing in the howto in this regard.<br><br></div>While doing so, I was wondering whether SGrid should vanish completely from the howto for 2.4. I think so, as deprecated features shouldnt be used for teaching IMO. Any objections?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 4, 2014 at 10:21 AM, Christoph Grüninger <span dir="ltr"><<a href="mailto:gruenich@dune-project.org" target="_blank">gruenich@dune-project.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">New commit, appeared at Sat Oct 4 10:21:33 2014 +0200<br>
as part of the following ref changes:<br>
<br>
branch refs/heads/master updated from 45c2ea1 -> 2f0a5d8<br>
<br>
Browsable version: <a href="http://cgit.dune-project.org/repositories/dune-grid-howto/commit/?id=2f0a5d8e4083ed26434d26392d91ca4ec79ec1b1" target="_blank">http://cgit.dune-project.org/repositories/dune-grid-howto/commit/?id=2f0a5d8e4083ed26434d26392d91ca4ec79ec1b1</a><br>
<br>
======================================================================<br>
<br>
commit 2f0a5d8e4083ed26434d26392d91ca4ec79ec1b1<br>
Author: Christoph Grüninger <<a href="mailto:gruenich@dune-project.org">gruenich@dune-project.org</a>><br>
Date: Sat Oct 4 10:21:20 2014 +0200<br>
<br>
[gettingstarted] Replace SGrid by YaspGrid.<br>
<br>
doc/grid-howto.tex | 41 +++++++++++++++++++++--------------------<br>
gettingstarted.cc | 20 ++++++++++----------<br>
2 files changed, 31 insertions(+), 30 deletions(-)<br>
<br>
<br>
<br>
diff --git a/doc/grid-howto.tex b/doc/grid-howto.tex<br>
index ffdeee5..5fb0de1 100644<br>
--- a/doc/grid-howto.tex<br>
+++ b/doc/grid-howto.tex<br>
@@ -1,5 +1,6 @@<br>
\documentclass[11pt,a4paper,headinclude,footinclude,DIV16,headings=normal]{scrreprt}<br>
\usepackage[automark]{scrpage2}<br>
+\usepackage{scrhack}<br>
\usepackage[ansinew]{inputenc}<br>
\usepackage{amsmath}<br>
\usepackage{amsfonts}<br>
@@ -312,7 +313,7 @@ the different classes before we go into the details.<br>
<br>
\section{Creating your first grid}<br>
<br>
-Let us start with a replacement of the famous ``hello world''<br>
+Let us start with a replacement of the famous \emph{hello world}<br>
program given below.<br>
<br>
\begin{lst}[File dune-grid-howto/gettingstarted.cc] \mbox{}<br>
@@ -326,8 +327,8 @@ produced by the \lstinline!configure! script in the application's<br>
build system. It contains the current configuration and can be used to<br>
compile different versions of your code depending on the configuration<br>
selected. It is important that this file is included before any other<br>
-\Dune{} header files. The next file \lstinline!dune/grid/sgrid.hh!<br>
-includes the headers for the \lstinline!SGrid! class which provides a<br>
+\Dune{} header files. The file \lstinline!dune/grid/yaspgrid.hh!<br>
+includes the headers for the \lstinline!YaspGrid! class which provides a<br>
special implementation of the \Dune{} grid interface with a<br>
structured mesh of arbitrary dimension. Then<br>
\lstinline!dune/grid/common/gridinfo.hh! loads the headers of some<br>
@@ -335,7 +336,7 @@ functions which print useful information about a grid.<br>
<br>
Since the dimension will be used as a template parameter in many<br>
places below we define it as a constant in line number \ref{gs:dim}.<br>
-The \lstinline!SGrid! class template takes two template parameters<br>
+The \lstinline!YaspGrid! class template takes two template parameters<br>
which are the dimension of the grid and the<br>
dimension of the space where the grid is embedded in (its world<br>
dimension). If the world dimension is strictly greater than the<br>
@@ -346,17 +347,16 @@ the selected value for the dimension. All identifiers of the \Dune{}<br>
framework are within the \lstinline!Dune! namespace.<br>
<br>
Lines \ref{gs:par0}-\ref{gs:par1} prepare the arguments for the<br>
-construction of an \lstinline!SGrid! object. These arguments use the<br>
-class template \lstinline!FieldVector<T,n>! which is a vector with<br>
+construction of a \lstinline!YaspGrid! object. The first argument use<br>
+the class template \lstinline!FieldVector<T,n>! which is a vector with<br>
\lstinline!n! components of type \lstinline!T!. You can either assign<br>
the same value to all components in the constructor (as is done here)<br>
or you could use \lstinline!operator[]! to assign values to individual<br>
-components. The variable \lstinline!N! defines the number of cells or<br>
-elements to be used in the respective dimension of the grid.<br>
-\lstinline!L! defines the coordinates of the lower left corner of the<br>
-cube and \lstinline!H! defines the coordinates of the upper right corner of the cube.<br>
+components. The variable \lstinline!length! defines the lengths of<br>
+the cube. The variable \lstinline!elements! defines the number of<br>
+cells or elements to be used in the respective dimension of the grid.<br>
Finally in line \ref{gs:grid} we are now able to<br>
-instantiate the \lstinline!SGrid! object.<br>
+instantiate the \lstinline!YaspGrid! object.<br>
<br>
The only thing we do with the grid in this little example is printing<br>
some information about it. After successfully running the executable<br>
@@ -365,14 +365,14 @@ some information about it. After successfully running the executable<br>
\begin{lst}[Output of gettingstarted] \mbox{}<br>
<br>
\begin{lstlisting}[basicstyle=\ttfamily\scriptsize]<br>
-=> SGrid(dim=3,dimworld=3)<br>
-level 0 codim[0]=27 codim[1]=108 codim[2]=144 codim[3]=64<br>
-leaf codim[0]=27 codim[1]=108 codim[2]=144 codim[3]=64<br>
-leaf dim=3 geomTypes=((cube,3)[0]=27,(cube,2)[1]=108,(cube,1)[2]=144,(cube,0)[3]=64)<br>
+=> Dune::YaspGrid<3, Dune::EquidistantCoordinates<double, 3> > (dim=3, dimworld=3)<br>
+level 0 codim[0]=64 codim[1]=240 codim[2]=300 codim[3]=125<br>
+leaf codim[0]=64 codim[1]=240 codim[2]=300 codim[3]=125<br>
+leaf dim=3 geomTypes=((cube, 3)[0]=64,(cube, 2)[1]=240,(simplex, 1)[2]=300,(simplex, 0)[3]=125)<br>
\end{lstlisting}<br>
\end{lst}<br>
<br>
-The first line tells you that you are looking at an \lstinline!SGrid!<br>
+The first line tells you that you are looking at an \lstinline!YaspGrid!<br>
object of the given dimensions. The \Dune{} grid interface supports<br>
unstructured, locally refined, logically nested grids. The coarsest<br>
grid is called level-0-grid or macro grid. Elements can be<br>
@@ -385,13 +385,14 @@ output tells us that this grid object consists only of a single level<br>
(level $0$) while the next line tells us that that level 0 coincides<br>
also with the leaf grid in this case. Each line reports about the<br>
number of grid entities which make up the grid. We see that there are<br>
-27 elements (codimension 0), 108 faces (codimension 1), 144 edges<br>
-(codimension 2) and 64 vertices (codimension 3) in the grid. The last<br>
+64 elements (codimension 0), 240 faces (codimension 1), 300 edges<br>
+(codimension 2) and 125 vertices (codimension 3) in the grid. The last<br>
line reports on the different types of entities making up the grid. In<br>
-this case all entities are of type ``cube''.<br>
+this case all entities are of type \emph{cube}, as a line and a point<br>
+are both \emph{cube} and \emph{simplex}.<br>
<br>
\begin{exc} Try to play around with different grid sizes by assigning<br>
- different values to the \lstinline!N! parameter. You can also change<br>
+ different values to the \lstinline!element! parameter. You can also change<br>
the dimension of the grid by varying \lstinline!dim!. Don't be<br>
modest. Also try dimensions 4 and 5!<br>
\end{exc}<br>
diff --git a/gettingstarted.cc b/gettingstarted.cc<br>
index 3379e1d..b4386b2 100644<br>
--- a/gettingstarted.cc<br>
+++ b/gettingstarted.cc<br>
@@ -1,13 +1,13 @@<br>
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-<br>
// vi: set et ts=4 sw=2 sts=2:<br>
-// $Id$<br>
<br>
// Dune includes<br>
-#include "config.h" // file constructed by ./configure script /*@\label{gs:inc0}@*/<br>
-#include <dune/grid/sgrid.hh> // load sgrid definition<br>
-#include <dune/grid/common/gridinfo.hh> // definition of gridinfo /*@\label{gs:inc1}@*/<br>
+#include <config.h> // file constructed by ./configure script /*@\label{gs:inc0}@*/<br>
+#include <array><br>
+#include <memory><br>
#include <dune/common/parallel/mpihelper.hh> // include mpi helper class<br>
-<br>
+#include <dune/grid/yaspgrid.hh> // load Yasp grid definition<br>
+#include <dune/grid/common/gridinfo.hh> // definition of gridinfo /*@\label{gs:inc1}@*/<br>
<br>
int main(int argc, char **argv)<br>
{<br>
@@ -18,11 +18,11 @@ int main(int argc, char **argv)<br>
try{<br>
// make a grid<br>
const int dim=3; /*@\label{gs:dim}@*/<br>
- typedef Dune::SGrid<dim,dim> GridType; /*@\label{gs:gridtype}@*/<br>
- Dune::FieldVector<int,dim> N(3); /*@\label{gs:par0}@*/<br>
- Dune::FieldVector<GridType::ctype,dim> L(-1.0);<br>
- Dune::FieldVector<GridType::ctype,dim> H(1.0); /*@\label{gs:par1}@*/<br>
- GridType grid(N,L,H); /*@\label{gs:grid}@*/<br>
+ typedef Dune::YaspGrid<dim> GridType; /*@\label{gs:gridtype}@*/<br>
+ Dune::FieldVector<double,dim> length(1.0); /*@\label{gs:par0}@*/<br>
+ std::array<int,dim> elements;<br>
+ std::fill(elements.begin(), elements.end(), 4); /*@\label{gs:par1}@*/<br>
+ GridType grid(length,elements); /*@\label{gs:grid}@*/<br>
<br>
// print some information about the grid<br>
Dune::gridinfo(grid);<br>
<br>
_______________________________________________<br>
Dune-Commit mailing list<br>
<a href="mailto:Dune-Commit@dune-project.org">Dune-Commit@dune-project.org</a><br>
<a href="http://lists.dune-project.org/mailman/listinfo/dune-commit" target="_blank">http://lists.dune-project.org/mailman/listinfo/dune-commit</a><br>
</blockquote></div><br></div>