[Dune] UG and DGF with element parameters

Oliver Sander sander at mi.fu-berlin.de
Sat Sep 1 17:39:33 CEST 2012


Committed, thanks.
cheers,
Oliver

Am 29.08.2012 11:35, schrieb Nicolas Schwenck:
> You are absolutely right: At the moment reading parameters also does not
> work with UG and vertices (even though my colleagues swear that they
> have used this functionality some time ago).
>
> Attached you'll find the patch for the insertionIndex methods for
> vertices and elements. Unfortunately I was not able to declare the
> specialized class GridFactory<UGGrid<dimworld> > as a friend so that I
> had to do it for the base class to use the private member target_ in
> ugentity.
>
> Best,
> Nicolas
>
> On 08/28/2012 09:27 PM, Dedner, Andreas wrote:
>> Well if there is any magic then its not the dgf side thats for sure:
>> dgfug.hh:
>> /** \brief return parameter for vertex */
>> std::vector< double > &parameter ( const typename Grid::template
>> Codim< dimension >::Entity &vertex )
>> {
>> if( numParameters< dimension >() <= 0 )
>> {
>> DUNE_THROW( InvalidStateException,
>> "Calling DGFGridFactory::parameter is only allowed if there are
>> parameters." );
>> }
>> return dgf_.vtxParams[ factory_.insertionIndex( vertex ) ];
>> }
>> So I guess that should not work...
>> ________________________________________
>> 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
>> Oliver Sander [sander at mi.fu-berlin.de]
>> Sent: 28 August 2012 19:49
>> To: dune at dune-project.org
>> Subject: Re: [Dune] UG and DGF with element parameters
>>
>> Hi Nicolas,
>>
>> > Using a dgf file with elementwise parameters and a UG grid throws me
>> the aforementioned error so that I assumed that I do not need the
>> insertionIndex methods directly but it is needed to handle elementwise
>> parameters. I actually don't know why it is not needed for vertex
>> parameters.
>>
>> Maybe that's a bug in the dgf reader? Or there is some magic default
>> implementation
>> for the vertices? I do not know.
>>> Anyhow I want to implement the missing methods. I followed the
>>> implementation for Alberta and ALU. Where I begin to struggle is: What
>>> is the method in UG (in Alberta it is somehow integrated/hidden in
>>> elementInfo() and in ALU it is getIndex() ) which gives me the index
>>> for an entity which I can then forward (because you said there will be
>>> simply no re-ordering)? Could you please help me on this one?
>>>
>> Have a look at the implementation of UGGridLevelIndexSet. There you'll
>> find how to extract
>> indices from UG.
>>
>> best,
>> Oliver
>>
>>> Best,
>>> Nicolas
>>>
>>> On 08/21/2012 06:07 PM, Oliver Sander wrote:
>>>> Hi Nicolas,
>>>> I never implemented that insertion order stuff for UG, because I could
>>>> convince UG not ro reorder elements and vertices to begin with, and
>>>> because I have so far not met anybody who actually needed those
>>>> methods.
>>>>
>>>> If you do need those methods I would ask you to implement them and send
>>>> me a patch. Implementation is trivial: there is simply no reordering.
>>>>
>>>> best,
>>>> Oliver
>>>>
>>>> Am 16.08.2012 15:03, schrieb Nicolas Schwenck:
>>>>> Dear DUNE,
>>>>>
>>>>> Running the testug in dune-grid/dune/grid/io/file/dgfparser/test with
>>>>> the file dune-grid/doc/grids/dgf/examplegrid10a.dgf on the trunk
>>>>> breaks
>>>>> for me with
>>>>>
>>>>> NotImplemented
>>>>> [insertionIndex:../../../../../../dune/grid/common/gridfactory.hh:181]:
>>>>>
>>>>> insertion indices have not yet been implemented.
>>>>>
>>>>> I assume that there is a problem with elementwise parameters for UG
>>>>> grids. Is this a bug or is it just not yet implemented as the error
>>>>> suggests? Does anybody uses ug for dgfs with elementwise parameters
>>>>> and
>>>>> can throw me a hint?
>>>>>
>>>>> Best,
>>>>> Nicolas
>>>>>
>>>>>
>>>> _______________________________________________
>>>> Dune mailing list
>>>> Dune at dune-project.org
>>>> http://lists.dune-project.org/mailman/listinfo/dune
>>>>
>>>
>>
>> --
>> ************************************************************************
>> * Oliver Sander ** email: sander at mi.fu-berlin.de *
>> * Freie Universität Berlin ** phone: + 49 (30) 838 75348 *
>> * Institut für Mathematik ** URL : page.mi.fu-berlin.de/~sander *
>> * Arnimallee 6 ** -------------------------------------*
>> * 14195 Berlin, Germany ** Member of MATHEON (www.matheon.de) *
>> ************************************************************************
>>
>>
>> _______________________________________________
>> Dune mailing list
>> Dune at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune
>>
>>
>>
>> _______________________________________________
>> Dune mailing list
>> Dune at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune
>
>
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune




More information about the Dune mailing list