Merge branch 'master' into sink_20190723

Hopefully the merge isssues were resolved.
This commit is contained in:
Miikka Vaisala
2019-09-02 11:58:48 +08:00
29 changed files with 1364 additions and 592 deletions

View File

@@ -26,7 +26,9 @@
*/
#include "host_forcing.h"
#include "src/core/math_utils.h"
// #include "src/core/math_utils.h"
#include <cmath>
using namespace std;
// The is a wrapper for genering random numbers with a chosen system.
AcReal
@@ -36,7 +38,7 @@ get_random_number_01()
return AcReal(rand()) / AcReal(RAND_MAX);
}
AcReal3
static AcReal3
cross(const AcReal3& a, const AcReal3& b)
{
AcReal3 c;
@@ -48,13 +50,13 @@ cross(const AcReal3& a, const AcReal3& b)
return c;
}
AcReal
static AcReal
dot(const AcReal3& a, const AcReal3& b)
{
return a.x * b.x + a.y * b.y + a.z * b.z;
}
AcReal3
static AcReal3
vec_norm(const AcReal3& a)
{
AcReal3 c;
@@ -67,7 +69,7 @@ vec_norm(const AcReal3& a)
return c;
}
AcReal3
static AcReal3
vec_multi_scal(const AcReal scal, const AcReal3& a)
{
AcReal3 c;

View File

@@ -32,14 +32,6 @@
AcReal get_random_number_01();
AcReal3 cross(const AcReal3& a, const AcReal3& b);
AcReal dot(const AcReal3& a, const AcReal3& b);
AcReal3 vec_norm(const AcReal3& a);
AcReal3 vec_multi_scal(const AcReal scal, const AcReal3& a);
AcReal3 helical_forcing_k_generator(const AcReal kmax, const AcReal kmin);
void helical_forcing_e_generator(AcReal3* e_force, const AcReal3 k_force);

View File

@@ -31,6 +31,16 @@
#include "host_memory.h"
#include "model_boundconds.h"
// Standalone flags
#define LDENSITY (1)
#define LHYDRO (1)
#define LMAGNETIC (1)
#define LENTROPY (1)
#define LTEMPERATURE (0)
#define LFORCING (1)
#define LUPWD (1)
#define AC_THERMAL_CONDUCTIVITY (AcReal(0.001)) // TODO: make an actual config parameter
typedef struct {
ModelScalar x, y, z;
} ModelVector;

View File

@@ -27,6 +27,7 @@
#pragma once
#include "astaroth.h"
#include "math.h"
typedef long double ModelScalar;