-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: Laplace kernels * WIP: Clean-Up and unit tests * Unit tests for Laplace 3d working. * Updated documentation. * Updated cargo path for rlst * Updated Rayon version * Fixed num_cpus version --------- Co-authored-by: Matthew Scroggs <[email protected]>
- Loading branch information
Showing
13 changed files
with
489 additions
and
15 deletions.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build] | ||
rustflags = ["-C", "target-cpu=native"] | ||
|
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
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[features] | ||
# Treat warnings as a build error. | ||
strict = [] | ||
|
||
[package] | ||
name = "bempp-kernel" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["Timo Betcke <[email protected]>"] | ||
description = "Evaluation of Green's function kernels." | ||
license = "BSD-3-Clause" | ||
homepage = "https://github.com/bempp/bempp-rs" | ||
repository = "https://github.com/bempp/bempp-rs" | ||
readme = "README.md" | ||
keywords = ["numerics"] | ||
categories = ["mathematics", "science"] | ||
|
||
[lib] | ||
name = "bempp_kernel" | ||
crate-type = ["lib", "cdylib"] | ||
|
||
[dependencies] | ||
bempp-tools = { path = "../tools"} | ||
bempp-traits = { path = "../traits" } | ||
paste = "1.*" | ||
libc = "0.2" | ||
approx = "0.5" | ||
rayon = "1.7" | ||
num = "0.4" | ||
num_cpus = "1" | ||
|
||
[dev-dependencies] | ||
rlst = {git = "https://github.com/linalg-rs/rlst.git" } |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use crate::traits::Kernel; | ||
use crate::types::EvalType; | ||
use bempp_traits::types::Scalar; | ||
|
||
pub(crate) fn check_dimensions_evaluate<K: Kernel, T: Scalar>( | ||
kernel: &K, | ||
eval_type: EvalType, | ||
sources: &[T::Real], | ||
targets: &[T::Real], | ||
charges: &[T], | ||
result: &[T], | ||
) { | ||
assert!( | ||
sources.len() % kernel.space_dimension() == 0, | ||
"Length of sources {} is not a multiple of space dimension {}.", | ||
sources.len(), | ||
kernel.space_dimension() | ||
); | ||
|
||
assert!( | ||
targets.len() % kernel.space_dimension() == 0, | ||
"Length of targets {} is not a multiple of space dimension {}.", | ||
sources.len(), | ||
kernel.space_dimension() | ||
); | ||
|
||
let nsources = sources.len() / kernel.space_dimension(); | ||
let ntargets = targets.len() / kernel.space_dimension(); | ||
|
||
assert_eq!( | ||
charges.len(), | ||
nsources, | ||
"Wrong dimension for `charges`. {} != {} ", | ||
charges.len(), | ||
nsources, | ||
); | ||
|
||
assert_eq!( | ||
result.len(), | ||
kernel.range_component_count(eval_type) * ntargets, | ||
"Wrong dimension for `result`. {} != {} ", | ||
result.len(), | ||
ntargets * kernel.range_component_count(eval_type), | ||
); | ||
} |
Oops, something went wrong.