[Dune] Dynamic load balancing with ALUGrid

Bernd Flemisch bernd at iws.uni-stuttgart.de
Fri Oct 26 13:32:49 CEST 2012


Hey Andreas,

thank you for your fast answer. This indeed solves my second issue. 
However, the first one remains. I attach an updated test file.

Kind regards
Bernd

On 10/26/2012 01:08 PM, Dedner, Andreas wrote:
> Hi Bernd
>
> You should be able to cast the derived class onto the interface class
> and that triggers the call to the correct method.
>
> Andreas
>
> ________________________________________
> From: dune-bounces+a.s.dedner=warwick.ac.uk at dune-project.org [dune-bounces+a.s.dedner=warwick.ac.uk at dune-project.org] on behalf of Bernd Flemisch [bernd at iws.uni-stuttgart.de]
> Sent: 26 October 2012 11:53
> To: Dune
> Subject: [Dune] Dynamic load balancing with ALUGrid
>
> Dear Dune,
>
> I try to use dynamic load balancing with ALUGrid. The grid itself gets
> balanced nicely, but I don't succeed in getting data balanced.
>
>   From dune/grid/alugrid/3d/grid.hh lines 701ff, I guess that I can pack
> a "usual" data handle which is used for communication into a
> ALUGridLoadBalanceDataHandle and call loadBalance with that handle. My
> initial attempt to do this fails with
> test-dynamiclb:
> ../../../dune/grid/alugrid/common/defaultindexsets.hh:218:
> Dune::DefaultIndexSet<GridImp, IteratorImp>::IndexType
> Dune::DefaultIndexSet<GridImp, IteratorImp>::index(const typename
> GridImp::Codim<cd>::Entity&) const [with int cd = 0; GridImp =
> Dune::ALU3dGrid<(Dune::ALU3dGridElementType)7u>; IteratorImp =
> Dune::EntityIterator<0, const
> Dune::ALU3dGrid<(Dune::ALU3dGridElementType)7u>,
> Dune::ALU3dGridLeafIterator<0, (Dune::PartitionIteratorType)4u, const
> Dune::ALU3dGrid<(Dune::ALU3dGridElementType)7u> > >;
> Dune::DefaultIndexSet<GridImp, IteratorImp>::IndexType = unsigned int;
> typename GridImp::Codim<cd>::Entity = Dune::Entity<0, 3, const
> Dune::ALU3dGrid<(Dune::ALU3dGridElementType)7u>,
> Dune::ALU3dGridEntity>]: Assertion `indexContainer( cd )[ en ].index()
>   >= 0' failed.
>
> I attach my effort, where I use a data handle copied from the
> grid-howto. It would be great if you could take a look.
>
> I have a second issue: I guess that I should be able to call loadBalance
> directly with a usual data handle, so that grid.hh lines 701ff takes
> care of it and packs it for me into a ALUGridLoadBalanceDataHandle
> before sending it to the real loadBalance method. However, since my data
> handle is only inherited from CommDataHandleIF, the packing routine is
> not triggered but the real loadBalance method is called directly leading
> to a compilation error. How can I trigger the execution of the packing
> routine for such a derived data handle?
>
> Thank you for having a look. Kind regards
> Bernd
>
> --
> _____________________________________________________________________
>
> 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
> _____________________________________________________________________


-- 
_____________________________________________________________________

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 --------------
A non-text attachment was scrubbed...
Name: test-dynamiclb.cc
Type: text/x-c++src
Size: 3408 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20121026/6fb1f70f/attachment.cc>


More information about the Dune mailing list