[Dune] Position of dofs for finite elements

Carsten Gräser graeser at mi.fu-berlin.de
Fri Jun 19 14:13:57 CEST 2020


Dear Timo,

Am 19.06.20 um 13:33 schrieb Timo Koch:
>> thanks a lot for the explanation, that already makes sense a lot more
>> sense now. That means that our interface
>> `problem.dirichlet(element, localPos)` is not very useful, if we want
>> it to be more general.
>> We’ll try to revisit the approach.

indeed there's no canonical way to get the interpolation points.
As Andreas explained, that's because localInterpolation.interpolate(...)
is not always an interpolation of function values but any linear
functional which may involve integration or Hermite-interpolation.

However, you should not need this for your application.
In fact the global interpolate() method of dune-functions
internally uses functions depending on (element,local coordinate).
These are also refereed to as grid functions. In a nutshell
a grid function f conceptually is a function acting on global
coordinates x that also provides an interface to evaluate it
locally

// get a localized version of f
auto localF = localFunction(f);
// ... loop over all elements
{
  //attach localized function to element
  localF.bind(element);
  // now you can evaluate with local coordinates wrt element
  localF(xLocal);
}

The full interface is documented here: https://arxiv.org/abs/1512.06136
If you have a function g(element,xLocal) you have to wrap it
in the above interface. Then you can simply pass it to
interpolate(...).

Such a wrapper does currently not exist, but implementing it
is mostly boilerplate code. As a starting point you can have
a look at analyticgridviewfunction.hh in dune-functions.

Best,
Carsten


> or I guess the interface is fine but there is no need to convert to
> coordinates first but we just do something like
> 
> std::vector<DirichletValues>values;
> interp.interpolate([&](constLocalCoordinate&x)
> -> DirichletValues {return problem.dirichlet(element, x); }, values);




-- 
Prof. Dr. Carsten Gräser
Freie Universität Berlin
Institut für Mathematik
Arnimallee 6
14195 Berlin, Germany
phone: +49 30 838 72637
fax  : +49 30 838 472637
email: graeser at mi.fu-berlin.de
URL  : http://page.mi.fu-berlin.de/graeser

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20200619/f1100159/attachment.sig>


More information about the Dune mailing list