16#ifndef CABANA_GRID_SPLINES_HPP
17#define CABANA_GRID_SPLINES_HPP
22#include <Kokkos_Core.hpp>
59 template <
class Scalar>
60 KOKKOS_INLINE_FUNCTION
static Scalar
63 return ( xp - low_x ) * rdx + 0.5;
71 KOKKOS_INLINE_FUNCTION
79 template <
class Scalar>
80 KOKKOS_INLINE_FUNCTION
static void stencil(
const Scalar x0,
83 indices[0] =
static_cast<int>( x0 );
93 template <
typename Scalar>
94 KOKKOS_INLINE_FUNCTION
static void value(
const Scalar,
111 template <
typename Scalar>
112 KOKKOS_INLINE_FUNCTION
static void gradient(
const Scalar,
const Scalar,
144 template <
class Scalar>
145 KOKKOS_INLINE_FUNCTION
static Scalar
148 return ( xp - low_x ) * rdx;
156 KOKKOS_INLINE_FUNCTION
168 template <
class Scalar>
169 KOKKOS_INLINE_FUNCTION
static void stencil(
const Scalar x0,
172 indices[0] =
static_cast<int>( x0 );
173 indices[1] = indices[0] + 1;
183 template <
typename Scalar>
184 KOKKOS_INLINE_FUNCTION
static void value(
const Scalar x0,
188 Scalar xn = x0 -
static_cast<int>( x0 );
189 values[0] = 1.0 - xn;
204 template <
typename Scalar>
205 KOKKOS_INLINE_FUNCTION
static void gradient(
const Scalar,
const Scalar rdx,
239 template <
class Scalar>
240 KOKKOS_INLINE_FUNCTION
static Scalar
243 return ( xp - low_x ) * rdx + 0.5;
251 KOKKOS_INLINE_FUNCTION
264 template <
class Scalar>
265 KOKKOS_INLINE_FUNCTION
static void stencil(
const Scalar x0,
268 indices[0] =
static_cast<int>( x0 ) - 1;
269 indices[1] = indices[0] + 1;
270 indices[2] = indices[1] + 1;
280 template <
typename Scalar>
281 KOKKOS_INLINE_FUNCTION
static void value(
const Scalar x0,
285 Scalar nine_eights = 9.0 / 8.0;
288 Scalar xn = x0 -
static_cast<int>( x0 ) + 0.5;
289 values[0] = 0.5 * xn * xn - 1.5 * xn + nine_eights;
293 values[1] = -xn * xn + 0.75;
297 values[2] = 0.5 * xn * xn + 1.5 * xn + nine_eights;
309 template <
typename Scalar>
310 KOKKOS_INLINE_FUNCTION
static void
314 Scalar xn = x0 -
static_cast<int>( x0 ) + 0.5;
315 gradients[0] = ( xn - 1.5 ) * rdx;
319 gradients[1] = ( -2.0 * xn ) * rdx;
323 gradients[2] = ( xn + 1.5 ) * rdx;
350 template <
class Scalar>
351 KOKKOS_INLINE_FUNCTION
static Scalar
354 return ( xp - low_x ) * rdx;
362 KOKKOS_INLINE_FUNCTION
376 template <
class Scalar>
377 KOKKOS_INLINE_FUNCTION
static void stencil(
const Scalar x0,
380 indices[0] =
static_cast<int>( x0 ) - 1;
381 indices[1] = indices[0] + 1;
382 indices[2] = indices[1] + 1;
383 indices[3] = indices[2] + 1;
393 template <
typename Scalar>
394 KOKKOS_INLINE_FUNCTION
static void value(
const Scalar x0,
398 Scalar one_sixth = 1.0 / 6.0;
399 Scalar two_thirds = one_sixth * 4.0;
400 Scalar four_thirds = two_thirds * 2.0;
403 Scalar xn = x0 -
static_cast<int>( x0 ) + 1.0;
404 Scalar xn2 = xn * xn;
405 values[0] = -xn * xn2 * one_sixth + xn2 - 2.0 * xn + four_thirds;
410 values[1] = 0.5 * xn * xn2 - xn2 + two_thirds;
415 values[2] = -0.5 * xn * xn2 - xn2 + two_thirds;
420 values[3] = xn * xn2 * one_sixth + xn2 + 2.0 * xn + four_thirds;
432 template <
typename Scalar>
433 KOKKOS_INLINE_FUNCTION
static void
437 Scalar xn = x0 -
static_cast<int>( x0 ) + 1.0;
438 gradients[0] = ( -0.5 * xn * xn + 2.0 * xn - 2.0 ) * rdx;
442 gradients[1] = ( 1.5 * xn * xn - 2.0 * xn ) * rdx;
446 gradients[2] = ( -1.5 * xn * xn - 2.0 * xn ) * rdx;
450 gradients[3] = ( 0.5 * xn * xn + 2.0 * xn + 2.0 ) * rdx;
476 template <
class Scalar>
477 KOKKOS_INLINE_FUNCTION
static Scalar
480 return ( xp - low_x ) * rdx + 0.5;
488 KOKKOS_INLINE_FUNCTION
503 template <
class Scalar>
504 KOKKOS_INLINE_FUNCTION
static void stencil(
const Scalar x0,
507 indices[0] =
static_cast<int>( x0 ) - 2;
508 indices[1] = indices[0] + 1;
509 indices[2] = indices[1] + 1;
510 indices[3] = indices[2] + 1;
511 indices[4] = indices[3] + 1;
521 template <
typename Scalar>
522 KOKKOS_INLINE_FUNCTION
static void value(
const Scalar x0,
526 Scalar denom_2 = 1.0 / 384.0;
527 Scalar denom_1 = denom_2 * 4.0;
528 Scalar denom_0 = denom_2 * 2.0;
531 Scalar xn = x0 -
static_cast<int>( x0 ) - 0.5;
532 Scalar xn2 = xn * xn;
533 Scalar xn4 = xn2 * xn2;
535 ( 16.0 * xn4 - 32.0 * xn * xn2 + 24.0 * xn2 - 8.0 * xn + 1.0 ) *
540 ( -16.0 * xn4 + 16.0 * xn * xn2 + 24.0 * xn2 - 44.0 * xn + 19.0 ) *
544 values[2] = ( 48.0 * xn4 - 120.0 * xn2 + 115.0 ) * denom_0;
548 ( -16.0 * xn4 - 16.0 * xn * xn2 + 24.0 * xn2 + 44.0 * xn + 19.0 ) *
553 ( 16.0 * xn4 + 32.0 * xn * xn2 + 24.0 * xn2 + 8.0 * xn + 1 ) *
566 template <
typename Scalar>
567 KOKKOS_INLINE_FUNCTION
static void
571 Scalar denom_2 = 1.0 / 48.0;
572 Scalar denom_1 = denom_2 * 2.0;
573 Scalar denom_0 = denom_2 * 12.0;
576 Scalar xn = x0 -
static_cast<int>( x0 ) - 0.5;
577 Scalar xn2 = xn * xn;
579 ( 8.0 * xn * xn2 - 12.0 * xn2 + 6.0 * xn - 1.0 ) * denom_2 * rdx;
582 gradients[1] = ( -16.0 * xn * xn2 + 12.0 * xn2 + 12.0 * xn - 11.0 ) *
586 gradients[2] = ( 4.0 * xn * xn2 - 5.0 * xn ) * denom_0 * rdx;
589 gradients[3] = ( -16.0 * xn * xn2 - 12.0 * xn2 + 12.0 * xn + 11.0 ) *
594 ( 8.0 * xn * xn2 + 12.0 * xn2 + 6.0 * xn + 1.0 ) * denom_2 * rdx;
620 template <
class Scalar>
621 KOKKOS_INLINE_FUNCTION
static Scalar
624 return ( xp - low_x ) * rdx;
632 KOKKOS_INLINE_FUNCTION
648 template <
class Scalar>
649 KOKKOS_INLINE_FUNCTION
static void stencil(
const Scalar x0,
652 indices[0] =
static_cast<int>( x0 ) - 2;
653 indices[1] = indices[0] + 1;
654 indices[2] = indices[1] + 1;
655 indices[3] = indices[2] + 1;
656 indices[4] = indices[3] + 1;
657 indices[5] = indices[4] + 1;
667 template <
typename Scalar>
668 KOKKOS_INLINE_FUNCTION
static void value(
const Scalar x0,
672 Scalar denom_2 = 1.0 / 3840.0;
673 Scalar denom_1 = denom_2 * 2.0;
676 Scalar xn = x0 -
static_cast<int>( x0 ) - 0.5;
677 Scalar xn2 = xn * xn;
678 Scalar xn4 = xn2 * xn2;
679 values[0] = ( -32.0 * xn * xn4 + 80.0 * xn4 - 80.0 * xn * xn2 +
680 40.0 * xn2 - 10.0 * xn + 1.0 ) *
684 values[1] = ( 160.0 * xn * xn4 - 240.0 * xn4 - 240.0 * xn * xn2 +
685 840.0 * xn2 - 750.0 * xn + 237.0 ) *
689 values[2] = ( -160.0 * xn * xn4 + 80.0 * xn4 + 560.0 * xn * xn2 -
690 440.0 * xn2 - 770.0 * xn + 841.0 ) *
694 values[3] = ( 160.0 * xn * xn4 + 80.0 * xn4 - 560.0 * xn * xn2 -
695 440.0 * xn2 + 770.0 * xn + 841.0 ) *
699 values[4] = ( -160.0 * xn * xn4 - 240.0 * xn4 + 240.0 * xn * xn2 +
700 840.0 * xn2 + 750.0 * xn + 237.0 ) *
704 values[5] = ( 32.0 * xn * xn4 + 80.0 * xn4 + 80.0 * xn * xn2 +
705 40.0 * xn2 + 10.0 * xn + 1.0 ) *
718 template <
typename Scalar>
719 KOKKOS_INLINE_FUNCTION
static void
723 Scalar denom_2 = 1.0 / 384.0;
724 Scalar denom_1 = denom_2 * 2.0;
727 Scalar xn = x0 -
static_cast<int>( x0 ) - 0.5;
728 Scalar xn2 = xn * xn;
729 Scalar xn4 = xn2 * xn2;
731 ( -16.0 * xn4 + 32.0 * xn * xn2 - 24.0 * xn2 + 8.0 * xn - 1.0 ) *
736 ( 80.0 * xn4 - 96.0 * xn * xn2 - 72.0 * xn2 + 168.0 * xn - 75.0 ) *
741 ( -80.0 * xn4 + 32.0 * xn * xn2 + 168.0 * xn2 - 88.0 * xn - 77.0 ) *
746 ( 80.0 * xn4 + 32.0 * xn * xn2 - 168.0 * xn2 - 88.0 * xn + 77.0 ) *
751 ( -80.0 * xn4 - 96.0 * xn * xn2 + 72.0 * xn2 + 168.0 * xn + 75.0 ) *
756 ( 16.0 * xn4 + 32.0 * xn * xn2 + 24.0 * xn2 + 8.0 * xn + 1.0 ) *
783 template <
class Scalar>
784 KOKKOS_INLINE_FUNCTION
static Scalar
787 return ( xp - low_x ) * rdx + 0.5;
795 KOKKOS_INLINE_FUNCTION
812 template <
class Scalar>
813 KOKKOS_INLINE_FUNCTION
static void stencil(
const Scalar x0,
816 indices[0] =
static_cast<int>( x0 ) - 3;
817 indices[1] = indices[0] + 1;
818 indices[2] = indices[1] + 1;
819 indices[3] = indices[2] + 1;
820 indices[4] = indices[3] + 1;
821 indices[5] = indices[4] + 1;
822 indices[6] = indices[5] + 1;
832 template <
typename Scalar>
833 KOKKOS_INLINE_FUNCTION
static void value(
const Scalar x0,
837 Scalar denom_31 = 1.0 / 46080.0;
838 Scalar denom_2 = denom_31 * 2.0;
839 Scalar denom_0 = denom_2 * 2.0;
842 Scalar xn = x0 -
static_cast<int>( x0 ) - 0.5;
843 Scalar xn2 = xn * xn;
844 Scalar xn4 = xn2 * xn2;
845 Scalar xn6 = xn2 * xn4;
846 values[0] = ( 64.0 * xn6 - 192.0 * xn * xn4 + 240.0 * xn4 -
847 160.0 * xn * xn2 + 60.0 * xn2 - 12.0 * xn + 1.0 ) *
851 values[1] = ( -192.0 * xn6 + 384.0 * xn * xn4 + 240.0 * xn4 -
852 1600.0 * xn * xn2 + 2220.0 * xn2 - 1416.0 * xn + 361.0 ) *
857 ( 960.0 * xn6 - 960.0 * xn * xn4 - 4080.0 * xn4 +
858 6880.0 * xn * xn2 + 4740.0 * xn2 - 17340.0 * xn + 10543.0 ) *
863 ( -320.0 * xn6 + 1680.0 * xn4 - 4620.0 * xn2 + 5887.0 ) * denom_0;
867 ( 960.0 * xn6 + 960.0 * xn * xn4 - 4080.0 * xn4 -
868 6880.0 * xn * xn2 + 4740.0 * xn2 + 17340.0 * xn + 10543.0 ) *
872 values[5] = ( -192.0 * xn6 - 384.0 * xn * xn4 + 240.0 * xn4 +
873 1600.0 * xn * xn2 + 2220.0 * xn2 + 1416.0 * xn + 361.0 ) *
877 values[6] = ( 64.0 * xn6 + 192.0 * xn * xn4 + 240.0 * xn4 +
878 160.0 * xn * xn2 + 60.0 * xn2 + 12.0 * xn + 1.0 ) *
891 template <
typename Scalar>
892 KOKKOS_INLINE_FUNCTION
static void
896 Scalar denom_3 = 1.0 / 3840.0;
897 Scalar denom_2 = denom_3 * 4.0;
898 Scalar denom_1 = denom_3 * 5.0;
899 Scalar denom_0 = denom_3 * 40.0;
902 Scalar xn = x0 -
static_cast<int>( x0 ) - 0.5;
903 Scalar xn2 = xn * xn;
904 Scalar xn4 = xn2 * xn2;
905 gradients[0] = ( 32.0 * xn * xn4 - 80.0 * xn4 + 80.0 * xn * xn2 -
906 40.0 * xn2 + 10.0 * xn - 1.0 ) *
910 gradients[1] = ( -48.0 * xn * xn4 + 80.0 * xn4 + 40.0 * xn * xn2 -
911 200.0 * xn2 + 185.0 * xn - 59.0 ) *
915 gradients[2] = ( 96.0 * xn * xn4 - 80.0 * xn4 - 272.0 * xn * xn2 +
916 344.0 * xn2 + 158.0 * xn - 289.0 ) *
921 ( -16.0 * xn * xn4 + 56.0 * xn * xn2 - 77.0 * xn ) * denom_0 * rdx;
924 gradients[4] = ( 96.0 * xn * xn4 + 80.0 * xn4 - 272.0 * xn * xn2 -
925 344.0 * xn2 + 158.0 * xn + 289.0 ) *
929 gradients[5] = ( -48.0 * xn * xn4 - 80.0 * xn4 + 40.0 * xn * xn2 +
930 200.0 * xn2 + 185.0 * xn + 59.0 ) *
934 gradients[6] = ( 32.0 * xn * xn4 + 80.0 * xn4 + 80.0 * xn * xn2 +
935 40.0 * xn2 + 10.0 * xn + 1.0 ) *
965template <
class... DataTags>
971template <
typename T,
typename SplineDataMemberTypes_t>
980template <
typename T,
typename U,
typename... Tags>
985template <
typename T,
typename... Tags>
986struct has_spline_tag<T, SplineDataMemberTypes<T, Tags...>> : std::true_type
992template <
typename Scalar,
int Order, std::
size_t NumSpaceDim,
class Tag>
996template <
typename Scalar,
int Order, std::
size_t NumSpaceDim>
1004template <
typename Scalar,
int Order, std::
size_t NumSpaceDim>
1008 Scalar
x[NumSpaceDim];
1012template <
typename Scalar,
int Order, std::
size_t NumSpaceDim>
1025template <
typename Scalar,
int Order, std::
size_t NumSpaceDim>
1038template <
typename Scalar,
int Order, std::
size_t NumSpaceDim>
1052template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1057template <
typename Scalar,
int Order, std::
size_t NumSpaceDim,
class EntityType>
1064 SplineWeightPhysicalGradients>
1095template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1137template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1139KOKKOS_INLINE_FUNCTION
1140 std::enable_if_t<
SplineData<Scalar, Order, NumSpaceDim, EntityType,
1141 DataTags>::has_physical_cell_size>
1145 const int d,
const Scalar dx )
1150template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1152KOKKOS_INLINE_FUNCTION std::enable_if_t<!SplineData<
1153 Scalar, Order, NumSpaceDim, EntityType, DataTags>::has_physical_cell_size>
1156 const int,
const Scalar )
1161template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1163KOKKOS_INLINE_FUNCTION
1164 std::enable_if_t<SplineData<Scalar, Order, NumSpaceDim, EntityType,
1165 DataTags>::has_logical_position>
1169 const int d,
const Scalar x )
1174template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1176KOKKOS_INLINE_FUNCTION std::enable_if_t<!SplineData<
1177 Scalar, Order, NumSpaceDim, EntityType, DataTags>::has_logical_position>
1180 const int,
const Scalar )
1185template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1187KOKKOS_INLINE_FUNCTION
1188 std::enable_if_t<SplineData<Scalar, Order, NumSpaceDim, EntityType,
1189 DataTags>::has_weight_values>
1193 const Scalar x[NumSpaceDim] )
1196 using spline_type =
typename SplineData<Scalar, Order, NumSpaceDim,
1197 EntityType, DataTags>::spline_type;
1198 for ( std::size_t d = 0; d < NumSpaceDim; ++d )
1199 spline_type::value( x[d], data.w[d] );
1202template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1204KOKKOS_INLINE_FUNCTION std::enable_if_t<!SplineData<
1205 Scalar, Order, NumSpaceDim, EntityType, DataTags>::has_weight_values>
1208 const Scalar[NumSpaceDim] )
1214template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1216KOKKOS_INLINE_FUNCTION
1217 std::enable_if_t<SplineData<Scalar, Order, NumSpaceDim, EntityType,
1218 DataTags>::has_weight_physical_gradients>
1222 const Scalar x[NumSpaceDim],
const Scalar rdx[NumSpaceDim] )
1225 using spline_type =
typename SplineData<Scalar, Order, NumSpaceDim,
1226 EntityType, DataTags>::spline_type;
1227 for ( std::size_t d = 0; d < NumSpaceDim; ++d )
1228 spline_type::gradient( x[d], rdx[d], data.g[d] );
1231template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1233KOKKOS_INLINE_FUNCTION
1234 std::enable_if_t<!SplineData<Scalar, Order, NumSpaceDim, EntityType,
1235 DataTags>::has_weight_physical_gradients>
1239 const Scalar[NumSpaceDim],
const Scalar[NumSpaceDim] )
1245template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1247KOKKOS_INLINE_FUNCTION
1248 std::enable_if_t<SplineData<Scalar, Order, NumSpaceDim, EntityType,
1249 DataTags>::has_physical_distance>
1253 const Scalar low_x[NumSpaceDim],
const Scalar p[NumSpaceDim],
1254 const Scalar dx[NumSpaceDim] )
1257 using spline_type =
typename SplineData<Scalar, Order, NumSpaceDim,
1258 EntityType, DataTags>::spline_type;
1260 for ( std::size_t d = 0; d < NumSpaceDim; ++d )
1262 offset = low_x[d] - p[d];
1263 for (
int n = 0; n < spline_type::num_knot; ++n )
1264 data.d[d][n] = offset + data.s[d][n] * dx[d];
1268template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
class EntityType,
1270KOKKOS_INLINE_FUNCTION std::enable_if_t<!SplineData<
1271 Scalar, Order, NumSpaceDim, EntityType, DataTags>::has_physical_distance>
1274 const Scalar[NumSpaceDim],
const Scalar[NumSpaceDim],
1275 const Scalar[NumSpaceDim] )
1281template <
typename Scalar,
int Order, std::size_t NumSpaceDim,
1282 class MemorySpace,
class EntityType,
class DataTags>
1285 const Scalar p[NumSpaceDim],
1295 Scalar low_x[NumSpaceDim];
1296 Scalar low_x_p1[NumSpaceDim];
1297 int low_id[NumSpaceDim];
1298 int low_id_p1[NumSpaceDim];
1299 for ( std::size_t d = 0; d < NumSpaceDim; ++d )
1304 local_mesh.coordinates( EntityType(), low_id, low_x );
1305 local_mesh.coordinates( EntityType(), low_id_p1, low_x_p1 );
1308 Scalar dx[NumSpaceDim];
1309 for ( std::size_t d = 0; d < NumSpaceDim; ++d )
1311 dx[d] = low_x_p1[d] - low_x[d];
1316 Scalar rdx[NumSpaceDim];
1317 for ( std::size_t d = 0; d < NumSpaceDim; ++d )
1318 rdx[d] = 1.0 / dx[d];
1321 Scalar x[NumSpaceDim];
1322 for ( std::size_t d = 0; d < NumSpaceDim; ++d )
1324 x[d] = sd_type::spline_type::mapToLogicalGrid( p[d], rdx[d], low_x[d] );
1329 for ( std::size_t d = 0; d < NumSpaceDim; ++d )
1331 sd_type::spline_type::stencil( x[d], data.s[d] );
KOKKOS_INLINE_FUNCTION std::enable_if_t< SplineData< Scalar, Order, NumSpaceDim, EntityType, DataTags >::has_physical_cell_size > setSplineData(SplinePhysicalCellSize, SplineData< Scalar, Order, NumSpaceDim, EntityType, DataTags > &data, const int d, const Scalar dx)
Assign physical cell size to the spline data.
Definition Cabana_Grid_Splines.hpp:1142
KOKKOS_INLINE_FUNCTION void evaluateSpline(const LocalMesh< MemorySpace, UniformMesh< Scalar, NumSpaceDim > > &local_mesh, const Scalar p[NumSpaceDim], SplineData< Scalar, Order, NumSpaceDim, EntityType, DataTags > &data)
Evaluate spline data at a point in a uniform mesh.
Definition Cabana_Grid_Splines.hpp:1283
Definition Cabana_Grid_LocalMesh.hpp:33
Core: particle data structures and algorithms.
Definition Cabana_AoSoA.hpp:36
Spline data members holder.
Definition Cabana_Grid_Splines.hpp:967
Scalar x[NumSpaceDim]
Logical position.
Definition Cabana_Grid_Splines.hpp:1008
Scalar dx[NumSpaceDim]
Physical cell size.
Definition Cabana_Grid_Splines.hpp:1000
Scalar d[NumSpaceDim][num_knot]
Physical distance.
Definition Cabana_Grid_Splines.hpp:1021
Spline< Order > spline_type
Spline type.
Definition Cabana_Grid_Splines.hpp:1016
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:1018
Scalar g[NumSpaceDim][num_knot]
Weight physical gradients.
Definition Cabana_Grid_Splines.hpp:1048
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:1045
Spline< Order > spline_type
Spline type.
Definition Cabana_Grid_Splines.hpp:1043
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:1031
Spline< Order > spline_type
Spline type.
Definition Cabana_Grid_Splines.hpp:1029
Scalar w[NumSpaceDim][num_knot]
Weight values.
Definition Cabana_Grid_Splines.hpp:1034
Spline data member.
Definition Cabana_Grid_Splines.hpp:993
static constexpr bool has_physical_distance
Is physical distance present.
Definition Cabana_Grid_Splines.hpp:1123
Scalar scalar_type
Spline scalar type.
Definition Cabana_Grid_Splines.hpp:1102
int s[NumSpaceDim][num_knot]
Local interpolation stencil.
Definition Cabana_Grid_Splines.hpp:1133
SplineDataMemberTypes< Tags... > member_tags
Spline member types.
Definition Cabana_Grid_Splines.hpp:1115
static constexpr bool has_weight_physical_gradients
Are weight physical gradients present.
Definition Cabana_Grid_Splines.hpp:1129
static constexpr bool has_physical_cell_size
Is physical cell size present.
Definition Cabana_Grid_Splines.hpp:1117
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:1108
Spline< Order > spline_type
Spline type.
Definition Cabana_Grid_Splines.hpp:1106
static constexpr std::size_t num_space_dim
Spatial dimension.
Definition Cabana_Grid_Splines.hpp:1112
EntityType entity_type
Entity type.
Definition Cabana_Grid_Splines.hpp:1110
static constexpr int order
Spline order.
Definition Cabana_Grid_Splines.hpp:1104
static constexpr bool has_logical_position
Is logical position present.
Definition Cabana_Grid_Splines.hpp:1120
static constexpr bool has_weight_values
Are weight values present.
Definition Cabana_Grid_Splines.hpp:1126
static constexpr bool has_weight_values
Weight values present.
Definition Cabana_Grid_Splines.hpp:1086
static constexpr bool has_logical_position
Logical position present.
Definition Cabana_Grid_Splines.hpp:1082
Scalar scalar_type
Spline scalar type.
Definition Cabana_Grid_Splines.hpp:1067
static constexpr std::size_t num_space_dim
Spatial dimension.
Definition Cabana_Grid_Splines.hpp:1077
static constexpr bool has_weight_physical_gradients
Weight physical gradients present.
Definition Cabana_Grid_Splines.hpp:1088
int s[NumSpaceDim][num_knot]
Local interpolation stencil.
Definition Cabana_Grid_Splines.hpp:1091
static constexpr bool has_physical_cell_size
Physical cell size present.
Definition Cabana_Grid_Splines.hpp:1080
static constexpr bool has_physical_distance
Physical distance present.
Definition Cabana_Grid_Splines.hpp:1084
EntityType entity_type
Entity type.
Definition Cabana_Grid_Splines.hpp:1075
static constexpr int order
Spline order.
Definition Cabana_Grid_Splines.hpp:1069
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:1073
Spline< Order > spline_type
Spline type.
Definition Cabana_Grid_Splines.hpp:1071
Spline data container.
Definition Cabana_Grid_Splines.hpp:1054
Spline data tag: logical position.
Definition Cabana_Grid_Splines.hpp:949
Spline data tag: physical cell size.
Definition Cabana_Grid_Splines.hpp:945
Spline data tag: physical distance.
Definition Cabana_Grid_Splines.hpp:953
Spline data tag: physical gradient.
Definition Cabana_Grid_Splines.hpp:961
Spline data tag: weight value.
Definition Cabana_Grid_Splines.hpp:957
static constexpr int order
Order.
Definition Cabana_Grid_Splines.hpp:41
static KOKKOS_INLINE_FUNCTION void offsets(int indices[num_knot])
Get the logical space stencil offsets of the spline. The stencil defines the offsets into a grid fiel...
Definition Cabana_Grid_Splines.hpp:72
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:44
static KOKKOS_INLINE_FUNCTION void value(const Scalar, Scalar values[num_knot])
Calculate the value of the spline at all knots.
Definition Cabana_Grid_Splines.hpp:94
static KOKKOS_INLINE_FUNCTION Scalar mapToLogicalGrid(const Scalar xp, const Scalar rdx, const Scalar low_x)
Map a physical location to the logical space of the dual grid in a single dimension.
Definition Cabana_Grid_Splines.hpp:61
static KOKKOS_INLINE_FUNCTION void gradient(const Scalar, const Scalar, Scalar gradients[num_knot])
Calculate the value of the gradient of the spline in the physical frame.
Definition Cabana_Grid_Splines.hpp:112
static KOKKOS_INLINE_FUNCTION void stencil(const Scalar x0, int indices[num_knot])
Compute the stencil indices for a given logical space location.
Definition Cabana_Grid_Splines.hpp:80
static KOKKOS_INLINE_FUNCTION Scalar mapToLogicalGrid(const Scalar xp, const Scalar rdx, const Scalar low_x)
Map a physical location to the logical space of the primal grid in a single dimension.
Definition Cabana_Grid_Splines.hpp:146
static constexpr int order
Order.
Definition Cabana_Grid_Splines.hpp:126
static KOKKOS_INLINE_FUNCTION void stencil(const Scalar x0, int indices[num_knot])
Compute the stencil indices for a given logical space location.
Definition Cabana_Grid_Splines.hpp:169
static KOKKOS_INLINE_FUNCTION void offsets(int indices[num_knot])
Get the logical space stencil offsets of the spline. The stencil defines the offsets into a grid fiel...
Definition Cabana_Grid_Splines.hpp:157
static KOKKOS_INLINE_FUNCTION void gradient(const Scalar, const Scalar rdx, Scalar gradients[num_knot])
Calculate the value of the gradient of the spline in the physical frame.
Definition Cabana_Grid_Splines.hpp:205
static KOKKOS_INLINE_FUNCTION void value(const Scalar x0, Scalar values[num_knot])
Calculate the value of the spline at all knots.
Definition Cabana_Grid_Splines.hpp:184
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:129
static constexpr int order
Order.
Definition Cabana_Grid_Splines.hpp:222
static KOKKOS_INLINE_FUNCTION void gradient(const Scalar x0, const Scalar rdx, Scalar gradients[num_knot])
Calculate the value of the gradient of the spline in the physical frame.
Definition Cabana_Grid_Splines.hpp:311
static KOKKOS_INLINE_FUNCTION void value(const Scalar x0, Scalar values[num_knot])
Calculate the value of the spline at all knots.
Definition Cabana_Grid_Splines.hpp:281
static KOKKOS_INLINE_FUNCTION void offsets(int indices[num_knot])
Get the logical space stencil offsets of the spline. The stencil defines the offsets into a grid fiel...
Definition Cabana_Grid_Splines.hpp:252
static KOKKOS_INLINE_FUNCTION Scalar mapToLogicalGrid(const Scalar xp, const Scalar rdx, const Scalar low_x)
Map a physical location to the logical space of the dual grid in a single dimension.
Definition Cabana_Grid_Splines.hpp:241
static KOKKOS_INLINE_FUNCTION void stencil(const Scalar x0, int indices[num_knot])
Compute the stencil indices for a given logical space location.
Definition Cabana_Grid_Splines.hpp:265
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:225
static KOKKOS_INLINE_FUNCTION void value(const Scalar x0, Scalar values[num_knot])
Calculate the value of the spline at all knots.
Definition Cabana_Grid_Splines.hpp:394
static KOKKOS_INLINE_FUNCTION void gradient(const Scalar x0, const Scalar rdx, Scalar gradients[num_knot])
Calculate the value of the gradient of the spline in the physical frame.
Definition Cabana_Grid_Splines.hpp:434
static KOKKOS_INLINE_FUNCTION void offsets(int indices[num_knot])
Get the logical space stencil offsets of the spline. The stencil defines the offsets into a grid fiel...
Definition Cabana_Grid_Splines.hpp:363
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:336
static constexpr int order
Order.
Definition Cabana_Grid_Splines.hpp:333
static KOKKOS_INLINE_FUNCTION Scalar mapToLogicalGrid(const Scalar xp, const Scalar rdx, const Scalar low_x)
Map a physical location to the logical space of the primal grid in a single dimension.
Definition Cabana_Grid_Splines.hpp:352
static KOKKOS_INLINE_FUNCTION void stencil(const Scalar x0, int indices[num_knot])
Compute the stencil indices for a given logical space location.
Definition Cabana_Grid_Splines.hpp:377
static KOKKOS_INLINE_FUNCTION void stencil(const Scalar x0, int indices[num_knot])
Compute the stencil indices for a given logical space location.
Definition Cabana_Grid_Splines.hpp:504
static constexpr int order
Order.
Definition Cabana_Grid_Splines.hpp:459
static KOKKOS_INLINE_FUNCTION void offsets(int indices[num_knot])
Definition Cabana_Grid_Splines.hpp:489
static KOKKOS_INLINE_FUNCTION void gradient(const Scalar x0, const Scalar rdx, Scalar gradients[num_knot])
Calculate the value of the gradient of the spline in the physical frame.
Definition Cabana_Grid_Splines.hpp:568
static KOKKOS_INLINE_FUNCTION void value(const Scalar x0, Scalar values[num_knot])
Calculate the value of the spline at all knots.
Definition Cabana_Grid_Splines.hpp:522
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:462
static KOKKOS_INLINE_FUNCTION Scalar mapToLogicalGrid(const Scalar xp, const Scalar rdx, const Scalar low_x)
Map a physical location to the logical space of the primal grid in a single dimension.
Definition Cabana_Grid_Splines.hpp:478
static KOKKOS_INLINE_FUNCTION Scalar mapToLogicalGrid(const Scalar xp, const Scalar rdx, const Scalar low_x)
Map a physical location to the logical space of the primal grid in a single dimension.
Definition Cabana_Grid_Splines.hpp:622
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:606
static KOKKOS_INLINE_FUNCTION void offsets(int indices[num_knot])
Get the logical space stencil offsets of the spline. The stencil defines the offsets into a grid fiel...
Definition Cabana_Grid_Splines.hpp:633
static KOKKOS_INLINE_FUNCTION void stencil(const Scalar x0, int indices[num_knot])
Compute the stencil indices for a given logical space location.
Definition Cabana_Grid_Splines.hpp:649
static KOKKOS_INLINE_FUNCTION void value(const Scalar x0, Scalar values[num_knot])
Calculate the value of the spline at all knots.
Definition Cabana_Grid_Splines.hpp:668
static KOKKOS_INLINE_FUNCTION void gradient(const Scalar x0, const Scalar rdx, Scalar gradients[num_knot])
Calculate the value of the gradient of the spline in the physical frame.
Definition Cabana_Grid_Splines.hpp:720
static constexpr int order
Order.
Definition Cabana_Grid_Splines.hpp:603
static KOKKOS_INLINE_FUNCTION void value(const Scalar x0, Scalar values[num_knot])
Calculate the value of the spline at all knots.
Definition Cabana_Grid_Splines.hpp:833
static constexpr int order
Order.
Definition Cabana_Grid_Splines.hpp:766
static KOKKOS_INLINE_FUNCTION Scalar mapToLogicalGrid(const Scalar xp, const Scalar rdx, const Scalar low_x)
Map a physical location to the logical space of the primal grid in a single dimension.
Definition Cabana_Grid_Splines.hpp:785
static KOKKOS_INLINE_FUNCTION void gradient(const Scalar x0, const Scalar rdx, Scalar gradients[num_knot])
Calculate the value of the gradient of the spline in the physical frame.
Definition Cabana_Grid_Splines.hpp:893
static constexpr int num_knot
The number of non-zero knots in the spline.
Definition Cabana_Grid_Splines.hpp:769
static KOKKOS_INLINE_FUNCTION void stencil(const Scalar x0, int indices[num_knot])
Compute the stencil indices for a given logical space location.
Definition Cabana_Grid_Splines.hpp:813
static KOKKOS_INLINE_FUNCTION void offsets(int indices[num_knot])
Get the logical space stencil offsets of the spline. The stencil defines the offsets into a grid fiel...
Definition Cabana_Grid_Splines.hpp:796
B-Spline interface for uniform grids.
Definition Cabana_Grid_Splines.hpp:33
Determine if a given spline tag is present.
Definition Cabana_Grid_Splines.hpp:972