Skip to content
Snippets Groups Projects
  1. Feb 14, 2023
  2. Feb 03, 2023
  3. Jan 30, 2023
  4. Jan 19, 2023
    • Carsten Gräser's avatar
      Merge branch 'cleanup/avoid-initialization-in-localassemblers' into 'master' · 3354ba2e
      Carsten Gräser authored
      [cleanup] Don't zero-initialize matrix in local assemblers
      
      See merge request !151
      3354ba2e
    • Carsten Gräser's avatar
      [cleanup] Don't zero-initialize matrix in local assemblers · 79479c65
      Carsten Gräser authored
      Zero-initilization already happens in the global assembler. Hence you
      don't need to and in fact should not do this in the local one, too.
      This has the advantage, that you can chain local assembler. E.g. you
      can get a local assembler for the H^1 norm using
      
      ```cpp
      auto massAssembler = Dune::Fufem::MassAssembler();
      auto laplaceAssembler = Dune::Fufem::LaplaceAssembler();
      auto h1Assembler = [=](auto&&... args) {
        massAssembler(args...);
        laplaceAssembler(args...);
      };
      ```
      
      or by implementing an abstract utility
      
      ```cpp
      auto sumLocalAssembler = [](auto... localAssemblers) {
        return [=] (auto&&... args) {
          std::initializer_list<int> { (localAssemblers(args...), 0)...};
        };
      };
      auto h1Assembler = sumLocalAssembler(Dune::Fufem::MassAssembler(), Dune::Fufem::LaplaceAssembler());
      ```
      79479c65
  5. Jan 18, 2023
  6. Jan 17, 2023
    • Carsten Gräser's avatar
      Capture structured bindings by value · 9630ef9c
      Carsten Gräser authored
      Capturing structured bindings by reference is not allowed
      before C++20. Here we can instead capture by value as a work around,
      because the shifted indices are thin wrappers.
      9630ef9c
    • Carsten Gräser's avatar
      [test]Extend test of istlMatrixBackend · 63427735
      Carsten Gräser authored
      This removed some trivial tests and instead introduces
      some more systematic tests with more complicated matrix
      types and bases. Since the `MatrixBuilder` has not been
      specialized for some of the tested matrix types, the
      corresponding matrices must be created manually.
      63427735
  7. Jan 16, 2023
    • Carsten Gräser's avatar
      [cleanup]Simplify ISTLMatrixBackend entry access by multi-indices · a435e04f
      Carsten Gräser authored
      This cleans up the entry access by a pair of row- and column-multi-indices
      as follows:
      
      * Factor out a generic utility function `visitMatrixEntry()` for
        accessing the `(i,j)`-th entry of a matrix with dynamic indices.
        By combining `hybridIndexAccess()` and `hybridRowIndexAccess()` this
        also works with multi-type matrices.
      * Factor out a generic utility function `visitMatrixEntryRecursive()` for
        recursively accessing matrix entries with dynamic row- and column-multi-indices.
        The action to apply to the resolved matrix entry is customizable.
      * Use `visitMatrixEntryRecursive()` to return matrix entries.
      
      This is a significant simplification of the old `MultiIndexResolver`-code
      and far more readable. It is also more generic, and forms the foundation
      of possible extensions to other methods that need multi-index-access,
      like, e.g., `matrixEntryExists(i,j)` or `addToMatrixEntry(i,j)`.
      a435e04f
    • Carsten Gräser's avatar
      Merge branch 'split-istlbackend' into 'master' · da1d2f09
      Carsten Gräser authored
      Split header assemblers/istlbackend.hh
      
      See merge request !148
      da1d2f09
    • Carsten Gräser's avatar
      Split header assemblers/istlbackend.hh · 3c782f15
      Carsten Gräser authored
      The header contained several independent classes. They are now
      split into separate headers in the new directory `backends/`.
      The old header is deprecated but includes the new one for compatibility.
      3c782f15
  8. Jan 12, 2023
  9. Jan 11, 2023
    • Carsten Gräser's avatar
      Remove AlienElementLocalBasisFunction · 9672c771
      Carsten Gräser authored
      * Remove `AlienElementLocalBasisFunction` and corresponding header.
        This is overly complicated and can be implemented simpler
        using the new `CachedFunction`.
      * Replace use of `AlienElementLocalBasisFunction` in dofconstraints.hh
        in favor of a direct implementation.
      9672c771
    • Carsten Gräser's avatar
      Modernize gradientassemblertest · c2f10586
      Carsten Gräser authored
      Switch from old `BasisGridFunction` to Dune::Functions::DiscreteGlobalBasisFunction`
      in the test, to avoid deprecation warning.
      c2f10586
    • Carsten Gräser's avatar
      Remove unused CachedComponentWrapper::evaluate() · e9c179a9
      Carsten Gräser authored
      In all placed where this class is used, the downstream code
      uses `operator()`.
      e9c179a9
    • Carsten Gräser's avatar
      Stop using CachedComponentWrapper in gradientassembler.hh · 5b08b68c
      Carsten Gräser authored
      * Use CachedFunction instead.
      * Remove now unused classes `LocalBasisDerivativeFunction`
        and `LocalBasisJacobianFunction` and corresponding headers.
        They are not used anywhere.
      5b08b68c
    • Carsten Gräser's avatar
      Add CachedFunction · 7a7d2450
      Carsten Gräser authored
      This is a simple wrapper for caching function evaluations. Together
      with very simple application specific lambda functions this provides
      the same functionality as `CachedComponentWrapper` with a far simpler
      implementation without CRTP, traits-classes, ... .
      7a7d2450
    • Carsten Gräser's avatar
      Switch function interface in `PortableGreyMap` · 1291d087
      Carsten Gräser authored
      * Let the function implement the dune-functions interface
      * Require dune-functions in `exportGreyMap()` member function
      * Adjust `pgmtest.cc`
      
      After this patch you can no longer pass a `Dune::VirtualFunction` or `VirtualGridFunction`,
      but have to use either the `std::function` or the `Dune::Functions::GridViewFunction` interface.
      1291d087
    • Carsten Gräser's avatar
      Switch function interface in `PortablePixelMap` · 7c18b2bc
      Carsten Gräser authored
      * Let the function implement the dune-functions interface
      * Require dune-functions in `exportPixelMap()` member function
      * Adjust `ppmtest.cc`
      
      After this patch you can no longer pass a `Dune::VirtualFunction` or `VirtualGridFunction`,
      but have to use either the `std::function` or the `Dune::Functions::GridViewFunction` interface.
      7c18b2bc
    • Carsten Gräser's avatar
      Switch function interface in `NewPFEAssembler` · b8a6fe93
      Carsten Gräser authored
      * Switch to dune-functions interface for grid functions
      * Adjust `newpfeassemblertest.cc`
      
      After this patch you can no longer pass a `Dune::VirtualFunction` or `VirtualGridFunction`,
      but have to use either the `std::function` or the `Dune::Functions::GridViewFunction` interface.
      b8a6fe93
    • Carsten Gräser's avatar
      Provide access to wrapped GlobalBasis in DuneFunctionsBasis<GlobalBasis> · d229e777
      Carsten Gräser authored
      This allows to e.g. use `Dune::Functions::DiscreteGlobalBasisFunction`
      with a wrapped basis without storing a separate copy of it.
      d229e777
    • Carsten Gräser's avatar
      Switch function interface in `VariableCoefficientViscosityAssembler` · b60a7f56
      Carsten Gräser authored
      * Switch to dune-functions interface for grid functions
      * Adjust `secondorderassemblertest.cc`
      
      After this patch you can no longer pass a `Dune::VirtualFunction` or `VirtualGridFunction`,
      but have to use either the `std::function` or the `Dune::Functions::GridViewFunction` interface.
      b60a7f56
    • Carsten Gräser's avatar
      Switch function interface in `FunctionIntegrator` · a3ef5853
      Carsten Gräser authored
      * Switch to dune-functions interface for grid functions
      * One now has to pass a dune-functions basis to
        `FunctionIntegrator::integrateDiscreteFunction()`
      * The function range type must be passed manually as
        template parameter to `FunctionIntegrator::integrateDiscreteFunction()`.
      * Adjust test
      
      After this patch you can no longer pass a `Dune::VirtualFunction` or `VirtualGridFunction`,
      but have to use either the `std::function` or the `Dune::Functions::GridViewFunction` interface.
      a3ef5853
    • Carsten Gräser's avatar
      [test]Update subgridxyfunctionalassemblertest · 49e06d86
      Carsten Gräser authored
      Adjust test to recent changes in `L2FunctionalAssembler`, `H1FunctionalAssembler`,
      `SubgridL2FunctionalAssembler`, and `SubgridH1FunctionalAssembler`:
      
      * Test with functions implementing the new interface.
      * Pass suitable `QuadratureRuleKey`s to constructors.
      49e06d86
    • Carsten Gräser's avatar
      Switch function interface in `SubgridH1FunctionalAssembler` · 099b0ff7
      Carsten Gräser authored
      * Switch to dune-functions interface for grid functions
      * Modernize constructor: You now have to pass a `QuadratureRuleKey`
        describing how to integrade the passed function instead of
        a raw quadrature rule order for the whole integrant.
      * Reduce magic:
        * This no longer works like a simple `H1FunctionalAssembler`
          if you pass Subgrid `GridFunction`s. In this use case
          use a plain `H1FunctionalAssembler` instead.
      
      After this patch you can no longer pass a `Dune::VirtualFunction` or `VirtualGridFunction`,
      but have to use either the `std::function` or the `Dune::Functions::GridViewFunction` interface.
      099b0ff7
    • Carsten Gräser's avatar
      Switch function interface in `SubgridL2FunctionalAssembler` · 243a9db5
      Carsten Gräser authored
      * Switch to dune-functions interface for grid functions
      * Reduce magic:
        * This no longer works like a simple `L2FunctionalAssembler`
          if you pass Subgrid `GridFunction`s. In this use case
          use a plain `L2FunctionalAssembler` instead.
        * The `QuadratureRuleKey` is no longer determined from the passed
          function automatically. Instead the manually passed `QuadratureRuleKey`
          is now always used.
      
      After this patch you can no longer pass a `Dune::VirtualFunction` or `VirtualGridFunction`,
      but have to use either the `std::function` or the `Dune::Functions::GridViewFunction` interface.
      243a9db5
    • Carsten Gräser's avatar
      Remove deprecated constructor of SubgridL2FunctionalAssembler · 9fcbfcba
      Carsten Gräser authored
      Remove the deprecated constructor taking a raw quadrature order,
      the now unused member storing this order, and all code paths evaluating it.
      9fcbfcba
    • Carsten Gräser's avatar
      Switch function interface in `H1FunctionalAssembler` · fb049768
      Carsten Gräser authored
      * Switch to dune-functions interface for grid functions
      * Modernize constructor: You now have to pass a `QuadratureRuleKey`
        describing how to integrade the passed function instead of
        a raw quadrature rule order for the whole integrant.
      * Adjust test
      * Disable test for dune-functions older than 2.9, because
        `derivative(DiscreteGlobalBasisFunction)` is used in the
        test but not implemented in before dune-functions-2.9.
      
      After this patch you can no longer pass a `Dune::VirtualFunction` or `VirtualGridFunction`,
      but have to use either the `std::function` or the `Dune::Functions::GridViewFunction` interface.
      fb049768
    • Carsten Gräser's avatar
      Switch function interface in `L2FunctionalAssembler` · c2bd2dc8
      Carsten Gräser authored
      After this patch you can no longer pass a `Dune::VirtualFunction` or `VirtualGridFunction`,
      but have to use either the `std::function` or the `Dune::Functions::GridViewFunction` interface.
      c2bd2dc8
    • Carsten Gräser's avatar
      Reverse dependency of basisgridfunction.hh and vintagebasisgridfunction.hh · 918ba8b6
      Carsten Gräser authored
      This moves the `Local(Derivative)Evaluator` implementations from
      `basisgridfunction.hh` to `vintagebasisgridfunction.hh`. Hence
      the former now includes the latter. This was the other way around before.
      
      By this change one can include `vintagebasisgridfunction.hh` without
      seeing deprecation warnings because `dune/common/function.hh` is implicitly
      included. Furthermore it allows to remove `basisgridfunction.hh` before
      `vintagebasisgridfunction.hh`.
      918ba8b6
    • Carsten Gräser's avatar
      Switch function interface in `GeneralizedLaplaceAssembler` · 9514ec94
      Carsten Gräser authored
      * Switch to dune-functions interface for grid functions
      * Adjust test
      * Also test with scalar- and matrix-valued dune-functions grid functions as coefficients
      * Disable test with `Dune::Functions::ComposedGridFunction` for dune-functions-2.8
      
      After this patch you can no longer pass a `Dune::VirtualFunction` or `VirtualGridFunction`
      as diffusivity coefficient, but have to use either the `std::function` or the
      `Dune::Functions::GridViewFunction` interface.
      9514ec94
    • Carsten Gräser's avatar
      Add some utilitilies for unified treatment of grid functions · 151195f0
      Carsten Gräser authored
      All utilities in this header are for transitional purposes to
      migrate dune-fufem from the `Dune::VirtualFunction`-based to a
      `std::function`-based interface, while keeping some compatibility.
      
      Unfortunately the dune-functions utilities (e.g. `makeGridViewFunction()`)
      cannot directly be used, because the old dune-fufem assemblers do not
      know a `GridView`, but only a `Grid`, while the dune-functions grid-function
      concept always required an `EntitySet` that typically represents a `GridView`.
      The work-around provided by this header works as follows:
      
      * Provide a utility `Dune::Fufem::Impl::localFunctionForGrid<Grid>(f)`
        that creates a local function suitable for a given `Grid` type - either by
        forwarding to `localFunction(f)` or by providing a wrapper.
      * To avoid implementing the wrapper again, `Dune::Functions::AnalyticGridViewFunction`
        is reused with a dummy `Dune::Fufem::Impl::AllEntityGridView` that contains all
        entities (but does not allow iteration or to obtain an index set).
      * Since the `GridView` type may differ, depending on which code path
        is used to create the grid function, we cannot directly store the
        global grid function in a `Dune::Functions::GridFunction` type-erasure
        wrapper. Instead we have to store the local function in a
        `Dune::Functions::LocalFunction` that only depends on the entity type.
        Since creating precise type of the latter from the `Grid` and `Range`
        is a little cumbersome, this is simplified by the alias
        `Dune::Fufem::Impl::LocalFunctionInterfaceForGrid<Grid,Range>`.
      151195f0
    • Carsten Gräser's avatar
      Merge branch 'remove-deprecated-headers' into 'master' · 3299eead
      Carsten Gräser authored
      Remove deprecated headers
      
      See merge request !147
      3299eead
    • Carsten Gräser's avatar
      4d4a3d79
    • Carsten Gräser's avatar
    • Carsten Gräser's avatar
      Remove empty header · b5afdb85
      Carsten Gräser authored
      b5afdb85
Loading