[Dune] calling subId(...) inside Dune::CommDataHandleIF::gather(...)
Vogelbacher Florian
Florian.Vogelbacher at psi.ch
Fri Sep 10 15:19:50 CEST 2010
Hi Andreas,
most probably I'm so wrong, but maybe you can verify it?
I have written the code to make the ordering but he never has to order
something. Therefore I assume globalID and Index are ordered the same
way. Are they?
Sorry for this confusion!
Florian
Vogelbacher Florian wrote:
> Hi Andreas,
>
> it seems to work. So many thanks.
>
> The reason for calling subId() is to sort DoFs:
> Considering two processes. I have to access the DoFs of a ghost entity.
> However if I just communicate with the other process, it might happen
> that the other process sends me the DoFs in another order as I would
> expect them. Or in other words: Is node=0 of the ghost entity of
> processA also the node=0 of the corresponding (overlap) element of
> processB? In my opinion not. Therefore I sort them ascending to the ID
> before sending.
>
> Am I possibly wrong with this thesis?
>
> Bye
> Florian
>
> Andreas Dedner wrote:
>> Hi,
>> that you only want codim 0 is not really a compile
>> time information, so the the gather method in this
>> form needs to be created for any codimension and
>> the subId method is not available on entities of
>> lower codimension - been discussed for some time but has not happened
>> yet. To solve this problem just
>> remove EntityType from the template list of your
>> gather method and fix the type to codim 0 - you probably
>> have to have a dummy method with template argument just
>> doing nothing to keep the compiler happy.
>>
>> BTW: why do you use subId instead of subIndex?
>>
>> Best
>> Andreas
>>
>> On Fri, 10 Sep 2010 12:23:15 +0200
>> Vogelbacher Florian <Florian.Vogelbacher at psi.ch> wrote:
>>> Dear Dune,
>>>
>>> inside the function gather(...) from a class derived from
>>> Dune::CommDataHandleIF I like to call the subId(...)
>>> function using the entity provided by the gather
>>> parameter list. However it throws me a whole bunch of
>>> errors. Follwing a excerpt of the gather().
>>>
>>> [...]
>>> template<class MessageBuffer, class EntityType>
>>> void gather (MessageBuffer& buff, const EntityType&
>>> entity) const
>>> {
>>> /** \brief Calculate codimensions of vertex and edge */
>>> unsigned int codimofvertex = GridType::dimension;
>>>
>>> /** \brief Storing the local corner numbers */
>>> int vi = 0;
>>> int vj = 1;
>>> int vk = 2;
>>> int vl = 3;
>>>
>>> /** \brief We get the global ID of each subentity 'node'
>>> and the
>>> GlobalId idNodeI = globalIdSet_.template subId(entity,
>>> vi, codimofvertex);
>>> GlobalId idNodeJ = globalIdSet_.template subId(entity,
>>> vj, codimofvertex);
>>> GlobalId idNodeK = globalIdSet_.template subId(entity,
>>> vk, codimofvertex);
>>> GlobalId idNodeL = globalIdSet_.template subId(entity,
>>> vl, codimofvertex);
>>> [...]
>>>
>>> The error is as follwing:
>>>
>>> ../algebra/parallelsolverdiscontinuousgalerkin.hh:298:
>>> error: no matching function for call to
>>> ‘Dune::IdSet<Dune::ALU3dGrid<3, 3, tetra>,
>>> Dune::ALU3dGridGlobalIdSet<3, 3, tetra>,
>>> Dune::ALUGridId<Dune::ALUMacroKey> >::subId(const
>>> Dune::Entity<1, 3, const Dune::ALU3dGrid<3, 3, tetra>,
>>> Dune::ALU3dGridEntity>&, int&, unsigned int&) const’
>>>
>> /home4/vogelbacher_f/svnwork/dune-trunk/dune-grid/dune/grid/common/indexidset.hh:377:
>>
>>> note: candidates are: IdTypeImp Dune::IdSet<GridImp,
>>> IdSetImp, IdTypeImp>::subId(const typename
>>> std::remove_const<_Tp>::type::Traits::Codim<0>::Entity&,
>>> int, unsigned int) const [with GridImp =
>>> Dune::ALU3dGrid<3, 3, tetra>, IdSetImp =
>>> Dune::ALU3dGridGlobalIdSet<3, 3, tetra>, IdTypeImp =
>>> Dune::ALUGridId<Dune::ALUMacroKey>]
>>>
>>> There are two things confusing me. First, why the
>>> function tries to use a parameter Dune::Entity<1,3,..>
>>> (and later in the error list for Dune::Entity<2,3,..>,
>>> Dune::Entity<3,3,..>) even though I use CODIM0 only.
>>>
>>> Secondly, how I might be able to change the type of the
>>> entity to be of the type used in the subId(...) function
>>> so I can call subId correctly.
>>>
>>> thanks a lot in advance
>>> florian
>>>
>>> --
>>> ---------------------------
>>> Paul Scherrer Institut
>>> Florian Vogelbacher
>>> WBCA/004
>>> 5232 Villigen PSI
>>> Switzerland
>>>
>>> Mail: Florian.Vogelbacher at psi.ch
>>> Phone: +41 (0) 563105019
>>> Web: www.psi.ch
>>> ---------------------------
>>>
>>> _______________________________________________
>>> Dune mailing list
>>> Dune at dune-project.org
>>> http://lists.dune-project.org/mailman/listinfo/dune
>>
>
--
---------------------------
Paul Scherrer Institut
Florian Vogelbacher
WBCA/004
5232 Villigen PSI
Switzerland
Mail: Florian.Vogelbacher at psi.ch
Phone: +41 (0) 563105019
Web: www.psi.ch
---------------------------
More information about the Dune
mailing list