[dune-pdelab] [dune-pdelab-commit] dune-pdelab r1054 - in trunk/dune/pdelab: finiteelementmap gridfunctionspace

Felix Heimann felix.heimann at iwr.uni-heidelberg.de
Fri Feb 11 11:35:03 CET 2011


Hi Christian, hi PDElab users,

simply reverting the patch will again lead to completely undefined
behavior of these functions for non-trivial block vectors. Instead, I
would propose to let the VectorContainer from the StdVectorBackend
export a BlockSize = 1 . Are there better ideas, objections? Otherwise,
I'll make the corresponding adjustments, to get PDElab in a stable state
again.

Best, Felix

Am Freitag, den 11.02.2011, 10:51 +0100 schrieb
christi at conan.iwr.uni-heidelberg.de:
> Author: christi
> Date: Fri Feb 11 10:51:25 2011
> New Revision: 1054
> URL: http://svn.dune-project.org/websvn/listing.php?repname=dune-pdelab&path=/&rev=1054&sc=1
> 
> Log:
> Revert Felix quick-fix, it broke all code _not_ using a BlockVector
> 
> Modified:
>    trunk/dune/pdelab/finiteelementmap/p1fem.hh   (props changed)
>    trunk/dune/pdelab/finiteelementmap/q1fem.hh   (props changed)
>    trunk/dune/pdelab/gridfunctionspace/constraints.hh
> 
> Modified: trunk/dune/pdelab/gridfunctionspace/constraints.hh
> ==============================================================================
> --- trunk/dune/pdelab/gridfunctionspace/constraints.hh	Mon Feb  7 12:02:05 2011	(r1053)
> +++ trunk/dune/pdelab/gridfunctionspace/constraints.hh	Fri Feb 11 10:51:25 2011	(r1054)
> @@ -605,15 +605,9 @@
>      void set_nonconstrained_dofs (const CG& cg, typename XG::ElementType x, XG& xg)
>      {
>        typedef typename XG::Backend B;
> -      for (typename XG::size_type i=0; i<xg.size(); ++i){
> -
> -        for (typename XG::size_type j=0; j < B::BlockSize; ++j){
> -          const typename XG::size_type flat_index = i * B::BlockSize + j;
> -          if (cg.find(flat_index)==cg.end())
> -            B::access(xg,flat_index) = x;
> -        }
> -
> -      }
> +      for (typename XG::size_type i=0; i<xg.size(); ++i)
> +        if (cg.find(i)==cg.end())
> +          B::access(xg,i) = x;
>  	}
>  
>      // construct constraints from given boundary condition function
> @@ -626,16 +620,9 @@
>      void copy_nonconstrained_dofs (const CG& cg, const XG& xgin, XG& xgout)
>      {
>        typedef typename XG::Backend B;
> -      for (typename XG::size_type i=0; i<xgin.size(); ++i){
> -
> -
> -        for (typename XG::size_type j=0; j < B::BlockSize; ++j){
> -          const typename XG::size_type flat_index = i * B::BlockSize + j;
> -          if (cg.find(flat_index)==cg.end())
> -            B::access(xgout,flat_index) = B::access(xgin,flat_index);
> -        }
> -
> -      }
> +      for (typename XG::size_type i=0; i<xgin.size(); ++i)
> +        if (cg.find(i)==cg.end())
> +          B::access(xgout,i) = B::access(xgin,i);
>  	}
>  
>      // construct constraints from given boundary condition function
> @@ -650,13 +637,9 @@
>        typedef typename XG::Backend B;
>  	  typedef typename CG::const_iterator global_col_iterator;
>        for (typename XG::size_type i=0; i<xg.size(); ++i){
> -
> -        for (typename XG::size_type j=0; j < B::BlockSize; ++j){
> -          const typename XG::size_type flat_index = i * B::BlockSize + j;
> -          global_col_iterator it = cg.find(flat_index);
> -          if (it == cg.end() || it->second.size() > 0)
> -            B::access(xg,flat_index) = x;
> -        }
> +        global_col_iterator it = cg.find(i);
> +        if (it == cg.end() || it->second.size() > 0)
> +          B::access(xg,i) = x;
>        }
>  	}
>  
> 
> _______________________________________________
> dune-pdelab-commit mailing list
> dune-pdelab-commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-pdelab-commit

-- 
Felix Heimann
Universität Heidelberg
Interdisziplinäres Zentrum für Wissenschaftliches Rechnen
Arbeitsgruppe Paralleles Rechnen
IWR 368, Raum 422
Tel: 06221 / 54 8881





More information about the dune-pdelab mailing list