hyper.deal
Loading...
Searching...
No Matches
vector_access_internal.h
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2020 by the hyper.deal authors
4//
5// This file is part of the hyper.deal library.
6//
7// The hyper.deal library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 3.0 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE.MD at
12// the top level directory of hyper.deal.
13//
14// ---------------------------------------------------------------------
15
16#ifndef HYPERDEAL_MATRIX_FREE_VECTOR_ACCESS_INTERNAL
17#define HYPERDEAL_MATRIX_FREE_VECTOR_ACCESS_INTERNAL
18
19#include <hyper.deal/base/config.h>
20
21namespace hyperdeal
22{
23 namespace internal
24 {
25 namespace MatrixFreeFunctions
26 {
27 template <typename Number, typename VectorizedArrayType>
29 {
30 void
31 process_dof(const Number &global, Number &local) const
32 {
33 local = global;
34 }
35
36 void
37 process_dofs_vectorized_transpose(
38 const unsigned int dofs_per_cell,
39 const std::array<Number *, VectorizedArrayType::size()> &global_ptr,
40 VectorizedArrayType * local) const
41 {
42 vectorized_load_and_transpose(dofs_per_cell, global_ptr, local);
43 }
44 };
45
46
47
48 template <typename Number, typename VectorizedArrayType>
50 {
51 void
52 process_dof(Number &global, const Number &local) const
53 {
54 global += local;
55 }
56
57 void
58 process_dofs_vectorized_transpose(
59 const unsigned int dofs_per_cell,
60 std::array<Number *, VectorizedArrayType::size()> &global_ptr,
61 const VectorizedArrayType * local) const
62 {
63 vectorized_transpose_and_store(true,
64 dofs_per_cell,
65 local,
66 global_ptr);
67 }
68 };
69
70
71
72 template <typename Number, typename VectorizedArrayType>
74 {
75 void
76 process_dof(Number &global, const Number &local) const
77 {
78 global = local;
79 }
80
81 void
82 process_dofs_vectorized_transpose(
83 const unsigned int dofs_per_cell,
84 std::array<Number *, VectorizedArrayType::size()> &global_ptr,
85 const VectorizedArrayType * local) const
86 {
87 vectorized_transpose_and_store(false,
88 dofs_per_cell,
89 local,
90 global_ptr);
91 }
92 };
93
94 } // namespace MatrixFreeFunctions
95 } // namespace internal
96} // namespace hyperdeal
97
98#endif
Definition vector_access_internal.h:29
Definition vector_access_internal.h:74