1 #ifndef _COMPADRE_GMLS_HPP_
2 #define _COMPADRE_GMLS_HPP_
4 #include "Compadre_Config.h"
35 Kokkos::View<double*>
_w;
38 Kokkos::View<double*>
_P;
41 Kokkos::View<double*>
_RHS;
46 Kokkos::View<double*>
_T;
53 Kokkos::View<double*>::HostMirror
_host_T;
92 Kokkos::View<double*, layout_right>
_alphas;
95 Kokkos::View<const double*, layout_right>::HostMirror
_host_alphas;
226 std::vector<TargetOperation>
_lro;
303 KOKKOS_INLINE_FUNCTION
304 void calcPij(
const member_type& teamMember,
double* delta,
double* thread_workspace,
const int target_index,
int neighbor_index,
const double alpha,
const int dimension,
const int poly_order,
bool specific_order_only =
false,
const scratch_matrix_right_type* V = NULL,
const ReconstructionSpace reconstruction_space =
ReconstructionSpace::ScalarTaylorPolynomial,
const SamplingFunctional sampling_strategy =
PointSample,
const int additional_evaluation_local_index = 0)
const;
321 KOKKOS_INLINE_FUNCTION
322 void calcGradientPij(
const member_type& teamMember,
double* delta,
double* thread_workspace,
const int target_index,
int neighbor_index,
const double alpha,
const int partial_direction,
const int dimension,
const int poly_order,
bool specific_order_only,
const scratch_matrix_right_type* V,
const ReconstructionSpace reconstruction_space,
const SamplingFunctional sampling_strategy,
const int additional_evaluation_local_index = 0)
const;
340 KOKKOS_INLINE_FUNCTION
341 void calcHessianPij(
const member_type& teamMember,
double* delta,
double* thread_workspace,
const int target_index,
int neighbor_index,
const double alpha,
const int partial_direction_1,
const int partial_direction_2,
const int dimension,
const int poly_order,
bool specific_order_only,
const scratch_matrix_right_type* V,
const ReconstructionSpace reconstruction_space,
const SamplingFunctional sampling_strategy,
const int additional_evaluation_local_index = 0)
const;
356 KOKKOS_INLINE_FUNCTION
357 void createWeightsAndP(
const member_type& teamMember,
scratch_vector_type delta,
scratch_vector_type thread_workspace,
scratch_matrix_right_type P,
scratch_vector_type w,
const int dimension,
int polynomial_order,
bool weight_p =
false,
scratch_matrix_right_type* V = NULL,
const ReconstructionSpace reconstruction_space =
ReconstructionSpace::ScalarTaylorPolynomial,
const SamplingFunctional sampling_strategy =
PointSample)
const;
372 KOKKOS_INLINE_FUNCTION
381 KOKKOS_INLINE_FUNCTION
394 KOKKOS_INLINE_FUNCTION
410 KOKKOS_INLINE_FUNCTION
414 KOKKOS_INLINE_FUNCTION
427 KOKKOS_INLINE_FUNCTION
434 KOKKOS_INLINE_FUNCTION
440 KOKKOS_INLINE_FUNCTION
446 KOKKOS_INLINE_FUNCTION
453 KOKKOS_INLINE_FUNCTION
461 KOKKOS_INLINE_FUNCTION
464 &&
"additional_list_num must be greater than or equal to 1, unlike neighbor lists which begin indexing at 0.");
470 KOKKOS_INLINE_FUNCTION
486 KOKKOS_INLINE_FUNCTION
502 KOKKOS_INLINE_FUNCTION
515 KOKKOS_INLINE_FUNCTION
517 XYZ coordinate_delta;
523 return coordinate_delta;
527 KOKKOS_INLINE_FUNCTION
531 val += global_coord.
x * (*V)(dim, 0);
532 val += global_coord.
y * (*V)(dim, 1);
533 if (
_dimensions>2) val += global_coord.
z * (*V)(dim, 2);
538 KOKKOS_INLINE_FUNCTION
543 val = local_coord.
x * (*V)(0, dim);
544 }
else if (dim == 0) {
545 val = local_coord.
x * ((*V)(0, dim) + (*V)(1, dim));
546 }
else if (dim == 1) {
547 val = local_coord.
y * ((*V)(0, dim) + (*V)(1, dim));
553 int getTargetOffsetIndexHost(
const int lro_num,
const int input_component,
const int output_component,
const int additional_evaluation_local_index = 0)
const {
557 + output_component );
561 KOKKOS_INLINE_FUNCTION
562 int getTargetOffsetIndexDevice(
const int lro_num,
const int input_component,
const int output_component,
const int additional_evaluation_local_index = 0)
const {
566 + output_component );
578 std::string solver_type_to_lower = dense_solver_type;
579 transform(solver_type_to_lower.begin(), solver_type_to_lower.end(), solver_type_to_lower.begin(), ::tolower);
580 if (solver_type_to_lower ==
"svd") {
582 }
else if (solver_type_to_lower ==
"lu") {
591 std::string problem_type_to_lower = problem_type;
592 transform(problem_type_to_lower.begin(), problem_type_to_lower.end(), problem_type_to_lower.begin(), ::tolower);
593 if (problem_type_to_lower ==
"standard") {
595 }
else if (problem_type_to_lower ==
"manifold") {
604 std::string constraint_type_to_lower = constraint_type;
605 transform(constraint_type_to_lower.begin(), constraint_type_to_lower.end(), constraint_type_to_lower.begin(), ::tolower);
606 if (constraint_type_to_lower ==
"none") {
608 }
else if (constraint_type_to_lower ==
"neumann_grad_scalar") {
628 const int poly_order,
629 const int dimensions = 3,
630 const std::string dense_solver_type = std::string(
"QR"),
631 const std::string problem_type = std::string(
"STANDARD"),
632 const std::string constraint_type = std::string(
"NO_CONSTRAINT"),
633 const int manifold_curvature_poly_order = 2) :
656 (
"operations needed for manifold gradient reconstruction", 1);
657 auto curvature_support_operations_mirror =
659 curvature_support_operations_mirror(0) =
665 _lro = std::vector<TargetOperation>();
706 const int dimensions = 3,
707 const std::string dense_solver_type = std::string(
"QR"),
708 const std::string problem_type = std::string(
"STANDARD"),
709 const std::string constraint_type = std::string(
"NO_CONSTRAINT"),
710 const int manifold_curvature_poly_order = 2)
717 const int poly_order,
718 const int dimensions = 3,
719 const std::string dense_solver_type = std::string(
"QR"),
720 const std::string problem_type = std::string(
"STANDARD"),
721 const std::string constraint_type = std::string(
"NO_CONSTRAINT"),
722 const int manifold_curvature_poly_order = 2)
723 :
GMLS(reconstruction_space, dual_sampling_strategy, dual_sampling_strategy, poly_order, dimensions, dense_solver_type, problem_type, constraint_type, manifold_curvature_poly_order) {}
770 KOKKOS_INLINE_FUNCTION
774 KOKKOS_INLINE_FUNCTION
778 KOKKOS_INLINE_FUNCTION
782 KOKKOS_INLINE_FUNCTION
786 KOKKOS_INLINE_FUNCTION
791 KOKKOS_INLINE_FUNCTION
795 KOKKOS_INLINE_FUNCTION
799 KOKKOS_INLINE_FUNCTION
803 KOKKOS_INLINE_FUNCTION
807 KOKKOS_INLINE_FUNCTION
820 KOKKOS_INLINE_FUNCTION
830 KOKKOS_INLINE_FUNCTION
833 const int np =
getNP(m, dimension, r_space);
837 nn = np * (1.7 + m*0.1);
840 nn = np * (1.4 + m*0.03);
854 KOKKOS_INLINE_FUNCTION
857 return std::pow(1.0-std::abs(r/h), power) * double(1.0-std::abs(r/h)>0.0);
860 double h_over_3 = h/3.0;
861 return 1./( h_over_3 * 2.5066282746310002416124 ) * std::exp(-.5*r*r/(h_over_3*h_over_3));
864 return ((1-x)+x*(1-x)*(1-2*x)) *
double(r<=h);
872 KOKKOS_INLINE_FUNCTION
874 double inside_val = delta_vector.
x*delta_vector.
x;
877 inside_val += delta_vector.
z*delta_vector.
z;
880 inside_val += delta_vector.
y*delta_vector.
y;
885 return std::sqrt(inside_val);
890 static int getTargetOutputIndex(
const int operation_num,
const int output_component_axis_1,
const int output_component_axis_2,
const int dimensions) {
892 return axis_1_size*output_component_axis_1 + output_component_axis_2;
898 return axis_1_size*output_component_axis_1 + output_component_axis_2;
938 &&
"Entire batch not computed at once, so getFullPolynomialCoefficientsBasis() can not be called.");
940 &&
"generateAlphas() called with keep_coefficients set to false.");
1004 double getTangentBundle(
const int target_index,
const int direction,
const int component)
const {
1007 scratch_matrix_right_type::HostMirror
1009 return T(direction, component);
1015 "getRefenceNormalDirection called, but reference outwrad normal directions were never provided.");
1016 scratch_vector_type::HostMirror
1018 return ref_N(component);
1050 const int output_component_axis_2,
const int input_component_axis_1,
1051 const int input_component_axis_2,
const int additional_evaluation_local_index = 0)
const {
1054 compadre_assert_debug((lro_number >= 0) &&
"getAlphaColumnOffset called for a TargetOperation that was not registered.");
1072 &&
"Entire batch not computed at once, so getFullPolynomialCoefficientsBasis() can not be called.");
1074 &&
"generateAlphas() called with keep_coefficients set to false.");
1094 return getAlpha(lro, target_index, 0, 0, neighbor_index, 0, 0, additional_evaluation_site);
1100 return getAlpha(lro, target_index, output_component, 0, neighbor_index, 0, 0, additional_evaluation_site);
1104 double getAlpha0TensorTo2Tensor(
TargetOperation lro,
const int target_index,
const int output_component_axis_1,
const int output_component_axis_2,
const int neighbor_index,
const int additional_evaluation_site = 0)
const {
1105 return getAlpha(lro, target_index, output_component_axis_1, output_component_axis_2, neighbor_index, 0, 0, additional_evaluation_site);
1111 return getAlpha(lro, target_index, 0, 0, neighbor_index, input_component, 0, additional_evaluation_site);
1117 return getAlpha(lro, target_index, output_component, 0, neighbor_index, input_component, 0, additional_evaluation_site);
1121 double getAlpha1TensorTo2Tensor(
TargetOperation lro,
const int target_index,
const int output_component_axis_1,
const int output_component_axis_2,
const int neighbor_index,
const int input_component,
const int additional_evaluation_site = 0)
const {
1123 return getAlpha(lro, target_index, output_component_axis_1, output_component_axis_2, neighbor_index, input_component, 0, additional_evaluation_site);
1127 double getAlpha2TensorTo0Tensor(
TargetOperation lro,
const int target_index,
const int neighbor_index,
const int input_component_axis_1,
const int input_component_axis_2,
const int additional_evaluation_site = 0)
const {
1128 return getAlpha(lro, target_index, 0, 0, neighbor_index, input_component_axis_1, input_component_axis_2, additional_evaluation_site);
1132 double getAlpha2TensorTo1Tensor(
TargetOperation lro,
const int target_index,
const int output_component,
const int neighbor_index,
const int input_component_axis_1,
const int input_component_axis_2,
const int additional_evaluation_site = 0)
const {
1133 return getAlpha(lro, target_index, output_component, 0, neighbor_index, input_component_axis_1, input_component_axis_2, additional_evaluation_site);
1137 double getAlpha2TensorTo2Tensor(
TargetOperation lro,
const int target_index,
const int output_component_axis_1,
const int output_component_axis_2,
const int neighbor_index,
const int input_component_axis_1,
const int input_component_axis_2,
const int additional_evaluation_site = 0)
const {
1138 return getAlpha(lro, target_index, output_component_axis_1, output_component_axis_2, neighbor_index, input_component_axis_1, input_component_axis_2, additional_evaluation_site);
1143 KOKKOS_INLINE_FUNCTION
1151 return (total_neighbors_before_target+
TO_GLOBAL(total_added_alphas_before_target))
1153 +
TO_GLOBAL(alpha_column_offset*alphas_per_tile_per_target);
1166 return (total_neighbors_before_target+
TO_GLOBAL(total_added_alphas_before_target))
1168 +
TO_GLOBAL(alpha_column_offset*alphas_per_tile_per_target);
1173 double getAlpha(
TargetOperation lro,
const int target_index,
const int output_component_axis_1,
const int output_component_axis_2,
const int neighbor_index,
const int input_component_axis_1,
const int input_component_axis_2,
const int additional_evaluation_site = 0)
const {
1195 output_component_axis_2, input_component_axis_1, input_component_axis_2, additional_evaluation_site);
1207 if (for_target)
return 0;
else return 1;
1213 const int target_index_in_weights =
1217 const int neighbor_index_in_weights =
1222 output_component, input_component);
1268 sm = std::min(bm,sm);
1283 if (
_RHS.extent(0) > 0)
1284 _RHS = Kokkos::View<double*>(
"RHS",0);
1288 template<
typename view_type_1,
typename view_type_2,
typename view_type_3,
typename view_type_4>
1290 view_type_1 neighbor_lists,
1291 view_type_2 source_coordinates,
1292 view_type_3 target_coordinates,
1293 view_type_4 epsilons) {
1294 this->setNeighborLists<view_type_1>(neighbor_lists);
1295 this->setSourceSites<view_type_2>(source_coordinates);
1296 this->setTargetSites<view_type_3>(target_coordinates);
1297 this->setWindowSizes<view_type_4>(epsilons);
1301 template<
typename view_type_1,
typename view_type_2,
typename view_type_3,
typename view_type_4>
1303 view_type_1 cr_neighbor_lists,
1304 view_type_1 number_of_neighbors_list,
1305 view_type_2 source_coordinates,
1306 view_type_3 target_coordinates,
1307 view_type_4 epsilons) {
1308 this->setNeighborLists<view_type_1>(cr_neighbor_lists, number_of_neighbors_list);
1309 this->setSourceSites<view_type_2>(source_coordinates);
1310 this->setTargetSites<view_type_3>(target_coordinates);
1311 this->setWindowSizes<view_type_4>(epsilons);
1315 template<
typename view_type_1,
typename view_type_2>
1317 view_type_1 additional_evaluation_indices,
1318 view_type_2 additional_evaluation_coordinates) {
1319 this->setAuxiliaryEvaluationIndicesLists<view_type_1>(additional_evaluation_indices);
1320 this->setAuxiliaryEvaluationCoordinates<view_type_2>(additional_evaluation_coordinates);
1324 template <
typename view_type>
1325 typename std::enable_if<view_type::rank==1&&std::is_same<decltype(_neighbor_lists)::internal_view_type,view_type>::value==1,
void>::type
1331 Kokkos::parallel_for(
"copy neighbor list sizes", Kokkos::RangePolicy<host_execution_space>(0,
_host_number_of_neighbors_list.extent(0)), KOKKOS_LAMBDA(
const int i) {
1340 template <
typename view_type>
1341 typename std::enable_if<view_type::rank==1&&std::is_same<decltype(_neighbor_lists)::internal_view_type,view_type>::value==0,
void>::type
1345 gmls_view_type d_neighbor_lists(
"compressed row neighbor lists data", neighbor_lists.extent(0));
1346 gmls_view_type d_number_of_neighbors_list(
"number of neighbors list", number_of_neighbors_list.extent(0));
1347 Kokkos::deep_copy(d_neighbor_lists, neighbor_lists);
1348 Kokkos::deep_copy(d_number_of_neighbors_list, number_of_neighbors_list);
1353 Kokkos::parallel_for(
"copy neighbor list sizes", Kokkos::RangePolicy<host_execution_space>(0,
_host_number_of_neighbors_list.extent(0)), KOKKOS_LAMBDA(
const int i) {
1363 template <
typename view_type>
1364 typename std::enable_if<view_type::rank==2, void>::type
setNeighborLists(view_type neighbor_lists) {
1366 _neighbor_lists = Convert2DToCompressedRowNeighborLists<decltype(neighbor_lists), Kokkos::View<int*> >(neighbor_lists);
1369 Kokkos::parallel_for(
"copy neighbor list sizes", Kokkos::RangePolicy<host_execution_space>(0,
_host_number_of_neighbors_list.extent(0)), KOKKOS_LAMBDA(
const int i) {
1379 template<
typename view_type>
1384 source_coordinates.extent(0), source_coordinates.extent(1));
1386 typedef typename view_type::memory_space input_array_memory_space;
1387 if (std::is_same<input_array_memory_space, device_memory_space>::value) {
1398 Kokkos::deep_copy(host_source_coordinates, source_coordinates);
1407 template<
typename view_type>
1415 template<
typename view_type>
1419 target_coordinates.extent(0), target_coordinates.extent(1));
1421 typedef typename view_type::memory_space input_array_memory_space;
1422 if (std::is_same<input_array_memory_space, device_memory_space>::value) {
1433 Kokkos::deep_copy(host_target_coordinates, target_coordinates);
1444 template<
typename view_type>
1455 template<
typename view_type>
1469 template<
typename view_type>
1481 template<
typename view_type>
1491 "Memory space does not match between _T and tangent_directions");
1496 Kokkos::parallel_for(
"copy tangent vectors", Kokkos::RangePolicy<device_execution_space>(0,
_target_coordinates.extent(0)), KOKKOS_LAMBDA(
const int i) {
1498 for (
int j=0; j<this_dimensions; ++j) {
1499 for (
int k=0; k<this_dimensions; ++k) {
1500 T(j,k) = tangent_directions(i, j, k);
1507 _host_T = Kokkos::create_mirror_view(
_T);
1515 template<
typename view_type>
1522 auto this_ref_N = this->
_ref_N;
1526 Kokkos::parallel_for(
"copy normal vectors", Kokkos::RangePolicy<device_execution_space>(0,
_target_coordinates.extent(0)), KOKKOS_LAMBDA(
const int i) {
1527 for (
int j=0; j<this_dimensions; ++j) {
1528 this_ref_N(i*this_dimensions + j) = outward_normal_directions(i, j);
1543 template<
typename view_type>
1550 Kokkos::deep_copy(host_extra_data, extra_data);
1558 template<
typename view_type>
1567 template<
typename view_type>
1574 Kokkos::deep_copy(host_extra_data, extra_data);
1582 template<
typename view_type>
1593 template <
typename view_type>
1597 evaluation_coordinates.extent(0), evaluation_coordinates.extent(1));
1599 typedef typename view_type::memory_space input_array_memory_space;
1600 if (std::is_same<input_array_memory_space, device_memory_space>::value) {
1611 Kokkos::deep_copy(host_additional_evaluation_coordinates, evaluation_coordinates);
1622 template <
typename view_type>
1631 template <
typename view_type>
1635 indices_lists.extent(0), indices_lists.extent(1));
1639 typedef typename view_type::memory_space input_array_memory_space;
1640 if (std::is_same<input_array_memory_space, device_memory_space>::value) {
1659 Kokkos::parallel_reduce(
"additional evaluation indices",
1661 KOKKOS_LAMBDA(
const int i,
int& t_max_evaluation_sites_per_target) {
1662 number_of_additional_evaluation_indices(i) = additional_evaluation_indices(i,0);
1663 t_max_evaluation_sites_per_target = (t_max_evaluation_sites_per_target > number_of_additional_evaluation_indices(i)+1)
1664 ? t_max_evaluation_sites_per_target : number_of_additional_evaluation_indices(i)+1;
1673 template <
typename view_type>
1685 Kokkos::parallel_reduce(
"additional evaluation indices",
1687 KOKKOS_LAMBDA(
const int i,
int& t_max_evaluation_sites_per_target) {
1688 number_of_additional_evaluation_indices(i) = additional_evaluation_indices(i,0);
1689 t_max_evaluation_sites_per_target = (t_max_evaluation_sites_per_target > number_of_additional_evaluation_indices(i)+1)
1690 ? t_max_evaluation_sites_per_target : number_of_additional_evaluation_indices(i)+1;
1699 std::string wt_to_lower = wt;
1700 transform(wt_to_lower.begin(), wt_to_lower.end(), wt_to_lower.begin(), ::tolower);
1701 if (wt_to_lower ==
"power") {
1703 }
else if (wt_to_lower ==
"gaussian") {
1705 }
else if (wt_to_lower ==
"cubicspline") {
1722 std::string wt_to_lower = wt;
1723 transform(wt_to_lower.begin(), wt_to_lower.end(), wt_to_lower.begin(), ::tolower);
1724 if (wt_to_lower ==
"power") {
1726 }
else if (wt_to_lower ==
"gaussian") {
1728 }
else if (wt_to_lower ==
"cubicspline") {
1788 std::vector<TargetOperation> temporary_lro_vector(1, lro);
1799 for (
size_t i=0; i<lro.size(); ++i) {
1801 bool operation_found =
false;
1803 for (
size_t j=0; j<
_lro.size(); ++j) {
1806 if (
_lro[j]==lro[i]) {
1808 operation_found =
true;
1818 if (!operation_found) {
1820 _lro.push_back(lro[i]);
1836 int total_offset = 0;
1837 int output_offset = 0;
1838 int input_offset = 0;
1839 for (
size_t i=0; i<
_lro.size(); ++i) {
1851 total_offset += input_tile_size * output_tile_size;
1852 output_offset += output_tile_size;
1853 input_offset += input_tile_size;
1902 void generateAlphas(
const int number_of_batches = 1,
const bool keep_coefficients =
false);
Kokkos::View< double * > _manifold_metric_tensor_inverse
metric tensor inverse for all problems
Divergence-free vector polynomial basis.
Kokkos::View< int * > _lro_input_tile_size
dimensions ^ rank of tensor of output for each sampling functional (device)
Kokkos::View< double *, layout_right > _alphas
generated alpha coefficients (device)
double getAlpha2TensorTo0Tensor(TargetOperation lro, const int target_index, const int neighbor_index, const int input_component_axis_1, const int input_component_axis_2, const int additional_evaluation_site=0) const
Helper function for getting alphas for scalar reconstruction from matrix data.
SamplingFunctional getDataSamplingFunctional() const
Get the data sampling functional specified at instantiation (often the same as the polynomial samplin...
int calculateBasisMultiplier(const ReconstructionSpace rs) const
Calculate basis_multiplier.
ReconstructionSpace getReconstructionSpace() const
Get the reconstruction space specified at instantiation.
Standard GMLS problem type.
std::size_t global_index_type
Kokkos::View< const double *****, layout_right >::HostMirror _host_prestencil_weights
generated weights for nontraditional samples required to transform data into expected sampling functi...
Kokkos::View< TargetOperation * > _operations
vector containing target functionals to be applied for reconstruction problem (device) ...
KOKKOS_INLINE_FUNCTION int getMaxNNeighbors() const
Returns the maximum neighbor lists size over all target sites.
int getManifoldWeightingPower() const
Power for weighting kernel for curvature.
bool _entire_batch_computed_at_once
whether entire calculation was computed at once the alternative is that it was broken up over many sm...
int getWeightingPower() const
Power for weighting kernel for GMLS problem.
int _max_evaluation_sites_per_target
maximum number of evaluation sites for each target (includes target site)
ProblemType getProblemType()
Get problem type.
KOKKOS_INLINE_FUNCTION int getMaxNumNeighbors() const
Get the maximum number of neighbors of all targets' neighborhoods (host/device)
Kokkos::View< double * > _manifold_curvature_coefficients
curvature polynomial coefficients for all problems
int _curvature_weighting_power
power to be used for weighting kernel for curvature
int output_rank
Rank of sampling functional output for each SamplingFunctional.
void generatePolynomialCoefficients(const int number_of_batches=1, const bool keep_coefficients=false)
Generates polynomial coefficients by setting up and solving least squares problems ! Sets up the batc...
static KOKKOS_INLINE_FUNCTION double EuclideanVectorLength(const XYZ &delta_vector, const int dimension)
Returns Euclidean norm of a vector.
Kokkos::View< int **, layout_right > _additional_evaluation_indices
(OPTIONAL) contains indices of entries in the _additional_evaluation_coordinates view (device) ...
Tag for functor to evaluate curvature targets and apply to coefficients of curvature reconstruction...
Kokkos::View< double * > _ref_N
Rank 2 tensor for high order approximation of tangent vectors for all problems.
KOKKOS_INLINE_FUNCTION int getSize(const int degree, const int dimension)
Returns size of basis.
double getAlpha1TensorTo0Tensor(TargetOperation lro, const int target_index, const int neighbor_index, const int input_component, const int additional_evaluation_site=0) const
Helper function for getting alphas for scalar reconstruction from vector data.
#define compadre_kernel_assert_release(condition)
compadre_kernel_assert_release is similar to compadre_assert_release, but is a call on the device...
constexpr SamplingFunctional ManifoldVectorPointSample
Point evaluations of the entire vector source function (but on a manifold, so it includes a transform...
decltype(_prestencil_weights) getPrestencilWeights() const
Get a view (device) of all rank 2 preprocessing tensors This is a rank 5 tensor that is able to provi...
GMLS(const int poly_order, const int dimensions=3, const std::string dense_solver_type=std::string("QR"), const std::string problem_type=std::string("STANDARD"), const std::string constraint_type=std::string("NO_CONSTRAINT"), const int manifold_curvature_poly_order=2)
Constructor for the case when the data sampling functional does not match the polynomial sampling fun...
bool _reference_outward_normal_direction_provided
whether or not the reference outward normal directions were provided by the user. ...
int getOutputDimensionOfSampling(SamplingFunctional sro) const
Dimensions ^ output rank for sampling operation (always in local chart if on a manifold, never ambient space)
team_policy::member_type member_type
Neumann Gradient Scalar Type.
int _NP
dimension of basis for polynomial reconstruction
KOKKOS_INLINE_FUNCTION void createWeightsAndP(const member_type &teamMember, scratch_vector_type delta, scratch_vector_type thread_workspace, scratch_matrix_right_type P, scratch_vector_type w, const int dimension, int polynomial_order, bool weight_p=false, scratch_matrix_right_type *V=NULL, const ReconstructionSpace reconstruction_space=ReconstructionSpace::ScalarTaylorPolynomial, const SamplingFunctional sampling_strategy=PointSample) const
Fills the _P matrix with either P or P*sqrt(w)
int _total_alpha_values
used for sizing P_target_row and the _alphas view
Kokkos::View< double * > _epsilons
h supports determined through neighbor search (device)
bool _orthonormal_tangent_space_provided
whether or not the orthonormal tangent directions were provided by the user.
KOKKOS_INLINE_FUNCTION int getTargetOffsetIndexDevice(const int lro_num, const int input_component, const int output_component, const int additional_evaluation_local_index=0) const
Handles offset from operation input/output + extra evaluation sites.
void setProblemData(view_type_1 cr_neighbor_lists, view_type_1 number_of_neighbors_list, view_type_2 source_coordinates, view_type_3 target_coordinates, view_type_4 epsilons)
Sets basic problem data (neighbor lists data, number of neighbors list, source coordinates, and target coordinates)
KOKKOS_INLINE_FUNCTION int getAdditionalEvaluationIndex(const int target_index, const int additional_list_num) const
(OPTIONAL) Mapping from [0,number of additional evaluation sites for a target] to the row that contai...
Kokkos::View< int *, host_memory_space > _host_number_of_neighbors_list
convenient copy on host of number of neighbors
void setQuadratureType(std::string quadrature_type)
Type of quadrature points.
static int getTargetOutputIndex(const int operation_num, const int output_component_axis_1, const int output_component_axis_2, const int dimensions)
Helper function for finding alpha coefficients.
std::string getQuadratureType() const
Type of quadrature points.
WeightingFunctionType getManifoldWeightingType() const
Type for weighting kernel for curvature.
bool _use_reference_outward_normal_direction_provided_to_orient_surface
whether or not to use reference outward normal directions to orient the surface in a manifold problem...
Kokkos::View< double * > _RHS
sqrt(w)*Identity matrix for all problems, later holds polynomial coefficients for all problems ...
KOKKOS_INLINE_FUNCTION void calcGradientPij(const member_type &teamMember, double *delta, double *thread_workspace, const int target_index, int neighbor_index, const double alpha, const int partial_direction, const int dimension, const int poly_order, bool specific_order_only, const scratch_matrix_right_type *V, const ReconstructionSpace reconstruction_space, const SamplingFunctional sampling_strategy, const int additional_evaluation_local_index=0) const
Evaluates the gradient of a polynomial basis under the Dirac Delta (pointwise) sampling function...
Kokkos::View< double * > _w
contains weights for all problems
void setWindowSizes(view_type epsilons)
Sets window sizes, also called the support of the kernel.
int _sampling_multiplier
actual dimension of the sampling functional e.g.
int _reconstruction_space_rank
actual rank of reconstruction basis
int _curvature_poly_order
order of basis for curvature reconstruction
decltype(_ref_N) getReferenceNormalDirections() const
Get a view (device) of all reference outward normal directions.
int getNumberOfNeighborsHost(int target_index) const
Get number of neighbors for a given target (host)
Kokkos::View< double **, layout_right > _target_coordinates
coordinates for target sites for reconstruction (device)
Each target applies a different data transform, but the same to each neighbor.
KOKKOS_INLINE_FUNCTION void calcPij(const member_type &teamMember, double *delta, double *thread_workspace, const int target_index, int neighbor_index, const double alpha, const int dimension, const int poly_order, bool specific_order_only=false, const scratch_matrix_right_type *V=NULL, const ReconstructionSpace reconstruction_space=ReconstructionSpace::ScalarTaylorPolynomial, const SamplingFunctional sampling_strategy=PointSample, const int additional_evaluation_local_index=0) const
Evaluates the polynomial basis under a particular sampling function. Generally used to fill a row of ...
std::enable_if< view_type::rank==2, void >::type setNeighborLists(view_type neighbor_lists)
Sets neighbor list information.
int _data_sampling_multiplier
effective dimension of the data sampling functional e.g.
std::vector< int > _lro_lookup
vector containing a mapping from a target functionals enum value to the its place in the list of targ...
KOKKOS_INLINE_FUNCTION global_index_type getAlphaIndexDevice(const int target_index, const int alpha_column_offset) const
Gives index into alphas given two axes, which when incremented by the neighbor number transforms acce...
Each target applies a different transform for each neighbor.
NeighborLists< Kokkos::View< int * > > _neighbor_lists
Accessor to get neighbor list data, offset data, and number of neighbors per target.
Quadrature _qm
manages and calculates quadrature
Kokkos::View< double * >::HostMirror _host_T
tangent vectors information (host)
int getInputDimensionOfOperation(TargetOperation lro) const
Dimensions ^ input rank for target operation (always in local chart if on a manifold, never ambient space)
double getAlpha0TensorTo1Tensor(TargetOperation lro, const int target_index, const int output_component, const int neighbor_index, const int additional_evaluation_site=0) const
Helper function for getting alphas for vector reconstruction from scalar data.
KOKKOS_INLINE_FUNCTION double convertGlobalToLocalCoordinate(const XYZ global_coord, const int dim, const scratch_matrix_right_type *V) const
Returns a component of the local coordinate after transformation from global to local under the ortho...
Kokkos::View< int * >::HostMirror _host_lro_input_tensor_rank
tensor rank of sampling functional (host)
void clearTargets()
Empties the vector of target functionals to apply to the reconstruction.
std::vector< TargetOperation > _lro
vector of user requested target operations
void setTargetExtraData(view_type extra_data)
(OPTIONAL) Sets extra data to be used by target operations in certain instances.
global_index_type getAlphaIndexHost(const int target_index, const int alpha_column_offset) const
Gives index into alphas given two axes, which when incremented by the neighbor number transforms acce...
void setReferenceOutwardNormalDirection(view_type outward_normal_directions, bool use_to_orient_surface=true)
(OPTIONAL) Sets outward normal direction.
int getOrderOfQuadraturePoints() const
Order of quadrature points.
void setAuxiliaryEvaluationIndicesLists(decltype(_additional_evaluation_indices) indices_lists)
(OPTIONAL) Sets the additional target evaluation coordinate indices list information.
void setDimensionOfQuadraturePoints(int dim)
Dimensions of quadrature points to use.
Scalar polynomial basis centered at the target site and scaled by sum of basis powers e...
Solve GMLS problem on a manifold (will use QR or SVD to solve the resultant GMLS problem dependent on...
int getAlphaColumnOffset(TargetOperation lro, const int output_component_axis_1, const int output_component_axis_2, const int input_component_axis_1, const int input_component_axis_2, const int additional_evaluation_local_index=0) const
Retrieves the offset for an operator based on input and output component, generic to row (but still m...
decltype(_T) getTangentDirections() const
Get a view (device) of all tangent direction bundles.
int _max_num_neighbors
maximum number of neighbors over all target sites
Kokkos::View< int * > _lro_input_tensor_rank
tensor rank of sampling functional (device)
Should be the total count of all available target functionals.
Kokkos::View< int * >::HostMirror _host_lro_output_tensor_rank
tensor rank of target functional (host)
WeightingFunctionType _curvature_weighting_type
weighting kernel type for curvature problem
WeightingFunctionType _weighting_type
weighting kernel type for GMLS
Kokkos::View< int * > _lro_output_tile_size
dimensions ^ rank of tensor of output for each target functional (device)
static KOKKOS_INLINE_FUNCTION int getNN(const int m, const int dimension=3, const ReconstructionSpace r_space=ReconstructionSpace::ScalarTaylorPolynomial)
Returns number of neighbors needed for unisolvency for a given basis order and dimension.
const SamplingFunctional _data_sampling_functional
generally the same as _polynomial_sampling_functional, but can differ if specified at GMLS class inst...
constexpr int TargetOutputTensorRank[]
Rank of target functional output for each TargetOperation Rank of target functional input for each Ta...
double getAlpha2TensorTo2Tensor(TargetOperation lro, const int target_index, const int output_component_axis_1, const int output_component_axis_2, const int neighbor_index, const int input_component_axis_1, const int input_component_axis_2, const int additional_evaluation_site=0) const
Helper function for getting alphas for matrix reconstruction from matrix data.
double getAlpha1TensorTo1Tensor(TargetOperation lro, const int target_index, const int output_component, const int neighbor_index, const int input_component, const int additional_evaluation_site=0) const
Helper function for getting alphas for vector reconstruction from vector data.
Tag for functor to evaluate targets, apply target evaluation to polynomial coefficients to store in _...
static ConstraintType parseConstraintType(const std::string &constraint_type)
Parses a string to determine constraint type.
KOKKOS_INLINE_FUNCTION int getNeighborDevice(int target_index, int neighbor_num) const
Offers N(i,j) indexing where N(i,j) is the index of the jth neighbor of i (device) ...
DenseSolverType _dense_solver_type
solver type for GMLS problem - can be QR, SVD or LU
static ProblemType parseProblemType(const std::string &problem_type)
Parses a string to determine problem type.
QR factorization performed on P*sqrt(w) matrix.
double getAlpha1TensorTo2Tensor(TargetOperation lro, const int target_index, const int output_component_axis_1, const int output_component_axis_2, const int neighbor_index, const int input_component, const int additional_evaluation_site=0) const
Helper function for getting alphas for matrix reconstruction from vector data.
void addTargets(TargetOperation lro)
Adds a target to the vector of target functional to be applied to the reconstruction.
Tag for functor to create a coarse tangent approximation from a given neighborhood of points...
pool_type _random_number_pool
Kokkos::View< int * > _lro_total_offsets
index for where this operation begins the for _alpha coefficients (device)
Kokkos::View< double * > _manifold_curvature_gradient
_dimension-1 gradient values for curvature for all problems
void setSourceExtraData(view_type extra_data)
(OPTIONAL) Sets extra data to be used by sampling functionals in certain instances.
double getAlpha(TargetOperation lro, const int target_index, const int output_component_axis_1, const int output_component_axis_2, const int neighbor_index, const int input_component_axis_1, const int input_component_axis_2, const int additional_evaluation_site=0) const
Underlying function all interface helper functions call to retrieve alpha values. ...
KOKKOS_INLINE_FUNCTION int getNEvaluationSitesPerTarget(const int target_index) const
(OPTIONAL) Returns number of additional evaluation sites for a particular target
KOKKOS_INLINE_FUNCTION int getNeighborIndex(const int target_index, const int neighbor_list_num) const
Mapping from [0,number of neighbors for a target] to the row that contains the source coordinates for...
ProblemType
Problem type, that optionally can handle manifolds.
ConstraintType getConstraintType()
Get constraint type.
Kokkos::View< int *, host_execution_space > host_managed_local_index_type
void setAuxiliaryEvaluationCoordinates(decltype(_additional_evaluation_coordinates) evaluation_coordinates)
(OPTIONAL) Sets additional points for evaluation of target operation on polynomial reconstruction...
void setAuxiliaryEvaluationIndicesLists(view_type indices_lists)
(OPTIONAL) Sets the additional target evaluation coordinate indices list information.
Kokkos::View< double *****, layout_right > _prestencil_weights
generated weights for nontraditional samples required to transform data into expected sampling functi...
void addTargets(std::vector< TargetOperation > lro)
Adds a vector of target functionals to the vector of target functionals already to be applied to the ...
#define TO_GLOBAL(variable)
KOKKOS_INLINE_FUNCTION int getSize(const int degree, const int dimension)
Returns size of basis.
KOKKOS_INLINE_FUNCTION int getNumberOfTargets() const
Get number of total targets having neighborhoods (host/device).
void setCurvatureWeightingType(const std::string &wt)
Type for weighting kernel for curvature.
std::enable_if< view_type::rank==1 &&std::is_same< decltype(_neighbor_lists)::internal_view_type, view_type >::value==1, void >::type setNeighborLists(view_type neighbor_lists, view_type number_of_neighbors_list)
Sets neighbor list information from compressed row neighborhood lists data (if same view_type)...
int _initial_index_for_batch
initial index for current batch
int input_rank
Rank of sampling functional input for each SamplingFunctional.
static KOKKOS_INLINE_FUNCTION int getNP(const int m, const int dimension=3, const ReconstructionSpace r_space=ReconstructionSpace::ScalarTaylorPolynomial)
Returns size of the basis for a given polynomial order and dimension General to dimension 1...
KOKKOS_INLINE_FUNCTION double getNeighborCoordinate(const int target_index, const int neighbor_list_num, const int dim, const scratch_matrix_right_type *V=NULL) const
Returns one component of the neighbor coordinate for a particular target.
KOKKOS_INLINE_FUNCTION double getTargetCoordinate(const int target_index, const int dim, const scratch_matrix_right_type *V=NULL) const
Returns one component of the target coordinate for a particular target.
void setSourceSites(decltype(_source_coordinates) source_coordinates)
Sets source coordinate information.
Kokkos::View< double **, layout_right > _source_extra_data
Extra data available to basis functions (optional)
KOKKOS_INLINE_FUNCTION void computeTargetFunctionalsOnManifold(const member_type &teamMember, scratch_vector_type t1, scratch_vector_type t2, scratch_matrix_right_type P_target_row, scratch_matrix_right_type V, scratch_matrix_right_type G_inv, scratch_vector_type curvature_coefficients, scratch_vector_type curvature_gradients) const
Evaluates a polynomial basis with a target functional applied, using information from the manifold cu...
void setTargetSites(decltype(_target_coordinates) target_coordinates)
Sets target coordinate information. Rows of this 2D-array should correspond to rows of the neighbor l...
Scalar basis reused as many times as there are components in the vector resulting in a much cheaper p...
Kokkos::View< int **, layout_right >::HostMirror _host_additional_evaluation_indices
(OPTIONAL) contains indices of entries in the _additional_evaluation_coordinates view (host) ...
SVD factorization performed on P*sqrt(w) matrix.
void setAdditionalEvaluationSitesData(view_type_1 additional_evaluation_indices, view_type_2 additional_evaluation_coordinates)
(OPTIONAL) Sets additional evaluation sites for each target site
int getPolynomialCoefficientsSize() const
Returns size of the basis used in instance's polynomial reconstruction.
ReconstructionSpace
Space in which to reconstruct polynomial.
KOKKOS_INLINE_FUNCTION int getNumberOfNeighborsDevice(int target_index) const
Get number of neighbors for a given target (device)
const SamplingFunctional _polynomial_sampling_functional
polynomial sampling functional used to construct P matrix, set at GMLS class instantiation ...
Tag for functor to assemble the P*sqrt(weights) matrix and construct sqrt(weights)*Identity.
std::enable_if< view_type::rank==1 &&std::is_same< decltype(_neighbor_lists)::internal_view_type, view_type >::value==0, void >::type setNeighborLists(view_type neighbor_lists, view_type number_of_neighbors_list)
Sets neighbor list information from compressed row neighborhood lists data (if different view_type)...
DenseSolverType getDenseSolverType()
Get dense solver type.
GMLS(ReconstructionSpace reconstruction_space, SamplingFunctional dual_sampling_strategy, const int poly_order, const int dimensions=3, const std::string dense_solver_type=std::string("QR"), const std::string problem_type=std::string("STANDARD"), const std::string constraint_type=std::string("NO_CONSTRAINT"), const int manifold_curvature_poly_order=2)
Constructor for the case when nonstandard sampling functionals or reconstruction spaces are to be use...
Tag for functor to calculate prestencil weights to apply to data to transform into a format expected ...
KOKKOS_INLINE_FUNCTION void getPDims(DenseSolverType dense_solver_type, ConstraintType constraint_type, ReconstructionSpace reconstruction_space, const int dimension, const int M, const int N, int &out_row, int &out_col)
Kokkos::View< double * >::HostMirror _host_epsilons
h supports determined through neighbor search (host)
Kokkos::View< double **, layout_right, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_right_type
Kokkos::View< double *, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_vector_type
KOKKOS_INLINE_FUNCTION int getMaxEvaluationSitesPerTarget() const
Returns the maximum number of evaluation sites over all target sites (target sites are included in to...
void setWeightingType(const WeightingFunctionType wt)
Type for weighting kernel for GMLS problem.
WeightingFunctionType
Available weighting kernel function types.
int getLocalDimensions() const
Local dimension of the GMLS problem (less than global dimension if on a manifold), set only at class instantiation.
NeighborLists assists in accessing entries of compressed row neighborhood lists.
Kokkos::View< double **, layout_right > _source_coordinates
all coordinates for the source for which _neighbor_lists refers (device)
Kokkos::View< int * > _lro_output_tensor_rank
tensor rank of target functional (device)
void setCurvaturePolynomialOrder(const int manifold_poly_order)
Sets basis order to be used when reoncstructing curvature.
void generateAlphas(const int number_of_batches=1, const bool keep_coefficients=false)
Meant to calculate target operations and apply the evaluations to the previously ! constructed polyno...
Kokkos::View< double **, layout_right > _target_extra_data
Extra data available to target operations (optional)
int _dimension_of_quadrature_points
dimension of quadrature rule
decltype(_alphas) getAlphas() const
Get a view (device) of all alphas.
KOKKOS_INLINE_FUNCTION void computeTargetFunctionals(const member_type &teamMember, scratch_vector_type t1, scratch_vector_type t2, scratch_matrix_right_type P_target_row) const
Evaluates a polynomial basis with a target functional applied to each member of the basis...
decltype(_RHS) getFullPolynomialCoefficientsBasis() const
Get a view (device) of all polynomial coefficients basis.
Kokkos::View< double * >::HostMirror _host_ref_N
reference outward normal vectors information (host)
Point evaluation of the gradient of a scalar.
GMLS(ReconstructionSpace reconstruction_space, const SamplingFunctional polynomial_sampling_strategy, const SamplingFunctional data_sampling_strategy, const int poly_order, const int dimensions=3, const std::string dense_solver_type=std::string("QR"), const std::string problem_type=std::string("STANDARD"), const std::string constraint_type=std::string("NO_CONSTRAINT"), const int manifold_curvature_poly_order=2)
Minimal constructor providing no data (neighbor lists, source sites, target sites) ...
int getDimensions() const
Dimension of the GMLS problem, set only at class instantiation.
KOKKOS_INLINE_FUNCTION void createWeightsAndPForCurvature(const member_type &teamMember, scratch_vector_type delta, scratch_vector_type thread_workspace, scratch_matrix_right_type P, scratch_vector_type w, const int dimension, bool only_specific_order, scratch_matrix_right_type *V=NULL) const
Fills the _P matrix with P*sqrt(w) for use in solving for curvature.
Kokkos::View< int * >::HostMirror _host_lro_input_tile_size
dimensions ^ rank of tensor of output for each sampling functional (host)
ParallelManager _pm
determines scratch level spaces and is used to call kernels
int getGlobalDimensions() const
Dimension of the GMLS problem's point data (spatial description of points in ambient space)...
void setWindowSizes(decltype(_epsilons) epsilons)
Sets window sizes, also called the support of the kernel (device)
KOKKOS_INLINE_FUNCTION void calcHessianPij(const member_type &teamMember, double *delta, double *thread_workspace, const int target_index, int neighbor_index, const double alpha, const int partial_direction_1, const int partial_direction_2, const int dimension, const int poly_order, bool specific_order_only, const scratch_matrix_right_type *V, const ReconstructionSpace reconstruction_space, const SamplingFunctional sampling_strategy, const int additional_evaluation_local_index=0) const
Evaluates the Hessian of a polynomial basis under the Dirac Delta (pointwise) sampling function...
Kokkos::View< TargetOperation * > _curvature_support_operations
vector containing target functionals to be applied for curvature
static int getInputRankOfSampling(SamplingFunctional sro)
Input rank for sampling operation.
KOKKOS_INLINE_FUNCTION void computeCurvatureFunctionals(const member_type &teamMember, scratch_vector_type t1, scratch_vector_type t2, scratch_matrix_right_type P_target_row, const scratch_matrix_right_type *V, const local_index_type local_neighbor_index=-1) const
Evaluates a polynomial basis for the curvature with a gradient target functional applied.
Generalized Moving Least Squares (GMLS)
global_index_type getRowOffsetHost(int target_index) const
Get offset into compressed row neighbor lists (host)
void setTargetExtraData(decltype(_target_extra_data) extra_data)
(OPTIONAL) Sets extra data to be used by target operations in certain instances.
int _added_alpha_size
additional alpha coefficients due to constraints
ProblemType _problem_type
problem type for GMLS problem, can also be set to STANDARD for normal or MANIFOLD for manifold proble...
int _basis_multiplier
dimension of the reconstructed function e.g.
int _global_dimensions
spatial dimension of the points, set at class instantiation only
Kokkos::View< double **, layout_right > _additional_evaluation_coordinates
(OPTIONAL) user provided additional coordinates for target operation evaluation (device) ...
double getAlpha0TensorTo2Tensor(TargetOperation lro, const int target_index, const int output_component_axis_1, const int output_component_axis_2, const int neighbor_index, const int additional_evaluation_site=0) const
Helper function for getting alphas for matrix reconstruction from scalar data.
DenseSolverType
Dense solver type.
Kokkos::View< double * > _T
Rank 3 tensor for high order approximation of tangent vectors for all problems.
void resetCoefficientData()
double getAlpha0TensorTo0Tensor(TargetOperation lro, const int target_index, const int neighbor_index, const int additional_evaluation_site=0) const
Helper function for getting alphas for scalar reconstruction from scalar data.
int getDimensionOfQuadraturePoints() const
Dimensions of quadrature points.
KOKKOS_INLINE_FUNCTION global_index_type getRowOffsetDevice(int target_index) const
Get offset into compressed row neighbor lists (device)
void setSourceSites(view_type source_coordinates)
Sets source coordinate information.
int getInputDimensionOfSampling(SamplingFunctional sro) const
Dimensions ^ output rank for sampling operation (always in ambient space, never local chart on a mani...
LU factorization performed on P^T*W*P matrix.
bool _store_PTWP_inv_PTW
whether polynomial coefficients were requested to be stored (in a state not yet applied to data) ...
static int getOutputRankOfSampling(SamplingFunctional sro)
Output rank for sampling operation.
int transform_type
Describes the SamplingFunction relationship to targets, neighbors.
Kokkos::View< int * > _number_of_additional_evaluation_indices
(OPTIONAL) contains the # of additional coordinate indices for each target
KOKKOS_INLINE_FUNCTION int getNumberOfQuadraturePoints() const
void setPolynomialOrder(const int poly_order)
Sets basis order to be used when reoncstructing any function.
constexpr int ActualReconstructionSpaceRank[]
Number of actual components in the ReconstructionSpace.
void setTargetSites(view_type target_coordinates)
Sets target coordinate information. Rows of this 2D-array should correspond to rows of the neighbor l...
ReconstructionSpace _reconstruction_space
reconstruction space for GMLS problems, set at GMLS class instantiation
void setAuxiliaryEvaluationCoordinates(view_type evaluation_coordinates)
(OPTIONAL) Sets additional points for evaluation of target operation on polynomial reconstruction...
Kokkos::View< const double *, layout_right >::HostMirror _host_alphas
generated alpha coefficients (host)
Kokkos::Random_XorShift64_Pool pool_type
void setCurvatureWeightingPower(int wp)
Power for weighting kernel for curvature.
int _weighting_power
power to be used for weighting kernel
Kokkos::View< double * > _P
P*sqrt(w) matrix for all problems.
Tag for functor to evaluate targets, apply target evaluation to polynomial coefficients to store in _...
Tag for functor to assemble the P*sqrt(weights) matrix and construct sqrt(weights)*Identity.
void setWeightingType(const std::string &wt)
Type for weighting kernel for GMLS problem.
KOKKOS_INLINE_FUNCTION double getTargetAuxiliaryCoordinate(const int target_index, const int additional_list_num, const int dim, const scratch_matrix_right_type *V=NULL) const
(OPTIONAL) Returns one component of the additional evaluation coordinates.
void setProblemData(view_type_1 neighbor_lists, view_type_2 source_coordinates, view_type_3 target_coordinates, view_type_4 epsilons)
Sets basic problem data (neighbor lists, source coordinates, and target coordinates) ...
constexpr SamplingFunctional PointSample
Available sampling functionals.
int _dimensions
dimension of the problem, set at class instantiation only
int calculateSamplingMultiplier(const ReconstructionSpace rs, const SamplingFunctional sro) const
Calculate sampling_multiplier.
host_managed_local_index_type getPolynomialCoefficientsDomainRangeSize() const
Returns (size of the basis used in instance's polynomial reconstruction) x (data input dimension) ...
decltype(_neighbor_lists)* getNeighborLists()
Get neighbor list accessor.
std::string _quadrature_type
quadrature rule type
Kokkos::View< TargetOperation * >::HostMirror _host_operations
vector containing target functionals to be applied for reconstruction problem (host) ...
static KOKKOS_INLINE_FUNCTION double Wab(const double r, const double h, const WeightingFunctionType &weighting_type, const int power)
Evaluates the weighting kernel.
bool _nontrivial_nullspace
whether or not operator to be inverted for GMLS problem has a nontrivial nullspace (requiring SVD) ...
struct SubviewND< T, T2, enable_if_t<(T::rank< 2)> >{T _data_in;T2 _data_original_view;bool _scalar_as_vector_if_needed;SubviewND(T data_in, T2 data_original_view, bool scalar_as_vector_if_needed){_data_in=data_in;_data_original_view=data_original_view;_scalar_as_vector_if_needed=scalar_as_vector_if_needed;}auto get1DView(const int column_num) -> decltype(Kokkos::subview(_data_in, Kokkos::ALL))
Creates 1D subviews of data from a 1D view, generally constructed with CreateNDSliceOnDeviceView.
int getTargetOperationLocalIndex(TargetOperation lro) const
Get the local index (internal) to GMLS for a particular TargetOperation Every TargetOperation has a g...
int getNumberOfQuadraturePoints() const
Number of quadrature points.
Tag for functor to assemble the P*sqrt(weights) matrix and construct sqrt(weights)*Identity for curva...
double getPreStencilWeight(SamplingFunctional sro, const int target_index, const int neighbor_index, bool for_target, const int output_component=0, const int input_component=0) const
Returns a stencil to transform data from its existing state into the input expected for some sampling...
KOKKOS_INLINE_FUNCTION void operator()(const AssembleStandardPsqrtW &, const member_type &teamMember) const
Functor to assemble the P*sqrt(weights) matrix and construct sqrt(weights)*Identity.
#define compadre_assert_debug(condition)
compadre_assert_debug is used for assertions that are checked in loops, as these significantly impact...
Kokkos::View< int * >::HostMirror _host_lro_total_offsets
index for where this operation begins the for _alpha coefficients (host)
KOKKOS_INLINE_FUNCTION XYZ getRelativeCoord(const int target_index, const int neighbor_list_num, const int dimension, const scratch_matrix_right_type *V=NULL) const
Returns the relative coordinate as a vector between the target site and the neighbor site...
void setWeightingPower(int wp)
Power for weighting kernel for GMLS problem.
double getAlpha2TensorTo1Tensor(TargetOperation lro, const int target_index, const int output_component, const int neighbor_index, const int input_component_axis_1, const int input_component_axis_2, const int additional_evaluation_site=0) const
Helper function for getting alphas for vector reconstruction from matrix data.
SamplingFunctional getPolynomialSamplingFunctional() const
Get the polynomial sampling functional specified at instantiation.
void setCurvatureWeightingType(const WeightingFunctionType wt)
Type for weighting kernel for curvature.
ConstraintType _constraint_type
constraint type for GMLS problem
int _local_dimensions
dimension of the problem, set at class instantiation only. For manifolds, generally _global_dimension...
Kokkos::View< int * >::HostMirror _host_lro_output_tile_size
dimensions ^ rank of tensor of output for each target functional (host)
KOKKOS_INLINE_FUNCTION int getRHSSquareDim(DenseSolverType dense_solver_type, ConstraintType constraint_type, ReconstructionSpace reconstruction_space, const int dimension, const int M, const int N)
int _order_of_quadrature_points
order of exact polynomial integration for quadrature rule
int getOutputDimensionOfOperation(TargetOperation lro, bool ambient=false) const
Dimensions ^ output rank for target operation.
#define compadre_assert_release(condition)
compadre_assert_release is used for assertions that should always be checked, but generally are not e...
Tag for functor to determine if tangent directions need reordered, and to reorder them if needed...
host_managed_local_index_type getPolynomialCoefficientsMemorySize() const
Returns 2D array size in memory on which coefficients are stored.
Tag for functor to evaluate curvature targets and construct accurate tangent direction approximation ...
WeightingFunctionType getWeightingType() const
Type for weighting kernel for GMLS problem.
constexpr SamplingFunctional VectorPointSample
Point evaluations of the entire vector source function.
double getReferenceNormalDirection(const int target_index, const int component) const
Get component of tangent or normal directions for manifold problems.
KOKKOS_INLINE_FUNCTION int getNNeighbors(const int target_index) const
Returns number of neighbors for a particular target.
void setOrderOfQuadraturePoints(int order)
Number quadrature points to use.
double getTangentBundle(const int target_index, const int direction, const int component) const
Get component of tangent or normal directions for manifold problems.
static DenseSolverType parseSolverType(const std::string &dense_solver_type)
Parses a string to determine solver type.
KOKKOS_INLINE_FUNCTION void applyTargetsToCoefficients(const member_type &teamMember, scratch_vector_type t1, scratch_vector_type t2, scratch_matrix_right_type Q, scratch_vector_type w, scratch_matrix_right_type P_target_row, const int target_NP) const
Helper function for applying the evaluations from a target functional to the polynomial coefficients...
int getTargetOffsetIndexHost(const int lro_num, const int input_component, const int output_component, const int additional_evaluation_local_index=0) const
Handles offset from operation input/output + extra evaluation sites.
int _poly_order
order of basis for polynomial reconstruction
TargetOperation
Available target functionals.
void setSourceExtraData(decltype(_source_extra_data) extra_data)
(OPTIONAL) Sets extra data to be used by sampling functionals in certain instances.
void setTangentBundle(view_type tangent_directions)
(OPTIONAL) Sets orthonormal tangent directions for reconstruction on a manifold.
#define compadre_kernel_assert_debug(condition)
KOKKOS_INLINE_FUNCTION double convertLocalToGlobalCoordinate(const XYZ local_coord, const int dim, const scratch_matrix_right_type *V) const
Returns a component of the global coordinate after transformation from local to global under the orth...
ConstraintType
Constraint type.
static int getSamplingOutputIndex(const SamplingFunctional sf, const int output_component_axis_1, const int output_component_axis_2)
Helper function for finding alpha coefficients.