[dune-fem] Bug with PetscDiscreteFunction and CombinedDiscreteFunctionSpace

Sacconi, Andrea a.sacconi11 at imperial.ac.uk
Fri Nov 28 18:35:13 CET 2014


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dune_testPetscCombined.cc
Type: text/x-c++src
Size: 3321 bytes
Desc: dune_testPetscCombined.cc
URL: <https://lists.dune-project.org/pipermail/dune-fem/attachments/20141128/70baec48/attachment.cc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mesh.msh.tar.gz
Type: application/gzip
Size: 5073 bytes
Desc: mesh.msh.tar.gz
URL: <https://lists.dune-project.org/pipermail/dune-fem/attachments/20141128/70baec48/attachment.gz>


More information about the dune-fem mailing list