FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
slip_filter_block_generic.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
8#ifndef KERNEL_LAFEM_ARCH_SLIP_FILTER_BLOCK_HPP
9#error "Do not include this implementation-only header file directly!"
10#endif
11
13namespace FEAT::LAFEM::Arch
14{
15 template <typename DT_, typename IT_>
16 void SlipFilterBlock::exec_generic_impl(DT_ * v, const DT_ * const f_nu, const IT_ * const f_idx, const Index f_nzes, const int bs)
17 {
18 const Index block_size = Index(bs);
19
20 FEAT_PRAGMA_OMP(parallel for)
21 for(Index i = 0; i < f_nzes; ++i)
22 {
23 DT_ sp(DT_(0));
24 DT_ scal(DT_(0));
25 for(Index j = 0 ; j < block_size ; ++j)
26 {
27 sp += v[block_size * f_idx[i] + j] *f_nu[block_size * i + j];
28 scal += f_nu[block_size * i + j]*f_nu[block_size * i + j];
29 }
30
31 sp /= scal;
32
33 for(Index j = 0 ; j < block_size ; ++j)
34 v[block_size * f_idx[i] + j] -= sp*f_nu[block_size * i + j];
35 }
36 }
37} // namespace FEAT::LAFEM::Arch
std::uint64_t Index
Index data type.