99#include " mesh/mesh.hpp"
1010#include " specfem/assembly/jacobian_matrix.hpp"
1111#include " specfem/assembly/mesh.hpp"
12+ #include " specfem/data_access.hpp"
1213#include " specfem/point.hpp"
1314
1415namespace specfem ::assembly::boundaries_impl {
@@ -44,8 +45,14 @@ template <> struct acoustic_free_surface<specfem::dimension::type::dim2> {
4445 const Kokkos::View<int *, Kokkos::HostSpace> &boundary_index_mapping,
4546 std::vector<specfem::element::boundary_tag_container> &boundary_tag);
4647
48+ template <typename IndexType,
49+ typename std::enable_if_t <
50+ specfem::data_access::is_index_type<IndexType>::value &&
51+ specfem::data_access::is_point<IndexType>::value &&
52+ IndexType::using_simd == false ,
53+ int > = 0 >
4754 KOKKOS_FORCEINLINE_FUNCTION void
48- load_on_device (const specfem::point::index<dimension_tag> &index,
55+ load_on_device (const IndexType &index,
4956 specfem::point::boundary<boundary_tag, dimension_tag, false >
5057 &boundary) const {
5158
@@ -54,8 +61,14 @@ template <> struct acoustic_free_surface<specfem::dimension::type::dim2> {
5461 return ;
5562 }
5663
64+ template <typename IndexType,
65+ typename std::enable_if_t <
66+ specfem::data_access::is_index_type<IndexType>::value &&
67+ specfem::data_access::is_point<IndexType>::value &&
68+ IndexType::using_simd == false ,
69+ int > = 0 >
5770 KOKKOS_FORCEINLINE_FUNCTION void
58- load_on_device (const specfem::point::index<dimension_tag> &index,
71+ load_on_device (const IndexType &index,
5972 specfem::point::boundary<
6073 specfem::element::boundary_tag::composite_stacey_dirichlet,
6174 dimension_tag, false > &boundary) const {
@@ -65,8 +78,14 @@ template <> struct acoustic_free_surface<specfem::dimension::type::dim2> {
6578 return ;
6679 }
6780
81+ template <typename IndexType,
82+ typename std::enable_if_t <
83+ specfem::data_access::is_index_type<IndexType>::value &&
84+ specfem::data_access::is_point<IndexType>::value &&
85+ IndexType::using_simd == true ,
86+ int > = 0 >
6887 KOKKOS_FORCEINLINE_FUNCTION void
69- load_on_device (const specfem::point::simd_index<dimension_tag> &index,
88+ load_on_device (const IndexType &index,
7089 specfem::point::boundary<boundary_tag, dimension_tag, true >
7190 &boundary) const {
7291
@@ -87,8 +106,14 @@ template <> struct acoustic_free_surface<specfem::dimension::type::dim2> {
87106 return ;
88107 }
89108
109+ template <typename IndexType,
110+ typename std::enable_if_t <
111+ specfem::data_access::is_index_type<IndexType>::value &&
112+ specfem::data_access::is_point<IndexType>::value &&
113+ IndexType::using_simd == true ,
114+ int > = 0 >
90115 KOKKOS_FORCEINLINE_FUNCTION void
91- load_on_device (const specfem::point::simd_index<dimension_tag> &index,
116+ load_on_device (const IndexType &index,
92117 specfem::point::boundary<
93118 specfem::element::boundary_tag::composite_stacey_dirichlet,
94119 dimension_tag, true > &boundary) const {
@@ -110,17 +135,28 @@ template <> struct acoustic_free_surface<specfem::dimension::type::dim2> {
110135 return ;
111136 }
112137
113- inline void
114- load_on_host (const specfem::point::index<dimension_tag> &index,
115- specfem::point ::boundary<boundary_tag, dimension_tag, false >
116- &boundary) const {
138+ template <typename IndexType,
139+ typename std::enable_if_t <
140+ specfem::data_access::is_index_type<IndexType>::value &&
141+ specfem::data_access::is_point<IndexType>::value &&
142+ IndexType::using_simd == false ,
143+ int > = 0 >
144+ inline void load_on_host (const IndexType &index,
145+ specfem::point::boundary<boundary_tag, dimension_tag,
146+ false > &boundary) const {
117147 boundary.tag +=
118148 h_quadrature_point_boundary_tag (index.ispec , index.iz , index.ix );
119149 return ;
120150 }
121151
152+ template <typename IndexType,
153+ typename std::enable_if_t <
154+ specfem::data_access::is_index_type<IndexType>::value &&
155+ specfem::data_access::is_point<IndexType>::value &&
156+ IndexType::using_simd == false ,
157+ int > = 0 >
122158 inline void
123- load_on_host (const specfem::point::index<dimension_tag> &index,
159+ load_on_host (const IndexType &index,
124160 specfem::point::boundary<
125161 specfem::element::boundary_tag::composite_stacey_dirichlet,
126162 dimension_tag, false > &boundary) const {
@@ -130,10 +166,15 @@ template <> struct acoustic_free_surface<specfem::dimension::type::dim2> {
130166 return ;
131167 }
132168
133- inline void
134- load_on_host (const specfem::point::simd_index<dimension_tag> &index,
135- specfem::point::boundary<boundary_tag, dimension_tag, true >
136- &boundary) const {
169+ template <typename IndexType,
170+ typename std::enable_if_t <
171+ specfem::data_access::is_index_type<IndexType>::value &&
172+ specfem::data_access::is_point<IndexType>::value &&
173+ IndexType::using_simd == true ,
174+ int > = 0 >
175+ inline void load_on_host (const IndexType &index,
176+ specfem::point::boundary<boundary_tag, dimension_tag,
177+ true > &boundary) const {
137178
138179 using simd = typename specfem::datatype::simd<type_real, true >;
139180
@@ -149,8 +190,14 @@ template <> struct acoustic_free_surface<specfem::dimension::type::dim2> {
149190 return ;
150191 }
151192
193+ template <typename IndexType,
194+ typename std::enable_if_t <
195+ specfem::data_access::is_index_type<IndexType>::value &&
196+ specfem::data_access::is_point<IndexType>::value &&
197+ IndexType::using_simd == true ,
198+ int > = 0 >
152199 inline void
153- load_on_host (const specfem::point::simd_index<dimension_tag> &index,
200+ load_on_host (const IndexType &index,
154201 specfem::point::boundary<
155202 specfem::element::boundary_tag::composite_stacey_dirichlet,
156203 dimension_tag, true > &boundary) const {
0 commit comments