Tinker9 70bd052 (Thu Nov 9 12:11:35 2023 -0800)
Loading...
Searching...
No Matches
math/switch.h
1#pragma once
2#include "ff/precision.h"
3#include "seq/seq.h"
4
5namespace tinker {
20#pragma acc routine seq
21template <int DO_DTAPER>
23void switchTaper5(real rik, real cut, real off, real& restrict taper,
24 real& restrict dtaper)
25{
26 real rinv = 1 / (cut - off);
27 real x = (rik - off) * rinv;
28 real x2 = x * x;
29 real x3 = x2 * x;
30 taper = x3 * (6 * x2 - 15 * x + 10);
31 if CONSTEXPR (DO_DTAPER) dtaper = 30 * (x * (1 - x)) * (x * (1 - x)) * rinv;
32}
33}
#define SEQ_CUDA
Definition: acc/seqdef.h:12
#define restrict
Definition: macro.h:51
#define CONSTEXPR
Definition: macro.h:61
real * x
Number of the trajectory frames.
__device__ void switchTaper5(real rik, real cut, real off, real &__restrict__ taper, real &__restrict__ dtaper)
Smooth function F: [cut,off]->[1,0].
Definition: math/switch.h:23
float real
Definition: precision.h:80
Definition: testrt.h:9