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

Andreas Dedner a.s.dedner at warwick.ac.uk
Sat Apr 2 17:00:30 CEST 2016


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
> 




More information about the dune-fem mailing list