-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PCMS interpolation functionality #148
Open
jacobmerson
wants to merge
50
commits into
develop
Choose a base branch
from
mls_interpolation
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
6aa1ca3
added adj_search.hpp header in MLSInterpolation.hpp file
abhiyan123 14f82b2
added regular grid linear interpolator and mls interpolator
abhiyan123 12a26bb
added interpolator subdirectory
abhiyan123 a3b97f3
added the interpolator folder with header files for MLS and linear me…
abhiyan123 e3ac60b
removed hdf5 header
abhiyan123 ec486e7
removed unnecessary files
abhiyan123 9ec0f44
Merge pull request #1 from abhiyanpaudel/interpolator
Fuad-HH 749be28
enforce number of support
Fuad-HH cca0eca
can use any dimension and degree of polynomial
abhiyan123 418fb08
Merge branch 'mls_generalMLS' into general_mls
abhiyan123 1ddc29c
added test cases
abhiyan123 eda1048
moved interpolator folder to pcms
abhiyan123 b90cbaf
modified to incorporate interpolator
abhiyan123 5cd5869
updated the file
abhiyan123 92d0183
deleted unneceesary files
abhiyan123 5b72727
variable radius for degas2
Fuad-HH 1bc767b
cleaned up the basis monomial calculation
abhiyan123 c052240
made it general
abhiyan123 8319c3d
updated the test cases that verifies the monomial basis calculations
abhiyan123 b9537dc
added unit test case that verifies the basis calculation
abhiyan123 174cf92
updated .gitignore file
abhiyan123 b65cee8
made changes to accomodate general mls procedure
abhiyan123 7021f91
compatible with the generalized mls
abhiyan123 723bcdf
added test case file name
abhiyan123 d5bd614
created the test case for generalized mls
abhiyan123 a14cf7d
merge general order interpolation changes from abhiyan's fork
Fuad-HH 810b760
move include adj_search_dega2.hpp from MLSInterpolation.hpp to test_r…
Fuad-HH 5609874
radius adaptation for adj_search
Fuad-HH f337543
added Nan Check
abhiyan123 726e6ff
formatted the files
abhiyan123 0b3b202
Merge pull request #7 from abhiyanpaudel/general_mls
Fuad-HH a7b5e33
revert clangformatting in CMakeLists.txt and remove const from suppor…
Fuad-HH 1f60fe1
merge centroid->node interp with general
Fuad-HH a2b1563
refactor
Fuad-HH 8e6873a
radius adaptation option added for cell2node search
Fuad-HH 4c93f4a
renamed test sections
abhiyan123 cd88d53
interface for passing various rbf functions
abhiyan123 5acab5e
updated the CMake list to include the new files
abhiyan123 cc8e3d8
changes to accomodate interface
abhiyan123 ec57a6d
changes to accomodate interface
abhiyan123 c888f28
updated test CMake list
abhiyan123 27453c6
added pcms_interpolator target
abhiyan123 f9bd120
set target properties for pcms_interpolator
abhiyan123 2ba0322
updated with kokkos kernels LU solver
abhiyan123 52dc62a
upgraded to kokkos kernels
abhiyan123 10f0b51
add radial basis function choices for user
abhiyan123 8e8e7fb
added and updated test cases
abhiyan123 cf60f99
Merge pull request #14 from abhiyanpaudel/general_mls
Fuad-HH b1cfb1f
Merge branch develop into mls_interpolation
jacobmerson 90b5218
make functions inline to compile
jacobmerson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
changes to accomodate interface
- Loading branch information
commit cc8e3d81a0e9c93f70569f675d76426422cc90ce
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
#include <Omega_h_fail.hpp> | ||
|
||
#include "points.hpp" | ||
#include <type_traits> | ||
|
||
#define PI_M 3.14159265358979323846 | ||
|
||
|
@@ -93,32 +94,6 @@ void BasisPoly(ScratchVecView basis_monomial, const MatViewType& slice_length, | |
} | ||
} | ||
|
||
KOKKOS_INLINE_FUNCTION | ||
double rbf(double r_sq, double rho_sq) | ||
{ | ||
double phi; | ||
double r = sqrt(r_sq); | ||
OMEGA_H_CHECK_PRINTF( | ||
rho_sq > 0, "ERROR: rho_sq in rbf has to be positive, but got %.16f\n", | ||
rho_sq); | ||
double rho = sqrt(rho_sq); | ||
double ratio = r / rho; | ||
double limit = 1 - ratio; | ||
if (limit < 0) { | ||
phi = 0; | ||
|
||
} else { | ||
phi = 5 * pow(ratio, 5) + 30 * pow(ratio, 4) + 72 * pow(ratio, 3) + | ||
82 * pow(ratio, 2) + 36 * ratio + 6; | ||
phi = phi * pow(limit, 6); | ||
} | ||
|
||
OMEGA_H_CHECK_PRINTF(!std::isnan(phi), | ||
"ERROR: phi in rbf is NaN. r_sq, rho_sq = (%f, %f)\n", | ||
r_sq, rho_sq); | ||
return phi; | ||
} | ||
|
||
// create vandermondeMatrix | ||
KOKKOS_INLINE_FUNCTION | ||
void VandermondeMatrix(ScratchMatView V, | ||
|
@@ -160,16 +135,20 @@ void PTphiMatrix(ScratchMatView pt_phi, ScratchMatView V, ScratchVecView Phi, | |
} | ||
|
||
// radial basis function vector | ||
KOKKOS_INLINE_FUNCTION | ||
void PhiVector(ScratchVecView Phi, const Coord target_point, | ||
const ScratchMatView local_source_points, int j, | ||
double cuttoff_dis_sq) | ||
template <typename Func, | ||
std::enable_if_t<std::is_invocable_r_v<double, Func, double, double>, | ||
bool> = true> | ||
KOKKOS_INLINE_FUNCTION void PhiVector(ScratchVecView Phi, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Naming |
||
const Coord target_point, | ||
const ScratchMatView local_source_points, | ||
int j, double cuttoff_dis_sq, | ||
Func rbf_func) | ||
{ | ||
int N = local_source_points.extent(0); | ||
double dx = target_point.x - local_source_points(j, 0); | ||
double dy = target_point.y - local_source_points(j, 1); | ||
double ds_sq = dx * dx + dy * dy; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this assuming 2D? |
||
Phi(j) = rbf(ds_sq, cuttoff_dis_sq); | ||
Phi(j) = rbf_func(ds_sq, cuttoff_dis_sq); | ||
OMEGA_H_CHECK_PRINTF(!std::isnan(Phi(j)), | ||
"ERROR: Phi(j) in PhiVector is NaN for j = %d " | ||
"ds_sq=%.16f, cuttoff_dis_sq=%.16f", | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not define our own pi. We can use M_PI from cmath