FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
scale_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_SCALE_BLOCK_HPP
9#error "Do not include this implementation-only header file directly!"
10#endif
11
12namespace FEAT::LAFEM::Arch
13{
14 template <typename ValueType_>
15 void ScaleBlock::exec_generic_impl(ValueType_ * r, const ValueType_ * const x, const ValueType_ alpha, const Index size)
16 {
17 if (x == r)
18 {
19 FEAT_PRAGMA_OMP(parallel for)
20 for (Index i = 0 ; i < size ; ++i)
21 {
22 for(int j = 0; j < ValueType_::n; ++j)
23 {
24 r[i][j] *= alpha[j];
25 }
26 }
27 }
28 else
29 {
30 FEAT_PRAGMA_OMP(parallel for)
31 for (Index i = 0 ; i < size ; ++i)
32 {
33 for(int j = 0; j < ValueType_::n; ++j)
34 {
35 r[i][j] = x[i][j] * alpha[j];
36 }
37 }
38 }
39 }
40} // namespace FEAT::LAFEM::Arch
std::uint64_t Index
Index data type.