5#include <dune/functions/common/typeerasure.hh>
7#include <amdis/common/ConceptsBase.hpp>
8#include <amdis/common/TypeTraits.hpp>
14template <
class Mat,
class Sol,
class Rhs>
15struct BoundaryConditionDefinition
20 virtual ~Interface() =
default;
21 virtual void init() = 0;
22 virtual void apply(Mat&, Sol&, Rhs&) = 0;
27 struct Model :
public Impl
30 void init() final { this->get().init(); }
31 void apply(Mat& A, Sol& x, Rhs& b)
final { this->get().apply(A,x,b); }
38 auto require(BC&& bc) ->
decltype
41 bc.apply(std::declval<Mat&>(), std::declval<Sol&>(), std::declval<Rhs&>())
45 using Base = Dune::Functions::TypeErasureBase<Interface, Model>;
60template <
class Mat,
class Sol,
class Rhs>
62 :
public Impl::BoundaryConditionDefinition<Mat,Sol,Rhs>::Base
64 using Definition = Impl::BoundaryConditionDefinition<Mat,Sol,Rhs>;
65 using Super =
typename Definition::Base;
69 template <
class Impl, Dune::disableCopyMove<BoundaryCondition,Impl> = 0>
73 static_assert(Concepts::models<
typename Definition::Concept(
Impl)>,
74 "Implementation does not model the BoundaryCondition concept.");
87 this->asInterface().init();
95 void apply(Mat& A, Sol& x, Rhs& b)
97 this->asInterface().apply(A,x,b);
Interface class for boundary conditions.
Definition: BoundaryCondition.hpp:63
void init()
Initialize the boundary condition.
Definition: BoundaryCondition.hpp:85
BoundaryCondition()=default
Default Constructor.
void apply(Mat &A, Sol &x, Rhs &b)
Apply the boundary condition to matrix and vector.
Definition: BoundaryCondition.hpp:95
BoundaryCondition(Impl &&impl)
Constructor. Pass any type supporting the BoundaryConditionInterface.
Definition: BoundaryCondition.hpp:70