Commit 07930b89 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'feature/dune-2.7' into 'releases/0.2'

make amdis compatible with dune 2.7, i.e. rewrite fillBoundaryCondition by...

See merge request !2
parents cef1164c 54678960
......@@ -26,8 +26,8 @@ namespace AMDiS
template <class RowBasis, class ColBasis>
void init(RowBasis const& rowBasis, ColBasis const& colBasis) { /* do nothing */ }
template <class Matrix, class X, class B, class RN, class CN>
void fillBoundaryCondition(Matrix& A, X& x, B& b, RN const& rowNode, CN const& colNode) { /* do nothing */ }
template <class Matrix, class X, class B, class RN, class RTP, class CN, class CTP>
void fillBoundaryCondition(Matrix& A, X& x, B& b, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath) { /* do nothing */ }
protected:
std::shared_ptr<BoundaryManagerBase const> boundaryManager_{nullptr};
......
......@@ -73,8 +73,8 @@ namespace AMDiS
* \tparam RN RowNode
* \tparam CN ColNode
**/
template <class Mat, class Sol, class Rhs, class RN, class CN>
void fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, CN const& colNode);
template <class Mat, class Sol, class Rhs, class RN, class RTP, class CN, class CTP>
void fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath);
private:
Dune::Std::optional<std::function<bool(Domain)>> predicate_;
......
......@@ -28,15 +28,15 @@ init(RB const& rowBasis, CB const& colBasis)
template <class D, class R>
template <class Mat, class Sol, class Rhs, class RN, class CN>
template <class Mat, class Sol, class Rhs, class RN, class RTP, class CN, class CTP>
void DirichletBC<D,R>::
fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, CN const& colNode)
fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath)
{
auto columns = Constraints<Mat>::dirichletBC(matrix, dirichletNodes_);
Dune::Hybrid::ifElse(std::is_same<RangeType_t<RN>, R>{},
[&](auto id) {
auto subBasis = Dune::Functions::subspaceBasis(rhs.basis(), rowNode.treePath());
auto subBasis = Dune::Functions::subspaceBasis(rhs.basis(), rowTreePath);
Dune::Functions::interpolate(subBasis, rhs, values_, dirichletNodes_);
});
......@@ -46,7 +46,7 @@ fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, C
Dune::Hybrid::ifElse(std::is_same<RangeType_t<CN>, R>{},
[&](auto id) {
auto subBasis = Dune::Functions::subspaceBasis(solution.basis(), colNode.treePath());
auto subBasis = Dune::Functions::subspaceBasis(solution.basis(), colTreePath);
Dune::Functions::interpolate(subBasis, solution, values_, dirichletNodes_);
});
}
......
......@@ -65,8 +65,8 @@ namespace AMDiS
template <class RB, class CB>
void init(RB const& rowBasis, CB const& colBasis);
template <class Mat, class Sol, class Rhs, class RN, class CN>
void fillBoundaryCondition(Mat& A, Sol& x, Rhs& b, RN const& rowNode, CN const& colNode);
template <class Mat, class Sol, class Rhs, class RN, class RTP, class CN, class CTP>
void fillBoundaryCondition(Mat& A, Sol& x, Rhs& b, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath);
auto const& associations() const
{
......
......@@ -231,9 +231,9 @@ coords(Node const& tree, std::vector<std::size_t> const& localIndices) const
template <class D, class MI>
template <class Mat, class Sol, class Rhs, class RN, class CN>
template <class Mat, class Sol, class Rhs, class RN, class RTP, class CN, class CTP>
void PeriodicBC<D,MI>::
fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, CN const& colNode)
fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath)
{
Constraints<Mat>::periodicBC(matrix, periodicNodes_, associations_);
......
......@@ -456,13 +456,13 @@ buildAfterAdapt(AdaptInfo& /*adaptInfo*/, Flag /*flag*/, bool asmMatrix, bool as
systemMatrix_->finish(asmMatrix);
rhs_->finish(asmVector);
for_each_node(localView.tree(), [&,this](auto const& rowNode, auto) {
for_each_node(localView.tree(), [&,this](auto const& colNode, auto) {
for_each_node(localView.tree(), [&,this](auto const& rowNode, auto row_tp) {
for_each_node(localView.tree(), [&,this](auto const& colNode, auto col_tp) {
// finish boundary condition
for (auto bc : dirichletBCs_[rowNode][colNode])
bc->fillBoundaryCondition(*systemMatrix_, *solution_, *rhs_, rowNode, colNode);
bc->fillBoundaryCondition(*systemMatrix_, *solution_, *rhs_, rowNode, row_tp, colNode, col_tp);
for (auto bc : periodicBCs_[rowNode][colNode])
bc->fillBoundaryCondition(*systemMatrix_, *solution_, *rhs_, rowNode, colNode);
bc->fillBoundaryCondition(*systemMatrix_, *solution_, *rhs_, rowNode, row_tp, colNode, col_tp);
});
});
......
......@@ -4,7 +4,6 @@
#include <dune/functions/functionspacebases/compositebasis.hh>
#include <dune/functions/functionspacebases/lagrangebasis.hh>
#include <dune/functions/functionspacebases/powerbasis.hh>
#include <dune/functions/functionspacebases/pqknodalbasis.hh>
#include <dune/grid/yaspgrid.hh>
#include <amdis/common/Logical.hpp>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment