[dune-fem] How to restrict/prolong multiple function during grid adaptation

Tobias Malkmus tomalk at mathematik.uni-freiburg.de
Thu Jun 20 08:42:43 CEST 2013


Hi Claus

I worked on the local restrict prolong stuff in the last days.
A tuple of two RPs in the following way works fine for me.

{
typedef RestrictProlongDefault< DiscreteFunctionType1 > 
RestrictProlongDefaultType1;
typedef RestrictProlongDefault< DiscreteFunctionType2 > 
RestrictProlongDefaultType2;

typedef RestrictProlongPair< RestrictProlongDefaultType1&, 
RestrictProlongDefaultType2& > RestrictProlongDefaultType;

typedef AdaptationManager< MyGridType, RestrictProlongDefaultType > 
AdaptationManagerType;


RestrictProlongDefaultType1 rp1( solution1 );
RestrictProlongDefaultType2 rp2( solution2 );

RestrictProlongDefaultType rp( rp1, rp2 );

AdaptationManagerType adop(grid,rp);

adop.adapt();
}

Both functions are restricted and prolongated in the correct way.
Ok i had to splash some const qualifiers for the EntityTypes in the 
RestrictProlongTuple calls to restrictLocal and prolongLocal, i think 
you will find them ;)


On 06/19/2013 08:59 PM, Claus-Justus Heine wrote:
> On-going story. Actually, I begin to wonder: is this a real design flaw,
> or is just that I am too stupid?
>
> I have successfully generated a RestrictProlongTuple (which is simply
> based on a std::tuple as storage, and does not use that fancy
> Interface-combination-pair stuff from Dune::Fem)
>
> I now get the following error
>
> Error: InvalidStateException
> [AdaptationManager:/home/claus/projects/Math/DUNE/git/dune-fem/dune/fem/space/common/adaptmanager.hh:649]:
> Only one instance of AdaptationManager allowed per grid instance
>
> The plot is as follows: I have a generic ParabolicFemScheme, which
> implements the ingredients for an "ALBERTA-style" space-time adaptive
> method and, yes, that one defines an AdaptationManager for this simple
> one-function setup.
>
> Then I derive a more advanced FEM-Scheme from that. This time to
> simulate the carbonation of concrete. That one needs the
> CO2-concentration, a pore-volume-fraction and a Ca(OH)2 concentration,
> and all of them need to be restricted/prolongated during grid adaptation.
>
> This is at least not handy. But I cannot imagine that the need to
> "restrict-prolong" more than one unknown has never occurred before in
> the Dune::Fem context. Has it not?

As far as i know Axel Pfeiffer did something on this in his thesis.

>
> Is it a real need that this AdaptationManager is a per-grid-singleton?
>
> Of course, I could work around by providing the AdaptationManagerType as
> an additional template-parameter (or use traits ...) to my transient
> fem-scheme class. But at the very least the current state of
> restricting/prolongating discrete functions in Dune::Fem appears to be a
> little bit complicated.
>
> What am I doing wrong?
>
> Thanks for any comment,
>
> best wishes,
>
> Claus

Best Tobias


-- 
Tobias Malkmus                 <tomalk at mathematik.uni-freiburg.de>

Mathematisches Institut               Tel: +49 761 203 5627
Abt. für Angewandte Mathematik        Universität Freiburg
Hermann-Herder-Str. 10
79104 Freiburg





More information about the dune-fem mailing list