Feature: FastDGGridOperator from exadune
This merge request copies the FastDGGridOperator from EXADune to PDELab. This allows to make use of blocking of degrees of freedom in the global degree of freedom vector for DG methods. This way we can avoid copying the data around several times.
All code credit goes to @smuething. I just copied his code around.
Merge request reports
Activity
- Resolved by René Heß
Sorry for being picky, but I don't think this MR is not OK.
- we are using two git repos. I don't link copying code around. I'd like to see the history.
- you could pick the relevant commits, as we only have few modified files and mostly new files.
- the MR could be split into two or three different sets of features, which would make it easier to review.
- the code uses TBB. Does it also work without TBB?
- there is no test at all for this assembler.
146 global_sn_view.attach(solution_); 147 } 148 149 //! Called immediately after binding of local function space in 150 //! global assembler. 151 //! @{ 152 template<typename EG, typename LFSUC, typename LFSVC> 153 void onBindLFSUV(const EG & eg, const LFSUC & lfsu_cache, const LFSVC & lfsv_cache){ 154 global_sl_view.bind(lfsu_cache); 155 //xl.resize(lfsu_cache.size()); 156 } 157 158 template<typename EG, typename LFSVC> 159 void onBindLFSV(const EG & eg, const LFSVC & lfsv_cache){ 160 global_rl_view.bind(lfsv_cache); 161 //rl.assign(lfsv_cache.size(),0.0); Sorry I forgot to tag the merge request work in progress. It is definitely not ready to be merged but I wanted to make it visible here so that @smuething and everybody else can have a look. So thanks for looking into it!
I think there will be more places with obvious mistakes or where things could be done better. I hope @smuething will find the time to look at it. Some specific answers:
- The #* file is of course garbage.
- About history preserving: I think this would be really hard. Maybe I am wrong but I would guess that preserving history from exadune would be really difficult.
- This whole merging back from exadune is something which should be discussed at some point. I have the impression that exadune is like a playground for implenenting features and finding the right ways to do it without worrying about breaking things. I think the developed features should in the end reach pdelab. The important question is how. I agree that more informative commit messages would be a good thing but it could be difficult to find someone with the time and knowledge to achieve a nice well documented merge into pdelab.
- For me it would be impossible to split this merge since I started with an example and fixed pdelab along the way.
- I can't say anything about TBB.
- Tests: Right now there is no test since this would involve writing a local operator. We have a test for this code but it comes from generated code that is not easy to read. Maybe just document that this is some kind of experimental feature that should only be used if you know what you are doing?
Edited by René HeßAbout history preserving: I think this would be really hard. Maybe I am wrong but I would guess that preserving history from exadune would be really difficult.
why? The changes are mainly new files. It should be easy to cherry-pick these commits and the other ones should only be few, so that hopefully it is not too much work to keep them working...
The main reason is that @smuething implemented the FastDGGridOperator directly in the normal pdelab GridOperator. This of course broke all CG stuff. So about 10 month ago @marian moved the FastDGGridOperator to a new file. If you look at a blame of
you can see that the history is already lost at this point.
changed milestone to %PDELab 2.9
In the next days I want to go through the last year's commit messages in EXADune PDELab because we also want to backport the improved interface for matrix-free computations. I can then tell whether everything is OK with this backport. But I reckon so, since you are both using it for your testing.
I personally believe that it is better that the two grid operators are separated because it really doesn't harm the old code.
added 1 commit
- 35414e29 - [LocalAssemblerBase,FastDG] revert mixing up public and proctected accessibility of members
added 1 commit
- 614f525f - [FastDGGridOperator,Engines] improve readability of code + consistent style
mentioned in merge request !212 (merged)
added 21 commits
- e3856241 - Add fastdg stuff in gridfunctionspace/
- d32cf9ea - Update lfsindexcache
- a599e7c5 - Remove timers from fastdg engines
- 91065bc4 - Remove direction in fastdg.hh
- 8ecbd998 - Update localfunctionspace.hh
- 4e2addd7 - Update backend/istl/bcrsmatrix.hh/vector.hh
- 6827e859 - Add backend/common/aliasedmatrixview.hh/aliasedvectorview.hh
- 9c986d19 - Add backend/istl/flatmatrixbackend.hh/flatvectorbackend.hh
- d1cfb904 - Remove flatmatrixbackend.hh/flatvectorbackend.hh
- ac3d5456 - Update bcrsmatrix.hh
- a778597d - Update matrixhelpers.hh
- 79f33890 - Update fastdg/assemlbler.hh
- e35d9a6a - Update p/g/c/assemblerutilities.hh
- fa19552c - Update subspacelocalfunctionspace.hh
- 85289732 - Add clear_row_block() method to simple matrix backends
- 31112b3e - Use std::tuple_size
- 310639b9 - Dune::ForEachValue -> Hybrid::forEach
- 8c0156cc - correct Dirichlet constraints handling in standard case to old behaviour
- e51df0d2 - [FastDG] delete friend declaration of GridOperator in local assembler
- b91a5424 - [LocalAssemblerBase,FastDG] revert mixing up public and proctected accessibility of members
- fdceb4dd - [FastDGGridOperator,Engines] improve readability of code + consistent style
Toggle commit list- Resolved by Dominic Kempf
added 1 commit
- bd972ab1 - Remove unneeded methods from aliasedmatrixview
Looks good to me. One last thing, though: After merging, the new operator might need the same cleanups as the standard one from Marian's !212 (merged).
146 146 } 147 147 148 148 //! Access time at given stage 149 Real timeAtStage(int stage_){ 149 Real timeAtStage(int stage_) const 150 { 150 151 return time+osp_method->d(stage_)*dt; 151 152 } 152 153 153 154 //! Access time at given stage 154 Real timeAtStage(){ 155 return time+osp_method->d(stage)*dt; 155 Real timeAtStage() const 156 { 157 return time+osp_method->d(stage_)*dt; changed milestone to %PDELab 2.7
mentioned in issue #88 (closed)
mentioned in issue #92 (closed)
added 5 commits
- 3085f7fc - Write test for FastDGOperator -> Residuals are done
- 5b5b1473 - Write test for FastDGOperator -> Jacobians are done
- b5f5099c - Write test for FastDGGridOperator -> return 1 if error is too large
- e3c332db - Fix small class access bug (public/private)
- f6f0df1f - Add test for instationary FastDG
Toggle commit listadded 180 commits
-
f6f0df1f...511f9d4e - 148 commits from branch
master
- ecdb1fe8 - Add fastdg stuff in gridfunctionspace/
- 43bb71c1 - Update lfsindexcache
- 70448c98 - Remove timers from fastdg engines
- 4df8b7d8 - Remove direction in fastdg.hh
- b9d7e3c6 - Update localfunctionspace.hh
- 895e3264 - Update backend/istl/bcrsmatrix.hh/vector.hh
- 0bee92c6 - Add backend/common/aliasedmatrixview.hh/aliasedvectorview.hh
- 1930dccd - Add backend/istl/flatmatrixbackend.hh/flatvectorbackend.hh
- efaaec2f - Remove flatmatrixbackend.hh/flatvectorbackend.hh
- 91c323b3 - Update bcrsmatrix.hh
- 3f7f3138 - Update matrixhelpers.hh
- c3d7b6ea - Update fastdg/assemlbler.hh
- f19efb8b - Update p/g/c/assemblerutilities.hh
- 0cc96626 - Update subspacelocalfunctionspace.hh
- a426d08e - Add clear_row_block() method to simple matrix backends
- 150e5637 - Use std::tuple_size
- 9de940d2 - Dune::ForEachValue -> Hybrid::forEach
- e8e0a9ee - correct Dirichlet constraints handling in standard case to old behaviour
- 7580a5db - [FastDG] delete friend declaration of GridOperator in local assembler
- 3f822313 - [LocalAssemblerBase,FastDG] revert mixing up public and proctected accessibility of members
- a9f674d8 - [FastDGGridOperator,Engines] improve readability of code + consistent style
- c990e1fe - Remove TBB stuff
- cf66e2bc - Remove unneeded methods from aliasedmatrixview
- 77c4838b - [PrestageEngine] fix code to cover default and fast DG grid operator
- af57721d - [OneStep,Prestage] improve documentation
- 8c7f9830 - [OneStep,Prestage] add empty bind-functions on the lfs and explain why
- 483fe64b - [bugfix] Use correct stage class member
- 81885cc8 - Write test for FastDGOperator -> Residuals are done
- 5ba06b27 - Write test for FastDGOperator -> Jacobians are done
- b28065fe - Write test for FastDGGridOperator -> return 1 if error is too large
- 7778446e - Fix small class access bug (public/private)
- 1efecf30 - Add test for instationary FastDG
Toggle commit list-
f6f0df1f...511f9d4e - 148 commits from branch
- Resolved by René Heß
- Resolved by René Heß
I finally had time to rebase to master and fix the issues mentioned by @marian. The tests pass so I will merge on friday if no one objects.
added 39 commits
-
6d913798...d98f396f - 5 commits from branch
master
- eda2b1da - Add fastdg stuff in gridfunctionspace/
- 84529f38 - Update lfsindexcache
- 8aae4bcb - Remove timers from fastdg engines
- e8244997 - Remove direction in fastdg.hh
- ceb99f8a - Update localfunctionspace.hh
- 169d63fa - Update backend/istl/bcrsmatrix.hh/vector.hh
- ca809f2f - Add backend/common/aliasedmatrixview.hh/aliasedvectorview.hh
- 286dcb36 - Add backend/istl/flatmatrixbackend.hh/flatvectorbackend.hh
- 61f9849c - Remove flatmatrixbackend.hh/flatvectorbackend.hh
- 02c3d31d - Update bcrsmatrix.hh
- cbea80e0 - Update matrixhelpers.hh
- 65248657 - Update fastdg/assemlbler.hh
- f47c8ae7 - Update p/g/c/assemblerutilities.hh
- 9b2a3274 - Update subspacelocalfunctionspace.hh
- 3e612110 - Add clear_row_block() method to simple matrix backends
- ed51efd2 - Use std::tuple_size
- d65ae046 - Dune::ForEachValue -> Hybrid::forEach
- 979f4226 - correct Dirichlet constraints handling in standard case to old behaviour
- 4b436829 - [FastDG] delete friend declaration of GridOperator in local assembler
- d526b830 - [LocalAssemblerBase,FastDG] revert mixing up public and proctected accessibility of members
- f0c7ee65 - [FastDGGridOperator,Engines] improve readability of code + consistent style
- 4b7aa714 - Remove TBB stuff
- fb5388f4 - Remove unneeded methods from aliasedmatrixview
- 0aaa0e26 - [PrestageEngine] fix code to cover default and fast DG grid operator
- c9dcb3ec - [OneStep,Prestage] improve documentation
- e5de600b - [OneStep,Prestage] add empty bind-functions on the lfs and explain why
- c4ec8176 - [bugfix] Use correct stage class member
- 3d6626aa - Write test for FastDGOperator -> Residuals are done
- d460daf3 - Write test for FastDGOperator -> Jacobians are done
- 4302e684 - Write test for FastDGGridOperator -> return 1 if error is too large
- 5a40dcff - Fix small class access bug (public/private)
- f3877bb9 - Add test for instationary FastDG
- ae11c5b9 - [bugfix] Fix bug introduced in rebasing
- db7c6f53 - Fix tests
Toggle commit list-
6d913798...d98f396f - 5 commits from branch
mentioned in commit 590ac4e6