[dune-fem] [Dune] Store Data in grid cells

Schock, Justus justus.schock at rwth-aachen.de
Thu Apr 7 21:22:56 CEST 2016


Hi Andreas,

Thanks for the response and it seems to be exactly what I've been looking for.

If I'm allowed to ask one last question:
Could you maybe tell me, which interface the class, containing the data function, should fit in? I tried several ones (I know it needs to contain a method called localFunction) but unfortunately I didn't get it to work.

I tried to pass a DomainType- and a RangeType-Reference to this function to store that data in the RangeType-Reference, but an Entity was expected. For some reasons it also didn't work, if I passed an Entity, so I'm a bit confused know.

Best,
Justus

-------- Originalnachricht --------
Betreff: Re: [Dune] Store Data in grid cells
Von: Andreas Dedner
An: "Schock, Justus" ,dune-fem at dune-project.org
Cc:

Hi Justus.
I just found your original email - I missed it the first time round.
Here you actually explain in some detail what you are planning to do.
For material properties I would probably still suggest to use the
FiniteVolume space together with the dune-fem discrete functions. Then
you can benefit from automatic prolongation/restriction of the data
during refinement for example and as I already pointed out things are
then more "aus einem Guss".
Perhaps the right starting point in that case is
  02.intro-2/source/introscheme.hh
Replace the
   LagrangeDiscreteFunctionSpace
with the
   FiniteVolumeDiscreteFunctionSpace
and in the solve method use the line
   Dune::Fem::interpolate( function_, solution_ );
to initialize the discrete function with the values you want to store on
each cell.

Does that look like it would do the trick for you?
Andreas

On 25/03/16 00:50, Schock, Justus wrote:
> Dear Duners,
>
>
> I want to use DUNE for solving PDEs (just like the Poisson-Equation or
> the Diffusion-Equation).
>
>
> This is why I want to store some data (like concentration etc.) directly
> in the cells of the grid.
>
>
> I even tried using Mappers (as explained in chapter 6 of the How-To) and
> tried to write something very similar to the elementdata.hh.
>
> ​Unfortunately it did not work as expected and I dont't know if it has
> been the wrong idea in general or only a wrong implementation.
>
>
> Furthermore I texperimented a bit with the DGF, trying to pass the cell
> data directly in the file, the grid is constructed from.
>
>
> Could anyone just give me a hint or some explanation/link/example how
> this should be done?
>
>
> Best,
> Justus
>
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-fem/attachments/20160407/e89f88ae/attachment.htm>


More information about the dune-fem mailing list