From cf223a6d6cd8fcb87e3ad5617476f6fb52f17578 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de> Date: Mon, 20 Aug 2018 12:01:39 +0200 Subject: [PATCH] [md][staggered] Fix localAssembler for clang * due to a bug in clang (https://stackoverflow.com/a/47849501), myMultiTypeBlockvector.size() (which is static constexpr) has to be changed to MultiTypeBlockVector::size() to be used as a constexpr template argument * probably a similar issue with using Dune::Hybrid::forEach and std::get<> --- .../subdomainstaggeredlocalassembler.hh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dumux/multidomain/subdomainstaggeredlocalassembler.hh b/dumux/multidomain/subdomainstaggeredlocalassembler.hh index f86611b827..2f07380eaa 100644 --- a/dumux/multidomain/subdomainstaggeredlocalassembler.hh +++ b/dumux/multidomain/subdomainstaggeredlocalassembler.hh @@ -332,17 +332,18 @@ private: template<class JacobianMatrixRow, class SubSol, class GridVariablesTuple> auto assembleJacobianAndResidualImpl_(Dune::index_constant<0>, JacobianMatrixRow& jacRow, SubSol& res, GridVariablesTuple& gridVariables) { + auto& gridVariablesI = *std::get<domainId>(gridVariables); const auto cellCenterGlobalI = problem().fvGridGeometry().elementMapper().index(this->element()); - const auto residual = this->asImp_().assembleCellCenterJacobianAndResidualImpl(jacRow[domainId], *std::get<domainId>(gridVariables)); + const auto residual = this->asImp_().assembleCellCenterJacobianAndResidualImpl(jacRow[domainId], gridVariablesI); res[cellCenterGlobalI] = residual; // for the coupling blocks using namespace Dune::Hybrid; - static constexpr auto otherDomainIds = makeIncompleteIntegerSequence<Dune::Hybrid::size(jacRow), domainId>{}; - forEach(otherDomainIds, [&, domainId = domainId](auto&& domainJ) + static constexpr auto otherDomainIds = makeIncompleteIntegerSequence<JacobianMatrixRow::size(), domainId>{}; + forEach(otherDomainIds, [&](auto&& domainJ) { - this->asImp_().assembleJacobianCellCenterCoupling(domainJ, jacRow[domainJ], residual, *std::get<domainJ>(gridVariables)); + this->asImp_().assembleJacobianCellCenterCoupling(domainJ, jacRow[domainJ], residual, gridVariablesI); }); } @@ -350,17 +351,18 @@ private: template<class JacobianMatrixRow, class SubSol, class GridVariablesTuple> void assembleJacobianAndResidualImpl_(Dune::index_constant<1>, JacobianMatrixRow& jacRow, SubSol& res, GridVariablesTuple& gridVariables) { - const auto residual = this->asImp_().assembleFaceJacobianAndResidualImpl(jacRow[domainId], *std::get<domainId>(gridVariables)); + auto& gridVariablesI = *std::get<domainId>(gridVariables); + const auto residual = this->asImp_().assembleFaceJacobianAndResidualImpl(jacRow[domainId], gridVariablesI); for(auto&& scvf : scvfs(this->fvGeometry())) res[scvf.dofIndex()] += residual[scvf.localFaceIdx()]; // for the coupling blocks using namespace Dune::Hybrid; - static constexpr auto otherDomainIds = makeIncompleteIntegerSequence<Dune::Hybrid::size(jacRow), domainId>{}; - forEach(otherDomainIds, [&, domainId = domainId](auto&& domainJ) + static constexpr auto otherDomainIds = makeIncompleteIntegerSequence<JacobianMatrixRow::size(), domainId>{}; + forEach(otherDomainIds, [&](auto&& domainJ) { - this->asImp_().assembleJacobianFaceCoupling(domainJ, jacRow[domainJ], residual, *std::get<domainJ>(gridVariables)); + this->asImp_().assembleJacobianFaceCoupling(domainJ, jacRow[domainJ], residual, gridVariablesI); }); } -- GitLab