KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
Kernel_Update_x.cpp
Go to the documentation of this file.
2
3#include "kids/debug_utils.h"
4#include "kids/hash_fnv1a.h"
5#include "kids/macro_utils.h"
6#include "kids/vars_list.h"
7
8namespace PROJECT_NS {
9
10const std::string Kernel_Update_x::getName() { return "Kernel_Update_x"; }
11
13
14void Kernel_Update_x::setInputDataSet_impl(std::shared_ptr<DataSet>& DS) {
15 dt_ptr = DS->def(DATA::iter::dt);
16 x = DS->def(DATA::integrator::x);
17 p = DS->def(DATA::integrator::p);
18 m = DS->def(DATA::integrator::m);
20 kids_real* mass = DS->def(DATA::model::mass);
21 frez_ptr = DS->def(DATA::iter::frez);
22 for (int iP = 0; iP < Dimension::P; ++iP) {
23 kids_real* m = this->m + iP * Dimension::N;
24 kids_real* minv = this->minv + iP * Dimension::N;
25 for (int j = 0; j < Dimension::N; ++j) {
26 m[j] = mass[j];
27 minv[j] = 1 / m[j];
28 }
29 }
30}
31
33 if (frez_ptr[0]) return stat;
34 for (int i = 0; i < Dimension::PN; ++i) x[i] += p[i] * minv[i] * scale * dt_ptr[0];
35 return stat;
36}
37
38}; // namespace PROJECT_NS
virtual int getType() const
Get the type of the kernel.
virtual void setInputDataSet_impl(std::shared_ptr< DataSet > &DS)
Virtual function to set input data set for the kernel implementation.
virtual const std::string getName()
Get the name of the kernel.
virtual Status & executeKernel_impl(Status &stat)
Virtual function to execute the kernel implementation.
provide utils for debugging the code
#define FUNCTION_NAME
Definition macro_utils.h:9
VARIABLE< kids_real > p
VARIABLE< kids_real > minv
VARIABLE< kids_real > m
VARIABLE< kids_real > x
VARIABLE< kids_real > dt
VARIABLE< kids_bint > frez
VARIABLE< kids_real > mass
std::size_t PN
Product of P and N (P * N).
Definition vars_list.cpp:14
std::size_t N
Number of nuclear degrees of freedom.
Definition vars_list.cpp:10
std::size_t P
Number of parallel trajectories (swarms of trajectories) in each Monte Carlo run.
Definition vars_list.cpp:9
< http://warp.povusers.org/FunctionParser/fparser.html
Definition Context.h:39
double kids_real
Alias for real number type.
Definition Types.h:59
constexpr uint32_t hash(const char *str)
Definition hash_fnv1a.h:12
declaration of variables used in the program.