[dune-pdelab] accumulate of LocalVector

Bernd Flemisch bernd at iws.uni-stuttgart.de
Mon Aug 20 14:34:23 CEST 2012


Hey Steffen,

thank you for the fast and helpful answer. Indeed, I overlooked that I 
reimplement the jacobian_volume method where I explicitly use a 
LocalVector to call the residual methods. That caused the warnings.

Kind regards
Bernd

On 08/20/2012 02:18 PM, Steffen Müthing wrote:
> Hi Bernd,
>
> Am 20.08.2012 um 14:01 schrieb Bernd Flemisch:
>
>> Dear PDELab,
>>
>> I am using the 1.0 release. I get warnings like
>> ../../../dumux/boxmodels/linearelasticity/2p/el2plocaloperator.hh:453:33: warning: 'void Dune::PDELab::LocalVector<T, LFSFlavorTag, W>::accumulate(const LFS&, Dune::PDELab::LocalVector<T, LFSFlavorTag, W>::size_type, Dune::PDELab::LocalVector<T, LFSFlavorTag, W>::value_type) [with LFS = Dune::PDELab::LeafLocalFunctionSpaceNode<Dune::PDELab::GridFunctionSpace<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::ALUCubeGrid<3, 3>, (Dune::PartitionIteratorType)4u> >, Dune::PDELab::Q1LocalFiniteElementMap<double, double, 3>, Dune::PDELab::NoConstraints, Dune::PDELab::ISTLVectorBackend<1>, Dune::PDELab::GridFunctionGeneralMapper>, Dune::PDELab::MultiIndex<long unsigned int, 3u> >, T = double, LFSFlavorTag = Dune::PDELab::AnySpaceTag, W = double, Dune::PDELab::LocalVector<T, LFSFlavorTag, W>::size_type = long unsigned int, Dune::PDELab::LocalVector<T, LFSFlavorTag, W>::value_type = double]' is deprecated (declared at /temp/bernd/DUMUX22/dune-pdelab/dune/pdelab/gridfunctionspace/localvector.hh:349) [-Wdeprecated-declarations]
>>
>>  From taking a look at gridfunctionspace/localvector.hh, I would think that I should use the accumulate method of the WeightedVectorAccumulationView rather than of the LocalVector. However, I do not know how to enforce this, also not by comparing with non-warning producing tests. Can you please help me? I am using the types given in the message above and also listed below.
> hmm, that's strange. Did you create the LocalVector yourself, or is it an object that the GridOperator passed to your LocalOperator?
> Because in that case you shouldn't get a warning... ;-)
>
> If you created the LocalVector yourself, you can just extract an AccumulationView using the nested type LocalVector::WeightedAccumulationView
> and the member method localVector.weightedAccumulationView(double). The double parameter is the weight that will be applied to the accumulated
> entries (just set it to 1 if you don't need it). For an example of this mechanism in action take a look at dune/pdelab/localoperator/defaultimp.hh. The
> numerical differentiation code in there creates its own residual vectors from the jacobian passed in by the GridOperator, wraps them in
> WeightedAccumulationViews and passes those on to the alpha_*() methods of the LocalOperator.
>
> By the way, you also don't get a LocalMatrix for the jacobian from the GridOperator, but a LocalMatrix::WeightedAccumulationView. ;-)
>
>> Thank you. Kind regards
>> Bernd
> I hope that clears things up a little! ;-)
>
> Greetings,
>
> Steffen
>
>> enum{dim = GridView::dimension};
>> typedef double Scalar;
>> typedef Dune::PDELab::NoConstraints Constraints;
>>
>> typedef Dune::PDELab::Q1LocalFiniteElementMap<Scalar,Scalar,dim> DisplacementFEM;
>> typedef Dune::PDELab::GridFunctionSpace<GridView,
>> DisplacementFEM,
>> Constraints,
>> Dune::PDELab::ISTLVectorBackend<1>
>>> ScalarDisplacementGFS;
>> typedef Dune::PDELab::PowerGridFunctionSpace<ScalarDisplacementGFS,
>> dim,
>> Dune::PDELab::GridFunctionSpaceBlockwiseMapper
>>> DisplacementGFS;
>> typedef Dune::PDELab::Q1LocalFiniteElementMap<Scalar,Scalar,dim> PressureFEM;
>> typedef Dune::PDELab::GridFunctionSpace<GridView,
>> PressureFEM,
>> Constraints,
>> Dune::PDELab::ISTLVectorBackend<1>
>>> ScalarPressureGFS;
>> typedef Dune::PDELab::PowerGridFunctionSpace<ScalarPressureGFS,
>> 2,
>> Dune::PDELab::GridFunctionSpaceBlockwiseMapper
>>> PressureGFS;
>> typedef Dune::PDELab::GridFunctionSpaceLexicographicMapper GFSMapper;
>> typedef Dune::PDELab::CompositeGridFunctionSpace<GFSMapper,
>> PressureGFS,
>> DisplacementGFS> GridFunctionSpace;
>>
>> typedef typename GridFunctionSpace::template ConstraintsContainer<Scalar>::Type ConstraintsTrafo;
>> typedef Dumux::PDELab::El2PLocalOperator<TypeTag> LocalOperator;
>> typedef Dune::PDELab::GridOperator<GridFunctionSpace,
>> GridFunctionSpace,
>> LocalOperator,
>> Dune::PDELab::ISTLBCRSMatrixBackend<1, 1>,
>> Scalar, Scalar, Scalar,
>> ConstraintsTrafo,
>> ConstraintsTrafo,
>> true
>>> GridOperator;
>> The local operator looks like
>> template<class TypeTag>
>> class El2PLocalOperator
>> :
>> public Dune::PDELab::FullVolumePattern,
>> public Dune::PDELab::LocalOperatorDefaultFlags
>> {...};
>>
>> -- 
>> _____________________________________________________________________
>>
>> Bernd Flemisch                               phone: +49 711 685 69162
>> IWS, Universität Stuttgart                   fax:   +49 711 685 60430
>> Pfaffenwaldring 61                  email: bernd at iws.uni-stuttgart.de
>> D-70569 Stuttgart                  url: www.hydrosys.uni-stuttgart.de
>> _____________________________________________________________________
>>
>>
>> _______________________________________________
>> dune-pdelab mailing list
>> dune-pdelab at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune-pdelab
> Steffen Müthing
> Universität Stuttgart
> Institut für Parallele und Verteilte Systeme
> Universitätsstr. 38
> 70569 Stuttgart
> Tel: +49 711 685 88429
> Fax: +49 711 685 88340
> Email: steffen.muething at ipvs.uni-stuttgart.de
>
>
> _______________________________________________
> dune-pdelab mailing list
> dune-pdelab at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-pdelab


-- 
_____________________________________________________________________

Bernd Flemisch                               phone: +49 711 685 69162
IWS, Universität Stuttgart                   fax:   +49 711 685 60430
Pfaffenwaldring 61                  email: bernd at iws.uni-stuttgart.de
D-70569 Stuttgart                  url: www.hydrosys.uni-stuttgart.de
_____________________________________________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20120820/49720d50/attachment.htm>


More information about the dune-pdelab mailing list