Skip to content
Snippets Groups Projects

Implement ILU and ILDL preconditioners for scalar matrix entries

Merged Oliver Sander requested to merge implement-ilu-double into master

This merge request shifts to a new implementation strategy: There are methods toVector and toMatrix now that interpret scalars as FieldVector or FieldMatrix objects, respectively. That allows to get rid of the Hybrid::ifElse pattern, which is legible but longer.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Oliver Sander added 1 commit

    added 1 commit

    • f05bd527 - Implement ILU/ILDL preconditioners for scalar matrix entries

    Compare with previous version

  • merged

  • Oliver Sander mentioned in commit ab28696c

    mentioned in commit ab28696c

  • I'm sorry for moaning about this change, but as far as I know this cast violates aliasing rules and thus leads to undefined behaviour. While it seems to work for now, I learned the hard way that such violations may lead to very hard to diagnose Heisenbugs.

  • There's two possible solutions, both involve to return a new value in toVector() and toMatrix() for raw types:

    • Create matrix/vector-like proxy classes storing a reference to the raw value and providing the necessary interface.
    • Return a new FieldMatrix<B,1,1> / FieldVector<B,1> copying the value.

    While the second solution avoids the boilerplate code of the first one, it introduces an artificial copy. However, I guess that the compiler would optimize the potential overhead anyway. But this should be verified.

  • Yep, I know. I am pretty sure that copying the value is not a problem in optimized code. Unoptimized code may indeed require measurements.

Please register or sign in to reply
Loading