-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TestRKAB: Updated initial data functions and paramete files
- Loading branch information
Lucas Sanches
committed
Oct 22, 2024
1 parent
afab507
commit 8679164
Showing
7 changed files
with
287 additions
and
378 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
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 was deleted.
Oops, something went wrong.
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,125 @@ | ||
#ifndef TEST_RKAB_GAUSSIAN_HXX | ||
#define TEST_RKAB_GAUSSIAN_HXX | ||
|
||
#include <cmath> | ||
|
||
namespace TestRKAB::gauss { | ||
|
||
template <typename T> | ||
static inline auto phi(T W, T A, T t, T x, T y, T z) noexcept -> T { | ||
using std::sqrt, std::cosh, std::sinh; | ||
|
||
const auto r{sqrt(x * x + y * y + z * z)}; | ||
|
||
if (r < sqrt(std::numeric_limits<T>::epsilon())) { | ||
return (2 * A * t) / (exp(pow(t, 2) / (2. * pow(W, 2))) * pow(W, 2)); | ||
} else { | ||
return (A * | ||
(exp(-0.5 * pow(t - sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)), 2) / | ||
pow(W, 2)) - | ||
exp(-0.5 * pow(t + sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)), 2) / | ||
pow(W, 2)))) / | ||
sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)); | ||
} | ||
} | ||
|
||
template <typename T> | ||
static inline auto Pi(T W, T A, T t, T x, T y, T z) noexcept -> T { | ||
using std::sqrt, std::cosh, std::sinh; | ||
|
||
const auto r{sqrt(x * x + y * y + z * z)}; | ||
|
||
if (r < sqrt(std::numeric_limits<T>::epsilon())) { | ||
return (2 * A * (-t + W) * (t + W)) / | ||
(exp(pow(t, 2) / (2. * pow(W, 2))) * pow(W, 4)); | ||
} else { | ||
return (2 * A * | ||
(sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)) * | ||
cosh((t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))) / | ||
pow(W, 2)) - | ||
t * sinh((t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))) / | ||
pow(W, 2)))) / | ||
(exp((pow(t, 2) + pow(x, 2) + pow(y, 2) + pow(z, 2)) / | ||
(2. * pow(W, 2))) * | ||
pow(W, 2) * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))); | ||
} | ||
} | ||
|
||
template <typename T> | ||
static inline auto Dx(T W, T A, T t, T x, T y, T z) noexcept -> T { | ||
using std::sqrt, std::cosh, std::sinh; | ||
|
||
const auto r{sqrt(x * x + y * y + z * z)}; | ||
|
||
if (r < sqrt(std::numeric_limits<T>::epsilon())) { | ||
return 0; | ||
} else { | ||
return (A * x * | ||
(pow(W, 2) + pow(x, 2) + pow(y, 2) + pow(z, 2) + | ||
t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)) + | ||
exp((2 * t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))) / | ||
pow(W, 2)) * | ||
t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)) - | ||
exp((2 * t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))) / | ||
pow(W, 2)) * | ||
(pow(W, 2) + pow(x, 2) + pow(y, 2) + pow(z, 2)))) / | ||
(exp((pow(t, 2) + pow(x, 2) + pow(y, 2) + pow(z, 2) + | ||
2 * t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))) / | ||
(2. * pow(W, 2))) * | ||
pow(W, 2) * pow(pow(x, 2) + pow(y, 2) + pow(z, 2), 1.5)); | ||
} | ||
} | ||
|
||
template <typename T> | ||
static inline auto Dy(T W, T A, T t, T x, T y, T z) noexcept -> T { | ||
using std::sqrt, std::cosh, std::sinh; | ||
|
||
const auto r{sqrt(x * x + y * y + z * z)}; | ||
|
||
if (r < sqrt(std::numeric_limits<T>::epsilon())) { | ||
return 0; | ||
} else { | ||
return (A * y * | ||
(pow(W, 2) + pow(x, 2) + pow(y, 2) + pow(z, 2) + | ||
t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)) + | ||
exp((2 * t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))) / | ||
pow(W, 2)) * | ||
t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)) - | ||
exp((2 * t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))) / | ||
pow(W, 2)) * | ||
(pow(W, 2) + pow(x, 2) + pow(y, 2) + pow(z, 2)))) / | ||
(exp((pow(t, 2) + pow(x, 2) + pow(y, 2) + pow(z, 2) + | ||
2 * t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))) / | ||
(2. * pow(W, 2))) * | ||
pow(W, 2) * pow(pow(x, 2) + pow(y, 2) + pow(z, 2), 1.5)); | ||
} | ||
} | ||
|
||
template <typename T> | ||
static inline auto Dz(T W, T A, T t, T x, T y, T z) noexcept -> T { | ||
using std::sqrt, std::cosh, std::sinh; | ||
|
||
const auto r{sqrt(x * x + y * y + z * z)}; | ||
|
||
if (r < sqrt(std::numeric_limits<T>::epsilon())) { | ||
return 0; | ||
} else { | ||
return (A * z * | ||
(pow(W, 2) + pow(x, 2) + pow(y, 2) + pow(z, 2) + | ||
t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)) + | ||
exp((2 * t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))) / | ||
pow(W, 2)) * | ||
t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)) - | ||
exp((2 * t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))) / | ||
pow(W, 2)) * | ||
(pow(W, 2) + pow(x, 2) + pow(y, 2) + pow(z, 2)))) / | ||
(exp((pow(t, 2) + pow(x, 2) + pow(y, 2) + pow(z, 2) + | ||
2 * t * sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))) / | ||
(2. * pow(W, 2))) * | ||
pow(W, 2) * pow(pow(x, 2) + pow(y, 2) + pow(z, 2), 1.5)); | ||
} | ||
} | ||
|
||
} // namespace TestRKAB::gauss | ||
|
||
#endif // TEST_RKAB_GAUSSIAN_HXX |
Oops, something went wrong.