Commit 54678960 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

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

make amdis compatible with dune 2.7, i.e. rewrite filleBoundaryCondition by passing a treepath additionally
parent cef1164c
...@@ -26,8 +26,8 @@ namespace AMDiS ...@@ -26,8 +26,8 @@ namespace AMDiS
template <class RowBasis, class ColBasis> template <class RowBasis, class ColBasis>
void init(RowBasis const& rowBasis, ColBasis const& colBasis) { /* do nothing */ } void init(RowBasis const& rowBasis, ColBasis const& colBasis) { /* do nothing */ }
template <class Matrix, class X, class B, class RN, class CN> 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, CN const& colNode) { /* do nothing */ } void fillBoundaryCondition(Matrix& A, X& x, B& b, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath) { /* do nothing */ }
protected: protected:
std::shared_ptr<BoundaryManagerBase const> boundaryManager_{nullptr}; std::shared_ptr<BoundaryManagerBase const> boundaryManager_{nullptr};
......
...@@ -73,8 +73,8 @@ namespace AMDiS ...@@ -73,8 +73,8 @@ namespace AMDiS
* \tparam RN RowNode * \tparam RN RowNode
* \tparam CN ColNode * \tparam CN ColNode
**/ **/
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 fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, CN const& colNode); void fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath);
private: private:
Dune::Std::optional<std::function<bool(Domain)>> predicate_; Dune::Std::optional<std::function<bool(Domain)>> predicate_;
......
...@@ -28,15 +28,15 @@ init(RB const& rowBasis, CB const& colBasis) ...@@ -28,15 +28,15 @@ init(RB const& rowBasis, CB const& colBasis)
template <class D, class R> 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>:: 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_); auto columns = Constraints<Mat>::dirichletBC(matrix, dirichletNodes_);
Dune::Hybrid::ifElse(std::is_same<RangeType_t<RN>, R>{}, Dune::Hybrid::ifElse(std::is_same<RangeType_t<RN>, R>{},
[&](auto id) { [&](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_); Dune::Functions::interpolate(subBasis, rhs, values_, dirichletNodes_);
}); });
...@@ -46,7 +46,7 @@ fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, C ...@@ -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>{}, Dune::Hybrid::ifElse(std::is_same<RangeType_t<CN>, R>{},
[&](auto id) { [&](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_); Dune::Functions::interpolate(subBasis, solution, values_, dirichletNodes_);
}); });
} }
......
...@@ -65,8 +65,8 @@ namespace AMDiS ...@@ -65,8 +65,8 @@ namespace AMDiS
template <class RB, class CB> template <class RB, class CB>
void init(RB const& rowBasis, CB const& colBasis); void init(RB const& rowBasis, CB const& colBasis);
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 fillBoundaryCondition(Mat& A, Sol& x, Rhs& b, RN const& rowNode, CN const& colNode); void fillBoundaryCondition(Mat& A, Sol& x, Rhs& b, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath);
auto const& associations() const auto const& associations() const
{ {
......
...@@ -231,9 +231,9 @@ coords(Node const& tree, std::vector<std::size_t> const& localIndices) const ...@@ -231,9 +231,9 @@ coords(Node const& tree, std::vector<std::size_t> const& localIndices) const
template <class D, class MI> 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>:: 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_); Constraints<Mat>::periodicBC(matrix, periodicNodes_, associations_);
......
...@@ -456,13 +456,13 @@ buildAfterAdapt(AdaptInfo& /*adaptInfo*/, Flag /*flag*/, bool asmMatrix, bool as ...@@ -456,13 +456,13 @@ buildAfterAdapt(AdaptInfo& /*adaptInfo*/, Flag /*flag*/, bool asmMatrix, bool as
systemMatrix_->finish(asmMatrix); systemMatrix_->finish(asmMatrix);
rhs_->finish(asmVector); rhs_->finish(asmVector);
for_each_node(localView.tree(), [&,this](auto const& rowNode, auto) { for_each_node(localView.tree(), [&,this](auto const& rowNode, auto row_tp) {
for_each_node(localView.tree(), [&,this](auto const& colNode, auto) { for_each_node(localView.tree(), [&,this](auto const& colNode, auto col_tp) {
// finish boundary condition // finish boundary condition
for (auto bc : dirichletBCs_[rowNode][colNode]) 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]) 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 @@ ...@@ -4,7 +4,6 @@
#include <dune/functions/functionspacebases/compositebasis.hh> #include <dune/functions/functionspacebases/compositebasis.hh>
#include <dune/functions/functionspacebases/lagrangebasis.hh> #include <dune/functions/functionspacebases/lagrangebasis.hh>
#include <dune/functions/functionspacebases/powerbasis.hh> #include <dune/functions/functionspacebases/powerbasis.hh>
#include <dune/functions/functionspacebases/pqknodalbasis.hh>
#include <dune/grid/yaspgrid.hh> #include <dune/grid/yaspgrid.hh>
#include <amdis/common/Logical.hpp> #include <amdis/common/Logical.hpp>
......
Supports Markdown
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