[dune-pdelab] Question on space construction

Oliver Sander sander at igpm.rwth-aachen.de
Tue May 5 10:31:29 CEST 2015


Am 05.05.2015 um 09:26 schrieb Steffen Müthing:
> Hi Oliver,
> 
>> Am 05.05.2015 um 06:46 schrieb Oliver Sander <sander at igpm.rwth-aachen.de>:
>>
>> Dear pdelab team,
>> I have a question concerning the tree construction of FE spaces in pdelab.
>> In my problem,  I have two P1 FE spaces.  One is 3-valued, and the other one
>> is 5-valued.  What I want is the product space of the two, so I guess I should
>> use the CompositeGridFunctionSpace class.  However, I also want the resulting
>> stiffness matrix to be BCRSMatrix<FieldMatrix<double,8,8> >.
>> How do I do this?  Is this combination of blocking across a CompositeGFSpace
>> possible at all?
> 
> yes, that works. You just keep using the EntityBlockedOrderingTag and the
> ISTLVectorBackend with static blocking further up the tree (inside the CompositeGridFunctionSpace).
> 

Thanks Steffen,
I think I tried that, but it gives me an 'invalid blocking structure' static assertion failure.
Am I doing it right?  Find below my setup code and the complete error message.  Of course I'll
prepare a complete test case if that helps.
Thanks!



    // set up vector-valued finite element space
    typedef PDELab::QkLocalFiniteElementMap<GridView,double,double,1> FEM;
    FEM fem(grid.leafGridView());


	//this sets up FE Space with dimension 2

    typedef PDELab::VectorGridFunctionSpace<GridView,
                                            FEM,
                                            3,
                                            PDELab::ISTLVectorBackend<PDELab::ISTLParameters::static_blocking>,
                                            PDELab::ISTLVectorBackend<>,
                                            PDELab::ConformingDirichletConstraints,
                                            PDELab::EntityBlockedOrderingTag,
                                            PDELab::DefaultLeafOrderingTag
                                           > DisplacementGFS;

    DisplacementGFS displacementGFS(grid.leafGridView(), fem);
    displacementGFS.name("displacement");

    typedef PDELab::VectorGridFunctionSpace<GridView,
                                            FEM,
                                            5,
                                            PDELab::ISTLVectorBackend<PDELab::ISTLParameters::static_blocking>,
                                            PDELab::ISTLVectorBackend<>,
                                            PDELab::ConformingDirichletConstraints,
                                            PDELab::EntityBlockedOrderingTag,
                                            PDELab::DefaultLeafOrderingTag
                                           > PlasticStrainGFS;

    PlasticStrainGFS plasticStrainGFS(grid.leafGridView(), fem);
    plasticStrainGFS.name("plastic strain");

    //typedef Dune::PDELab::ISTLVectorBackend<Dune::PDELab::ISTLParameters::static_blocking, 2> VBE; //stimmt das wirklich?
    typedef Dune::PDELab::ISTLVectorBackend<PDELab::ISTLParameters::static_blocking> VBE; //stimmt das wirklich?
    typedef Dune::PDELab::CompositeGridFunctionSpace<VBE,PDELab::EntityBlockedOrderingTag,DisplacementGFS, PlasticStrainGFS> CompositeGFS;


In file included from /home/sander/dune/dune-pdelab/dune/pdelab/backend/istlvectorbackend.hh:13:0,
                 from /home/sander/dune/dune-plasticity/src/dune-plasticity.cc:18:
/home/sander/dune/dune-pdelab/dune/pdelab/backend/istl/vectorhelpers.hh: In instantiation of ‘struct
Dune::PDELab::istl::parent_child_vector_descriptor_data<Dune::PDELab::istl::combine_vector_descriptor_parent::reduce<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::leaf_vector_descriptor<double,
Dune::PDELab::ISTLVectorBackend<> >, Dune::PDELab::istl::leaf_vector_descriptor<double, Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::istl::leaf_vector_descriptor<double,
Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::istl::leaf_vector_descriptor<double, Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::istl::leaf_vector_descriptor<double,
Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u> >::type, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u,
2ul> >’:
/home/sander/dune/dune-pdelab/dune/pdelab/backend/istl/vectorhelpers.hh:343:14:   required from ‘struct
Dune::PDELab::istl::parent_child_vector_descriptor<Dune::PDELab::istl::parent_child_vector_descriptor_data<Dune::PDELab::istl::combine_vector_descriptor_parent::reduce<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::leaf_vector_descriptor<double,
Dune::PDELab::ISTLVectorBackend<> >, Dune::PDELab::istl::leaf_vector_descriptor<double, Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::istl::leaf_vector_descriptor<double,
Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::istl::leaf_vector_descriptor<double, Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::istl::leaf_vector_descriptor<double,
Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u> >::type, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u,
2ul> >, (Dune::PDELab::ISTLParameters::Blocking)2u>’
/home/sander/dune/dune-pdelab/dune/pdelab/backend/istl/vectorhelpers.hh:366:18:   required from ‘struct
Dune::PDELab::istl::combine_vector_descriptor_parent::reduce<Dune::PDELab::istl::combine_vector_descriptor_parent::reduce<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::cascading_vector_descriptor<Dune::PDELab::istl::leaf_vector_descriptor<double,
Dune::PDELab::ISTLVectorBackend<> >, Dune::PDELab::istl::leaf_vector_descriptor<double, Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::istl::leaf_vector_descriptor<double,
Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::istl::leaf_vector_descriptor<double, Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::istl::leaf_vector_descriptor<double,
Dune::PDELab::ISTLVectorBackend<> > >, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u> >::type, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u,
2ul> >::type’
/home/sander/dune/dune-pdelab/dune/pdelab/backend/istlvectorbackend.hh:321:85:   required from ‘struct
Dune::PDELab::ISTLVectorSelectorHelper<Dune::PDELab::CompositeGridFunctionSpace<Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 2ul>,
Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >,
(Dune::PartitionIteratorType)4u> >, Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >,
(Dune::PartitionIteratorType)4u> >, double, double, 1ul>, 3ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 1ul>,
Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)0u, 1ul>, Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag,
Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> >, Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2,
Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >, Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2,
Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >, double, double, 1ul>, 5ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 1ul>,
Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)0u, 1ul>, Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag,
Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> > >, double>’
/home/sander/dune/dune-pdelab/dune/pdelab/backend/istlvectorbackend.hh:326:12:   required from ‘struct
Dune::PDELab::BackendVectorSelectorHelper<Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 2ul>,
Dune::PDELab::CompositeGridFunctionSpace<Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 2ul>, Dune::PDELab::EntityBlockedOrderingTag,
Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >,
Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >, double,
double, 1ul>, 3ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 1ul>, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)0u, 1ul>,
Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> >,
Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >,
Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >, double,
double, 1ul>, 5ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 1ul>, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)0u, 1ul>,
Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> > >, double>’
/home/sander/dune/dune-pdelab/dune/pdelab/backend/backendselector.hh:14:97:   required from ‘struct
Dune::PDELab::BackendVectorSelector<Dune::PDELab::CompositeGridFunctionSpace<Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 2ul>, Dune::PDELab::EntityBlockedOrderingTag,
Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >,
Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >, double,
double, 1ul>, 3ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 1ul>, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)0u, 1ul>,
Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> >,
Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >,
Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >, double,
double, 1ul>, 5ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 1ul>, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)0u, 1ul>,
Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> > >, double>’
/home/sander/dune/dune-pdelab/dune/pdelab/gridoperator/gridoperator.hh:42:75:   required from ‘class
Dune::PDELab::GridOperator<Dune::PDELab::CompositeGridFunctionSpace<Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 2ul>, Dune::PDELab::EntityBlockedOrderingTag,
Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >,
Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >, double,
double, 1ul>, 3ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 1ul>, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)0u, 1ul>,
Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> >,
Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >,
Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >, double,
double, 1ul>, 5ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 1ul>, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)0u, 1ul>,
Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> > >,
Dune::PDELab::CompositeGridFunctionSpace<Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 2ul>, Dune::PDELab::EntityBlockedOrderingTag,
Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >,
Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >, double,
double, 1ul>, 3ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 1ul>, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)0u, 1ul>,
Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> >,
Dune::PDELab::VectorGridFunctionSpace<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >,
Dune::PDELab::QkLocalFiniteElementMap<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2, Dune::EquidistantCoordinates<double, 2> >, (Dune::PartitionIteratorType)4u> >, double,
double, 1ul>, 5ul, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)2u, 1ul>, Dune::PDELab::ISTLVectorBackend<(Dune::PDELab::ISTLParameters::Blocking)0u, 1ul>,
Dune::PDELab::ConformingDirichletConstraints, Dune::PDELab::EntityBlockedOrderingTag, Dune::PDELab::LeafOrderingTag<Dune::PDELab::DefaultLeafOrderingParams> > >,
Dune::PDELab::LinearPrimalPlasticity<StVenantKirchhoffParameters<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u> > > >,
Dune::PDELab::ISTLMatrixBackend, double, double, double>’
/home/sander/dune/dune-plasticity/src/dune-plasticity.cc:139:25:   required from here
/home/sander/dune/dune-pdelab/dune/pdelab/backend/istl/vectorhelpers.hh:282:9: error: static assertion failed: invalid blocking structure.
         static_assert((Backend::Traits::block_type != ISTLParameters::static_blocking) ||
         ^
src/CMakeFiles/dune-plasticity.dir/build.make:54: recipe for target 'src/CMakeFiles/dune-plasticity.dir/dune-plasticity.cc.o' failed
make[2]: *** [src/CMakeFiles/dune-plasticity.dir/dune-plasticity.cc.o] Error 1
CMakeFiles/Makefile2:1067: recipe for target 'src/CMakeFiles/dune-plasticity.dir/all' failed
make[1]: *** [src/CMakeFiles/dune-plasticity.dir/all] Error 2
Makefile:147: recipe for target 'all' failed
make: *** [all] Error 2
~/dune/dune-plasticity/build-cmake/src(

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20150505/257fba3c/attachment.sig>


More information about the dune-pdelab mailing list