[Dune-devel] [Dune-Commit] [Commit] dune-grid - 4c01c85: [cleanup][vtktest] Construct the grid using initializer lists similar as in subsamplingvtktest.

Markus Blatt markus at dr-blatt.de
Tue Mar 31 12:12:40 CEST 2015


On Thu, Mar 19, 2015 at 12:13:27AM +0100, Jö Fahlke wrote:
> New commit, appeared at Thu Mar 19 00:13:27 2015 +0100
> as part of the following ref changes:
> 
>     branch refs/heads/master    updated from b91b5f0 -> c5e7a95
> 
> Browsable version: http://cgit.dune-project.org/repositories/dune-grid/commit/?id=4c01c85bb033e5f1cdf9e363d54c091328a28716
> 
> ======================================================================
> 
> commit 4c01c85bb033e5f1cdf9e363d54c091328a28716
> Author: Jö Fahlke <jorrit at jorrit.de>
> Date:   Wed Mar 18 22:23:15 2015 +0100
> 
>     [cleanup][vtktest] Construct the grid using initializer lists similar as in
>     subsamplingvtktest.
>     
>     subsamplingvtktest and vtktest are obviously clones that have diverged.  This
>     is part of an effort to transfer improvements made in one to the other.
> 
>  dune/grid/io/file/test/vtktest.cc | 20 ++++++--------------
>  1 file changed, 6 insertions(+), 14 deletions(-)
> 
> 
> 
> diff --git a/dune/grid/io/file/test/vtktest.cc b/dune/grid/io/file/test/vtktest.cc
> index b9e33eb..d2de878 100644
> --- a/dune/grid/io/file/test/vtktest.cc
> +++ b/dune/grid/io/file/test/vtktest.cc
> @@ -129,15 +129,10 @@ int doWrite( const GridView &gridView, Dune :: VTK :: DataMode dm )
>  }
>  
>  template<int dim>
> -int vtkCheck(int* n, double* h)
> +int vtkCheck(const Dune::array<int, dim>& elements,
> +              const Dune::FieldVector<double, dim>& upperRight)
>  {
> -  typedef Dune::YaspGrid<dim> Grid;
> -  Dune::FieldVector<typename Grid::ctype, dim> L(0);
> -  std::copy(h, h+dim, L.begin());
> -  Dune::array<int, dim> s;
> -  std::copy(n, n+dim, s.begin());
> -
> -  Dune::YaspGrid<dim> g(L, s, std::bitset<dim>(), 0);
> +  Dune::YaspGrid<dim> g(upperRight, elements);
>  
>    if(g.comm().rank() == 0)
>      std::cout << std::endl
> @@ -172,14 +167,11 @@ int main(int argc, char **argv)
>        std::cout << "vtktest: MPI_Comm_size == " << mpiHelper.size()
>                  << std::endl;
>  
> -    int n[] = { 5, 5, 5, 5 };
> -    double h[] = { 1.0, 2.0, 3.0, 4.0 };
> -
>      int result = 0; // pass by default
>  
> -    acc(result, vtkCheck<1>(n,h));
> -    acc(result, vtkCheck<2>(n,h));
> -    acc(result, vtkCheck<3>(n,h));
> +    acc(result, vtkCheck<1>({5}, {1.0}));
> +    acc(result, vtkCheck<2>({5,5}, {1.0, 2.0}));
> +    acc(result, vtkCheck<3>({5,5,5}, {1.0, 2.0, 3.0}));

Please be aware that this causes a lot of trouble for gcc-4.4, see 
<http://lists.dune-project.org/pipermail/dune-devel/2015-March/001326.html>

Markus

-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20150331/c4affbad/attachment.sig>


More information about the Dune-devel mailing list