GEOSX
DataLayouts.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 Total, S.A
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOSX_COMMON_DATALAYOUTS_HPP_
20 #define GEOSX_COMMON_DATALAYOUTS_HPP_
21 
22 #include "RAJA/RAJA.hpp"
23 #include "LvArray/src/Array.hpp"
24 
25 namespace geosx
26 {
27 
28 namespace nodes
29 {
30 
31 #if defined( GEOSX_USE_CUDA )
32 
34 using REFERENCE_POSITION_PERM = RAJA::PERM_JI;
35 
37 using TOTAL_DISPLACEMENT_PERM = RAJA::PERM_JI;
38 
40 using INCR_DISPLACEMENT_PERM = RAJA::PERM_JI;
41 
43 using VELOCITY_PERM = RAJA::PERM_JI;
44 
46 using ACCELERATION_PERM = RAJA::PERM_JI;
47 
48 #else
49 
51 using REFERENCE_POSITION_PERM = RAJA::PERM_IJ;
52 
54 using TOTAL_DISPLACEMENT_PERM = RAJA::PERM_IJ;
55 
57 using INCR_DISPLACEMENT_PERM = RAJA::PERM_IJ;
58 
60 using VELOCITY_PERM = RAJA::PERM_IJ;
61 
63 using ACCELERATION_PERM = RAJA::PERM_IJ;
64 
65 #endif
66 
69 
72 
75 
78 
81 
82 } // namespace nodes
83 
84 namespace cells
85 {
86 
87 #if defined( GEOSX_USE_CUDA )
88 
90 using NODE_MAP_PERMUTATION = RAJA::PERM_JI;
91 
92 #else
93 
95 using NODE_MAP_PERMUTATION = RAJA::PERM_IJ;
96 
97 #endif
98 
100 static constexpr int NODE_MAP_USD = LvArray::typeManipulation::getStrideOneDimension( NODE_MAP_PERMUTATION {} );
101 
102 } // namespace cells
103 
104 namespace solid
105 {
106 
107 #if defined( GEOSX_USE_CUDA )
108 
110 using STRESS_PERMUTATION = RAJA::PERM_KJI;
111 
113 using STIFFNESS_PERMUTATION = RAJA::PERM_KJI;
114 
115 #else
116 
118 using STRESS_PERMUTATION = RAJA::PERM_IJK;
119 
121 using STIFFNESS_PERMUTATION = RAJA::PERM_IJK;
122 
123 #endif
124 
126 static constexpr int STRESS_USD = LvArray::typeManipulation::getStrideOneDimension( STRESS_PERMUTATION {} );
127 
130 
131 } // namespace solid
132 
133 } // namespace geosx
134 
135 #endif // GEOSX_COMMON_DATALAYOUTS_HPP_
RAJA::PERM_IJ TOTAL_DISPLACEMENT_PERM
Node total displacement permutation when not using cuda.
Definition: DataLayouts.hpp:54
static constexpr int INCR_DISPLACEMENT_USD
Node incremental displacement unit stride dimension.
Definition: DataLayouts.hpp:74
RAJA::PERM_IJK STIFFNESS_PERMUTATION
Constitutive model stiffness permutation when not using cuda.
RAJA::PERM_IJ INCR_DISPLACEMENT_PERM
Node incremental displacement permutation when not using cuda.
Definition: DataLayouts.hpp:57
Contains the implementation of LvArray::Array.
static constexpr int VELOCITY_USD
Node velocity unit stride dimension.
Definition: DataLayouts.hpp:77
RAJA::PERM_IJ ACCELERATION_PERM
Node acceleration permutation when not using cuda.
Definition: DataLayouts.hpp:63
static constexpr int STRESS_USD
Constitutive model stress unit stride dimension.
constexpr camp::idx_t getStrideOneDimension(camp::idx_seq< INDICES... >)
static constexpr int ACCELERATION_USD
Node acceleration unit stride dimension.
Definition: DataLayouts.hpp:80
static constexpr int TOTAL_DISPLACEMENT_USD
Node total displacement unit stride dimension.
Definition: DataLayouts.hpp:71
static constexpr int STIFFNESS_USD
Constitutive model stiffness unit stride dimension.
static constexpr int NODE_MAP_USD
Cell node map unit stride dimension.
RAJA::PERM_IJ REFERENCE_POSITION_PERM
Node reference position permutation when not using cuda.
Definition: DataLayouts.hpp:51
RAJA::PERM_IJ VELOCITY_PERM
Node velocity permutation when not using cuda.
Definition: DataLayouts.hpp:60
static constexpr int REFERENCE_POSITION_USD
Node reference position unit stride dimension.
Definition: DataLayouts.hpp:68