Add explicit template instantiation of class FoamGrid
Summary
This MR fixes some problems with explicit template instantiation of the class FoamGrid
. And a library including these explicit instantiations is added.
Details
The problems come from explicit specializations of methods for some entity dimensions. If these methods are instantiated for all grid dimensions it crashes. Instead of this explicit overloads, I have added templated member functions that are instantiated only for the correct dimensions.
Some additional commits in the MR:
- Fix missing forward declaration of types used in friend declarations
- Rename
foamgrid.cc
tofoamgrid.impl.hh
since it was not a source file, but a header file of template implementations. Instead a new filefoamgrid.cc
is added, containing just the template instantiations. - Move the include of
foamgrid.impl.hh
out of theDune
namespace and add include guards.
Merge request reports
Activity
mentioned in issue #16 (closed)
- Resolved by Simon Praetorius
@tkoch commented on a deleted MR:
@simon.praetorius Thanks! With the explicit template instantiations will I still be able to use FoamGrid<1, 10> (I don't know if that ever worked or was used but it was supposed to) or does that not work anymore? I always wondered about that aspect of the feature and never got around trying it out.
Yes. Only those symbols explicitly instantiated are put into the library. But, everything else is instantiated on request, e.g. when you write
FoamGrid<1, 10>
in your executable.Edited by Simon Praetorius
- Resolved by Simon Praetorius
- Resolved by Timo Koch
- Resolved by Simon Praetorius
added 2 commits
- Resolved by Simon Praetorius
- Resolved by Simon Praetorius
- Resolved by Simon Praetorius
- Resolved by Simon Praetorius
added 15 commits
Toggle commit listadded 1 commit
- f7684cea - Add explici template instantiation of clss FoamGrid
added 1 commit
- 19c96e60 - Add explici template instantiation of clss FoamGrid
added 3 commits
-
19c96e60...72aafe80 - 2 commits from branch
master
- 6a9b970e - Add explicit template instantiations of class FoamGrid
-
19c96e60...72aafe80 - 2 commits from branch
added 1 commit
- 3982001c - [lib] Add foamgrid library as module library
@simon.praetorius I get a linker error with your version (something related to Dune::Exception) which disappears after my last commit. Is there something wrong with this approach?