[Dune] Communicating IdSet elements
Markus Blatt
Markus.Blatt at iwr.uni-heidelberg.de
Tue Jul 26 14:18:48 CEST 2011
Hi,
On Tue, Jul 26, 2011 at 01:31:51PM +0200, Jö Fahlke wrote:
> With ALUGrid the is a small pitfall however: alugrid provides two
> loadBalance(dataHandle) methods, one for Dune-datahandles, and one for
> ALUGrid-native datahandles. These two datahandles have a somewhat different
> interface. The methods are declared like
>
> // ALU-specific datahandle
> template<class DataHandle>
> bool loadBalance(DataHandle &data);
>
> // Dune datahandle
> template<class DataHandleImpl, class Data>
> bool loadBalance(CommDataHandleIF<DataHandleImpl, Data> &dataHandle);
>
> This means that if you have a Dune data handle like
>
> template<class Grid>
> class RedistributeDataHandle :
> public Dune::CommDataHandleIF<RedistributeDataHandle<Grid>, int>
> { ... };
>
> you need to cast it to it's base class when calling loadBalance():
>
> typedef RedistributeDataHandle<Grid> DataHandle;
> DataHandle dh(*gridp, elementTagMap);
> gridp->loadBalance(static_cast<Dune::CommDataHandleIF<DataHandle, int>&>(dh));
>
> Otherwise the compiler will assume it is an ALU-specific datahandle and will
> probably complain. See
> <https://svn.dune-project.org/svn/dune-grid/trunk/src/gmsh-to-alu/main.hh> for
Maybe we should incorpoprate this into the FAQ?
Markus
--
Markus Blatt, Interdisciplinary Center for Scientific Computing,
University Heidelberg, Im Neuenheimer Feld 368, D-69120 Heidelberg
Tel: +49 (0) 6221 548881 Fax: +49 (0) 6221 548884
'Mathematics knows no races or geographic boundaries; for
mathematics, the cultural world is one country' - David Hilbert
More information about the Dune
mailing list