Compadre  1.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
GMLS_SmallBatchReuse_Device.cpp
Go to the documentation of this file.
1 /*
2  *
3  * This examples tests the ability to reuse a GMLS class instance,
4  * changing the target and neighbor list for the new target.
5  *
6  */
7 
8 #include <iostream>
9 #include <string>
10 #include <vector>
11 #include <map>
12 #include <stdlib.h>
13 #include <cstdio>
14 #include <random>
15 
16 #include <Compadre_Config.h>
17 #include <Compadre_GMLS.hpp>
18 #include <Compadre_Evaluator.hpp>
20 
21 #include "GMLS_Tutorial.hpp"
22 
23 #ifdef COMPADRE_USE_MPI
24 #include <mpi.h>
25 #endif
26 
27 #include <Kokkos_Timer.hpp>
28 #include <Kokkos_Core.hpp>
29 
30 using namespace Compadre;
31 
32 //! [Parse Command Line Arguments]
33 
34 // called from command line
35 int main (int argc, char* args[]) {
36 
37 // initializes MPI (if available) with command line arguments given
38 #ifdef COMPADRE_USE_MPI
39 MPI_Init(&argc, &args);
40 #endif
41 
42 // initializes Kokkos with command line arguments given
43 Kokkos::initialize(argc, args);
44 
45 // becomes false if the computed solution not within the failure_threshold of the actual solution
46 bool all_passed = true;
47 
48 // code block to reduce scope for all Kokkos View allocations
49 // otherwise, Views may be deallocating when we call Kokkos::finalize() later
50 {
51  // check if 7 arguments are given from the command line, the first being the program name
52  // constraint_type used in solving each GMLS problem:
53  // 0 - No constraints used in solving each GMLS problem
54  // 1 - Neumann Gradient Scalar used in solving each GMLS problem
55  int constraint_type = 0; // No constraints by default
56  if (argc >= 7) {
57  int arg7toi = atoi(args[6]);
58  if (arg7toi > 0) {
59  constraint_type = arg7toi;
60  }
61  }
62 
63  // check if 6 arguments are given from the command line, the first being the program name
64  // problem_type used in solving each GMLS problem:
65  // 0 - Standard GMLS problem
66  // 1 - Manifold GMLS problem
67  int problem_type = 0; // Standard by default
68  if (argc >= 6) {
69  int arg6toi = atoi(args[5]);
70  if (arg6toi > 0) {
71  problem_type = arg6toi;
72  }
73  }
74 
75  // check if 5 arguments are given from the command line, the first being the program name
76  // solver_type used for factorization in solving each GMLS problem:
77  // 0 - SVD used for factorization in solving each GMLS problem
78  // 1 - QR used for factorization in solving each GMLS problem
79  // 2 - LU used for factorization in solving each GMLS problem
80  int solver_type = 1; // QR by default
81  if (argc >= 5) {
82  int arg5toi = atoi(args[4]);
83  if (arg5toi >= 0) {
84  solver_type = arg5toi;
85  }
86  }
87 
88  // check if 4 arguments are given from the command line
89  // dimension for the coordinates and the solution
90  int dimension = 3; // dimension 3 by default
91  if (argc >= 4) {
92  int arg4toi = atoi(args[3]);
93  if (arg4toi > 0) {
94  dimension = arg4toi;
95  }
96  }
97 
98  // check if 3 arguments are given from the command line
99  // set the number of target sites where we will reconstruct the target functionals at
100  int number_target_coords = 200; // 200 target sites by default
101  if (argc >= 3) {
102  int arg3toi = atoi(args[2]);
103  if (arg3toi > 0) {
104  number_target_coords = arg3toi;
105  }
106  }
107 
108  // check if 2 arguments are given from the command line
109  // set the number of target sites where we will reconstruct the target functionals at
110  int order = 3; // 3rd degree polynomial basis by default
111  if (argc >= 2) {
112  int arg2toi = atoi(args[1]);
113  if (arg2toi > 0) {
114  order = arg2toi;
115  }
116  }
117 
118  // the functions we will be seeking to reconstruct are in the span of the basis
119  // of the reconstruction space we choose for GMLS, so the error should be very small
120  const double failure_tolerance = 1e-9;
121 
122  // Laplacian is a second order differential operator, which we expect to be slightly less accurate
123  const double laplacian_failure_tolerance = 1e-9;
124 
125  // minimum neighbors for unisolvency is the same as the size of the polynomial basis
126  const int min_neighbors = Compadre::GMLS::getNP(order, dimension);
127 
128  //! [Parse Command Line Arguments]
129  Kokkos::Timer timer;
130  //! [Setting Up The Point Cloud]
131 
132  // approximate spacing of source sites
133  double h_spacing = 0.05;
134  int n_neg1_to_1 = 2*(1/h_spacing) + 1; // always odd
135 
136  // number of source coordinate sites that will fill a box of [-1,1]x[-1,1]x[-1,1] with a spacing approximately h
137  const int number_source_coords = std::pow(n_neg1_to_1, dimension);
138 
139  // coordinates of source sites
140  Kokkos::View<double**, Kokkos::DefaultExecutionSpace> source_coords_device("source coordinates",
141  number_source_coords, 3);
142  Kokkos::View<double**>::HostMirror source_coords = Kokkos::create_mirror_view(source_coords_device);
143 
144  // coordinates of target sites
145  Kokkos::View<double**, Kokkos::DefaultExecutionSpace> target_coords_device ("target coordinates", number_target_coords, 3);
146  Kokkos::View<double**>::HostMirror target_coords = Kokkos::create_mirror_view(target_coords_device);
147 
148 
149  // fill source coordinates with a uniform grid
150  int source_index = 0;
151  double this_coord[3] = {0,0,0};
152  for (int i=-n_neg1_to_1/2; i<n_neg1_to_1/2+1; ++i) {
153  this_coord[0] = i*h_spacing;
154  for (int j=-n_neg1_to_1/2; j<n_neg1_to_1/2+1; ++j) {
155  this_coord[1] = j*h_spacing;
156  for (int k=-n_neg1_to_1/2; k<n_neg1_to_1/2+1; ++k) {
157  this_coord[2] = k*h_spacing;
158  if (dimension==3) {
159  source_coords(source_index,0) = this_coord[0];
160  source_coords(source_index,1) = this_coord[1];
161  source_coords(source_index,2) = this_coord[2];
162  source_index++;
163  }
164  }
165  if (dimension==2) {
166  source_coords(source_index,0) = this_coord[0];
167  source_coords(source_index,1) = this_coord[1];
168  source_coords(source_index,2) = 0;
169  source_index++;
170  }
171  }
172  if (dimension==1) {
173  source_coords(source_index,0) = this_coord[0];
174  source_coords(source_index,1) = 0;
175  source_coords(source_index,2) = 0;
176  source_index++;
177  }
178  }
179 
180  // fill target coords somewhere inside of [-0.5,0.5]x[-0.5,0.5]x[-0.5,0.5]
181  for(int i=0; i<number_target_coords; i++){
182 
183  // first, we get a uniformly random distributed direction
184  double rand_dir[3] = {0,0,0};
185 
186  for (int j=0; j<dimension; ++j) {
187  // rand_dir[j] is in [-0.5, 0.5]
188  rand_dir[j] = ((double)rand() / (double) RAND_MAX) - 0.5;
189  }
190 
191  // then we get a uniformly random radius
192  for (int j=0; j<dimension; ++j) {
193  target_coords(i,j) = rand_dir[j];
194  }
195 
196  }
197 
198 
199  //! [Setting Up The Point Cloud]
200 
201 
202  //! [Creating The Data]
203 
204 
205  // source coordinates need copied to device before using to construct sampling data
206  Kokkos::deep_copy(source_coords_device, source_coords);
207 
208  // target coordinates copied next, because it is a convenient time to send them to device
209  Kokkos::deep_copy(target_coords_device, target_coords);
210 
211  // need Kokkos View storing true solution
212  Kokkos::View<double*, Kokkos::DefaultExecutionSpace> sampling_data_device("samples of true solution",
213  source_coords_device.extent(0));
214 
215  Kokkos::View<double**, Kokkos::DefaultExecutionSpace> gradient_sampling_data_device("samples of true gradient",
216  source_coords_device.extent(0), dimension);
217 
218  Kokkos::View<double**, Kokkos::DefaultExecutionSpace> divergence_sampling_data_device
219  ("samples of true solution for divergence test", source_coords_device.extent(0), dimension);
220 
221  Kokkos::parallel_for("Sampling Manufactured Solutions", Kokkos::RangePolicy<Kokkos::DefaultExecutionSpace>
222  (0,source_coords.extent(0)), KOKKOS_LAMBDA(const int i) {
223 
224  // coordinates of source site i
225  double xval = source_coords_device(i,0);
226  double yval = (dimension>1) ? source_coords_device(i,1) : 0;
227  double zval = (dimension>2) ? source_coords_device(i,2) : 0;
228 
229  // data for targets with scalar input
230  sampling_data_device(i) = trueSolution(xval, yval, zval, order, dimension);
231 
232  // data for targets with vector input (divergence)
233  double true_grad[3] = {0,0,0};
234  trueGradient(true_grad, xval, yval,zval, order, dimension);
235 
236  for (int j=0; j<dimension; ++j) {
237  gradient_sampling_data_device(i,j) = true_grad[j];
238 
239  // data for target with vector input (curl)
240  divergence_sampling_data_device(i,j) = divergenceTestSamples(xval, yval, zval, j, dimension);
241  }
242 
243  });
244 
245 
246  //! [Creating The Data]
247 
248 
249  //! [Setting Up The GMLS Object]
250 
251  // solver name for passing into the GMLS class
252  std::string solver_name;
253  if (solver_type == 0) { // SVD
254  solver_name = "SVD";
255  } else if (solver_type == 1) { // QR
256  solver_name = "QR";
257  } else if (solver_type == 2) { // LU
258  solver_name = "LU";
259  }
260 
261  // problem name for passing into the GMLS class
262  std::string problem_name;
263  if (problem_type == 0) { // Standard
264  problem_name = "STANDARD";
265  } else if (problem_type == 1) { // Manifold
266  problem_name = "MANIFOLD";
267  }
268 
269  // boundary name for passing into the GMLS class
270  std::string constraint_name;
271  if (constraint_type == 0) { // No constraints
272  constraint_name = "NO_CONSTRAINT";
273  } else if (constraint_type == 1) { // Neumann Gradient Scalar
274  constraint_name = "NEUMANN_GRAD_SCALAR";
275  }
276 
277  // initialize an instance of the GMLS class
279  order, dimension,
280  solver_name.c_str(), problem_name.c_str(), constraint_name.c_str(),
281  2 /*manifold order*/);
282 
283  // create a vector of target operations
284  std::vector<TargetOperation> lro(5);
285  lro[0] = ScalarPointEvaluation;
290 
291  // and then pass them to the GMLS class
292  my_GMLS.addTargets(lro);
293 
294  // sets the weighting kernel function from WeightingFunctionType
295  my_GMLS.setWeightingType(WeightingFunctionType::Power);
296 
297  // power to use in that weighting kernel function
298  my_GMLS.setWeightingPower(2);
299 
300  // set source sites once for all targets
301  my_GMLS.setSourceSites(source_coords_device);
302 
303 
304  // Point cloud construction for neighbor search
305  // CreatePointCloudSearch constructs an object of type PointCloudSearch, but deduces the templates for you
306  auto point_cloud_search(CreatePointCloudSearch(source_coords, dimension));
307 
308  // loop through the target sites
309  for (int i=0; i<number_target_coords; i++) {
310  timer.reset();
311  // pass in neighbor lists, source coordinates, target coordinates, and window sizes
312  //
313  // single neighbor lists have the format:
314  // dimensions: (1 single neighbor list for one target) X (# maximum number of neighbors for any given target + 1)
315  // the first column contains the number of neighbors for that rows corresponding target index
316  //
317  // source coordinates have the format:
318  // dimensions: (# number of source sites) X (dimension)
319  // entries in the neighbor lists (integers) correspond to rows of this 2D array
320  //
321  // single target coordinates have the format:
322  // dimensions: (1 single target site) X (dimension)
323  // # of target sites is same as # of rows of neighbor lists
324  //
325 
326 
327  // coordinates of single target sites
328  Kokkos::View<double**, Kokkos::DefaultExecutionSpace> single_target_coords_device ("single target coordinates", 1, 3);
329  Kokkos::View<double**>::HostMirror single_target_coords = Kokkos::create_mirror_view(single_target_coords_device);
330  for (int j=0; j<3; ++j) {
331  single_target_coords(0,j) = target_coords(i,j);
332  }
333  // target coordinates copied next, because it is a convenient time to send them to device
334  Kokkos::deep_copy(single_target_coords_device, single_target_coords);
335  Kokkos::fence();
336 
337  //! [Performing Neighbor Search]
338 
339  // each row is a neighbor list for a target site, with the first column of each row containing
340  // the number of neighbors for that rows corresponding target site
341  double epsilon_multiplier = 1.5;
342  int estimated_upper_bound_number_neighbors =
343  point_cloud_search.getEstimatedNumberNeighborsUpperBound(min_neighbors, dimension, epsilon_multiplier);
344 
345  Kokkos::View<int**, Kokkos::DefaultExecutionSpace> single_neighbor_lists_device("neighbor lists",
346  1, estimated_upper_bound_number_neighbors); // first column is # of neighbors
347  Kokkos::View<int**>::HostMirror single_neighbor_lists = Kokkos::create_mirror_view(single_neighbor_lists_device);
348 
349  // each target site has a window size
350  Kokkos::View<double*, Kokkos::DefaultExecutionSpace> single_epsilon_device("h supports", 1);
351  Kokkos::View<double*>::HostMirror single_epsilon = Kokkos::create_mirror_view(single_epsilon_device);
352 
353  // query the point cloud to generate the neighbor lists using a kdtree to produce the n nearest neighbor
354  // to each target site, adding (epsilon_multiplier-1)*100% to whatever the distance away the further neighbor used is from
355  // each target to the view for epsilon
356  point_cloud_search.generate2DNeighborListsFromKNNSearch(false /*not dry run*/, single_target_coords,
357  single_neighbor_lists, single_epsilon, min_neighbors, epsilon_multiplier);
358 
359  //! [Performing Neighbor Search]
360 
361 
362  // Copy data back to device (they were filled on the host)
363  // We could have filled Kokkos Views with memory space on the host
364  // and used these instead, and then the copying of data to the device
365  // would be performed in the GMLS class
366  Kokkos::deep_copy(single_neighbor_lists_device, single_neighbor_lists);
367  Kokkos::deep_copy(single_epsilon_device, single_epsilon);
368  Kokkos::fence(); // let call to build neighbor lists complete before copying back to device
369 
370  // Create temporary small views to hold just one target's information at a time
371  my_GMLS.setNeighborLists(single_neighbor_lists_device);
372  my_GMLS.setTargetSites(single_target_coords_device);
373  my_GMLS.setWindowSizes(single_epsilon_device);
374 
375 
376  // generate the alphas that to be combined with data for each target operation requested in lro
377  my_GMLS.generateAlphas(1, true /* keep polynomial coefficients, only needed for a test later in this program */);
378 
379 
380  //! [Setting Up The GMLS Object]
381 
382  double instantiation_time = timer.seconds();
383  std::cout << "Took " << instantiation_time << "s to complete alphas generation." << std::endl;
384  Kokkos::fence(); // let generateAlphas finish up before using alphas
385 
386 
387  //! [Apply GMLS Alphas To Data]
388 
389  // it is important to note that if you expect to use the data as a 1D view, then you should use double*
390  // however, if you know that the target operation will result in a 2D view (vector or matrix output),
391  // then you should template with double** as this is something that can not be infered from the input data
392  // or the target operator at compile time. Additionally, a template argument is required indicating either
393  // Kokkos::HostSpace or Kokkos::DefaultExecutionSpace::memory_space()
394 
395  // The Evaluator class takes care of handling input data views as well as the output data views.
396  // It uses information from the GMLS class to determine how many components are in the input
397  // as well as output for any choice of target functionals and then performs the contactions
398  // on the data using the alpha coefficients generated by the GMLS class, all on the device.
399  Evaluator gmls_evaluator(&my_GMLS);
400 
401  auto output_value = gmls_evaluator.applyAlphasToDataAllComponentsAllTargetSites<double*, Kokkos::HostSpace>
402  (sampling_data_device, ScalarPointEvaluation);
403 
404  auto output_laplacian = gmls_evaluator.applyAlphasToDataAllComponentsAllTargetSites<double*, Kokkos::HostSpace>
405  (sampling_data_device, LaplacianOfScalarPointEvaluation);
406 
407  auto output_gradient = gmls_evaluator.applyAlphasToDataAllComponentsAllTargetSites<double**, Kokkos::HostSpace>
408  (sampling_data_device, GradientOfScalarPointEvaluation);
409 
410  auto output_divergence = gmls_evaluator.applyAlphasToDataAllComponentsAllTargetSites<double*, Kokkos::HostSpace>
411  (gradient_sampling_data_device, DivergenceOfVectorPointEvaluation, VectorPointSample);
412 
413  auto output_curl = gmls_evaluator.applyAlphasToDataAllComponentsAllTargetSites<double**, Kokkos::HostSpace>
414  (divergence_sampling_data_device, CurlOfVectorPointEvaluation);
415 
416  // retrieves polynomial coefficients instead of remapped field
417  auto scalar_coefficients = gmls_evaluator.applyFullPolynomialCoefficientsBasisToDataAllComponents<double**, Kokkos::HostSpace>
418  (sampling_data_device);
419 
420  //! [Apply GMLS Alphas To Data]
421 
422  Kokkos::fence(); // let application of alphas to data finish before using results
423  // times the Comparison in Kokkos
424 
425  //! [Check That Solutions Are Correct]
426 
427  // load value from output
428  double GMLS_value = output_value(0);
429 
430  // load laplacian from output
431  double GMLS_Laplacian = output_laplacian(0);
432 
433  // load partial x from gradient
434  // this is a test that the scalar_coefficients 2d array returned hold valid entries
435  // scalar_coefficients(i,1)*1./epsilon(i) is equivalent to the target operation acting
436  // on the polynomials applied to the polynomial coefficients
437  double GMLS_GradX = scalar_coefficients(0,1)*1./single_epsilon(0);
438  //output_gradient(i,0);
439 
440  // load partial y from gradient
441  double GMLS_GradY = (dimension>1) ? output_gradient(0,1) : 0;
442 
443  // load partial z from gradient
444  double GMLS_GradZ = (dimension>2) ? output_gradient(0,2) : 0;
445 
446  // load divergence from output
447  double GMLS_Divergence = output_divergence(0);
448 
449  // load curl from output
450  double GMLS_CurlX = (dimension>1) ? output_curl(0,0) : 0;
451  double GMLS_CurlY = (dimension>1) ? output_curl(0,1) : 0;
452  double GMLS_CurlZ = (dimension>2) ? output_curl(0,2) : 0;
453 
454 
455  // target site i's coordinate
456  double xval = target_coords(i,0);
457  double yval = (dimension>1) ? target_coords(i,1) : 0;
458  double zval = (dimension>2) ? target_coords(i,2) : 0;
459 
460  // evaluation of various exact solutions
461  double actual_value = trueSolution(xval, yval, zval, order, dimension);
462  double actual_Laplacian = trueLaplacian(xval, yval, zval, order, dimension);
463 
464  double actual_Gradient[3] = {0,0,0}; // initialized for 3, but only filled up to dimension
465  trueGradient(actual_Gradient, xval, yval, zval, order, dimension);
466 
467  double actual_Divergence;
468  actual_Divergence = trueLaplacian(xval, yval, zval, order, dimension);
469 
470  double actual_Curl[3] = {0,0,0}; // initialized for 3, but only filled up to dimension
471  // (and not at all for dimimension = 1)
472  if (dimension>1) {
473  actual_Curl[0] = curlTestSolution(xval, yval, zval, 0, dimension);
474  actual_Curl[1] = curlTestSolution(xval, yval, zval, 1, dimension);
475  if (dimension>2) {
476  actual_Curl[2] = curlTestSolution(xval, yval, zval, 2, dimension);
477  }
478  }
479 
480  // check actual function value
481  if(GMLS_value!=GMLS_value || std::abs(actual_value - GMLS_value) > failure_tolerance) {
482  all_passed = false;
483  std::cout << i << " Failed Actual by: " << std::abs(actual_value - GMLS_value) << std::endl;
484  }
485 
486  // check Laplacian
487  if(std::abs(actual_Laplacian - GMLS_Laplacian) > laplacian_failure_tolerance) {
488  all_passed = false;
489  std::cout << i <<" Failed Laplacian by: " << std::abs(actual_Laplacian - GMLS_Laplacian) << std::endl;
490  }
491 
492  // check gradient
493  if(std::abs(actual_Gradient[0] - GMLS_GradX) > failure_tolerance) {
494  all_passed = false;
495  std::cout << i << " Failed GradX by: " << std::abs(actual_Gradient[0] - GMLS_GradX) << std::endl;
496  if (dimension>1) {
497  if(std::abs(actual_Gradient[1] - GMLS_GradY) > failure_tolerance) {
498  all_passed = false;
499  std::cout << i << " Failed GradY by: " << std::abs(actual_Gradient[1] - GMLS_GradY) << std::endl;
500  }
501  }
502  if (dimension>2) {
503  if(std::abs(actual_Gradient[2] - GMLS_GradZ) > failure_tolerance) {
504  all_passed = false;
505  std::cout << i << " Failed GradZ by: " << std::abs(actual_Gradient[2] - GMLS_GradZ) << std::endl;
506  }
507  }
508  }
509 
510  // check divergence
511  if(std::abs(actual_Divergence - GMLS_Divergence) > failure_tolerance) {
512  all_passed = false;
513  std::cout << i << " Failed Divergence by: " << std::abs(actual_Divergence - GMLS_Divergence) << std::endl;
514  }
515 
516  // check curl
517  if (order > 2) { // reconstructed solution not in basis unless order greater than 2 used
518  double tmp_diff = 0;
519  if (dimension>1)
520  tmp_diff += std::abs(actual_Curl[0] - GMLS_CurlX) + std::abs(actual_Curl[1] - GMLS_CurlY);
521  if (dimension>2)
522  tmp_diff += std::abs(actual_Curl[2] - GMLS_CurlZ);
523  if(std::abs(tmp_diff) > failure_tolerance) {
524  all_passed = false;
525  std::cout << i << " Failed Curl by: " << std::abs(tmp_diff) << std::endl;
526  }
527  }
528  }
529 
530 
531  //! [Check That Solutions Are Correct]
532  // stop timing comparison loop
533  //! [Finalize Program]
534 
535 
536 } // end of code block to reduce scope, causing Kokkos View de-allocations
537 // otherwise, Views may be deallocating when we call Kokkos::finalize() later
538 
539 // finalize Kokkos and MPI (if available)
540 Kokkos::finalize();
541 #ifdef COMPADRE_USE_MPI
542 MPI_Finalize();
543 #endif
544 
545 // output to user that test passed or failed
546 if(all_passed) {
547  fprintf(stdout, "Passed test \n");
548  return 0;
549 } else {
550  fprintf(stdout, "Failed test \n");
551  return -1;
552 }
553 
554 } // main
555 
556 
557 //! [Finalize Program]
Point evaluation of the curl of a vector (results in a vector)
Lightweight Evaluator Helper This class is a lightweight wrapper for extracting and applying all rele...
PointCloudSearch< view_type > CreatePointCloudSearch(view_type src_view, const local_index_type dimensions=-1, const local_index_type max_leaf=-1)
CreatePointCloudSearch allows for the construction of an object of type PointCloudSearch with templat...
Kokkos::View< output_data_type, output_array_layout, output_memory_space > applyFullPolynomialCoefficientsBasisToDataAllComponents(view_type_input_data sampling_data, bool scalar_as_vector_if_needed=true) const
Generation of polynomial reconstruction coefficients by applying to data in GMLS. ...
int main(int argc, char *args[])
[Parse Command Line Arguments]
Definition: GMLS_Device.cpp:29
Point evaluation of a scalar.
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 void trueGradient(double *ans, double x, double y, double z, int order, int dimension)
Scalar basis reused as many times as there are components in the vector resulting in a much cheaper p...
Point evaluation of the laplacian of a scalar (could be on a manifold or not)
Point evaluation of the divergence of a vector (results in a scalar)
Point evaluation of the gradient of a scalar.
KOKKOS_INLINE_FUNCTION double trueLaplacian(double x, double y, double z, int order, int dimension)
Generalized Moving Least Squares (GMLS)
KOKKOS_INLINE_FUNCTION double curlTestSolution(double x, double y, double z, int component, int dimension)
KOKKOS_INLINE_FUNCTION double divergenceTestSamples(double x, double y, double z, int component, int dimension)
Kokkos::View< output_data_type, output_array_layout, output_memory_space > applyAlphasToDataAllComponentsAllTargetSites(view_type_input_data sampling_data, TargetOperation lro, const SamplingFunctional sro_in=PointSample, bool scalar_as_vector_if_needed=true, const int evaluation_site_local_index=0) const
Transformation of data under GMLS.
KOKKOS_INLINE_FUNCTION double trueSolution(double x, double y, double z, int order, int dimension)
constexpr SamplingFunctional VectorPointSample
Point evaluations of the entire vector source function.