Skip to content
Snippets Groups Projects

Draft: Remove FieldMatrix/Vector scalar specialization

Open Simon Praetorius requested to merge feature/remove-fieldvector1-scalar into master
2 unresolved threads

(This is an experiment whether it would be possible to remove the FieldVector<K,1> and FieldMatrix<K,1,1> specialization completely.)

See accompanying MRs in other modules:

Edited by Simon Praetorius

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
  • Simon Praetorius mentioned in merge request dune-istl!601

    mentioned in merge request dune-istl!601

  • Simon Praetorius mentioned in merge request dune-geometry!261

    mentioned in merge request dune-geometry!261

  • mentioned in merge request dune-localfunctions!284

  • Simon Praetorius mentioned in merge request dune-grid!767

    mentioned in merge request dune-grid!767

  • mentioned in merge request staging/dune-functions!502

  • Apparently, the core and staging and a few extensions modules pass after some code changes.

  • Thanks for checking. I'm all for the removal, but it will need a vote and a deprecation period.

    • I agree that this should be removed, but expect that this break lots of user code. While most downstream libraries are (mostly) generic wrt the dimension anyway and thus require little effort to fix, there will be many users that use Field*<*,1> like a scalar, because this was for a long time encouraged by dune and partly still is (cf. e.g. dune-istl!600 (merged)).

    • Sure, this is nothing quickly changed. I just wanted to try whether it is possible to do and what the consequences are before I formulate a proposal.

      I have also seen that this interpretation as scalar is used in many places. Also the scalar local basis functions are using FieldVector<T,1> (this is another aspect but a little bit independent of this implicit conversion topic) and the evaluated shape functions are used like scalars everywhere. The core modules are mostly fine. dune-localfunctions needed the most changes. But, discretization modules are another topic. This will be more difficult to adapt.

    • Please register or sign in to reply
    • Also the scalar local basis functions are using FieldVector<T,1> (this is another aspect but a little bit independent of this implicit conversion topic) and the evaluated shape functions are used like scalars everywhere.

      This also directly came to my mind. Currently the interface hard-codes a local basis range is always a vector with a certain dimension. This does not only lead to the problem you mentioned (identify scalar with FieldVector<*,1>) but is also to restrictive e.g. for matrix-valued bases like Arnold-Winther. While this seems to be orthogonal to the removal of the specialization, we should carefully consider the least painful transition path.

      If we e.g. want to generalize the local basis ranges and transition from FieldVector<T,1> to plain T for simple scalar bases, it might be easier as long as there's some compatibility between the two types, as provided by the specialization.

    • The issue with the scalar basis implemented with FieldVector<T,1> as RangeType is actually the JacobianType, which is a FieldMatrix<T,1,dim>. There is no .dot() product for single-row matrices directly. Thus, either people use J[0].dot() or J * transposed(J). Both will not work if changed to a FieldVector. I just wanted to separate this discussion from the scalar conversion, but also have the impression we should discuss this at some point and maybe revise our current design pattern.

    • Please register or sign in to reply
  • Simon Praetorius changed the description

    changed the description

Please register or sign in to reply
Loading