[dune-functions] Function space of constant functions

Carsten Gräser graeser at mi.fu-berlin.de
Wed Nov 14 22:35:26 CET 2018


Hi Simon,

Am 14.11.18 um 21:41 schrieb Christian Engwer:
[...]
>> I have recently implemented a minimal function space for dune-functions that
>> represents essentially something like span{1}, so a space of constants or of
>> constant functions. I wanted to have this in the context of dune-functions
>> functionspacebases to embed these constants in a PDE setting. Applications
>> include:
[...]
>> Maybe someone is interested in this. Probably there are also other ways to
>> achieve the same, but this was for me just an experiment how to include this
>> in the functionspacebases setting.
>>
>> If there is wider interest in this feature, I could merge this into the
>> dune-function repository.
without looking at the code: That's just the P0 basis with
all basis functions mapped to the index 0, isn't it? Maybe
this can also be obtained using (abusing)

  https://gitlab.dune-project.org/staging/dune-functions/merge_requests/125

Something like the following should (almost) do the trick:

  auto scalarPrebasis = []() {
      return Experimental::transformIndices(lagrange<0>(),
        Experimental::indexTransformation(
          [](auto& multiIndex, const auto& basis) { multiIndex = {0}; },
          [](const auto& prefix, const auto& basis) { return std::size_t(prefix.size()==0); },
          Dune::Indices::_1, Dune::Indices::_1));
    };

It's "abusing" and "almost", because the fact that this is
not just a transformation leads to a minor problem: The
resulting basis will not return the proper value on dimension().
This could be fixed by widening the scope and allowing to
hijack dimension() with a lambda, too.

Best,
Carsten

PS:
Like Christian I'd say that you normally don't need this
to solve a Neumann problem.

-- 
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-functions/attachments/20181114/563707ae/attachment.sig>


More information about the dune-functions mailing list