GPUE  v1.0
GPU Gross-Pitaevskii Equation numerical solver for Bose-Einstein condensates
dynamic.h
Go to the documentation of this file.
1 //##############################################################################
14  //#############################################################################
15 
16 #ifndef DYNAMIC_H
17 #define DYNAMIC_H
18 
19 #include <string>
20 #include "../include/ds.h"
21 
30 EqnNode parse_eqn(Grid &par, std::string eqn_string, std::string val_str);
31 
38 void find_element_num(EqnNode eqn_tree, int &element_num);
39 
47 void tree_to_array(EqnNode eqn, EqnNode_gpu *eqn_array, int &element_num);
48 
56 void allocate_equation(EqnNode_gpu *eqn_cpu, EqnNode_gpu *eqn_gpu, int n);
57 
64 
65 /*----------------------------------------------------------------------------//
66 * GPU KERNELS
67 *-----------------------------------------------------------------------------*/
68 
80 __device__ double evaluate_eqn_gpu(EqnNode_gpu *eqn, double x, double y,
81  double z, double time, int element_num);
82 
96 __global__ void find_field(double *field, double dx, double dy, double dz,
97  double xMax, double yMax, double zMax,
98  double time, EqnNode_gpu *eqn);
99 
106 __global__ void zeros(double *field, int n);
107 
116 __device__ double poly_j(int v, double x, int n);
117 
118 #endif
EqnNode parse_eqn(Grid &par, std::string eqn_string, std::string val_str)
Parses a provided equation string into an Abstract Syntax Tree ,.
tuple dy
Definition: en.py:60
void allocate_equation(EqnNode_gpu *eqn_cpu, EqnNode_gpu *eqn_gpu, int n)
Allocates space on GPU for AST ,.
tuple dx
Definition: en.py:59
end % idx is for time
tuple yMax
Definition: en.py:63
__global__ void zeros(double *field, int n)
Creates a field of all zeros ,.
Struct to hold the node information for the AST on the CPU.
Definition: ds.h:56
Struct to hold the node information for the AST on the GPU.
Definition: ds.h:71
double * z
Definition: ds.h:121
__global__ void find_field(double *field, double dx, double dy, double dz, double xMax, double yMax, double zMax, double time, EqnNode_gpu *eqn)
Creates a fields for all values of x, y, and z with AST ,.
tuple xMax
Definition: en.py:62
__device__ double evaluate_eqn_gpu(EqnNode_gpu *eqn, double x, double y, double z, double time, int element_num)
Evaluates a GPU AST with provided x, y, z, and t valued ,.
__device__ double poly_j(int v, double x, int n)
Polynomial approximation for J bessel functions ,.
void parse_param_file(Grid &par)
Parses a provided file into Abstract Syntax Trees ,.
Class to hold the variable map and grid information.
Definition: ds.h:86
def par
Definition: plot.py:237
void tree_to_array(EqnNode eqn, EqnNode_gpu *eqn_array, int &element_num)
Transforms an AST into a GPU array ,.
void find_element_num(EqnNode eqn_tree, int &element_num)
finds the total number of elements in an Abstract Syntax Tree ,