FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
component_copy_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#ifndef KERNEL_LAFEM_ARCH_COMPONENT_COPY_GENERIC_HPP
8#define KERNEL_LAFEM_ARCH_COMPONENT_COPY_GENERIC_HPP 1
9
10#ifndef KERNEL_LAFEM_ARCH_COMPONENT_COPY_HPP
11#error "Do not include this implementation-only header file directly!"
12#endif
13
14namespace FEAT
15{
16 namespace LAFEM
17 {
18 namespace Arch
19 {
20 template <typename DT_>
21 void ComponentCopy::value_generic(DT_ * r, const DT_ * const x, const int stride, const int block, const Index size)
22 {
23 FEAT_PRAGMA_OMP(parallel for)
24 for(Index i = 0; i < size; ++i)
25 {
26 r[i*Index(stride) + Index(block)] = x[i];
27 }
28 }
29
30 template <typename DT_>
31 void ComponentCopy::value_to_generic(const DT_ * const r, DT_ * x, const int stride, const int block, const Index size)
32 {
33 FEAT_PRAGMA_OMP(parallel for)
34 for(Index i = 0; i < size; ++i)
35 {
36 x[i] = r[i*Index(stride) + Index(block)];
37 }
38 }
39 } // namespace Arch
40 } // namespace LAFEM
41} // namespace FEAT
42
43#endif // KERNEL_LAFEM_ARCH_COMPONENT_COPY_GENERIC_HPP
FEAT namespace.
Definition: adjactor.hpp:12
std::uint64_t Index
Index data type.