Peano
|
Kernel functions for SPH (scalar and vector version). More...
#include <config.h>
#include <math.h>
#include "dimension.h"
#include "error.h"
#include "inline.h"
#include "minmax.h"
#include "vector.h"
Go to the source code of this file.
Macros | |
#define | kernel_gamma_inv ((float)(1. / kernel_gamma)) |
#define | kernel_gamma2 ((float)(kernel_gamma * kernel_gamma)) |
#define | kernel_ivals_f ((float)(kernel_ivals)) |
#define | kernel_root |
#define | kernel_norm ((float)(hydro_dimension_unit_sphere * kernel_gamma_dim)) |
Functions | |
__attribute__ ((always_inline)) INLINE static void kernel_deval(float u | |
Computes the kernel function and its derivative. | |
for (int k=2;k<=kernel_degree;k++) = x * w + coeffs[k] | |
for (int k=2;k< kernel_degree;k++) dw_dx | |
void | hydro_kernel_dump (int N) |
Test the SPH kernel function by dumping it in the interval [0,1]. | |
Variables | |
float *restrict | W = w * kernel_constant * kernel_gamma_inv_dim |
float *restrict float *restrict | dW_dx |
const int | temp = (int)(x * kernel_ivals_f) |
const int | ind = temp > kernel_ivals ? kernel_ivals : temp |
const float *const | coeffs = &kernel_coeffs[ind * (kernel_degree + 1)] |
float | w = coeffs[0] * x + coeffs[1] |
float | dw_dx = coeffs[0] |
Kernel functions for SPH (scalar and vector version).
All constants and kernel coefficients are taken from table 1 of Dehnen & Aly, MNRAS, 425, pp. 1062-1082 (2012).
Definition in file kernel_hydro.h.
#define kernel_gamma2 ((float)(kernel_gamma * kernel_gamma)) |
Definition at line 206 of file kernel_hydro.h.
#define kernel_gamma_inv ((float)(1. / kernel_gamma)) |
Definition at line 205 of file kernel_hydro.h.
#define kernel_ivals_f ((float)(kernel_ivals)) |
Definition at line 233 of file kernel_hydro.h.
#define kernel_norm ((float)(hydro_dimension_unit_sphere * kernel_gamma_dim)) |
Definition at line 241 of file kernel_hydro.h.
#define kernel_root |
Definition at line 236 of file kernel_hydro.h.
__attribute__ | ( | (always_inline) | ) |
Computes the kernel function and its derivative.
Computes the kernel function derivative.
Computes the kernel function in double precision.
Computes the kernel function.
The kernel function needs to be mutliplied by \(h^{-d}\) and the gradient by \(h^{-(d+1)}\), where \(d\) is the dimensionality of the problem.
Returns 0 if \(u > \gamma = H/h\).
u | The ratio of the distance to the smoothing length \(u = x/h\). |
W | (return) The value of the kernel function \(W(x,h)\). |
dW_dx | (return) The norm of the gradient of \(|\nabla W(x,h)|\). |
The kernel function needs to be mutliplied by \(h^{-d}\), where \(d\) is the dimensionality of the problem.
Returns 0 if \(u > \gamma = H/h\)
u | The ratio of the distance to the smoothing length \(u = x/h\). |
W | (return) The value of the kernel function \(W(x,h)\). |
Required for computing the projected kernel because rounding error causes problems for the GSL integration function if we evaluate in single precision.
The kernel function needs to be mutliplied by \(h^{-d}\), where \(d\) is the dimensionality of the problem.
Returns 0 if \(u > \gamma = H/h\)
u | The ratio of the distance to the smoothing length \(u = x/h\). |
W | (return) The value of the kernel function \(W(x,h)\). |
The kernel function needs to be mutliplied by \(h^{-d}\) and the gradient by \(h^{-(d+1)}\), where \(d\) is the dimensionality of the problem.
Returns 0 if \(u > \gamma = H/h\).
u | The ratio of the distance to the smoothing length \(u = x/h\). |
dW_dx | (return) The norm of the gradient of \(|\nabla W(x,h)|\). |
for | ( | ) |
Definition at line 273 of file kernel_hydro.h.
Test the SPH kernel function by dumping it in the interval [0,1].
N | number of intervals in [0,1]. |
Definition at line 31 of file kernel_hydro.c.
References dw_dx, kernel_deval(), and w.
const float *const coeffs = &kernel_coeffs[ind * (kernel_degree + 1)] |
Definition at line 266 of file kernel_hydro.h.
Referenced by for(), swift2::kernels::legacy::kernelHydro::kernel_deval(), and swift2::kernels::legacy::kernelHydro::kernel_eval().
* dW_dx |
Definition at line 258 of file kernel_hydro.h.
Referenced by swift2::kernels::legacy::kernelHydro::kernel_deval().
float dw_dx = coeffs[0] |
Definition at line 270 of file kernel_hydro.h.
Referenced by for(), hydro_kernel_dump(), and swift2::kernels::legacy::kernelHydro::kernel_deval().
Definition at line 265 of file kernel_hydro.h.
Referenced by swift2::kernels::legacy::kernelHydro::kernel_deval(), and swift2::kernels::legacy::kernelHydro::kernel_eval().
const int temp = (int)(x * kernel_ivals_f) |
Definition at line 264 of file kernel_hydro.h.
Referenced by exahype2::fv::musclhancock::internal::computeTimeDerivative_LoopBody(), swift2::kernels::legacy::hydro_update_smoothing_length_and_rerun_if_required(), swift2::kernels::legacy::kernelHydro::kernel_deval(), swift2::kernels::legacy::kernelHydro::kernel_eval(), tarch::la::lu(), applications::exahype2::ccz4::ncp(), examples::exahype2::mgccz4::ncp(), tl::basic_iterator< C >::operator++(), swift2::kernels::legacy::hydroDimensions::pow_dimension_plus_one(), applications::exahype2::ccz4::source(), examples::exahype2::mgccz4::source(), and applications::exahype2::ccz4::TestingOutput().
* W = w * kernel_constant * kernel_gamma_inv_dim |
Definition at line 258 of file kernel_hydro.h.
Referenced by swift2::kernels::legacy::kernelHydro::kernel_deval(), and swift2::kernels::legacy::kernelHydro::kernel_eval().
Definition at line 269 of file kernel_hydro.h.
Referenced by applications::exahype2::CompressibleNavierStokes::NavierStokesSolver::boundaryConditions(), applications::exahype2::CompressibleNavierStokes::NavierStokesSolver::calculateDerivatives(), applications::exahype2::CompressibleNavierStokes::NavierStokesSolver::flux(), for(), hydro_kernel_dump(), applications::exahype2::CompressibleNavierStokes::NavierStokesSolver::initialCondition(), swift2::kernels::legacy::kernelHydro::kernel_deval(), swift2::kernels::legacy::kernelHydro::kernel_eval(), main(), applications::exahype2::CompressibleNavierStokes::NavierStokesSolver::maxEigenvalue(), applications::exahype2::CompressibleNavierStokes::NavierStokesSolver::nonconservativeProduct(), Numerics::rotate_dofs(), Numerics::rotate_dofs_inverse(), TP::Utilities::scalarproduct(), and applications::exahype2::CompressibleNavierStokes::NavierStokesSolver::sourceTerm().