[dune-pdelab] More constructors for ISTL***Container [patch]

Christian Engwer christian.engwer at uni-muenster.de
Sat May 3 22:03:39 CEST 2014


Thanks! patch applied

Christian

On Sat, May 03, 2014 at 08:16:50AM +0200, Oliver Sander wrote:
> Dear PDELab,
> please find attached two small patches for the ISTL backend.
> They add new constructors for the matrix and vector containers
> that allow to use containers with pre-existing matrices and vectors.
> Please consider those for inclusion into pdelab master.
> Thanks,
> Oliver

> From f2f0453b652c87daeb07b5845be7c66a950a0420 Mon Sep 17 00:00:00 2001
> From: Oliver Sander <sander at igpm.rwth-aachen.de>
> Date: Sat, 3 May 2014 06:49:31 +0200
> Subject: [PATCH 1/2] Add constructor for a given GridOperator and ISTL matrix
> 
> ---
>  dune/pdelab/backend/istlmatrixbackend.hh | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/dune/pdelab/backend/istlmatrixbackend.hh b/dune/pdelab/backend/istlmatrixbackend.hh
> index 124dc78..ffaed32 100644
> --- a/dune/pdelab/backend/istlmatrixbackend.hh
> +++ b/dune/pdelab/backend/istlmatrixbackend.hh
> @@ -95,6 +95,22 @@ namespace Dune {
>          _stats = go.matrixBackend().buildPattern(go,*this);
>        }
>  
> +      /** \brief Construct matrix container using an externally given matrix as storage
> +       *
> +       * \tparam GO GridOperator type used to assemble into the matrix
> +       *
> +       * \param go GridOperator object used to assemble into the matrix
> +       * \param container ISTL matrix type that stores the actual data
> +       *
> +       * This ISTLMatrixContainer constructor will reassemble the matrix occupation pattern.
> +       */
> +      template<typename GO>
> +      ISTLMatrixContainer (const GO& go, Container& container)
> +        : _container(Dune::stackobject_to_shared_ptr(container))
> +      {
> +        _stats = go.matrixBackend().buildPattern(go,*this);
> +      }
> +
>        template<typename GO>
>        ISTLMatrixContainer (const GO& go, const E& e)
>          : _container(make_shared<Container>())
> -- 
> 1.9.2
> 

> From 8d305eabb6e457f3a03b6b20a801e29fd4a66898 Mon Sep 17 00:00:00 2001
> From: Oliver Sander <sander at igpm.rwth-aachen.de>
> Date: Sat, 3 May 2014 06:50:22 +0200
> Subject: [PATCH 2/2] Add constructor for a given GridFunctionSpace and ISTL
>  vector
> 
> ---
>  dune/pdelab/backend/istlvectorbackend.hh | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/dune/pdelab/backend/istlvectorbackend.hh b/dune/pdelab/backend/istlvectorbackend.hh
> index 4cad556..2c311e1 100644
> --- a/dune/pdelab/backend/istlvectorbackend.hh
> +++ b/dune/pdelab/backend/istlvectorbackend.hh
> @@ -101,6 +101,19 @@ namespace Dune {
>          : _gfs(gfs)
>        {}
>  
> +      /** \brief Constructs an ISTLBlockVectorContainer for an explicitly given vector object
> +       *
> +       * \param gfs GridFunctionSpace that determines the size and the blocking of the vector
> +       * \param container The actual ISTL container class
> +       */
> +      ISTLBlockVectorContainer (const GFS& gfs, Container& container)
> +        : _gfs(gfs)
> +        , _container(stackobject_to_shared_ptr(container))
> +      {
> +        _container->resize(gfs.ordering().blockCount());
> +        istl::dispatch_vector_allocation(gfs.ordering(),*_container,typename GFS::Ordering::ContainerAllocationTag());
> +      }
> +
>        ISTLBlockVectorContainer (const GFS& gfs, const E& e)
>          : _gfs(gfs)
>          , _container(make_shared<Container>(gfs.ordering().blockCount()))
> -- 
> 1.9.2
> 




> _______________________________________________
> dune-pdelab mailing list
> dune-pdelab at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-pdelab


-- 
Prof. Dr. Christian Engwer 
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster

E-Mail	christian.engwer at uni-muenster.de
Telefon	+49 251 83-35067
FAX		+49 251 83-32729




More information about the dune-pdelab mailing list