Compadre  1.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
GMLS_Host.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <string>
3 #include <vector>
4 #include <map>
5 #include <stdlib.h>
6 #include <cstdio>
7 #include <random>
8 
9 #include <Compadre_Config.h>
10 #include <Compadre_GMLS.hpp>
11 #include <Compadre_Evaluator.hpp>
12 #include "GMLS_Tutorial.hpp"
13 
14 #ifdef COMPADRE_USE_MPI
15 #include <mpi.h>
16 #endif
17 
18 #include <Kokkos_Timer.hpp>
19 #include <Kokkos_Core.hpp>
20 
21 using namespace Compadre;
22 
23 int main (int argc, char* args[])
24 {
25 
26 #ifdef COMPADRE_USE_MPI
27  MPI_Init(&argc, &args);
28 #endif
29 
30 bool all_passed = true;
31 
32 {
33  // check if 7 arguments are given from the command line, the first being the program name
34  // constraint_type used in solving each GMLS problem:
35  // 0 - No constraints used in solving each GMLS problem
36  // 1 - Neumann Gradient Scalar used in solving each GMLS problem
37  int constraint_type = 0; // No constraints by default
38  if (argc >= 7) {
39  int arg7toi = atoi(args[6]);
40  if (arg7toi > 0) {
41  constraint_type = arg7toi;
42  }
43  }
44 
45  // check if 6 arguments are given from the command line, the first being the program name
46  // problem_type used in solving each GMLS problem:
47  // 0 - Standard GMLS problem
48  // 1 - Manifold GMLS problem
49  int problem_type = 0; // Standard by default
50  if (argc >= 6) {
51  int arg6toi = atoi(args[5]);
52  if (arg6toi > 0) {
53  problem_type = arg6toi;
54  }
55  }
56 
57  // check if 5 arguments are given from the command line, the first being the program name
58  // solver_type used for factorization in solving each GMLS problem:
59  // 0 - SVD used for factorization in solving each GMLS problem
60  // 1 - QR used for factorization in solving each GMLS problem
61  // 2 - LU used for factorization in solving each GMLS problem
62  int solver_type = 1; // QR by default
63  if (argc >= 5) {
64  int arg5toi = atoi(args[4]);
65  if (arg5toi >= 0) {
66  solver_type = arg5toi;
67  }
68  }
69 
70  int dimension = 3;
71  if (argc >= 4) {
72  int arg4toi = atoi(args[3]);
73  if (arg4toi > 0) {
74  dimension = arg4toi;
75  }
76  }
77 
78  const double failure_tolerance = 1e-9;
79 
80  const int order = atoi(args[1]); // 9
81 
82  const int offset = 15;
83  std::mt19937 rng(50);
84  const int min_neighbors = 1*Compadre::GMLS::getNP(order);
85  const int max_neighbors = 1*Compadre::GMLS::getNP(order)*1.15;
86  std::cout << min_neighbors << " " << max_neighbors << std::endl;
87  std::uniform_int_distribution<int> gen_num_neighbors(min_neighbors, max_neighbors); // uniform, unbiased
88 
89 
90  Kokkos::initialize(argc, args);
91  Kokkos::Timer timer;
92  Kokkos::Profiling::pushRegion("Setup");
93 
94 
95  const int number_target_coords = atoi(args[2]); // 200
96  const int N = 40000;
97  std::uniform_int_distribution<int> gen_neighbor_number(offset, N); // 0 to 10 are junk (part of test)
98 
99 
100  Kokkos::View<int**, Kokkos::HostSpace> neighbor_lists("neighbor lists", number_target_coords, max_neighbors+1); // first column is # of neighbors
101  Kokkos::View<double**, Kokkos::HostSpace> source_coords("neighbor coordinates", N, dimension);
102  Kokkos::View<double*, Kokkos::HostSpace> epsilon("h supports", number_target_coords);
103 
104  for (int i=0; i<number_target_coords; i++) {
105  epsilon(i) = 0.5;
106  }
107 
108 // // fake coordinates not to be used
109  for(int i = 0; i < offset; i++){
110  for(int j = 0; j < dimension; j++){
111  source_coords(i,j) = 0.1;
112  }
113  }
114 
115  // filling others with random coordinates
116  for(int i = offset; i < N; i++){ //ignore first ten entries
117  double randx = (2.0*(double)rand() / (double) RAND_MAX - 1.0)*epsilon(0)/2.0;
118  double randy = (2.0*(double)rand() / (double) RAND_MAX - 1.0)*epsilon(0)/2.0;
119  double randz = (2.0*(double)rand() / (double) RAND_MAX - 1.0)*epsilon(0)/2.0;
120  source_coords(i,0) = randx;
121  if (dimension>1) source_coords(i,1) = randy;
122  if (dimension>2) source_coords(i,2) = randz;
123  }
124 
125  const double target_epsilon = 0.1;
126  // fill target coords
127  Kokkos::View<double**, Kokkos::HostSpace> target_coords ("target coordinates", number_target_coords, dimension);
128  for(int i = 0; i < number_target_coords; i++){ //ignore first ten entries
129  double randx = (2.0*(double)rand() / (double) RAND_MAX - 1.0)*target_epsilon/2.0;
130  double randy = (2.0*(double)rand() / (double) RAND_MAX - 1.0)*target_epsilon/2.0;
131  double randz = (2.0*(double)rand() / (double) RAND_MAX - 1.0)*target_epsilon/2.0;
132  target_coords(i,0) = randx;
133  if (dimension>1) target_coords(i,1) = randy;
134  if (dimension>2) target_coords(i,2) = randz;
135  }
136 
137  // randomly fill neighbor lists
138  for (int i=0; i<number_target_coords; i++) {
139 // int r = gen_num_neighbors(rng);
140 // assert(r<source_coords.extent(0)-offset);
141  int r = max_neighbors;
142  neighbor_lists(i,0) = r; // number of neighbors is random between max and min
143 
144  for(int j=0; j<r; j++){
145  neighbor_lists(i,j+1) = offset + j + 1;
146 // bool placed = false;
147 // while (!placed) {
148 // int ind = gen_neighbor_number(rng);
149 // bool located = false;
150 // for (int k=1; k<j+1; k++) {
151 // if (neighbor_lists(i,k) == ind) {
152 // located = true;
153 // break;
154 // }
155 // }
156 // if (!located) {
157 // neighbor_lists(i,j+1) = ind;
158 // placed = true;
159 // } // neighbors can be from 10,...,N-1
160 // }
161  }
162  }
163 
164  Kokkos::Profiling::popRegion();
165  timer.reset();
166 
167  // solver name for passing into the GMLS class
168  std::string solver_name;
169  if (solver_type == 0) { // SVD
170  solver_name = "SVD";
171  } else if (solver_type == 1) { // QR
172  solver_name = "QR";
173  } else if (solver_type == 2) { // LU
174  solver_name = "LU";
175  }
176 
177  // problem name for passing into the GMLS class
178  std::string problem_name;
179  if (problem_type == 0) { // Standard
180  problem_name = "STANDARD";
181  } else if (problem_type == 1) { // Manifold
182  problem_name = "MANIFOLD";
183  }
184 
185  // boundary name for passing into the GMLS class
186  std::string constraint_name;
187  if (constraint_type == 0) { // No constraints
188  constraint_name = "NO_CONSTRAINT";
189  } else if (constraint_type == 1) { // Neumann Gradient Scalar
190  constraint_name = "NEUMANN_GRAD_SCALAR";
191  }
192 
193  GMLS my_GMLS(order, dimension,
194  solver_name.c_str(), problem_name.c_str(), constraint_name.c_str(),
195  2 /*manifold order*/);
196  my_GMLS.setProblemData(neighbor_lists, source_coords, target_coords, epsilon);
197  my_GMLS.setWeightingPower(10);
198 
199  std::vector<TargetOperation> lro(5);
200  lro[0] = ScalarPointEvaluation;
205  my_GMLS.addTargets(lro);
206  my_GMLS.generateAlphas();
207 
208  double instantiation_time = timer.seconds();
209  std::cout << "Took " << instantiation_time << "s to complete instantiation." << std::endl;
210 
211  Kokkos::Profiling::pushRegion("Creating Data");
212 
213 
214  // need Kokkos View storing true solution
215  Kokkos::View<double*, Kokkos::HostSpace> sampling_data("samples of true solution", source_coords.extent(0));
216  Kokkos::View<double**, Kokkos::HostSpace> gradient_sampling_data("samples of true gradient", source_coords.extent(0), dimension);
217  Kokkos::View<double**, Kokkos::LayoutLeft, Kokkos::HostSpace> divergence_sampling_data("samples of true solution for divergence test", source_coords.extent(0), dimension);
218  Kokkos::parallel_for("Sampling Manufactured Solutions", Kokkos::RangePolicy<Kokkos::DefaultHostExecutionSpace>(0,source_coords.extent(0)), KOKKOS_LAMBDA(const int i) {
219  double xval = source_coords(i,0);
220  double yval = (dimension>1) ? source_coords(i,1) : 0;
221  double zval = (dimension>2) ? source_coords(i,2) : 0;
222  sampling_data(i) = trueSolution(xval, yval, zval, order, dimension);
223  double true_grad[3] = {0,0,0};
224  trueGradient(true_grad, xval, yval,zval, order, dimension);
225  for (int j=0; j<dimension; ++j) {
226  divergence_sampling_data(i,j) = divergenceTestSamples(xval, yval, zval, j, dimension);
227  gradient_sampling_data(i,j) = true_grad[j];
228  }
229  });
230  Kokkos::Profiling::popRegion();
231 
232  Evaluator gmls_evaluator(&my_GMLS);
233 
234  for (int i=0; i<number_target_coords; i++) {
235 
236  Kokkos::Profiling::pushRegion("Apply Alphas to Data");
237 
238  double GMLS_value = gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(sampling_data, 0, ScalarPointEvaluation, i, 0, 0, 0, 0, 0);
239  //for (int j = 0; j< neighbor_lists(i,0); j++){
240  // double xval = source_coords(neighbor_lists(i,j+1),0);
241  // double yval = (dimension>1) ? source_coords(neighbor_lists(i,j+1),1) : 0;
242  // double zval = (dimension>2) ? source_coords(neighbor_lists(i,j+1),2) : 0;
243  // GMLS_value += gmls_evaluator.getAlpha0TensorTo0Tensor(ScalarPointEvaluation, i, j)*trueSolution(xval, yval, zval, order, dimension);
244  //}
245 
246  double GMLS_Laplacian = gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(sampling_data, 0, LaplacianOfScalarPointEvaluation, i, 0, 0, 0, 0, 0);
247  //double GMLS_Laplacian = 0.0;
248  //for (int j = 0; j< neighbor_lists(i,0); j++){
249  // double xval = source_coords(neighbor_lists(i,j+1),0);
250  // double yval = (dimension>1) ? source_coords(neighbor_lists(i,j+1),1) : 0;
251  // double zval = (dimension>2) ? source_coords(neighbor_lists(i,j+1),2) : 0;
252  // GMLS_Laplacian += gmls_evaluator.getAlpha0TensorTo0Tensor(LaplacianOfScalarPointEvaluation, i, j)*trueSolution(xval, yval, zval, order, dimension);
253  //}
254 
255  double GMLS_GradX = gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(sampling_data, 0, GradientOfScalarPointEvaluation, i, 0, 0, 0, 0, 0);
256  //double GMLS_GradX = 0.0;
257  //for (int j = 0; j< neighbor_lists(i,0); j++){
258  // double xval = source_coords(neighbor_lists(i,j+1),0);
259  // double yval = (dimension>1) ? source_coords(neighbor_lists(i,j+1),1) : 0;
260  // double zval = (dimension>2) ? source_coords(neighbor_lists(i,j+1),2) : 0;
261  // GMLS_GradX += gmls_evaluator.getAlpha0TensorTo1Tensor(GradientOfScalarPointEvaluation, i, 0, j)*trueSolution(xval, yval, zval, order, dimension);
262  //}
263 
264  double GMLS_GradY = (dimension>1) ? gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(sampling_data, 0, GradientOfScalarPointEvaluation, i, 0, 1, 0, 0, 0) : 0;
265  //double GMLS_GradY = 0.0;
266  //if (dimension>1) {
267  // for (int j = 0; j< neighbor_lists(i,0); j++){
268  // double xval = source_coords(neighbor_lists(i,j+1),0);
269  // double yval = source_coords(neighbor_lists(i,j+1),1);
270  // double zval = (dimension>2) ? source_coords(neighbor_lists(i,j+1),2) : 0;
271  // GMLS_GradY += gmls_evaluator.getAlpha0TensorTo1Tensor(GradientOfScalarPointEvaluation, i, 1, j)*trueSolution(xval, yval, zval, order, dimension);
272  // }
273  //}
274 
275  double GMLS_GradZ = (dimension>2) ? gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(sampling_data, 0, GradientOfScalarPointEvaluation, i, 0, 2, 0, 0, 0) : 0;
276  //double GMLS_GradZ = 0.0;
277  //if (dimension>2) {
278  // for (int j = 0; j< neighbor_lists(i,0); j++){
279  // double xval = source_coords(neighbor_lists(i,j+1),0);
280  // double yval = source_coords(neighbor_lists(i,j+1),1);
281  // double zval = source_coords(neighbor_lists(i,j+1),2);
282  // GMLS_GradZ += gmls_evaluator.getAlpha0TensorTo1Tensor(GradientOfScalarPointEvaluation, i, 2, j)*trueSolution(xval, yval, zval, order, dimension);
283  // }
284  //}
285 
286  double GMLS_Divergence = gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(gradient_sampling_data, 0, DivergenceOfVectorPointEvaluation, i, 0, 0, 0, 0, 0);
287  if (dimension>1) GMLS_Divergence += gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(gradient_sampling_data, 1, DivergenceOfVectorPointEvaluation, i, 0, 0, 0, 1, 0);
288  if (dimension>2) GMLS_Divergence += gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(gradient_sampling_data, 2, DivergenceOfVectorPointEvaluation, i, 0, 0, 0, 2, 0);
289 
290  //double GMLS_Divergence = gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(Kokkos::subview(gradient_sampling_data,Kokkos::ALL,0), 0, DivergenceOfVectorPointEvaluation, i, 0, 0, 0, 0);
291  //if (dimension>1) GMLS_Divergence += gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(Kokkos::subview(gradient_sampling_data,Kokkos::ALL,1), 1, DivergenceOfVectorPointEvaluation, i, 0, 0, 1, 0);
292  //if (dimension>2) GMLS_Divergence += gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(Kokkos::subview(gradient_sampling_data,Kokkos::ALL,2), 2, DivergenceOfVectorPointEvaluation, i, 0, 0, 2, 0);
293  //double GMLS_Divergence = 0.0;
294  //for (int j = 0; j< neighbor_lists(i,0); j++){
295  // double xval = source_coords(neighbor_lists(i,j+1),0);
296  // double yval = (dimension>1) ? source_coords(neighbor_lists(i,j+1),1) : 0;
297  // double zval = (dimension>2) ? source_coords(neighbor_lists(i,j+1),2) : 0;
298  // // TODO: use different functions for the vector components
299  // if (use_arbitrary_order_divergence) {
300  // GMLS_Divergence += gmls_evaluator.getAlpha1TensorTo0Tensor(DivergenceOfVectorPointEvaluation, i, j, 0)*trueSolution(xval, yval, zval, order, dimension);
301  // if (dimension>1) GMLS_Divergence += gmls_evaluator.getAlpha1TensorTo0Tensor(DivergenceOfVectorPointEvaluation, i, j, 1)*trueSolution(xval, yval, zval, order, dimension);
302  // if (dimension>2) GMLS_Divergence += gmls_evaluator.getAlpha1TensorTo0Tensor(DivergenceOfVectorPointEvaluation, i, j, 2)*trueSolution(xval, yval, zval, order, dimension);
303  // } else {
304  // for (int k=0; k<dimension; ++k) {
305  // GMLS_Divergence += gmls_evaluator.getAlpha1TensorTo0Tensor(DivergenceOfVectorPointEvaluation, i, j, k)*divergenceTestSamples(xval, yval, zval, k, dimension);
306  // }
307  // }
308  //}
309 
310  double GMLS_CurlX = 0.0;
311  double GMLS_CurlY = 0.0;
312  double GMLS_CurlZ = 0.0;
313  if (dimension>1) {
314  for (int j=0; j<dimension; ++j) {
315  GMLS_CurlX += gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(divergence_sampling_data, j, CurlOfVectorPointEvaluation, i, 0, 0, 0, j, 0);
316  GMLS_CurlY += gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(divergence_sampling_data, j, CurlOfVectorPointEvaluation, i, 0, 1, 0, j, 0);
317  }
318  }
319 
320  if (dimension>2) {
321  for (int j=0; j<dimension; ++j) {
322  GMLS_CurlZ += gmls_evaluator.applyAlphasToDataSingleComponentSingleTargetSite(divergence_sampling_data, j, CurlOfVectorPointEvaluation, i, 0, 2, 0, j, 0);
323  }
324 
325  }
326 
327  Kokkos::Profiling::popRegion();
328  //if (dimension>1) {
329  // for (int j = 0; j< neighbor_lists(i,0); j++){
330  // double xval = source_coords(neighbor_lists(i,j+1),0);
331  // double yval = source_coords(neighbor_lists(i,j+1),1);
332  // double zval = (dimension>2) ? source_coords(neighbor_lists(i,j+1),2) : 0;
333  // for (int k=0; k<dimension; ++k) {
334  // GMLS_CurlX += my_GMLS.getAlpha1TensorTo1Tensor(CurlOfVectorPointEvaluation, i, 0, j, k)*divergenceTestSamples(xval, yval, zval, k, dimension);
335  // }
336  // }
337 
338  // for (int j = 0; j< neighbor_lists(i,0); j++){
339  // double xval = source_coords(neighbor_lists(i,j+1),0);
340  // double yval = source_coords(neighbor_lists(i,j+1),1);
341  // double zval = (dimension>2) ? source_coords(neighbor_lists(i,j+1),2) : 0;
342  // for (int k=0; k<dimension; ++k) {
343  // GMLS_CurlY += my_GMLS.getAlpha1TensorTo1Tensor(CurlOfVectorPointEvaluation, i, 1, j, k)*divergenceTestSamples(xval, yval, zval, k, dimension);
344  // }
345  // }
346  //}
347 
348  //if (dimension>2) {
349  // for (int j = 0; j< neighbor_lists(i,0); j++){
350  // double xval = source_coords(neighbor_lists(i,j+1),0);
351  // double yval = source_coords(neighbor_lists(i,j+1),1);
352  // double zval = source_coords(neighbor_lists(i,j+1),2);
353  // for (int k=0; k<dimension; ++k) {
354  // GMLS_CurlZ += my_GMLS.getAlpha1TensorTo1Tensor(CurlOfVectorPointEvaluation, i, 2, j, k)*divergenceTestSamples(xval, yval, zval, k, dimension);
355  // }
356  // }
357  //}
358  //
359  Kokkos::Profiling::pushRegion("Comparison");
360 
361  double xval = target_coords(i,0);
362  double yval = (dimension>1) ? target_coords(i,1) : 0;
363  double zval = (dimension>2) ? target_coords(i,2) : 0;
364 
365  double actual_value = trueSolution(xval, yval, zval, order, dimension);
366  double actual_Laplacian = trueLaplacian(xval, yval, zval, order, dimension);
367  double actual_Gradient[3] = {0,0,0};
368  trueGradient(actual_Gradient, xval, yval, zval, order, dimension);
369  double actual_Divergence;
370  actual_Divergence = trueLaplacian(xval, yval, zval, order, dimension);
371 
372  double actual_CurlX = 0;
373  double actual_CurlY = 0;
374  double actual_CurlZ = 0;
375  if (dimension>1) {
376  actual_CurlX = curlTestSolution(xval, yval, zval, 0, dimension);
377  actual_CurlY = curlTestSolution(xval, yval, zval, 1, dimension);
378  }
379  if (dimension>2) {
380  actual_CurlZ = curlTestSolution(xval, yval, zval, 2, dimension);
381  }
382 
383 // fprintf(stdout, "Reconstructed value: %f \n", GMLS_value);
384 // fprintf(stdout, "Actual value: %f \n", actual_value);
385 // fprintf(stdout, "Reconstructed Laplacian: %f \n", GMLS_Laplacian);
386 // fprintf(stdout, "Actual Laplacian: %f \n", actual_Laplacian);
387 
388  if(GMLS_value!=GMLS_value || std::abs(actual_value - GMLS_value) > failure_tolerance) {
389  all_passed = false;
390  std::cout << "Failed Actual by: " << std::abs(actual_value - GMLS_value) << std::endl;
391  }
392 
393  if(std::abs(actual_Laplacian - GMLS_Laplacian) > failure_tolerance) {
394  all_passed = false;
395  std::cout << "Failed Laplacian by: " << std::abs(actual_Laplacian - GMLS_Laplacian) << std::endl;
396  }
397 
398  if(std::abs(actual_Gradient[0] - GMLS_GradX) > failure_tolerance) {
399  all_passed = false;
400  std::cout << "Failed GradX by: " << std::abs(actual_Gradient[0] - GMLS_GradX) << std::endl;
401  }
402 
403  if (dimension>1) {
404  if(std::abs(actual_Gradient[1] - GMLS_GradY) > failure_tolerance) {
405  all_passed = false;
406  std::cout << "Failed GradY by: " << std::abs(actual_Gradient[1] - GMLS_GradY) << std::endl;
407  }
408  }
409 
410  if (dimension>2) {
411  if(std::abs(actual_Gradient[2] - GMLS_GradZ) > failure_tolerance) {
412  all_passed = false;
413  std::cout << "Failed GradZ by: " << std::abs(actual_Gradient[2] - GMLS_GradZ) << std::endl;
414  }
415  }
416 
417  if(std::abs(actual_Divergence - GMLS_Divergence) > failure_tolerance) {
418  all_passed = false;
419  std::cout << "Failed Divergence by: " << std::abs(actual_Divergence - GMLS_Divergence) << std::endl;
420  }
421 
422  double tmp_diff = 0;
423  if (dimension>1)
424  tmp_diff += std::abs(actual_CurlX - GMLS_CurlX) + std::abs(actual_CurlY - GMLS_CurlY);
425  if (dimension>2)
426  tmp_diff += std::abs(actual_CurlZ - GMLS_CurlZ);
427  if(std::abs(tmp_diff) > failure_tolerance) {
428  all_passed = false;
429  std::cout << "Failed Curl by: " << std::abs(tmp_diff) << std::endl;
430  }
431  Kokkos::Profiling::popRegion();
432  }
433 
434 }
435 
436  Kokkos::finalize();
437 #ifdef COMPADRE_USE_MPI
438  MPI_Finalize();
439 #endif
440 
441 if(all_passed) {
442  fprintf(stdout, "Passed test \n");
443  return 0;
444 } else {
445  fprintf(stdout, "Failed test \n");
446  return -1;
447 }
448 }
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...
double applyAlphasToDataSingleComponentSingleTargetSite(view_type_data sampling_input_data, const int column_of_input, TargetOperation lro, const int target_index, const int evaluation_site_local_index, const int output_component_axis_1, const int output_component_axis_2, const int input_component_axis_1, const int input_component_axis_2, bool scalar_as_vector_if_needed=true) const
Dot product of alphas with sampling data, FOR A SINGLE target_index, where sampling data is in a 1D/2...
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)
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)
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) ...
KOKKOS_INLINE_FUNCTION double trueSolution(double x, double y, double z, int order, int dimension)