Moved basic built-in functions for vector operations to math_utils.h from integration.cuh so that they are shared with the CPU and GPU
This commit is contained in:
@@ -75,6 +75,12 @@ static const InitType test_cases[] = {INIT_TYPE_RANDOM, INIT_TYPE_XWAVE,
|
||||
INIT_TYPE_GAUSSIAN_RADIAL_EXPL, INIT_TYPE_ABC_FLOW};
|
||||
// #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
static inline bool
|
||||
is_valid(const ModelScalar a)
|
||||
{
|
||||
return !isnan(a) && !isinf(a);
|
||||
}
|
||||
|
||||
#if TEST_TYPE == \
|
||||
QUICK_TEST // REGULAR TEST START HERE
|
||||
// --------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
*/
|
||||
#include "host_forcing.h"
|
||||
|
||||
#include "src/core/math_utils.h"
|
||||
// #include "src/core/math_utils.h"
|
||||
#include "math.h"
|
||||
|
||||
// The is a wrapper for genering random numbers with a chosen system.
|
||||
AcReal
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
|
||||
AcReal get_random_number_01();
|
||||
|
||||
AcReal3 cross(const AcReal3& a, const AcReal3& b);
|
||||
// AcReal3 cross(const AcReal3& a, const AcReal3& b);
|
||||
|
||||
AcReal dot(const AcReal3& a, const AcReal3& b);
|
||||
// AcReal dot(const AcReal3& a, const AcReal3& b);
|
||||
|
||||
AcReal3 vec_norm(const AcReal3& a);
|
||||
// AcReal3 vec_norm(const AcReal3& a);
|
||||
|
||||
AcReal3 vec_multi_scal(const AcReal scal, const AcReal3& a);
|
||||
// AcReal3 vec_multi_scal(const AcReal scal, const AcReal3& a);
|
||||
|
||||
AcReal3 helical_forcing_k_generator(const AcReal kmax, const AcReal kmin);
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#pragma once
|
||||
#include "astaroth.h"
|
||||
|
||||
#include "math.h"
|
||||
|
||||
typedef long double ModelScalar;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user