10#include <kernel/lafem/sparse_matrix_bcsr.hpp>
11#include <kernel/lafem/dense_vector_blocked.hpp>
12#include <kernel/lafem/sparse_vector_blocked.hpp>
13#include <kernel/lafem/arch/slip_filter.hpp>
81 template <
typename DT2_ = DT_,
typename IT2_ = IT_>
85 template <
typename DT2_ = DT_,
typename IT2_ = IT_>
88 static_assert(
BlockSize > 1,
"BlockSize has to be >= 2 in SlipFilter!");
122 _nu(std::move(other.
_nu)),
132 _sv = std::forward<
decltype(other._sv)>(other._sv);
133 _nu = std::forward<
decltype(other._nu)>(other._nu);
147 other.clone(*
this, clone_mode);
154 _nu.clone(other.get_nu(), clone_mode);
155 _sv.clone(other.get_filter_vector(), clone_mode);
159 template<
typename DT2_,
typename IT2_,
int BS_>
162 _nu.convert(other.get_nu());
163 _sv.convert(other.get_filter_vector());
176 return _nu.bytes() +
_sv.bytes();
184 const SparseVectorBlocked<DT_, IT_, BlockSize>& get_filter_vector()
const
189 SparseVectorBlocked<DT_, IT_, BlockSize>& get_nu()
193 const SparseVectorBlocked<DT_, IT_, BlockSize>& get_nu()
const
220 return _sv.used_elements();
226 return _sv.indices();
232 return _sv.indices();
238 return _sv.elements();
244 return _sv.elements();
249 return _sv.used_elements() <=
Index(0);
264 Arch::SlipFilter::template filter_rhs<BlockSize_>
265 (vector.template elements<Perspective::pod>(),
_sv.template elements<Perspective::pod>(),
_sv.indices(),
_sv.used_elements());
294 Arch::SlipFilter::template filter_def<BlockSize_>
295 (vector.template elements<Perspective::pod>(),
_sv.template elements<Perspective::pod>(),
_sv.indices(),
_sv.used_elements() );
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Blocked Dense data vector class template.
Index size() const
The number of elements.
Slip Filter class template.
void convert(const SlipFilter< DT2_, IT2_, BS_ > &other)
Converts data from another UnitFilter.
SparseVectorBlocked< DT_, IT_, BlockSize_ > _nu
This will contain the pointwise outer unit normal in all vertices.
SlipFilter(SlipFilter &&other)
move-ctor
DenseVectorBlocked< DT_, IT_, BlockSize_ > VectorType
Our supported vector type.
SparseVectorBlocked< DT_, IT_, BlockSize_ > _sv
This will contain the data for filtering.
Index used_elements() const
static constexpr int BlockSize
The block size.
DT_ DataType
data-type typedef
void add(IndexType idx, ValueType val)
Adds one element to the filter.
void clone(const SlipFilter &other, CloneMode clone_mode=CloneMode::Deep)
Clones data from another SlipFilter.
void filter_def(VectorType &vector) const
Applies the filter onto a defect vector.
std::size_t bytes() const
Returns the total amount of bytes allocated.
void filter_rhs(VectorType &vector) const
Applies the filter onto the right-hand-side vector.
SlipFilter(Index num_vertices, Index num_dofs)
Constructor.
void filter_sol(VectorType &vector) const
Applies the filter onto the solution vector.
void clear()
Clears the underlying data (namely the SparseVector)
SlipFilter & operator=(SlipFilter &&other)
move-assignment operator
const IT_ * get_indices() const
IT_ IndexType
index-type typedef
void filter_cor(VectorType &vector) const
Applies the filter onto a correction vector.
SlipFilter clone(CloneMode clone_mode=CloneMode::Deep) const
Creates a clone of itself.
const ValueType * get_values() const
Tiny::Vector< DataType, BlockSize > ValueType
Value type.
virtual ~SlipFilter()
virtual destructor
SlipFilter()
default constructor
Sparse vector class template.
Tiny Vector class template.
std::uint64_t Index
Index data type.