@@ -31,13 +31,16 @@ Omega_h::Reals getCentroids(Omega_h::Mesh& mesh)
3131
3232MLSMeshInterpolation::MLSMeshInterpolation (Omega_h::Mesh& source_mesh,
3333 double radius, uint min_req_support,
34- uint degree, bool adapt_radius)
34+ uint degree, bool adapt_radius,
35+ double lambda, double decay_factor)
3536 : source_mesh_(source_mesh),
3637 target_mesh_(source_mesh),
3738 radius_(radius),
3839 min_req_supports_(min_req_support),
3940 degree_(degree),
40- adapt_radius_(adapt_radius)
41+ adapt_radius_(adapt_radius),
42+ lambda_(lambda),
43+ decay_factor_(decay_factor)
4144{
4245 single_mesh_ = true ;
4346 target_coords_ = source_mesh_.coords ();
@@ -60,13 +63,16 @@ MLSMeshInterpolation::MLSMeshInterpolation(Omega_h::Mesh& source_mesh,
6063 Omega_h::Mesh& target_mesh,
6164 const double radius,
6265 uint min_req_support, uint degree,
63- const bool adapt_radius)
66+ const bool adapt_radius,
67+ double lambda, double decay_factor)
6468 : source_mesh_(source_mesh),
6569 target_mesh_(target_mesh),
6670 radius_(radius),
6771 min_req_supports_(min_req_support),
6872 degree_(degree),
69- adapt_radius_(adapt_radius)
73+ adapt_radius_(adapt_radius),
74+ lambda_(lambda),
75+ decay_factor_(decay_factor)
7076{
7177 OMEGA_H_CHECK_PRINTF (source_mesh_.dim () == 2 && target_mesh_.dim () == 2 ,
7278 " Only 2D meshes are supported but found %d, %d\n " ,
@@ -80,7 +86,7 @@ MLSMeshInterpolation::MLSMeshInterpolation(Omega_h::Mesh& source_mesh,
8086 target_field_ =
8187 Omega_h::HostWrite<Omega_h::Real>(target_mesh_.nverts (), " target field" );
8288
83- find_supports (min_req_supports_);
89+ find_supports (min_req_supports_, 3 * min_req_supports_ );
8490}
8591
8692KOKKOS_INLINE_FUNCTION
@@ -391,8 +397,9 @@ void MLSMeshInterpolation::eval(
391397
392398 // TODO: make the basis function a template or pass it as a parameter
393399 auto target_field_write = mls_interpolation (
394- Omega_h::Reals (source_field_), source_coords_, target_coords_, supports_, 2 ,
395- degree_, pcms::RadialBasisFunction::RBF_GAUSSIAN, 0 , 1e-6 , 5 );
400+ Omega_h::Reals (source_field_), source_coords_, target_coords_, supports_,
401+ source_mesh_.dim (), degree_, pcms::RadialBasisFunction::RBF_GAUSSIAN,
402+ lambda_, 1e-6 , decay_factor_);
396403
397404 target_field_ = Omega_h::HostWrite<Omega_h::Real>(target_field_write);
398405 copyHostWrite2ScalarArrayView (target_field_, target_field);
0 commit comments