Skip to content
Snippets Groups Projects
  1. Jan 09, 2025
  2. Jan 07, 2025
  3. Jan 06, 2025
    • Carsten Gräser's avatar
      Merge branch 'feature/composedgridfunction-fix-range' into 'master' · 8f62563e
      Carsten Gräser authored
      Relax range type deduction in ComposedGridFunction
      
      See merge request !500
      8f62563e
    • Simon Praetorius's avatar
      simplify signed in conversion · c79d5e17
      Simon Praetorius authored and Carsten Gräser's avatar Carsten Gräser committed
      c79d5e17
    • Markus Blatt's avatar
      Cater for 32bit architecture where size_t is unsigned int. · f3d7ce10
      Markus Blatt authored and Carsten Gräser's avatar Carsten Gräser committed
      Using long unsigned int breaks compilation on 32bit architectures for
      no reason
      
      Compile errors fixed on 32bit are:
       ```
       cd /<<PKGBUILDDIR>>/build/dune/functions/analyticfunctions/test && /usr/bin/c++ -DHAVE_CONFIG_H -DHAVE_MPI=1 -DHAVE_SUPERLU=1 -DMPICH_SKIP_MPICXX=1 -DMPIPP_H -DMPI_NO_CPPBIND=1 -DModelP -DOMPI_SKIP_MPICXX=1 -D_MPICC_H -I/<<PKGBUILDDIR>>/build -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/build/include -I/<<PKGBUILDDIR>>/build/include_private -isystem /usr/lib/arm-linux-gnueabi/mpich/include -isystem /usr/include/superlu -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIE -MD -MT dune/functions/analyticfunctions/test/CMakeFiles/polynomialtest.dir/polynomialtest.cc.o -MF CMakeFiles/polynomialtest.dir/polynomialtest.cc.o.d -o CMakeFiles/polynomialtest.dir/polynomialtest.cc.o -c /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc: In instantiation of ‘Dune::TestSuite testDynamicPolynomial() [with Scalar = double; CoefficientArgs = {std::array<double, 4>}]’:
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc:221:68:   required from here
        221 |   suite.subTest(testDynamicPolynomial<double, std::array<double,4>>());
            |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc:58:14: error: class template argument deduction failed:
         58 |     auto p = Polynomial(Coefficients({1, 2, 3, -4}));
            |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc:58:14: error: no matching function for call to ‘Polynomial(std::array<double, 4>)’
      In file included from /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc:15:
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:145:3: note: candidate: ‘template<class K, class C> Polynomial(C)-> Dune::Functions::Polynomial<K, C>’
        145 |   Polynomial(Coefficients coefficients) :
            |   ^~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:145:3: note:   template argument deduction/substitution failed:
      /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc:58:14: note:   couldn’t deduce template parameter ‘K’
         58 |     auto p = Polynomial(Coefficients({1, 2, 3, -4}));
            |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:135:3: note: candidate: ‘template<class K, class C> Polynomial()-> Dune::Functions::Polynomial<K, C>’
        135 |   Polynomial() = default;
            |   ^~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:135:3: note:   candidate expects 0 arguments, 1 provided
      /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:121:7: note: candidate: ‘template<class K, class C> Polynomial(Dune::Functions::Polynomial<K, C>)-> Dune::Functions::Polynomial<K, C>’
        121 | class Polynomial
            |       ^~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:121:7: note:   template argument deduction/substitution failed:
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc:58:14: note:   ‘std::array<double, 4>’ is not derived from ‘Dune::Functions::Polynomial<K, C>’
         58 |     auto p = Polynomial(Coefficients({1, 2, 3, -4}));
            |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:207:1: note: candidate: ‘template<class K> Dune::Functions::Polynomial(std::initializer_list<_Tp>)-> Polynomial<K, std::vector<TIN> >’
        207 | Polynomial(std::initializer_list<K>) -> Polynomial<K, std::vector<K>>;
            | ^~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:207:1: note:   template argument deduction/substitution failed:
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc:58:14: note:   ‘std::array<double, 4>’ is not derived from ‘std::initializer_list<_Tp>’
         58 |     auto p = Polynomial(Coefficients({1, 2, 3, -4}));
            |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:204:1: note: candidate: ‘template<class K, K ...ci> Dune::Functions::Polynomial(std::integer_sequence<T, t ...>)-> Polynomial<K, std::integer_sequence<T, t ...> >’
        204 | Polynomial(std::integer_sequence<K, ci...>) -> Polynomial<K, std::integer_sequence<K,ci...>>;
            | ^~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:204:1: note:   template argument deduction/substitution failed:
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc:58:14: note:   ‘std::array<double, 4>’ is not derived from ‘std::integer_sequence<T, t ...>’
         58 |     auto p = Polynomial(Coefficients({1, 2, 3, -4}));
            |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:201:1: note: candidate: ‘template<class K, long unsigned int n> Dune::Functions::Polynomial(std::array<K, n>)-> Polynomial<K, std::array<K, n> >’
        201 | Polynomial(std::array<K,n>) -> Polynomial<K, std::array<K,n>>;
            | ^~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:201:1: note:   template argument deduction/substitution failed:
      /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc:58:14: note:   mismatched types ‘long unsigned int’ and ‘unsigned int’
         58 |     auto p = Polynomial(Coefficients({1, 2, 3, -4}));
            |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/polynomial.hh:198:1: note: candidate: ‘template<class K> Dune::Functions::Polynomial(std::vector<TIN>)-> Polynomial<K, std::vector<TIN> >’
        198 | Polynomial(std::vector<K>) -> Polynomial<K, std::vector<K>>;
            | ^~~~~~~~~~
       ...
        /<<PKGBUILDDIR>>/dune/functions/analyticfunctions/test/polynomialtest.cc:184:28: error: no match for ‘operator==’ (operand types are ‘Dune::Functions::Polynomial<int, std::tuple<long unsigned int, std::integral_constant<long unsigned int, 6>, long int> >’ and ‘Dune::Functions::Polynomial<int, std::tuple<long unsigned int, std::integral_constant<unsigned int, 6>, long int> >’)
        184 |   suite.check(derivative(p)==dp);
            |
      ```
      f3d7ce10
    • Carsten Gräser's avatar
      Relax range type deduction in ComposedGridFunction · 2f0c5c3e
      Carsten Gräser authored
      Use `localFunction(f)(localX)` instead of `f(globalX)`
      for the wrapped grid function `f` when deducing the
      range type in `ComposedGridFunction`. This is more
      flexible in case the wrapped function does not implement
      global evaluation, but only the local one. Since we wrap
      a `GridFunction` the latter must always exist.
      2f0c5c3e
    • Carsten Gräser's avatar
      Merge branch 'bugfix/fix-monomialsettest' into 'master' · 4350d949
      Carsten Gräser authored
      [bugfix] Fix error message in monomialsettest.cc
      
      See merge request !503
      4350d949
    • Carsten Gräser's avatar
      [bugfix] Fix error message in monomialsettest.cc · 730c0033
      Carsten Gräser authored
      The error message created for the exception assumes
      `dim==2` while it is actually templated wrt `dim`
      and we test with 1,2,3. Since the check passes, this
      bug is normally not triggered, but the compiler warns
      about the bogus read with `p[i][1]` if `p[i]` has
      size one.
      730c0033
    • Carsten Gräser's avatar
      Merge branch 'bugfix/fix-global-transformation' into 'master' · 2dfbb229
      Carsten Gräser authored
      [bugfix] Don't use mv and mtv with raw random access containers
      
      See merge request !501
      2dfbb229
    • Carsten Gräser's avatar
      [cleanup] Remove explicit initialization of the base class. · 64242056
      Carsten Gräser authored
      Since the `DenseVector` base class does not contain any
      members, we don't need to explicitly initialize it.
      64242056
    • Carsten Gräser's avatar
      Delete copy constructor of wrapper · 8a3ce218
      Carsten Gräser authored
      Since `Impl::DenseVectorView` is just a wrapper around
      a refence/pointer to a raw container, having a copy
      constructor does not make sense. Unless we introduce
      dynamic memory management the only possibility is to
      either let a copy-constructed `DenseVectorView` to the
      same storage or to `nullptr`. Both are not what one would
      expect. Assume e.g. the following function expecting a
      matrix and vector argument gets a `DenseVectorView` as `x`:
      
      ```cpp
      template<class A, class X>
      auto foo(const A& a, const X& x) {
        auto y = x; // Assume that this copies the internal pointer,
        a.mv(x, y); // then this changes the storage of x when writing to y.
        return x*y;
      }
      ```
      8a3ce218
  4. Dec 17, 2024
    • Carsten Gräser's avatar
      [bugfix] Don't use mv and mtv with raw random access containers · ae45a832
      Carsten Gräser authored
      The Dune matrix types do not support `MatrixType::mv(x,y)` passing
      plain random access containers as vectors but require `x.N()` and
      `y.N()` if bound checks are enabled.
      As a fix we introduce an internal `Impl::DensseVectorView` class
      that provides the `DenseVector` interface for generic random
      access containers.
      
      Notice that this class is not tested for general use and should
      be replaced by `DenseVectorSpan` once this was added to dune-common
      and is sufficiently generic for beeing used here.
      ae45a832
  5. Nov 23, 2024
  6. Nov 22, 2024
    • Carsten Gräser's avatar
      [bugfix] Fix gready overload of operator<< for StaticMultiIndex · 4b2cae95
      Carsten Gräser authored
      When overloading the free operator `operator<<(const S&, const T&)`
      for a stream `S` and a specific type `T` that we have under control,
      one should not provide a gready overload for `template<class S>` but
      use `std::ostream`.
      Here we do _not_ want to define what `s << StaticMultiIndex()` means for
      any type `S` but only for cases where we write into a character stream.
      
      A downstream library may want to define the same operator for a type `S`
      under _its_ control, e.g. to define its own custom semantics
      for `s<<t`.
      4b2cae95
  7. Nov 14, 2024
  8. Nov 13, 2024
  9. Oct 15, 2024
  10. Oct 10, 2024
    • Carsten Gräser's avatar
      6e1893ae
    • Carsten Gräser's avatar
      [hermite] Rename Hermite* to CubicHermite* · 47137b56
      Carsten Gräser authored
      There are many Hermite-type elements. The one implemented here
      is commonly known as cubic Hermite element.
      47137b56
    • Carsten Gräser's avatar
      [hermite][test] Disable test that has not been merged · 396cf3ee
      Carsten Gräser authored
      This commit is not ment to be merged but should
      be removed once the test is in. It only serves
      to disable it in a minimal invasive way such that
      the CI can be run.
      396cf3ee
    • Maik Porrmann's avatar
      [hermite][cleanup] Cleanup and improve MorleyPreBasis · ecb1f7c5
      Maik Porrmann authored and Carsten Gräser's avatar Carsten Gräser committed
      
      Layout cleanup:
      
      * Unify indentation.
      * Unify placement of opening/closing braces.
      * Unify placement of `static_assert`s and add missing conditions.
      * Surround each method by empty lines.
      * Put initializer and base class specifier in new line.
      * Fix a few typos.
      * For my inner Monk: Unify indentation of multiline doxygen comments.
      
      Other cleanup:
      
      * Cleanup includes.
      * Drop `coeffsize` and use `constexpr` function instead of nested ternary operators.
      * Rename `MorleyLocalBasis` to `MorleyReferenceLocalBasis`.
      
      Co-authored-by: Carsten Gräser's avatarCarsten Gräser <graeser@math.fau.de>
      ecb1f7c5
    • Maik Porrmann's avatar
      [hermite][cleanup] Cleanup and improve HermitePreBasis · 2b510f7c
      Maik Porrmann authored and Carsten Gräser's avatar Carsten Gräser committed
      
      Layout cleanup:
      
      * Unify indentation.
      * Unify placement of opening/closing braces.
      * Unify placement of `static_assert`s and add missing conditions.
      * Surround each method by empty lines.
      * Put initializer and base class specifier in new line.
      * Fix a few typos.
      * Order some `using` statements.
      * For my inner Monk: Unify indentation of multiline doxygen comments.
      
      Other cleanup:
      
      * Remove redundant members.
      * Cleanup includes.
      * Drop `coeffsize` and use `constexpr` function instead of nester ternary operators.
      * Rename `HermiteLocalBasis` to `HermiteReferenceLocalBasis`.
      * Improve documentation.
      * Extract generic mapper-based utilities into separate header:
        * A simple range over all subindices associated to an element within a `MCMGMapper`.
        * A function computing average mesh sizes for all DOFs addressed by a `MCMGMapper`.
      * Cleanup internal members:
        * Incorporate `LFE::fillMatrix()` into `LFE::bind()` to avoid useless indirection.
        * Incorporate `PreBasis::updateState()` into `PreBasis::update()` to avoid useless indirection.
        * Use meaningfull names for member variables instead of generic ones like `localState` and `data`.
        * Use `std::array<T,n>` instead of `std::vector<T>` if `n` is a small compile time constant.
      
      Interface improvements:
      
      * Add global basis.
      
      Further changes:
      
      * Test on a non-uniform grid.
      * Fix a bug (and memory leak) when binding to an element.
      * Order includes lexicographically.
      
      Co-authored-by: Carsten Gräser's avatarCarsten Gräser <graeser@math.fau.de>
      2b510f7c
  11. Oct 06, 2024
    • Carsten Gräser's avatar
      [hermite][cleanup][doc] Improve TransformedFiniteElementMixin · 3ff5ebe5
      Carsten Gräser authored
      
      * Extend documentation.
      * Move non-working 'example' into doxygen documenation.
      * Unify coding style.
      * Remove redundant calls to `resize()`.
      
      Co-authored-by: default avatarMaik Porrmann <maik.porrmann@tu-dresden.de>
      3ff5ebe5
    • Carsten Gräser's avatar
    • Carsten Gräser's avatar
      [hermite] Add FunctionalDescriptor class · 6932ab96
      Carsten Gräser authored
      This is needed to specify the nature of the DOFs
      of a Hermite-basis in order to identify those
      that need to be constrained for a certain boundary
      condition.
      6932ab96
    • Maik Porrmann's avatar
      [hermite] Add a Morley-basis · 2c678e2e
      Maik Porrmann authored and Carsten Gräser's avatar Carsten Gräser committed
      This implements the global basis for the
      nonconforming Morley-element. The implementation
      is based on `TransformedFiniteElementMixin`.
      This only provides the classical quadratic
      element in 2d and no higher-order or 3d extensions.
      
      Notice that the element is H^1- and H^2-nonconforming.
      2c678e2e
    • Maik Porrmann's avatar
      [hermite] Add a cubic Hermite-basis · cb6232ce
      Maik Porrmann authored and Carsten Gräser's avatar Carsten Gräser committed
      This uses the `TransformedFiniteElementMixin` helper
      class to imeplement the crucial local transformation
      needed to ensure global continuity of derivatives.
      The implementation provides:
      
      * The 1d cubic Hermite basis (aka cubic C1 splines)
      * The 2d cubic Hermite basis (aka Hermite triangle)
      * A version of the 2d cubic Hermite basis where
        the cubic element bubble is eliminated. This
        is known as 'reduced Hermite triangle'
        and provides one part of the mixed DKT-element.
      * The 3d cubic Hermite basis
      
      Notice that, except for the 1d case, these FE-spaces
      are one H^1 but not H^2 conforming.
      cb6232ce
    • Maik Porrmann's avatar
      [hermite] Add TransformedFiniteElementMixin class · 16af94aa
      Maik Porrmann authored and Carsten Gräser's avatar Carsten Gräser committed
      This CRTP-mixin class implements the `localBasis()`
      part of a `LocalFiniteElement` using a transformation
      of another basis. The implementation class is required
      to implement member functions `referenceLocalBasis()`
      and `transform()`. The former allows to define the
      local ansatz-space in terms of _some_ local basis
      based on the corresponding interface in dune-localfunctions.
      The target basis is then given by a set of linear
      combinations of those reference basis functions.
      The `transform()` methods implements the linear
      transformation indiced by those linear combinations.
      
      Since the same transformation is used for function
      values as well as any order of derivative, this
      __cannot__ be used to implement range transformation
      as e.g. Piola-transformations.
      16af94aa
  12. Oct 03, 2024
  13. Oct 02, 2024
  14. Sep 27, 2024
  15. Sep 25, 2024
Loading