[dune-fem] Bug with PetscDiscreteFunction and CombinedDiscreteFunctionSpace

Tobias Malkmus tomalk at mathematik.uni-freiburg.de
Mon Dec 1 10:06:02 CET 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Andrea

The problem is the following:

The Petsc binding assumes that for continuous spaces the
localBlockSize is equal to the dimension of the range vectors. This is
not valid for a CombinedDiscreteFunctionSpace, build upon two
continuous discrete function spaces, (localBlockSize=1 and arbitrary
dimRange).

The part which fails in petsc is responsiable for the parallel data
structures of the underlaying petsc vector.

If you don't need the parallel part you can try to comment out the
lines 187 - 218 in the file
dune-fem/dune/fem/misc/petsc/petscdofmappings.hh to make it work (not
tested).

In parallel setting this is just not working at the moment.


Best Tobias

On 11/28/2014 06:35 PM, Sacconi, Andrea wrote:
> Hi dune-fem users,
> 
> I would like to ask you a question about Petsc and the usage of
> PetscDiscreteFunction with a CombinedDiscreteFunctionSpace. I
> attach a very simple test that fails. Here is the error message:
> 
> /usr/local_machine/dune-trunk/dune-fem/dune/fem/function/vectorfunction/vectorfunction.hh:135:
> Dune::Fem::VectorDiscreteFunction<DiscreteFunctionSpace,
> DofVector>::VectorDiscreteFunction(const string&, const
> DiscreteFunctionSpaceType&,
> Dune::Fem::VectorDiscreteFunction<DiscreteFunctionSpace,
> DofVector>::DofVectorType&) [with DiscreteFunctionSpace =
> Dune::Fem::LagrangeDiscreteFunctionSpace<Dune::Fem::FunctionSpace<double,
> double, 2, 1>, Dune::Fem::LeafGridPart<Dune::AlbertaGrid<1> >, 1>;
> DofVector = Dune::Fem::DynamicVector<int>; std::string =
> std::basic_string<char>;
> Dune::Fem::VectorDiscreteFunction<DiscreteFunctionSpace,
> DofVector>::DiscreteFunctionSpaceType =
> Dune::Fem::LagrangeDiscreteFunctionSpace<Dune::Fem::FunctionSpace<double,
> double, 2, 1>, Dune::Fem::LeafGridPart<Dune::AlbertaGrid<1> >, 1>;
> Dune::Fem::VectorDiscreteFunction<DiscreteFunctionSpace,
> DofVector>::DofVectorType = Dune::Fem::DynamicVector<int>]:
> Assertion `dofVector_->size() == (unsigned
> int)dfSpace.blockMapper().size() * DiscreteFunctionSpaceType ::
> localBlockSize' failed.
> 
> The combined space is made of a scalar and a vector (e.g., pressure
> and velocity for Stokes), but apparently in analysing the space I
> think the scalar one is taken as space, while constructing a
> Dune::Fem::VectorDiscreteFunction. Using grep, I found that it has
> something to do with petscdofmappings.hh and the call of
> ToNewDImRange<1>. For the combined space, I see from the trunk:
> 
> template< int newDimRange > struct ToNewDimRange { typedef typename
> conditional< (newDimRange == 1), typename
> DiscreteFunctionSpaceType1 :: template ToNewDimRange< 1 > :: Type, 
> typename BaseType :: template ToNewDimRange< newDimRange > :: Type
>> :: type Type;
> };
> 
> Why is there DiscreteFunctionSpaceType1? I suspect this could be a
> reason, but I have no idea how mappings, block sizes or other
> things are handled internally. Is there someone able to shed light
> on the matter?
> 
> Thanks in advance! Andrea 
> __________________________________________________________
> 
> Andrea Sacconi PhD student, Applied Mathematics AMMP Section,
> Department of Mathematics, Imperial College London, London SW7 2AZ,
> UK a.sacconi11 at imperial.ac.uk
> 
> 
> 
> _______________________________________________ dune-fem mailing
> list dune-fem at dune-project.org 
> http://lists.dune-project.org/mailman/listinfo/dune-fem
> 


- -- 
Tobias Malkmus                 <tomalk at mathematik.uni-freiburg.de>

Mathematisches Institut               Tel: +49 761 203 5627
Abt. für Angewandte Mathematik        Universität Freiburg
Hermann-Herder-Str. 10
79104 Freiburg

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJUfC96AAoJEBMY7DHvcWNggOQH/1H6GmfBEPtkDqfIPjvGYL7D
lLYPJfgYIYkBmuhcVoq4cYHI6pMcHdST+rqn7rYBqo+6HiDo+Mr++g5IxVCJh25h
vEC/H80JRe0zrUObCviin8cU0Mq7hLtker3TqRYaj2O+FjEoZqgtjOns3Q/JhKjV
KLXz5Hqbbx6pyPzZh8T4LReWrtksycbcg+6xhx81pYD6U509UpXtB6R89bKBUVdP
jqC+PEk4hKlpGyB3L33USFSiicPtcJqdWa50vL3FbRlDhg48jZT0s/odz2r8BVAf
QebyEethKmJCjNYGXx50/aMF5BH1gfs2+wihiOuszD8DQtg05o5gEGSlUVvVBqE=
=c+uh
-----END PGP SIGNATURE-----




More information about the dune-fem mailing list