Skip to content
Snippets Groups Projects
  1. Feb 16, 2025
  2. Feb 15, 2025
    • Carsten Gräser's avatar
    • Carsten Gräser's avatar
      [examples] Don't use dune-vtk with 2.9 · 432a70c4
      Carsten Gräser authored
      432a70c4
    • Carsten Gräser's avatar
    • Carsten Gräser's avatar
    • Carsten Gräser's avatar
    • Carsten Gräser's avatar
      [constraints] Fix contraint computation for hierarchical bases · bb58d223
      Carsten Gräser authored
      The algorithm basically interpolates fine DOFs from
      coarse basis functions of neighboring elements. This
      requires some mechanism to interpolate only hanging fine
      DOFs and not all.
      Instead of checking if the fine interpolation point is in
      within the coarse element, we now check if the interpolated
      DOF is associated to a subentity of the intersection.
      In most cases this is equivalent. But for hierarchical bases,
      the former does probably not lead to the desired result (*).
      
      Remark: (*)
      In principle one would expect that the conforming hierarchical
      basis consists of the conforming P1-basis plus conforming bubbles.
      This is the case for both algorithms (except for some numerical
      issues for the old one). However, it turnes out that there are
      different possibilities to define the conforming bubbles and
      it's not clear which one is desired. Ideally we would like to have:
      
      * The bubbles are lagrangian, i.e. each one is zero at the interpolation
        point of the other ones.
      * The bubbles are non-negative.
      
      For hanging nodes you can't have both at once. The old algorithm
      guarantees the former, the new one the latter property. I'm undecides
      which one is 'correct'.
      bb58d223
    • Carsten Gräser's avatar
      [examples] Add adaptive Poisson example with hanging nodes · f20ff90d
      Carsten Gräser authored
      This demonstrates the usage of hanging node.
      So far the refinement indicator is a very crude
      quick and dirty hack.
      f20ff90d
    • Carsten Gräser's avatar
      [constraints] Add constraints support for dune-functions basis · 913fbc59
      Carsten Gräser authored
      This adds a class `AffineConstraints` for storing contraints
      for general dune-functions bases and a method
      `makeContinuityConstraints()` for computing the
      constraints for the H^1-conforming subspace
      for classical FE spaces on grid with hanging nodes.
      
      This is experimental and the interface may change.
      Also some features are still missing:
      
      * The code is generic and should work with nested
        bases and subspace bases. But this has not been
        tested so far.
      * One may want to generalize `makeContinuityConstraints()`
        such that one can extend an existing constraints
        object. This way one could add constraints for
        different branches in the tree one after the other.
      * Currently constraints are stored in a simple
        `std::unordered_map<std::map<Index,Coeff>>`
        data structure. Maybe this could be more efficient
        in a vector-based data structure or a sparse matrix.
        I had a compress method in mind that transforms into
        a more efficient storage once the contraints are fully
        build. But in my tests copying into a vector-bases
        data structure did not improve significantly, probably
        because the number of entries is relatively small.
      * The constraints class is called `AffineConstraints`
        because it is intended to also hold Dirichlet constraints.
        This feature is currently missing.
      913fbc59
  3. Feb 03, 2025
  4. Feb 01, 2025
    • Carsten Gräser's avatar
      [examples] Use new traversal to incorporate Dirichlet constraints · efa39edf
      Carsten Gräser authored
      This has a few advantages:
      * It does not require the basis just to do algebraic transformations.
      * It is also correct if the pattern is not exactly the one given by
        the local basis coupling. This is e.g. important for hanging nodes.
      * It is faster, because we loop over the matrix entries just once
        and in consecutive order.
      efa39edf
    • Carsten Gräser's avatar
      Add utility functions for recursive traversal of matrices and vectors · 4fbf8312
      Carsten Gräser authored
      This allows
      
      ```cpp
      recursiveForEachMatrixEntry(matrix, [](auto&& matrix_ij, auto&& i, auto&& j) {
        ...
      });
      
      recursiveForEachVectorEntry(vector, [](auto&& vector_i, auto&& i) {
        ...
      });
      ```
      
      Here the container is traversed hierachically and the row and column multi-indices
      `i` and `j` are instances of `Dune::Functions::StaticMultiIndex` with appropriate
      length depending on the nesting depth.
      4fbf8312
    • Carsten Gräser's avatar
      Merge branch 'cleanup/fix-example-types' into 'master' · fe543f9c
      Carsten Gräser authored
      [examples] Fix matrix/vector types of examples
      
      See merge request !256
      fe543f9c
    • Carsten Gräser's avatar
      [examples] Fix matrix/vector types of examples · 5e9faaed
      Carsten Gräser authored
      The nested matrix and vector types should correspond
      to the index tree of the basis. Here, this is not the
      case since `Field*<T,*>` was used instead of `T`.
      While this is in many cases no problem, it may fail
      if the matrix is recursively traversed with `IsNumber`
      as termination criterion.
      5e9faaed
  5. Jan 26, 2025
  6. Jan 25, 2025
    • Carsten Gräser's avatar
      ab970652
    • Carsten Gräser's avatar
      Remove tracking of processed entries in assembleGlobalBasisTransferMatrix · 27404f93
      Carsten Gräser authored
      To avoid duplicate work, `assembleGlobalBasisTransferMatrix()` used
      a container to store all processed fine basis functions. The used
      container is a `std::unordered_set<MultiIndex>`.
      
      Unfortunately this container is really slow. With the improved
      implemention it turned that checking, filling, clearning this
      container is in fact more expensive and the assembly is faster
      if the checks are removed. This is based on the test cases
      of the corresponding test, that checks various combinations
      of bases on 2d and 3d grids.
      
      Using a suitable bit vector to store flags would indeed be faster.
      However, it is very hard to derive a suitable container type
      generically based on the current basis interface. (This will
      hopefully iprove soon.)
      27404f93
  7. Jan 24, 2025
  8. Jan 23, 2025
  9. Jan 22, 2025
Loading